README better
This commit is contained in:
parent
464ac2c877
commit
bebaa8ba05
49
README.md
49
README.md
@ -11,6 +11,8 @@ The emulator / debugger...
|
||||
### compiler.py / compiler_beta.py
|
||||
This compiler compiles from 'tronScript' to a binary save-state of the emulator. It has been designed with the main priority of being as easy as possible to compile. Usability was ~~maybe~~ impacted by this decisio.
|
||||
I forget, what the difference between normal and beta is...
|
||||
More information about tronScript can be found in TronScript_README.txt
|
||||
|
||||
|
||||
### mima.py
|
||||
A variation of asm.py to emulate a MiMa (minimal machine). No, the compiler can not compile for this architecture.
|
||||
@ -18,50 +20,3 @@ A variation of asm.py to emulate a MiMa (minimal machine). No, the compiler can
|
||||
### asmCust.py
|
||||
Does not work (I think...)
|
||||
|
||||
|
||||
## TronScript
|
||||
tronScript is a stupid assembly-like low level language for my asmTron emulator
|
||||
|
||||
|
||||
Available Commands:
|
||||
|
||||
newVar [var] - Initializes new var; not needed most of the time:
|
||||
Compiler automatically initializes new vars when used
|
||||
jumpMark [jumpMark name] - Sets an JumpMark to jump to using the "jump" command
|
||||
jump [jumpMark name] - Jumps to an JumpMark
|
||||
getVarAddress [var A] [var B] - Saves [var A]'s memory-address into [var B]
|
||||
getArrayAddress [array] [index] [var] - Saves [array][[index]]'s memory-adress into [var]
|
||||
exec [func name] - Executes function with name [func name]
|
||||
setVar [var] [value] - Sets var [var] to [value] (decimal)
|
||||
setVar [var] b[value] - Sets var [var] to [value] (binary)
|
||||
setArrayIndex [array] [index] [value] - Sets [array][[index]] to [value] (decimal)
|
||||
setArrayIndex [array] [index] b[value] - Sets [array][[index]] to [value] (binary)
|
||||
getArrayIndex [array] [index] [var] - Stores the content of [array][[index]] into var [var]
|
||||
copyVar [var A] [var B] - Copies to value of [var A] to [var B] (B=A)
|
||||
write [var] - Writes value of [var] to console
|
||||
read [var] - Reads input from console into [var]
|
||||
add [var A] [var B] [var OUT] - Adds [var A] + [var B] = [var OUT]
|
||||
subtract [var A] [var B] [var OUT] - Subtracts [var A] - [var B] = [var OUT]
|
||||
if [var A] [??] [var B] [cmd] [pars] - ?? = [==,!=,>,<,>=,<=] if clause is true,
|
||||
executes [cmd] with [pars]
|
||||
for [goal] [counter] [step] [cmd] [pars]- Sets [counter] = 0; Executes [cmd] with [pars] and
|
||||
adds [step] to [counter], until [goal]==[counter]
|
||||
:[asm] v#[var] - Executes [asm]-assembler command with par [var]
|
||||
:[asm] d#[par] - Executes [asm]-assembler command with par [par] (decimal)
|
||||
:[asm] b#[par] - Executes [asm]-assembler command with par [par] (binary)
|
||||
:[asm] - - Executes [asm]-assembler command with par b#00000000 / d#0
|
||||
:[asm] ~ - Executes [asm]-assembler command with par b#11111111 / d#255
|
||||
shellcode [code] - Executes binary code [code]
|
||||
nop - Nothing; sleep one cycle
|
||||
halt - Stops execution of program; automatically added to the end of
|
||||
your program if not present
|
||||
|
||||
function [funcName] { - Defines function [funcName] with code [funcCode]
|
||||
[funcCode line 1] ! Every function can only have one instance at a time:
|
||||
[funcCode line 2] ! A function shall not call itself and a sub function shall
|
||||
[funcCode line 3] ! not call any of its root functions !!!
|
||||
. ! If you need this functionality, implement it in assembly...
|
||||
.
|
||||
. Why is that so? This is a stupid compiler, which does not use
|
||||
[funcCode line n] a stack to return from functions, but a function-specific variable
|
||||
} to store the jump-back-address... :P
|
||||
|
45
TronScript_README.txt
Normal file
45
TronScript_README.txt
Normal file
@ -0,0 +1,45 @@
|
||||
tronScript is a stupid pretty assembly-like low level language for my asmTron emulator
|
||||
|
||||
|
||||
Available Commands:
|
||||
|
||||
newVar [var] - Initializes new var; not needed most of the time:
|
||||
Compiler automatically initializes new vars when used
|
||||
jumpMark [jumpMark name] - Sets an JumpMark to jump to using the "jump" command
|
||||
jump [jumpMark name] - Jumps to an JumpMark
|
||||
getVarAddress [var A] [var B] - Saves [var A]'s memory-address into [var B]
|
||||
getArrayAddress [array] [index] [var] - Saves [array][[index]]'s memory-adress into [var]
|
||||
exec [func name] - Executes function with name [func name]
|
||||
setVar [var] [value] - Sets var [var] to [value] (decimal)
|
||||
setVar [var] b[value] - Sets var [var] to [value] (binary)
|
||||
setArrayIndex [array] [index] [value] - Sets [array][[index]] to [value] (decimal)
|
||||
setArrayIndex [array] [index] b[value] - Sets [array][[index]] to [value] (binary)
|
||||
getArrayIndex [array] [index] [var] - Stores the content of [array][[index]] into var [var]
|
||||
copyVar [var A] [var B] - Copies to value of [var A] to [var B] (B=A)
|
||||
write [var] - Writes value of [var] to console
|
||||
read [var] - Reads input from console into [var]
|
||||
add [var A] [var B] [var OUT] - Adds [var A] + [var B] = [var OUT]
|
||||
subtract [var A] [var B] [var OUT] - Subtracts [var A] - [var B] = [var OUT]
|
||||
if [var A] [??] [var B] [cmd] [pars] - ?? = [==,!=,>,<,>=,<=] if clause is true,
|
||||
executes [cmd] with [pars]
|
||||
for [goal] [counter] [step] [cmd] [pars]- Sets [counter] = 0; Executes [cmd] with [pars] and
|
||||
adds [step] to [counter], until [goal]==[counter]
|
||||
:[asm] v#[var] - Executes [asm]-assembler command with par [var]
|
||||
:[asm] d#[par] - Executes [asm]-assembler command with par [par] (decimal)
|
||||
:[asm] b#[par] - Executes [asm]-assembler command with par [par] (binary)
|
||||
:[asm] - - Executes [asm]-assembler command with par b#00000000 / d#0
|
||||
:[asm] ~ - Executes [asm]-assembler command with par b#11111111 / d#255
|
||||
shellcode [code] - Executes binary code [code]
|
||||
nop - Nothing; sleep one cycle
|
||||
halt - Stops execution of program; automatically added to the end of
|
||||
your program if not present
|
||||
|
||||
function [funcName] { - Defines function [funcName] with code [funcCode]
|
||||
[funcCode line 1] ! Every function can only have one instance at a time:
|
||||
[funcCode line 2] ! A function shall not call itself and a sub function shall
|
||||
[funcCode line 3] ! not call any of its root functions !!!
|
||||
. ! If you need this functionality, implement it in assembly...
|
||||
.
|
||||
. Why is that so? This is a stupid compiler, which does not use
|
||||
[funcCode line n] a stack to return from functions, but a function-specific variable
|
||||
} to store the jump-back-address... :P
|
Loading…
Reference in New Issue
Block a user