Added logical functions and a subroutine EXIT

This commit is contained in:
Jeremiah Orians 2016-10-29 12:05:41 -04:00
parent 1ee3d8d296
commit 40ec859e51
No known key found for this signature in database
GPG Key ID: 7457821534D2ACCD
1 changed files with 57 additions and 0 deletions

View File

@ -26,6 +26,12 @@
CALLI R15 @cold_start
HALT
;; EXIT function
;; Pops Return stack
;; And jumps to NEXT
:EXIT
POPR R13 R15
;; NEXT function
;; increments to next instruction
;; Jumps to updated current
@ -334,5 +340,56 @@
PUSHR R0 R14
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
;;