mirror of
https://gitlab.com/jusax23/raspberry-pi-pico-machine-code-emulator.git
synced 2024-11-22 22:56:36 +01:00
219 lines
2.2 KiB
ActionScript
219 lines
2.2 KiB
ActionScript
|
|
||
|
v0 = 0;2
|
||
|
l1 = 2;6
|
||
|
SHS 8
|
||
|
;code
|
||
|
|
||
|
;defvar: executing value:
|
||
|
|
||
|
;num: Loading num
|
||
|
LIA 3
|
||
|
|
||
|
; load 0 List element
|
||
|
LIX 0
|
||
|
SOA 2 l1
|
||
|
|
||
|
;num: Loading num
|
||
|
LIA 2
|
||
|
|
||
|
; load 1 List element
|
||
|
LIX 2
|
||
|
SOA 2 l1
|
||
|
|
||
|
;num: Loading num
|
||
|
LIA 1
|
||
|
|
||
|
; load 2 List element
|
||
|
LIX 4
|
||
|
SOA 2 l1
|
||
|
|
||
|
; return List Pointer
|
||
|
LIA l1
|
||
|
|
||
|
LIB 65535
|
||
|
BWA
|
||
|
|
||
|
;defvar: Store Value
|
||
|
STA 2 v0
|
||
|
|
||
|
;print: executing value:
|
||
|
|
||
|
; Load list pointers
|
||
|
|
||
|
;num: Loading num
|
||
|
LIA 0
|
||
|
|
||
|
; calculate Byte offset
|
||
|
LIB 2
|
||
|
MUL 0 0 0
|
||
|
|
||
|
; Load pointer Address
|
||
|
LIX v0
|
||
|
|
||
|
LOB 2 v0
|
||
|
|
||
|
ADD 0 0 0
|
||
|
|
||
|
CAX
|
||
|
;fetch list-nth
|
||
|
LOA 2 0
|
||
|
|
||
|
;print Value
|
||
|
OUT 0
|
||
|
|
||
|
;print: executing value:
|
||
|
|
||
|
; Load list pointers
|
||
|
|
||
|
;num: Loading num
|
||
|
LIA 1
|
||
|
|
||
|
; calculate Byte offset
|
||
|
LIB 2
|
||
|
MUL 0 0 0
|
||
|
|
||
|
; Load pointer Address
|
||
|
LIX v0
|
||
|
|
||
|
LOB 2 v0
|
||
|
|
||
|
ADD 0 0 0
|
||
|
|
||
|
CAX
|
||
|
;fetch list-nth
|
||
|
LOA 2 0
|
||
|
|
||
|
;print Value
|
||
|
OUT 0
|
||
|
|
||
|
;print: executing value:
|
||
|
|
||
|
; Load list pointers
|
||
|
|
||
|
;num: Loading num
|
||
|
LIA 2
|
||
|
|
||
|
; calculate Byte offset
|
||
|
LIB 2
|
||
|
MUL 0 0 0
|
||
|
|
||
|
; Load pointer Address
|
||
|
LIX v0
|
||
|
|
||
|
LOB 2 v0
|
||
|
|
||
|
ADD 0 0 0
|
||
|
|
||
|
CAX
|
||
|
;fetch list-nth
|
||
|
LOA 2 0
|
||
|
|
||
|
;print Value
|
||
|
OUT 0
|
||
|
|
||
|
;Load value
|
||
|
|
||
|
;num: Loading num
|
||
|
LIA 5
|
||
|
|
||
|
PSH 2
|
||
|
; Load list pointers
|
||
|
|
||
|
;num: Loading num
|
||
|
LIA 1
|
||
|
|
||
|
; calculate Byte offset
|
||
|
LIB 2
|
||
|
MUL 0 0 0
|
||
|
|
||
|
; Load pointer Address
|
||
|
LIX v0
|
||
|
|
||
|
LOB 2 v0
|
||
|
|
||
|
ADD 0 0 0
|
||
|
CAX
|
||
|
PUL 2
|
||
|
|
||
|
;fetch list-nth
|
||
|
SOA 2 0
|
||
|
|
||
|
;print: executing value:
|
||
|
|
||
|
; Load list pointers
|
||
|
|
||
|
;num: Loading num
|
||
|
LIA 0
|
||
|
|
||
|
; calculate Byte offset
|
||
|
LIB 2
|
||
|
MUL 0 0 0
|
||
|
|
||
|
; Load pointer Address
|
||
|
LIX v0
|
||
|
|
||
|
LOB 2 v0
|
||
|
|
||
|
ADD 0 0 0
|
||
|
|
||
|
CAX
|
||
|
;fetch list-nth
|
||
|
LOA 2 0
|
||
|
|
||
|
;print Value
|
||
|
OUT 0
|
||
|
|
||
|
;print: executing value:
|
||
|
|
||
|
; Load list pointers
|
||
|
|
||
|
;num: Loading num
|
||
|
LIA 1
|
||
|
|
||
|
; calculate Byte offset
|
||
|
LIB 2
|
||
|
MUL 0 0 0
|
||
|
|
||
|
; Load pointer Address
|
||
|
LIX v0
|
||
|
|
||
|
LOB 2 v0
|
||
|
|
||
|
ADD 0 0 0
|
||
|
|
||
|
CAX
|
||
|
;fetch list-nth
|
||
|
LOA 2 0
|
||
|
|
||
|
;print Value
|
||
|
OUT 0
|
||
|
|
||
|
;print: executing value:
|
||
|
|
||
|
; Load list pointers
|
||
|
|
||
|
;num: Loading num
|
||
|
LIA 2
|
||
|
|
||
|
; calculate Byte offset
|
||
|
LIB 2
|
||
|
MUL 0 0 0
|
||
|
|
||
|
; Load pointer Address
|
||
|
LIX v0
|
||
|
|
||
|
LOB 2 v0
|
||
|
|
||
|
ADD 0 0 0
|
||
|
|
||
|
CAX
|
||
|
;fetch list-nth
|
||
|
LOA 2 0
|
||
|
|
||
|
;print Value
|
||
|
OUT 0
|
||
|
|
||
|
HLT
|
||
|
;functions
|
||
|
|