Advertisement
1_2002 Miscellaneous #111676

masasm C preproccescor

my very first attempt at writing a language translater. A very basic language that does input and output as well as operations on variables. Translates to C then shells to gcc to compile. For windows users comes with gcc, I am going to make another pass for variable checks for a line by line print out for debugging so sometimes you have to use gcc 's errors to fix your code.

AI

AI Summary: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Source Code
original-source
<HTML>
<FONT FACE="FIXEDSYS" COLOR="#BD0000">
my very first attempt at writing a language translater. A very basic language that does input and output as well as operations on variables. Translates to C then shells to gcc to compile. For windows users comes with gcc, I am going to make another pass for variable checks for a line by line print out for debugging so sometimes you have to use gcc 's errors to fix your code. <br><br>
<b>instructions </b><br>
<br>
<pre>
; comments
mov dest,from
print what
input var
pause 0
return 0
inc var
dec var
add var,var
sub var,var
mul var,var
div var,var
and var,var
or var,var
xor var,var
not var,var
cmp var,var
jmp label 
jne label ; != 
je label ; == 
jge label ; >=
jg label ; >
jl label ; < 
jle label ; <=
; intro to variables
mas ProgramName {
var
{
var& x := 0 ; integer
var$ s := "str" ; constant string
var$ str ; string
var# real := 0 ; double
}
begin {
start:
print "hello world\n"
print s
print str
}
}
; simple loop
mas object {
var {
var& x := 0
}
begin {
start:
inc x
print "hello world"
cmp x,10
jne start
}
}
; math
mas math {
var {
var& x := 100
var& y := 100
var& z := 25
var& counter := 0
}
begin {
start:
add x,y
sub x,z
mul x,z
div z,5
xor x,y
and y,z
inc counter
cmp counter,10
jne start
}
}
</pre>
 <b>Screen Shots </b><br><br>
<img src="http://www.lostsidedead-software.com/vc1.jpg"><br>
<img src="http://www.lostsidedead-software.com/vc2.jpg"><br>
<img src="http://www.lostsidedead-software.com/dp.jpg"><br>
<img src="http://www.lostsidedead-software.com/dp2.jpg"><br>
<img src="http://www.lostsidedead-software.com/thec.jpg"><br>
<br>
<b> Download </b><br>
windows users , for Microsoft visual C++ <a href="http://www.lostsidedead-software.com/masasm2.zip"> here </a><br><br>
run masasm.exe to compile your programs with the arguments
masasm script.masasm program.exe
</FONT>
</HTML>
Original Comments (3)
Recovered from Wayback Machine