|
|
Terms of Agreement:
By using this article, you agree to the following terms...
1) You may use
this article in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
2) You MAY NOT redistribute this article (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.
3) You may link to this article from another website, but ONLY if it is not wrapped in a frame.
4) You will abide by any additional copyright restrictions which the author may have placed in the article or article's description. |
Master Assembly Script (MAS)
Mas is a scripting language designed for use in video game programming. It is meant to allow
aspects of the game to be scripted rather then hard coded so they can be changed without
the actual executable being changed. It is a simple scripting language and in its first ful
release has very limited functionality.
A mas program is simple, and is layed out as follows
mas ProgramName {
var {
var& variable ; comment var& means long integer
var# float ; means floating point
var$ string ; means string variable
}
begin {
start:
mov variable, 0
jmp start ; jump to start code label
}
}
Mas is similar to assembly language, in that you use code labels, do compares, and
then use instructions to jump based on the flags register. However there are no registers
and the instructions directly operate on variables.
Download
Mas Demo
MasterX SDK with Mas (2.2)
MVX Game Engine with Mas
Instruction List
mov - takes 2 operands
mov source,from
cls - takes 1 operand
cls 0
println takes 1 operand
println variable
input takes 1 operand
input variable
return takes 1 operand
return 0
cmp takes 2 operands
cmp variable1,variable2
jmp takes 1 operand
jmp label
jne takes 1 operand
jne label
jg takes 1 operand
jg label
jl takes 1 operand
jl label
jge takes 1 operand
jge label
jle takes 1 operand
jle label
pause takes 1 operand
pause 0
inc takes 1 operand
inc variable
dec takes 1 operand
dec variable
add takes 2 operands
add var1 , var2
sub takes 2 operands
sub var1, var2
mul takes 2 operands
mul var1, var2
div takes 2 operands
div var1, var2
finc takes 1 operand
finc variable
fdec takes 1 operand
fdec varaible
fadd takes 2 operands
fadd var1, var2
fsub takes 2 operands
fsub var1, var2
fmul takes 2 operands
fmul var1, var2
fdiv takes 2 operands
fdiv var1, var2
int takes 1 operand
int interupt number for callback
push takes 1 operand
push variable to push into stack
pop takes 1 operand
pop variable to pop off of stack
| |
Other 273 submission(s) by this author
|
|
|
Report Bad Submission |
|
|
Your Vote! |
See Voting Log |
|
Other User Comments |
3/4/2002 11:46:25 AM:Thushar hanx for this fine peace of code
|
3/4/2002 1:31:18 PM:Dan Anderson I just had one question. Do you think
an MAS script file could be compiled to
a ready to run file? Sort of like how
Java has byte code .class files. Just a
thought
|
3/4/2002 3:43:55 PM:Lee Trager tight code. you should try maken ur own
lang ;)
|
3/4/2002 5:18:21 PM:Jared Bruni the first version of MAS I had a
bytecode like java, but for the second
version I decided to just have it
interpet the script as is.
|
|
Add Your Feedback! |
Note:Not only will your feedback be posted, but an email will be sent to the code's author in your name.
NOTICE: The author of this article has been kind enough to share it with you. If you have a criticism, please state it politely or it will be deleted.
For feedback not related to this particular article, please click here. |
|