Update examples to new assembly syntax
This commit is contained in:
parent
ae0c31d83a
commit
7446bcab45
6 changed files with 50 additions and 57 deletions
|
|
@ -12,27 +12,27 @@
|
|||
; Functions take a fixed number of arguments. For this example, all
|
||||
; values have a size of one word (24 bit).
|
||||
|
||||
IAR = main
|
||||
SP = 0xfffff
|
||||
FP = 0xfffff
|
||||
.reg IAR main
|
||||
.reg SP -1
|
||||
.reg FP -1
|
||||
|
||||
; Temporary variables at a fixed memory location
|
||||
;
|
||||
; These are useful for commands like ADD, which need a fixed memory
|
||||
; address. They are always under the complete control of the currently
|
||||
; running function.
|
||||
tmp1: LIT 0
|
||||
tmp2: LIT 0
|
||||
tmp3: LIT 0
|
||||
tmp4: LIT 0
|
||||
tmp5: LIT 0
|
||||
tmp1: .lit 0
|
||||
tmp2: .lit 0
|
||||
tmp3: .lit 0
|
||||
tmp4: .lit 0
|
||||
tmp5: .lit 0
|
||||
|
||||
100:
|
||||
.org 100
|
||||
main:
|
||||
CALL caller
|
||||
HALT
|
||||
|
||||
200:
|
||||
.org 200
|
||||
caller:
|
||||
;; 1. Initialisation
|
||||
|
||||
|
|
@ -121,7 +121,7 @@ caller:
|
|||
|
||||
RET
|
||||
|
||||
300:
|
||||
.org 300
|
||||
callee:
|
||||
; This callee doesn't really need its own stack since all
|
||||
; calculations did fit into the temporary variables. I still created
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue