Added logical functions and a subroutine EXIT
This commit is contained in:
parent
1ee3d8d296
commit
40ec859e51
|
@ -26,6 +26,12 @@
|
||||||
CALLI R15 @cold_start
|
CALLI R15 @cold_start
|
||||||
HALT
|
HALT
|
||||||
|
|
||||||
|
;; EXIT function
|
||||||
|
;; Pops Return stack
|
||||||
|
;; And jumps to NEXT
|
||||||
|
:EXIT
|
||||||
|
POPR R13 R15
|
||||||
|
|
||||||
;; NEXT function
|
;; NEXT function
|
||||||
;; increments to next instruction
|
;; increments to next instruction
|
||||||
;; Jumps to updated current
|
;; Jumps to updated current
|
||||||
|
@ -334,5 +340,56 @@
|
||||||
PUSHR R0 R14
|
PUSHR R0 R14
|
||||||
JSR_COROUTINE R11 ; NEXT
|
JSR_COROUTINE R11 ; NEXT
|
||||||
|
|
||||||
|
;; AND
|
||||||
|
:AND_Text
|
||||||
|
"AND"
|
||||||
|
:AND_Entry
|
||||||
|
&GEqual_Entry ; Pointer to >=
|
||||||
|
&AND_Text ; Pointer to Name
|
||||||
|
NOP ; Flags
|
||||||
|
POPR R0 R14
|
||||||
|
POPR R1 R14
|
||||||
|
AND R0 R0 R1
|
||||||
|
PUSHR R0 R14
|
||||||
|
JSR_COROUTINE R11 ; NEXT
|
||||||
|
|
||||||
|
;; OR
|
||||||
|
:OR_Text
|
||||||
|
"OR"
|
||||||
|
:OR_Entry
|
||||||
|
&AND_Entry ; Pointer to AND
|
||||||
|
&OR_Text ; Pointer to Name
|
||||||
|
NOP ; Flags
|
||||||
|
POPR R0 R14
|
||||||
|
POPR R1 R14
|
||||||
|
OR R0 R0 R1
|
||||||
|
PUSHR R0 R14
|
||||||
|
JSR_COROUTINE R11 ; NEXT
|
||||||
|
|
||||||
|
;; XOR
|
||||||
|
:XOR_Text
|
||||||
|
"XOR"
|
||||||
|
:XOR_Entry
|
||||||
|
&OR_Entry ; Pointer to OR
|
||||||
|
&XOR_Text ; Pointer to Name
|
||||||
|
NOP ; Flags
|
||||||
|
POPR R0 R14
|
||||||
|
POPR R1 R14
|
||||||
|
XOR R0 R0 R1
|
||||||
|
PUSHR R0 R14
|
||||||
|
JSR_COROUTINE R11 ; NEXT
|
||||||
|
|
||||||
|
;; NOT
|
||||||
|
:NOT_Text
|
||||||
|
"NOT"
|
||||||
|
:NOT_Entry
|
||||||
|
&XOR_Entry ; Pointer to XOR
|
||||||
|
&NOT_Text ; Pointer to Name
|
||||||
|
NOP ; Flags
|
||||||
|
POPR R0 R14
|
||||||
|
NOT R0 R0
|
||||||
|
PUSHR R0 R14
|
||||||
|
JSR_COROUTINE R11 ; NEXT
|
||||||
|
|
||||||
:cold_start
|
:cold_start
|
||||||
;;
|
;;
|
||||||
|
|
Loading…
Reference in New Issue