Advertisement
3_2004-2005 Complete Applications #146616

MasAsm interperter and Mas Byte code Assembler

Updated Now Includes a version of MasAsm interperter with a Hash Table. Also includes MasAsm byte code Assembler, and a IDE for you to edit your code and shell the assembler with.

AI

Resumo por IA: 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.

Código fonte
original-source
<HTML>
<BODY>
<FONT COLOR="#BD0000" FACE="FIXEDSYS">
<img src="http://www.lostsidedead-software.com/cool_logo.jpg">
<br><br><b> MasAsm interperter and Mas ByteCode Assembler </b><br><br>
MasAsm is a simple language that bases itself off of assembly language.
Its like assembly language simplified. It allows you to directly do instructions on variables
without having to move the variables into a register first. MasAsm Can be compiled to Perl
or Mas ByteCode and run in the MasAsm interperter. MasAsm comes with a IDE written in Visual Basic 
to simplify the proccess of writing a script and shelling it to the compiler/interperter.
<br><br><b> Update </b><br>
I updated the masasm interperter adding 1 instruction the int instruction which allows you to make a callback to C++ code. You specify a integer and with C++ you give the masasmInterpreator a pointer to a function with 1 paramter that is a integer and it passes the integer to the parameter and you use a switch to select the different numbers. Also updated the variable table making it a <b>hash</b> table.
<br><br><br>
<b> Download </b><br>
<a href="http://www.lostsidedead-software.com/masinterp_hashtable.zip">Updated masasm interperter with a hash table </a> <br><br>
<br><br>
<a href="http://www.lostsidedead-software.com/masasm_ide.zip"> MasAsm IDE - with compiled interperter and compiled script compiler </a>
<br>
<a href="http://www.lostsidedead-software.com/masasm_interp.zip"> MasAsm interperter Visual C++ 6.0 Source Code <br><br></a>
<a href="http://www.lostsidedead-software.com/codes/borland_masasm_interpreator.zip">MasAsm interperter Borland C++ Builder 6 Project</a><br><br><br>
<a href="http://www.lostsidedead-software.com/masasm_interp_compiler.zip"> MasAsm ByteCode Assembler </a><br>
<a href="http://www.lostsidedead-software.com/masasm_perl.zip"> MasAsm to Perl Script Assembler </a><br>
<b> Screen Shots </b><br>
<br><br>
<img src="http://www.lostsidedead-software.com/vb_masasm_ide.jpg"><br>
<img src="http://www.lostsidedead-software.com/masinterp_vc1.jpg"><br>
<img src="http://www.lostsidedead-software.com/masinterp_masasm.jpg"><br>
<img src="http://www.lostsidedead-software.com/masinterp_debug.jpg"><br>
<br><br>
<b>Instructions </b><br>
<br>
<pre>
; comments
mov dest,from
print what
input var
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" ; string
 var$ str ; string
 var# real := 0 ; double
 }
<br>
 begin {
 start:
 print "hello world\n"
 print s
 print str
 }
<br>}
<br>; simple loop
 mas object {
 var {
 var& x := 0
 }
<br>
 begin {
 start:
 inc x
 print "hello world"
 cmp x,10
 jne start
 }
<br>}
<br>; math
 mas math {
 var {
 var& x := 100
 var& y := 100
 var& z := 25
 var& counter := 0
 }
<br>
 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
 }
<br>}
mas calculator {
var {
var& x := 0
var& y := 0
var& index := 0
}
begin {
start:
print "calculator script written by Jared Bruni\n"
printout:
print "enter one of the following \n-1)exit\n1)add\n2)subtract\n3)multiply\n4)divide\n"
input index
cmp index,-1
je over
cmp index,1
je addindex
cmp index,2
je subindex
cmp index,3
je mulindex
cmp index,4
je divindex
print "invalid entry\n"
jmp printout
addindex:
print "\nenter a number: "
input x
print "\nenter another number: "
input y
print x
print "+"
print y
add x,y
print "="
print x
print "\n"
jmp printout
subindex:
print "\nenter a number: "
input x
print "\nenter another number: "
input y
print x
print "-"
print y
sub x,y
print "="
print x
print "\n"
jmp printout
mulindex:
print "\nenter a number: "
input x
print "\nenter another number: "
input y
print x
print "*"
print y
mul x,y
print "="
print x
print "\n"
jmp printout
divindex:
print "\nenter a number: "
input x
print "\nenter another number: "
input y
print x
print "/"
print y
div x,y
print "="
print x
print "\n"
jmp printout
over:
}
}
<br></pre>
<br><br> to download the calculator program click <a href="http://www.lostsidedead-software.com/calculator.zip"> here </a>
</FONT>
</BODY>
</HTML>
Comentários originais (3)
Recuperado do Wayback Machine