Fixed typo of CMPSKIP(u) to CMPSKIP(u)I which is required per the naming convention
This commit is contained in:
parent
1f3e2c3357
commit
73651b577e
|
@ -366,16 +366,16 @@ void assemble(struct Token* p)
|
|||
setExpression(p, "STORER8", "2F1", 4);
|
||||
setExpression(p, "STORER16", "2F2", 4);
|
||||
setExpression(p, "STORER32", "2F3", 4);
|
||||
setExpression(p, "CMPSKIP.G", "A00", 4);
|
||||
setExpression(p, "CMPSKIP.GE", "A01", 4);
|
||||
setExpression(p, "CMPSKIP.E", "A02", 4);
|
||||
setExpression(p, "CMPSKIP.NE", "A03", 4);
|
||||
setExpression(p, "CMPSKIP.LE", "A04", 4);
|
||||
setExpression(p, "CMPSKIP.L", "A05", 4);
|
||||
setExpression(p, "CMPSKIPU.G", "A10", 4);
|
||||
setExpression(p, "CMPSKIPU.GE", "A11", 4);
|
||||
setExpression(p, "CMPSKIPU.LE", "A14", 4);
|
||||
setExpression(p, "CMPSKIPU.L", "A15", 4);
|
||||
setExpression(p, "CMPSKIPI.G", "A00", 4);
|
||||
setExpression(p, "CMPSKIPI.GE", "A01", 4);
|
||||
setExpression(p, "CMPSKIPI.E", "A02", 4);
|
||||
setExpression(p, "CMPSKIPI.NE", "A03", 4);
|
||||
setExpression(p, "CMPSKIPI.LE", "A04", 4);
|
||||
setExpression(p, "CMPSKIPI.L", "A05", 4);
|
||||
setExpression(p, "CMPSKIPUI.G", "A10", 4);
|
||||
setExpression(p, "CMPSKIPUI.GE", "A11", 4);
|
||||
setExpression(p, "CMPSKIPUI.LE", "A14", 4);
|
||||
setExpression(p, "CMPSKIPUI.L", "A15", 4);
|
||||
|
||||
/* 0OPI Group */
|
||||
setExpression(p, "JUMP", "3C00", 4);
|
||||
|
|
|
@ -196,16 +196,16 @@ DEFINE STORER 2F0
|
|||
DEFINE STORER8 2F1
|
||||
DEFINE STORER16 2F2
|
||||
DEFINE STORER32 2F3
|
||||
DEFINE CMPSKIP.G A00
|
||||
DEFINE CMPSKIP.GE A01
|
||||
DEFINE CMPSKIP.E A02
|
||||
DEFINE CMPSKIP.NE A03
|
||||
DEFINE CMPSKIP.LE A04
|
||||
DEFINE CMPSKIP.L A05
|
||||
DEFINE CMPSKIPU.G A10
|
||||
DEFINE CMPSKIPU.GE A11
|
||||
DEFINE CMPSKIPU.LE A14
|
||||
DEFINE CMPSKIPU.L A15
|
||||
DEFINE CMPSKIPI.G A00
|
||||
DEFINE CMPSKIPI.GE A01
|
||||
DEFINE CMPSKIPI.E A02
|
||||
DEFINE CMPSKIPI.NE A03
|
||||
DEFINE CMPSKIPI.LE A04
|
||||
DEFINE CMPSKIPI.L A05
|
||||
DEFINE CMPSKIPUI.G A10
|
||||
DEFINE CMPSKIPUI.GE A11
|
||||
DEFINE CMPSKIPUI.LE A14
|
||||
DEFINE CMPSKIPUI.L A15
|
||||
|
||||
# 0OPI Group
|
||||
DEFINE JUMP 3C00
|
||||
|
|
|
@ -1105,54 +1105,54 @@ void decode_1OPI(struct Instruction* c)
|
|||
strncpy(Name, "STORER32", 19);
|
||||
break;
|
||||
}
|
||||
case 0xA00: /* CMPSKIP.G */
|
||||
case 0xA00: /* CMPSKIPI.G */
|
||||
{
|
||||
strncpy(Name, "CMPSKIP.G", 19);
|
||||
strncpy(Name, "CMPSKIPI.G", 19);
|
||||
break;
|
||||
}
|
||||
case 0xA01: /* CMPSKIP.GE */
|
||||
case 0xA01: /* CMPSKIPI.GE */
|
||||
{
|
||||
strncpy(Name, "CMPSKIP.GE", 19);
|
||||
strncpy(Name, "CMPSKIPI.GE", 19);
|
||||
break;
|
||||
}
|
||||
case 0xA02: /* CMPSKIP.E */
|
||||
case 0xA02: /* CMPSKIPI.E */
|
||||
{
|
||||
strncpy(Name, "CMPSKIP.E", 19);
|
||||
strncpy(Name, "CMPSKIPI.E", 19);
|
||||
break;
|
||||
}
|
||||
case 0xA03: /* CMPSKIP.NE */
|
||||
case 0xA03: /* CMPSKIPI.NE */
|
||||
{
|
||||
strncpy(Name, "CMPSKIP.NE", 19);
|
||||
strncpy(Name, "CMPSKIPI.NE", 19);
|
||||
break;
|
||||
}
|
||||
case 0xA04: /* CMPSKIP.LE */
|
||||
case 0xA04: /* CMPSKIPI.LE */
|
||||
{
|
||||
strncpy(Name, "CMPSKIP.LE", 19);
|
||||
strncpy(Name, "CMPSKIPI.LE", 19);
|
||||
break;
|
||||
}
|
||||
case 0xA05: /* CMPSKIP.L */
|
||||
case 0xA05: /* CMPSKIPI.L */
|
||||
{
|
||||
strncpy(Name, "CMPSKIP.L", 19);
|
||||
strncpy(Name, "CMPSKIPI.L", 19);
|
||||
break;
|
||||
}
|
||||
case 0xA10: /* CMPSKIPU.G */
|
||||
case 0xA10: /* CMPSKIPUI.G */
|
||||
{
|
||||
strncpy(Name, "CMPSKIPU.G", 19);
|
||||
strncpy(Name, "CMPSKIPUI.G", 19);
|
||||
break;
|
||||
}
|
||||
case 0xA11: /* CMPSKIPU.GE */
|
||||
case 0xA11: /* CMPSKIPUI.GE */
|
||||
{
|
||||
strncpy(Name, "CMPSKIPU.GE", 19);
|
||||
strncpy(Name, "CMPSKIPUI.GE", 19);
|
||||
break;
|
||||
}
|
||||
case 0xA14: /* CMPSKIPU.LE */
|
||||
case 0xA14: /* CMPSKIPUI.LE */
|
||||
{
|
||||
strncpy(Name, "CMPSKIPU.LE", 19);
|
||||
strncpy(Name, "CMPSKIPUI.LE", 19);
|
||||
break;
|
||||
}
|
||||
case 0xA15: /* CMPSKIPU.L */
|
||||
case 0xA15: /* CMPSKIPUI.L */
|
||||
{
|
||||
strncpy(Name, "CMPSKIPU.L", 19);
|
||||
strncpy(Name, "CMPSKIPUI.L", 19);
|
||||
break;
|
||||
}
|
||||
default: /* Unknown 1OPI*/
|
||||
|
|
|
@ -527,27 +527,27 @@ DO NOT USE.
|
|||
| ... | Reserved |
|
||||
| 9F FF FF FF | Reserved |
|
||||
|
||||
** CMPSKIP Group
|
||||
| Hex | Name | Comment |
|
||||
|-------------+---------------------+------------------------------------|
|
||||
| A0 0a ii ii | CMPSKIP.G a ii ii | a > ii ii ? Skip Next instruction |
|
||||
| A0 1a ii ii | CMPSKIP.GE a ii ii | a >= ii ii ? Skip Next instruction |
|
||||
| A0 2a ii ii | CMPSKIP.E a ii ii | a == ii ii ? Skip Next instruction |
|
||||
| A0 3a ii ii | CMPSKIP.NE a ii ii | a != ii ii ? Skip Next instruction |
|
||||
| A0 4a ii ii | CMPSKIP.LE a ii ii | a <= ii ii ? Skip Next instruction |
|
||||
| A0 5a ii ii | CMPSKIP.L a ii ii | a < ii ii ? Skip Next instruction |
|
||||
| A0 6a ii ii | Reserved | |
|
||||
| ... | Reserved | |
|
||||
| A0 Fa ii ii | Reserved | |
|
||||
| A1 0a ii ii | CMPSKIPU.G a ii ii | a > ii ii ? Skip Next instruction |
|
||||
| A1 1a ii ii | CMPSKIPU.GE a ii ii | a >= ii ii ? Skip Next instruction |
|
||||
| A1 2a ii ii | Reserved | |
|
||||
| A1 3a ii ii | Reserved | |
|
||||
| A1 4a ii ii | CMPSKIPU.LE a ii ii | a <= ii ii ? Skip Next instruction |
|
||||
| A1 5a ii ii | CMPSKIPU.L a ii ii | a < ii ii ? Skip Next instruction |
|
||||
| A1 6a ii ii | Reserved | |
|
||||
| ... | Reserved | |
|
||||
| A1 Fa ii ii | Reserved | |
|
||||
** CMPSKIPI Group
|
||||
| Hex | Name | Comment |
|
||||
|-------------+----------------------+------------------------------------|
|
||||
| A0 0a ii ii | CMPSKIPI.G a ii ii | a > ii ii ? Skip Next instruction |
|
||||
| A0 1a ii ii | CMPSKIPI.GE a ii ii | a >= ii ii ? Skip Next instruction |
|
||||
| A0 2a ii ii | CMPSKIPI.E a ii ii | a == ii ii ? Skip Next instruction |
|
||||
| A0 3a ii ii | CMPSKIPI.NE a ii ii | a != ii ii ? Skip Next instruction |
|
||||
| A0 4a ii ii | CMPSKIPI.LE a ii ii | a <= ii ii ? Skip Next instruction |
|
||||
| A0 5a ii ii | CMPSKIPI.L a ii ii | a < ii ii ? Skip Next instruction |
|
||||
| A0 6a ii ii | Reserved | |
|
||||
| ... | Reserved | |
|
||||
| A0 Fa ii ii | Reserved | |
|
||||
| A1 0a ii ii | CMPSKIPUI.G a ii ii | a > ii ii ? Skip Next instruction |
|
||||
| A1 1a ii ii | CMPSKIPUI.GE a ii ii | a >= ii ii ? Skip Next instruction |
|
||||
| A1 2a ii ii | Reserved | |
|
||||
| A1 3a ii ii | Reserved | |
|
||||
| A1 4a ii ii | CMPSKIPUI.LE a ii ii | a <= ii ii ? Skip Next instruction |
|
||||
| A1 5a ii ii | CMPSKIPUI.L a ii ii | a < ii ii ? Skip Next instruction |
|
||||
| A1 6a ii ii | Reserved | |
|
||||
| ... | Reserved | |
|
||||
| A1 Fa ii ii | Reserved | |
|
||||
|
||||
** Reserved Block 2
|
||||
At this time these instructions only produce a warning; but could do anything.
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
;; Handle case of Head->next not being NULL
|
||||
LOAD32 R0 R0 0 ; Move to next node
|
||||
LOAD32 R2 R0 0 ; Get node->next
|
||||
CMPSKIP.E R2 0 ; If it is not null
|
||||
CMPSKIPI.E R2 0 ; If it is not null
|
||||
JUMP @add_node_1 ; Move to the next node and try again
|
||||
JUMP @add_node_0 ; Else simply act as if we got this node
|
||||
; in the first place
|
||||
|
|
|
@ -4,9 +4,9 @@
|
|||
# R15 will be used as the stack pointer
|
||||
:start
|
||||
LOADUI R15 @stack
|
||||
LOADUI R0 22 ; Allocate 22 bytes
|
||||
LOADUI R0 22 ; Allocate 22 bytes
|
||||
CALLI R15 @malloc
|
||||
LOADUI R0 42 ; Allocate 42 bytes
|
||||
LOADUI R0 42 ; Allocate 42 bytes
|
||||
CALLI R15 @malloc
|
||||
HALT
|
||||
|
||||
|
@ -17,7 +17,7 @@
|
|||
;; Get current malloc pointer
|
||||
LOADR R1 @malloc_pointer
|
||||
;; Deal with special case
|
||||
CMPSKIP.NE R1 0 ; If Zero set to our start of heap space
|
||||
CMPSKIPI.NE R1 0 ; If Zero set to our start of heap space
|
||||
LOADUI R1 0x600
|
||||
|
||||
;; update malloc pointer
|
||||
|
|
|
@ -23,19 +23,19 @@
|
|||
FGETC ; Read a Char
|
||||
|
||||
;; Flag if reached EOF
|
||||
CMPSKIP.GE R0 0
|
||||
CMPSKIPI.GE R0 0
|
||||
TRUE R14
|
||||
|
||||
;; Stop if EOF
|
||||
CMPSKIP.GE R0 0
|
||||
CMPSKIPI.GE R0 0
|
||||
JUMP @Readline_2
|
||||
|
||||
;; Handle Backspace
|
||||
CMPSKIP.E R0 127
|
||||
CMPSKIPI.E R0 127
|
||||
JUMP @Readline_1
|
||||
|
||||
;; Move back 1 character if R3 > 0
|
||||
CMPSKIP.LE R3 0
|
||||
CMPSKIPI.LE R3 0
|
||||
SUBUI R3 R3 1
|
||||
|
||||
;; Hopefully they keep typing
|
||||
|
@ -43,7 +43,7 @@
|
|||
|
||||
:Readline_1
|
||||
;; Replace all CR with LF
|
||||
CMPSKIP.NE R0 13
|
||||
CMPSKIPI.NE R0 13
|
||||
LOADUI R0 10
|
||||
|
||||
;; Store the Byte
|
||||
|
@ -53,7 +53,7 @@
|
|||
ADDUI R3 R3 1
|
||||
|
||||
;; Check for EOL
|
||||
CMPSKIP.NE R0 10
|
||||
CMPSKIPI.NE R0 10
|
||||
JUMP @Readline_2
|
||||
|
||||
;; Otherwise loop
|
||||
|
@ -61,7 +61,7 @@
|
|||
|
||||
:Readline_2
|
||||
;; Set Text pointer
|
||||
CMPSKIP.E R3 0 ; Don't bother for Empty strings
|
||||
CMPSKIPI.E R3 0 ; Don't bother for Empty strings
|
||||
STORE32 R2 R4 8
|
||||
;; Correct Malloc
|
||||
MOVE R0 R3 ; Ensure actually allocates exactly
|
||||
|
|
|
@ -24,14 +24,14 @@
|
|||
MOVE R3 R1
|
||||
LOADUI R4 0
|
||||
:cmpbyte
|
||||
LOADXU8 R0 R2 R4 ; Get a byte of our first string
|
||||
LOADXU8 R1 R3 R4 ; Get a byte of our second string
|
||||
ADDUI R4 R4 1 ; Prep for next loop
|
||||
CMP R1 R0 R1 ; Compare the bytes
|
||||
CMPSKIP.E R0 0 ; Stop if byte is NULL
|
||||
JUMP.E R1 @cmpbyte ; Loop if bytes are equal
|
||||
LOADXU8 R0 R2 R4 ; Get a byte of our first string
|
||||
LOADXU8 R1 R3 R4 ; Get a byte of our second string
|
||||
ADDUI R4 R4 1 ; Prep for next loop
|
||||
CMP R1 R0 R1 ; Compare the bytes
|
||||
CMPSKIPI.E R0 0 ; Stop if byte is NULL
|
||||
JUMP.E R1 @cmpbyte ; Loop if bytes are equal
|
||||
;; Done
|
||||
MOVE R0 R1 ; Prepare for return
|
||||
MOVE R0 R1 ; Prepare for return
|
||||
;; Restore registers
|
||||
POPR R4 R15
|
||||
POPR R3 R15
|
||||
|
|
|
@ -17,13 +17,13 @@
|
|||
LOADUI R1 0 ; Read from tty
|
||||
FGETC ; Read a Char
|
||||
|
||||
CMPSKIP.NE R0 13 ; Replace all CR
|
||||
CMPSKIPI.NE R0 13 ; Replace all CR
|
||||
LOADUI R0 10 ; WIth LF
|
||||
|
||||
FPUTC ; Display the Char to User
|
||||
|
||||
;; Check for Ctrl-D
|
||||
CMPSKIP.NE R0 4
|
||||
CMPSKIPI.NE R0 4
|
||||
JUMP @finish
|
||||
|
||||
;; Check for EOF
|
||||
|
@ -93,7 +93,7 @@
|
|||
:ascii_comment
|
||||
LOADUI R1 0 ; Read from tty
|
||||
FGETC ; Read another char
|
||||
CMPSKIP.NE R0 13 ; Replace all CR
|
||||
CMPSKIPI.NE R0 13 ; Replace all CR
|
||||
LOADUI R0 10 ; WIth LF
|
||||
FPUTC ; Let the user see it
|
||||
CMPUI R14 R0 10 ; Stop at the end of line
|
||||
|
|
|
@ -49,7 +49,7 @@ FFFFFFFF # HALT ; We are Done
|
|||
# ;; Get current malloc pointer
|
||||
2E01 @malloc_pointer # LOADR R1 @malloc_pointer
|
||||
# ;; Deal with special case
|
||||
A0310000 # CMPSKIP.NE R1 0 ; If Zero set to our start of heap space
|
||||
A0310000 # CMPSKIPI.NE R1 0 ; If Zero set to our start of heap space
|
||||
2D214000 # LOADUI R1 0x4000
|
||||
# ;; update malloc pointer
|
||||
09000301 # SWAP R0 R1
|
||||
|
@ -80,25 +80,25 @@ A0310000 # CMPSKIP.NE R1 0 ; If Zero set to our start of heap space
|
|||
:Tokenize_Line_0
|
||||
42100100 # FGETC ; Get a Char
|
||||
# ;; Deal with lines comments starting with #
|
||||
A0300023 # CMPSKIP.NE R0 35
|
||||
A0300023 # CMPSKIPI.NE R0 35
|
||||
3C00 @Purge_Line_Comment # JUMP @Purge_Line_Comment
|
||||
# ;; Deal with Line comments starting with ;
|
||||
A030003b # CMPSKIP.NE R0 59
|
||||
A030003b # CMPSKIPI.NE R0 59
|
||||
3C00 @Purge_Line_Comment # JUMP @Purge_Line_Comment
|
||||
# ;; Deal with Tab
|
||||
A0300009 # CMPSKIP.NE R0 9
|
||||
A0300009 # CMPSKIPI.NE R0 9
|
||||
3C00 @Tokenize_Line_0 # JUMP @Tokenize_Line_0 ; Throw away byte and try again
|
||||
# ;; Deal with New line
|
||||
A030000a # CMPSKIP.NE R0 10
|
||||
A030000a # CMPSKIPI.NE R0 10
|
||||
3C00 @Tokenize_Line_0 # JUMP @Tokenize_Line_0 ; Throw away byte and try again
|
||||
# ;; Deal with space characters
|
||||
A0300020 # CMPSKIP.NE R0 32
|
||||
A0300020 # CMPSKIPI.NE R0 32
|
||||
3C00 @Tokenize_Line_0 # JUMP @Tokenize_Line_0 ; Throw away byte and try again
|
||||
# ;; Flag if reached EOF
|
||||
A0100000 # CMPSKIP.GE R0 0
|
||||
A0100000 # CMPSKIPI.GE R0 0
|
||||
0D00003E # TRUE R14
|
||||
# ;; Stop if EOF
|
||||
A0100000 # CMPSKIP.GE R0 0
|
||||
A0100000 # CMPSKIPI.GE R0 0
|
||||
3C00 @Tokenize_Line_Done # JUMP @Tokenize_Line_Done
|
||||
# ;; Allocate a new Node
|
||||
09000520 # MOVE R2 R0 ; Get Char out the way
|
||||
|
@ -106,10 +106,10 @@ A0100000 # CMPSKIP.GE R0 0
|
|||
2D0F @malloc # CALLI R15 @malloc ; Get address of new Node
|
||||
09000320 # SWAP R2 R0 ; Store Pointer in R2
|
||||
# ;; Deal with Strings wrapped in ""
|
||||
A0300022 # CMPSKIP.NE R0 34
|
||||
A0300022 # CMPSKIPI.NE R0 34
|
||||
3C00 @Store_String # JUMP @Store_String
|
||||
# ;; Deal with Strings wrapped in '
|
||||
A0300027 # CMPSKIP.NE R0 39
|
||||
A0300027 # CMPSKIPI.NE R0 39
|
||||
3C00 @Store_String # JUMP @Store_String
|
||||
# ;; Everything else is an atom store it
|
||||
2D0F @Store_Atom # CALLI R15 @Store_Atom
|
||||
|
@ -134,7 +134,7 @@ A0300027 # CMPSKIP.NE R0 39
|
|||
# ;; Comment never existed
|
||||
:Purge_Line_Comment
|
||||
42100100 # FGETC ; Get another Char
|
||||
A020000a # CMPSKIP.E R0 10 ; Stop When LF is reached
|
||||
A020000a # CMPSKIPI.E R0 10 ; Stop When LF is reached
|
||||
3C00 @Purge_Line_Comment # JUMP @Purge_Line_Comment ; Otherwise keep looping
|
||||
3C00 @Tokenize_Line_0 # JUMP @Tokenize_Line_0 ; Return as if this never happened
|
||||
|
||||
|
@ -192,11 +192,11 @@ C306 @Store_String_0 # CMPJUMP.NE R0 R6 @Store_String_0 ; Loop if matching not f
|
|||
05049045 # STOREX8 R0 R4 R5 ; Store the Byte
|
||||
42100100 # FGETC ; Get next Byte
|
||||
0F550001 # ADDUI R5 R5 1 ; Prep for next loop
|
||||
A0300009 # CMPSKIP.NE R0 9 ; If char is Tab
|
||||
A0300009 # CMPSKIPI.NE R0 9 ; If char is Tab
|
||||
3C00 @Store_Atom_Done # JUMP @Store_Atom_Done ; Be done
|
||||
A030000a # CMPSKIP.NE R0 10 ; If char is LF
|
||||
A030000a # CMPSKIPI.NE R0 10 ; If char is LF
|
||||
3C00 @Store_Atom_Done # JUMP @Store_Atom_Done ; Be done
|
||||
A0300020 # CMPSKIP.NE R0 32 ; If char is Space
|
||||
A0300020 # CMPSKIPI.NE R0 32 ; If char is Space
|
||||
3C00 @Store_Atom_Done # JUMP @Store_Atom_Done ; Be done
|
||||
# ;; Otherwise loop
|
||||
3C00 @Store_Atom_0 # JUMP @Store_Atom_0
|
||||
|
@ -238,7 +238,7 @@ A0300020 # CMPSKIP.NE R0 32 ; If char is Space
|
|||
# ;; Handle case of Head->next not being NULL
|
||||
18000000 # LOAD32 R0 R0 0 ; Move to next node
|
||||
18200000 # LOAD32 R2 R0 0 ; Get node->next
|
||||
A0220000 # CMPSKIP.E R2 0 ; If it is not null
|
||||
A0220000 # CMPSKIPI.E R2 0 ; If it is not null
|
||||
3C00 @Add_Token_1 # JUMP @Add_Token_1 ; Move to the next node and try again
|
||||
3C00 @Add_Token_0 # JUMP @Add_Token_0 ; Else simply act as if we got this node
|
||||
# ; in the first place
|
||||
|
@ -269,7 +269,7 @@ A0220000 # CMPSKIP.E R2 0 ; If it is not null
|
|||
0503A134 # LOADXU8 R1 R3 R4 ; Get a byte of our second string
|
||||
0F440001 # ADDUI R4 R4 1 ; Prep for next loop
|
||||
05004101 # CMP R1 R0 R1 ; Compare the bytes
|
||||
A0200000 # CMPSKIP.E R0 0 ; Stop if byte is NULL
|
||||
A0200000 # CMPSKIPI.E R0 0 ; Stop if byte is NULL
|
||||
2C51 @cmpbyte # JUMP.E R1 @cmpbyte ; Loop if bytes are equal
|
||||
# ;; Done
|
||||
09000501 # MOVE R0 R1 ; Prepare for return
|
||||
|
@ -312,7 +312,7 @@ A0200000 # CMPSKIP.E R0 0 ; Stop if byte is NULL
|
|||
18220000 # LOAD32 R2 R2 0 ; Get Next->Next
|
||||
18020008 # LOAD32 R0 R2 8 ; Get Next->Next->Text
|
||||
18320004 # LOAD32 R3 R2 4 ; Get Next->Next->type
|
||||
A0330002 # CMPSKIP.NE R3 2 ; If node is a string
|
||||
A0330002 # CMPSKIPI.NE R3 2 ; If node is a string
|
||||
0F000001 # ADDUI R0 R0 1 ; Skip first char
|
||||
2301000c # STORE32 R0 R1 12 ; Set Expression = Next->Next->Text
|
||||
# ;; Set p->Next = p->Next->Next->Next
|
||||
|
@ -320,7 +320,7 @@ A0330002 # CMPSKIP.NE R3 2 ; If node is a string
|
|||
23010000 # STORE32 R0 R1 0 ; Set Next = Next->Next->Next
|
||||
:Identify_Macros_1
|
||||
18010000 # LOAD32 R0 R1 0 ; Get node->next
|
||||
A0300000 # CMPSKIP.NE R0 0 ; If node->next is NULL
|
||||
A0300000 # CMPSKIPI.NE R0 0 ; If node->next is NULL
|
||||
3C00 @Identify_Macros_Done # JUMP @Identify_Macros_Done ; Be done
|
||||
# ;; Otherwise keep looping
|
||||
3C00 @Identify_Macros_0 # JUMP @Identify_Macros_0
|
||||
|
@ -351,9 +351,9 @@ A0300000 # CMPSKIP.NE R0 0 ; If node->next is NULL
|
|||
1820000c # LOAD32 R2 R0 12 ; Load Expression pointer
|
||||
18100008 # LOAD32 R1 R0 8 ; Load Text pointer
|
||||
18000000 # LOAD32 R0 R0 0 ; Load Next pointer
|
||||
A0330001 # CMPSKIP.NE R3 1 ; If a macro
|
||||
A0330001 # CMPSKIPI.NE R3 1 ; If a macro
|
||||
2D0F @setExpression # CALLI R15 @setExpression ; Apply to other nodes
|
||||
A0200000 # CMPSKIP.E R0 0 ; If Next is Null
|
||||
A0200000 # CMPSKIPI.E R0 0 ; If Next is Null
|
||||
3C00 @Line_Macro_0 # JUMP @Line_Macro_0 ; Don't loop
|
||||
# ;; Clean up
|
||||
0902803F # POPR R3 R15
|
||||
|
@ -380,7 +380,7 @@ A0200000 # CMPSKIP.E R0 0 ; If Next is Null
|
|||
09000450 # COPY R5 R0 ; Use R5 for Node pointer
|
||||
:setExpression_0
|
||||
18350004 # LOAD32 R3 R5 4 ; Load type into R3
|
||||
A0330001 # CMPSKIP.NE R3 1 ; Check if Macro
|
||||
A0330001 # CMPSKIPI.NE R3 1 ; Check if Macro
|
||||
3C00 @setExpression_1 # JUMP @setExpression_1 ; Move to next if Macro
|
||||
18050008 # LOAD32 R0 R5 8 ; Load Text pointer into R0 for Comparision
|
||||
09000414 # COPY R1 R4 ; Put Macro Text for comparision
|
||||
|
@ -411,13 +411,13 @@ A0330001 # CMPSKIP.NE R3 1 ; Check if Macro
|
|||
:Process_String_0
|
||||
# ;; Get node type
|
||||
18100004 # LOAD32 R1 R0 4 ; Load Type
|
||||
A0210002 # CMPSKIP.E R1 2 ; If not a string
|
||||
A0210002 # CMPSKIPI.E R1 2 ; If not a string
|
||||
3C00 @Process_String_Done # JUMP @Process_String_Done ; Just go to next
|
||||
# ;; Its a string
|
||||
18100008 # LOAD32 R1 R0 8 ; Get Text pointer
|
||||
14210000 # LOAD8 R2 R1 0 ; Get first char of Text
|
||||
# ;; Deal with '
|
||||
A0220027 # CMPSKIP.E R2 39 ; If char is not '
|
||||
A0220027 # CMPSKIPI.E R2 39 ; If char is not '
|
||||
3C00 @Process_String_1 # JUMP @Process_String_1 ; Move to next label
|
||||
# ;; Simply use Hex strings as is
|
||||
0F110001 # ADDUI R1 R1 1 ; Move Text pointer by 1
|
||||
|
@ -428,7 +428,7 @@ A0220027 # CMPSKIP.E R2 39 ; If char is not '
|
|||
2D0F @Hexify_String # CALLI R15 @Hexify_String
|
||||
:Process_String_Done
|
||||
18000000 # LOAD32 R0 R0 0 ; Load Next
|
||||
A0200000 # CMPSKIP.E R0 0 ; If Next isn't NULL
|
||||
A0200000 # CMPSKIPI.E R0 0 ; If Next isn't NULL
|
||||
3C00 @Process_String_0 # JUMP @Process_String_0 ; Recurse down list
|
||||
# ;; Restore registers
|
||||
0902802F # POPR R2 R15
|
||||
|
@ -465,7 +465,7 @@ B03000ff # ANDI R3 R0 0xFF ; Preserve byte to check for NULL
|
|||
2D0F @hex32 # CALLI R15 @hex32 ; Convert to hex and store in Expression
|
||||
0F220004 # ADDUI R2 R2 4 ; Pointer Text pointer to next 4 bytes
|
||||
0F440008 # ADDUI R4 R4 8 ; Increment storage space required
|
||||
A0230000 # CMPSKIP.E R3 0 ; If byte was NULL
|
||||
A0230000 # CMPSKIPI.E R3 0 ; If byte was NULL
|
||||
3C00 @Hexify_String_0 # JUMP @Hexify_String_0
|
||||
# ;; Done
|
||||
0F040001 # ADDUI R0 R4 1 ; Lead space for NULL terminator
|
||||
|
@ -502,7 +502,7 @@ A0230000 # CMPSKIP.E R3 0 ; If byte was NULL
|
|||
:hex4
|
||||
B000000f # ANDI R0 R0 0x000F ; isolate nybble
|
||||
0F000030 # ADDUI R0 R0 48 ; convert to ascii
|
||||
A0400039 # CMPSKIP.LE R0 57 ; If nybble was greater than '9'
|
||||
A0400039 # CMPSKIPI.LE R0 57 ; If nybble was greater than '9'
|
||||
0F000007 # ADDUI R0 R0 7 ; Shift it into 'A' range of ascii
|
||||
21010000 # STORE8 R0 R1 0 ; Store Hex Char
|
||||
0F110001 # ADDUI R1 R1 1 ; Increment address pointer
|
||||
|
@ -537,7 +537,7 @@ A0400039 # CMPSKIP.LE R0 57 ; If nybble was greater than '9'
|
|||
09000401 # COPY R0 R1 ; Put Text pointer into R0
|
||||
2D0F @numerate_string # CALLI R15 @numerate_string ; Convert to number in R0
|
||||
14110000 # LOAD8 R1 R1 0 ; Get first char of Text
|
||||
A0210030 # CMPSKIP.E R1 48 ; Skip next comparision if '0'
|
||||
A0210030 # CMPSKIPI.E R1 48 ; Skip next comparision if '0'
|
||||
C205 @Eval_Immediates_1 # CMPJUMP.E R0 R5 @Eval_Immediates_1 ; Don't do anything if string isn't a number
|
||||
09000510 # MOVE R1 R0 ; Preserve number
|
||||
2D200005 # LOADUI R0 5 ; Allocate enough space for 4 hex and a null
|
||||
|
@ -578,24 +578,24 @@ C245 @Eval_Immediates_2 # CMPJUMP.E R4 R5 @Eval_Immediates_2 ; If null be done
|
|||
0D000022 # FALSE R2 ; Set Negative flag to false
|
||||
0D000023 # FALSE R3 ; Set current count to Zero
|
||||
14010001 # LOAD8 R0 R1 1 ; Get second byte
|
||||
A0300078 # CMPSKIP.NE R0 120 ; If the second byte is x
|
||||
A0300078 # CMPSKIPI.NE R0 120 ; If the second byte is x
|
||||
3C00 @numerate_string_hex # JUMP @numerate_string_hex ; treat string like hex
|
||||
# ;; Deal with Decimal input
|
||||
2D24000a # LOADUI R4 10 ; Multiply by 10
|
||||
14010000 # LOAD8 R0 R1 0 ; Get a byte
|
||||
A030002d # CMPSKIP.NE R0 45 ; If - toggle flag
|
||||
A030002d # CMPSKIPI.NE R0 45 ; If - toggle flag
|
||||
0D000032 # TRUE R2 ; So that we know to negate
|
||||
A0220000 # CMPSKIP.E R2 0 ; If toggled
|
||||
A0220000 # CMPSKIPI.E R2 0 ; If toggled
|
||||
0F110001 # ADDUI R1 R1 1 ; Move to next
|
||||
:numerate_string_dec
|
||||
14010000 # LOAD8 R0 R1 0 ; Get a byte
|
||||
A0300000 # CMPSKIP.NE R0 0 ; If NULL
|
||||
A0300000 # CMPSKIPI.NE R0 0 ; If NULL
|
||||
3C00 @numerate_string_done # JUMP @numerate_string_done ; Be done
|
||||
05006334 # MUL R3 R3 R4 ; Shift counter by 10
|
||||
10000030 # SUBI R0 R0 48 ; Convert ascii to number
|
||||
A0100000 # CMPSKIP.GE R0 0 ; If less than a number
|
||||
A0100000 # CMPSKIPI.GE R0 0 ; If less than a number
|
||||
3C00 @numerate_string_done # JUMP @numerate_string_done ; Terminate NOW
|
||||
A050000a # CMPSKIP.L R0 10 ; If more than a number
|
||||
A050000a # CMPSKIPI.L R0 10 ; If more than a number
|
||||
3C00 @numerate_string_done # JUMP @numerate_string_done ; Terminate NOW
|
||||
05001330 # ADDU R3 R3 R0 ; Don't add to the count
|
||||
0F110001 # ADDUI R1 R1 1 ; Move onto next byte
|
||||
|
@ -603,25 +603,25 @@ A050000a # CMPSKIP.L R0 10 ; If more than a number
|
|||
# ;; Deal with Hex input
|
||||
:numerate_string_hex
|
||||
14010000 # LOAD8 R0 R1 0 ; Get a byte
|
||||
A0200030 # CMPSKIP.E R0 48 ; All hex strings start with 0x
|
||||
A0200030 # CMPSKIPI.E R0 48 ; All hex strings start with 0x
|
||||
3C00 @numerate_string_done # JUMP @numerate_string_done ; Be done if not a match
|
||||
0F110002 # ADDUI R1 R1 2 ; Move to after leading 0x
|
||||
:numerate_string_hex_0
|
||||
14010000 # LOAD8 R0 R1 0 ; Get a byte
|
||||
A0300000 # CMPSKIP.NE R0 0 ; If NULL
|
||||
A0300000 # CMPSKIPI.NE R0 0 ; If NULL
|
||||
3C00 @numerate_string_done # JUMP @numerate_string_done ; Be done
|
||||
2D530004 # SL0I R3 4 ; Shift counter by 16
|
||||
10000030 # SUBI R0 R0 48 ; Convert ascii number to number
|
||||
A050000a # CMPSKIP.L R0 10 ; If A-F
|
||||
A050000a # CMPSKIPI.L R0 10 ; If A-F
|
||||
10000007 # SUBI R0 R0 7 ; Shove into Range
|
||||
A0500010 # CMPSKIP.L R0 16 ; If a-f
|
||||
A0500010 # CMPSKIPI.L R0 16 ; If a-f
|
||||
10000020 # SUBI R0 R0 32 ; Shove into Range
|
||||
05001330 # ADDU R3 R3 R0 ; Add to the count
|
||||
0F110001 # ADDUI R1 R1 1 ; Get next Hex
|
||||
3C00 @numerate_string_hex_0 # JUMP @numerate_string_hex_0
|
||||
# ;; Clean up
|
||||
:numerate_string_done
|
||||
A0220000 # CMPSKIP.E R2 0 ; If Negate flag has been set
|
||||
A0220000 # CMPSKIPI.E R2 0 ; If Negate flag has been set
|
||||
09000033 # NEG R3 R3 ; Make the number negative
|
||||
09000503 # MOVE R0 R3 ; Put number in R0
|
||||
# ;; Restore Registers
|
||||
|
@ -720,7 +720,7 @@ A0220000 # CMPSKIP.E R2 0 ; If Negate flag has been set
|
|||
0D000024 # FALSE R4 ; Start index at 0
|
||||
:Print_Line_0
|
||||
0503A034 # LOADXU8 R0 R3 R4 ; Get our first byte
|
||||
A0300000 # CMPSKIP.NE R0 0 ; If the loaded byte is NULL
|
||||
A0300000 # CMPSKIPI.NE R0 0 ; If the loaded byte is NULL
|
||||
3C00 @Print_Line_Done # JUMP @Print_Line_Done ; Be done
|
||||
42100200 # FPUTC ; Otherwise print
|
||||
0F440001 # ADDUI R4 R4 1 ; Increment for next loop
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
;; Get current malloc pointer
|
||||
LOADR R1 @malloc_pointer
|
||||
;; Deal with special case
|
||||
CMPSKIP.NE R1 0 ; If Zero set to our start of heap space
|
||||
CMPSKIPI.NE R1 0 ; If Zero set to our start of heap space
|
||||
LOADUI R1 0x4000
|
||||
|
||||
;; update malloc pointer
|
||||
|
@ -87,31 +87,31 @@
|
|||
FGETC ; Get a Char
|
||||
|
||||
;; Deal with lines comments starting with #
|
||||
CMPSKIP.NE R0 35
|
||||
CMPSKIPI.NE R0 35
|
||||
JUMP @Purge_Line_Comment
|
||||
|
||||
;; Deal with Line comments starting with ;
|
||||
CMPSKIP.NE R0 59
|
||||
CMPSKIPI.NE R0 59
|
||||
JUMP @Purge_Line_Comment
|
||||
|
||||
;; Deal with Tab
|
||||
CMPSKIP.NE R0 9
|
||||
CMPSKIPI.NE R0 9
|
||||
JUMP @Tokenize_Line_0 ; Throw away byte and try again
|
||||
|
||||
;; Deal with New line
|
||||
CMPSKIP.NE R0 10
|
||||
CMPSKIPI.NE R0 10
|
||||
JUMP @Tokenize_Line_0 ; Throw away byte and try again
|
||||
|
||||
;; Deal with space characters
|
||||
CMPSKIP.NE R0 32
|
||||
CMPSKIPI.NE R0 32
|
||||
JUMP @Tokenize_Line_0 ; Throw away byte and try again
|
||||
|
||||
;; Flag if reached EOF
|
||||
CMPSKIP.GE R0 0
|
||||
CMPSKIPI.GE R0 0
|
||||
TRUE R14
|
||||
|
||||
;; Stop if EOF
|
||||
CMPSKIP.GE R0 0
|
||||
CMPSKIPI.GE R0 0
|
||||
JUMP @Tokenize_Line_Done
|
||||
|
||||
;; Allocate a new Node
|
||||
|
@ -121,11 +121,11 @@
|
|||
SWAP R2 R0 ; Store Pointer in R2
|
||||
|
||||
;; Deal with Strings wrapped in "
|
||||
CMPSKIP.NE R0 34
|
||||
CMPSKIPI.NE R0 34
|
||||
JUMP @Store_String
|
||||
|
||||
;; Deal with Strings wrapped in '
|
||||
CMPSKIP.NE R0 39
|
||||
CMPSKIPI.NE R0 39
|
||||
JUMP @Store_String
|
||||
|
||||
;; Everything else is an atom store it
|
||||
|
@ -154,7 +154,7 @@
|
|||
;; Comment never existed
|
||||
:Purge_Line_Comment
|
||||
FGETC ; Get another Char
|
||||
CMPSKIP.E R0 10 ; Stop When LF is reached
|
||||
CMPSKIPI.E R0 10 ; Stop When LF is reached
|
||||
JUMP @Purge_Line_Comment ; Otherwise keep looping
|
||||
JUMP @Tokenize_Line_0 ; Return as if this never happened
|
||||
|
||||
|
@ -219,13 +219,13 @@
|
|||
FGETC ; Get next Byte
|
||||
ADDUI R5 R5 1 ; Prep for next loop
|
||||
|
||||
CMPSKIP.NE R0 9 ; If char is Tab
|
||||
CMPSKIPI.NE R0 9 ; If char is Tab
|
||||
JUMP @Store_Atom_Done ; Be done
|
||||
|
||||
CMPSKIP.NE R0 10 ; If char is LF
|
||||
CMPSKIPI.NE R0 10 ; If char is LF
|
||||
JUMP @Store_Atom_Done ; Be done
|
||||
|
||||
CMPSKIP.NE R0 32 ; If char is Space
|
||||
CMPSKIPI.NE R0 32 ; If char is Space
|
||||
JUMP @Store_Atom_Done ; Be done
|
||||
|
||||
;; Otherwise loop
|
||||
|
@ -273,7 +273,7 @@
|
|||
;; Handle case of Head->next not being NULL
|
||||
LOAD32 R0 R0 0 ; Move to next node
|
||||
LOAD32 R2 R0 0 ; Get node->next
|
||||
CMPSKIP.E R2 0 ; If it is not null
|
||||
CMPSKIPI.E R2 0 ; If it is not null
|
||||
JUMP @Add_Token_1 ; Move to the next node and try again
|
||||
JUMP @Add_Token_0 ; Else simply act as if we got this node
|
||||
; in the first place
|
||||
|
@ -305,7 +305,7 @@
|
|||
LOADXU8 R1 R3 R4 ; Get a byte of our second string
|
||||
ADDUI R4 R4 1 ; Prep for next loop
|
||||
CMP R1 R0 R1 ; Compare the bytes
|
||||
CMPSKIP.E R0 0 ; Stop if byte is NULL
|
||||
CMPSKIPI.E R0 0 ; Stop if byte is NULL
|
||||
JUMP.E R1 @cmpbyte ; Loop if bytes are equal
|
||||
;; Done
|
||||
MOVE R0 R1 ; Prepare for return
|
||||
|
@ -352,7 +352,7 @@
|
|||
LOAD32 R2 R2 0 ; Get Next->Next
|
||||
LOAD32 R0 R2 8 ; Get Next->Next->Text
|
||||
LOAD32 R3 R2 4 ; Get Next->Next->type
|
||||
CMPSKIP.NE R3 2 ; If node is a string
|
||||
CMPSKIPI.NE R3 2 ; If node is a string
|
||||
ADDUI R0 R0 1 ; Skip first char
|
||||
STORE32 R0 R1 12 ; Set Expression = Next->Next->Text
|
||||
|
||||
|
@ -362,7 +362,7 @@
|
|||
|
||||
:Identify_Macros_1
|
||||
LOAD32 R0 R1 0 ; Get node->next
|
||||
CMPSKIP.NE R0 0 ; If node->next is NULL
|
||||
CMPSKIPI.NE R0 0 ; If node->next is NULL
|
||||
JUMP @Identify_Macros_Done ; Be done
|
||||
|
||||
;; Otherwise keep looping
|
||||
|
@ -397,9 +397,9 @@
|
|||
LOAD32 R2 R0 12 ; Load Expression pointer
|
||||
LOAD32 R1 R0 8 ; Load Text pointer
|
||||
LOAD32 R0 R0 0 ; Load Next pointer
|
||||
CMPSKIP.NE R3 1 ; If a macro
|
||||
CMPSKIPI.NE R3 1 ; If a macro
|
||||
CALLI R15 @setExpression ; Apply to other nodes
|
||||
CMPSKIP.E R0 0 ; If Next is Null
|
||||
CMPSKIPI.E R0 0 ; If Next is Null
|
||||
JUMP @Line_Macro_0 ; Don't loop
|
||||
|
||||
;; Clean up
|
||||
|
@ -429,7 +429,7 @@
|
|||
|
||||
:setExpression_0
|
||||
LOAD32 R3 R5 4 ; Load type into R3
|
||||
CMPSKIP.NE R3 1 ; Check if Macro
|
||||
CMPSKIPI.NE R3 1 ; Check if Macro
|
||||
JUMP @setExpression_1 ; Move to next if Macro
|
||||
LOAD32 R0 R5 8 ; Load Text pointer into R0 for Comparision
|
||||
COPY R1 R4 ; Put Macro Text for comparision
|
||||
|
@ -463,7 +463,7 @@
|
|||
:Process_String_0
|
||||
;; Get node type
|
||||
LOAD32 R1 R0 4 ; Load Type
|
||||
CMPSKIP.E R1 2 ; If not a string
|
||||
CMPSKIPI.E R1 2 ; If not a string
|
||||
JUMP @Process_String_Done ; Just go to next
|
||||
|
||||
;; Its a string
|
||||
|
@ -471,7 +471,7 @@
|
|||
LOAD8 R2 R1 0 ; Get first char of Text
|
||||
|
||||
;; Deal with '
|
||||
CMPSKIP.E R2 39 ; If char is not '
|
||||
CMPSKIPI.E R2 39 ; If char is not '
|
||||
JUMP @Process_String_1 ; Move to next label
|
||||
|
||||
;; Simply use Hex strings as is
|
||||
|
@ -485,7 +485,7 @@
|
|||
|
||||
:Process_String_Done
|
||||
LOAD32 R0 R0 0 ; Load Next
|
||||
CMPSKIP.E R0 0 ; If Next isn't NULL
|
||||
CMPSKIPI.E R0 0 ; If Next isn't NULL
|
||||
JUMP @Process_String_0 ; Recurse down list
|
||||
|
||||
;; Restore registers
|
||||
|
@ -525,7 +525,7 @@
|
|||
CALLI R15 @hex32 ; Convert to hex and store in Expression
|
||||
ADDUI R2 R2 4 ; Pointer Text pointer to next 4 bytes
|
||||
ADDUI R4 R4 8 ; Increment storage space required
|
||||
CMPSKIP.E R3 0 ; If byte was NULL
|
||||
CMPSKIPI.E R3 0 ; If byte was NULL
|
||||
JUMP @Hexify_String_0
|
||||
|
||||
;; Done
|
||||
|
@ -564,7 +564,7 @@
|
|||
:hex4
|
||||
ANDI R0 R0 0x000F ; isolate nybble
|
||||
ADDUI R0 R0 48 ; convert to ascii
|
||||
CMPSKIP.LE R0 57 ; If nybble was greater than '9'
|
||||
CMPSKIPI.LE R0 57 ; If nybble was greater than '9'
|
||||
ADDUI R0 R0 7 ; Shift it into 'A' range of ascii
|
||||
STORE8 R0 R1 0 ; Store Hex Char
|
||||
ADDUI R1 R1 1 ; Increment address pointer
|
||||
|
@ -601,7 +601,7 @@
|
|||
COPY R0 R1 ; Put Text pointer into R0
|
||||
CALLI R15 @numerate_string ; Convert to number in R0
|
||||
LOAD8 R1 R1 0 ; Get first char of Text
|
||||
CMPSKIP.E R1 48 ; Skip next comparision if '0'
|
||||
CMPSKIPI.E R1 48 ; Skip next comparision if '0'
|
||||
CMPJUMP.E R0 R5 @Eval_Immediates_1 ; Don't do anything if string isn't a number
|
||||
MOVE R1 R0 ; Preserve number
|
||||
LOADUI R0 5 ; Allocate enough space for 4 hex and a null
|
||||
|
@ -645,27 +645,27 @@
|
|||
FALSE R2 ; Set Negative flag to false
|
||||
FALSE R3 ; Set current count to Zero
|
||||
LOAD8 R0 R1 1 ; Get second byte
|
||||
CMPSKIP.NE R0 120 ; If the second byte is x
|
||||
CMPSKIPI.NE R0 120 ; If the second byte is x
|
||||
JUMP @numerate_string_hex ; treat string like hex
|
||||
|
||||
;; Deal with Decimal input
|
||||
LOADUI R4 10 ; Multiply by 10
|
||||
LOAD8 R0 R1 0 ; Get a byte
|
||||
CMPSKIP.NE R0 45 ; If - toggle flag
|
||||
CMPSKIPI.NE R0 45 ; If - toggle flag
|
||||
TRUE R2 ; So that we know to negate
|
||||
CMPSKIP.E R2 0 ; If toggled
|
||||
CMPSKIPI.E R2 0 ; If toggled
|
||||
ADDUI R1 R1 1 ; Move to next
|
||||
:numerate_string_dec
|
||||
LOAD8 R0 R1 0 ; Get a byte
|
||||
|
||||
CMPSKIP.NE R0 0 ; If NULL
|
||||
CMPSKIPI.NE R0 0 ; If NULL
|
||||
JUMP @numerate_string_done ; Be done
|
||||
|
||||
MUL R3 R3 R4 ; Shift counter by 10
|
||||
SUBI R0 R0 48 ; Convert ascii to number
|
||||
CMPSKIP.GE R0 0 ; If less than a number
|
||||
CMPSKIPI.GE R0 0 ; If less than a number
|
||||
JUMP @numerate_string_done ; Terminate NOW
|
||||
CMPSKIP.L R0 10 ; If more than a number
|
||||
CMPSKIPI.L R0 10 ; If more than a number
|
||||
JUMP @numerate_string_done ; Terminate NOW
|
||||
ADDU R3 R3 R0 ; Don't add to the count
|
||||
|
||||
|
@ -675,19 +675,19 @@
|
|||
;; Deal with Hex input
|
||||
:numerate_string_hex
|
||||
LOAD8 R0 R1 0 ; Get a byte
|
||||
CMPSKIP.E R0 48 ; All hex strings start with 0x
|
||||
CMPSKIPI.E R0 48 ; All hex strings start with 0x
|
||||
JUMP @numerate_string_done ; Be done if not a match
|
||||
ADDUI R1 R1 2 ; Move to after leading 0x
|
||||
:numerate_string_hex_0
|
||||
LOAD8 R0 R1 0 ; Get a byte
|
||||
CMPSKIP.NE R0 0 ; If NULL
|
||||
CMPSKIPI.NE R0 0 ; If NULL
|
||||
JUMP @numerate_string_done ; Be done
|
||||
|
||||
SL0I R3 4 ; Shift counter by 16
|
||||
SUBI R0 R0 48 ; Convert ascii number to number
|
||||
CMPSKIP.L R0 10 ; If A-F
|
||||
CMPSKIPI.L R0 10 ; If A-F
|
||||
SUBI R0 R0 7 ; Shove into Range
|
||||
CMPSKIP.L R0 16 ; If a-f
|
||||
CMPSKIPI.L R0 16 ; If a-f
|
||||
SUBI R0 R0 32 ; Shove into Range
|
||||
ADDU R3 R3 R0 ; Add to the count
|
||||
|
||||
|
@ -696,7 +696,7 @@
|
|||
|
||||
;; Clean up
|
||||
:numerate_string_done
|
||||
CMPSKIP.E R2 0 ; If Negate flag has been set
|
||||
CMPSKIPI.E R2 0 ; If Negate flag has been set
|
||||
NEG R3 R3 ; Make the number negative
|
||||
MOVE R0 R3 ; Put number in R0
|
||||
|
||||
|
@ -806,7 +806,7 @@
|
|||
|
||||
:Print_Line_0
|
||||
LOADXU8 R0 R3 R4 ; Get our first byte
|
||||
CMPSKIP.NE R0 0 ; If the loaded byte is NULL
|
||||
CMPSKIPI.NE R0 0 ; If the loaded byte is NULL
|
||||
JUMP @Print_Line_Done ; Be done
|
||||
FPUTC ; Otherwise print
|
||||
ADDUI R4 R4 1 ; Increment for next loop
|
||||
|
|
|
@ -66,30 +66,30 @@ FFFFFFFF # HALT
|
|||
# :Readline_0
|
||||
42100100 # FGETC ; Read a Char
|
||||
# ;; Flag if reached EOF
|
||||
A0100000 # CMPSKIP.GE R0 0
|
||||
A0100000 # CMPSKIPI.GE R0 0
|
||||
0D00003E # TRUE R14
|
||||
# ;; Stop if EOF
|
||||
A0100000 # CMPSKIP.GE R0 0
|
||||
A0100000 # CMPSKIPI.GE R0 0
|
||||
3C00003c # JUMP @Readline_2
|
||||
# ;; Handle Backspace
|
||||
A020007f # CMPSKIP.E R0 127
|
||||
A020007f # CMPSKIPI.E R0 127
|
||||
3C000010 # JUMP @Readline_1
|
||||
# ;; Move back 1 character if R3 > 0
|
||||
A0430000 # CMPSKIP.LE R3 0
|
||||
A0430000 # CMPSKIPI.LE R3 0
|
||||
11330001 # SUBUI R3 R3 1
|
||||
# ;; Hopefully they keep typing
|
||||
3C00ffdc # JUMP @Readline_0
|
||||
# :Readline_1
|
||||
# ;; Replace all CR with LF
|
||||
A030000d # CMPSKIP.NE R0 13
|
||||
A030000d # CMPSKIPI.NE R0 13
|
||||
2D20000a # LOADUI R0 10
|
||||
# ;; Store the Byte
|
||||
05049023 # STOREX8 R0 R2 R3
|
||||
# ;; Check for EOL
|
||||
A030000a # CMPSKIP.NE R0 10
|
||||
A030000a # CMPSKIPI.NE R0 10
|
||||
3C000014 # JUMP @Readline_2
|
||||
# ;; Prevent lines from exceeding 255 chars
|
||||
A04300ff # CMPSKIP.LE R3 255
|
||||
A04300ff # CMPSKIPI.LE R3 255
|
||||
3C00000c # JUMP @Readline_2
|
||||
# ;; Prep for next loop
|
||||
0F330001 # ADDUI R3 R3 1
|
||||
|
@ -150,7 +150,7 @@ A04300ff # CMPSKIP.LE R3 255
|
|||
# ;; Get current malloc pointer
|
||||
2E010020 # LOADR R1 @malloc_pointer
|
||||
# ;; Deal with special case
|
||||
A0310000 # CMPSKIP.NE R1 0 ; If Zero set to our start of heap space
|
||||
A0310000 # CMPSKIPI.NE R1 0 ; If Zero set to our start of heap space
|
||||
2D214000 # LOADUI R1 0x4000
|
||||
# ;; update malloc pointer
|
||||
09000301 # SWAP R0 R1
|
||||
|
@ -173,7 +173,7 @@ A0310000 # CMPSKIP.NE R1 0 ; If Zero set to our start of heap space
|
|||
0D000021 # FALSE R1 ; Read from tty
|
||||
42100100 # FGETC ; Read a Char
|
||||
# ;; Quit if q
|
||||
A0300071 # CMPSKIP.NE R0 113
|
||||
A0300071 # CMPSKIPI.NE R0 113
|
||||
0D01001F # RET R15
|
||||
# ;; Print if p
|
||||
1FE00070 # CMPUI R14 R0 112
|
||||
|
@ -188,7 +188,7 @@ A0300071 # CMPSKIP.NE R0 113
|
|||
2C6E0014 # JUMP.NE R14 @EditorLoop_1
|
||||
180D0000 # LOAD32 R0 R13 0 ; Load head->next
|
||||
# ;; If head->next isn't null make it the new head
|
||||
A0200000 # CMPSKIP.E R0 0
|
||||
A0200000 # CMPSKIPI.E R0 0
|
||||
090005D0 # MOVE R13 R0
|
||||
3C00ffc4 # JUMP @EditorLoop
|
||||
# :EditorLoop_1
|
||||
|
@ -197,7 +197,7 @@ A0200000 # CMPSKIP.E R0 0
|
|||
2C6E0014 # JUMP.NE R14 @EditorLoop_2
|
||||
180D0004 # LOAD32 R0 R13 4 ; Load head->prev
|
||||
# ;; If head->prev isn't null make it the new head
|
||||
A0200000 # CMPSKIP.E R0 0
|
||||
A0200000 # CMPSKIPI.E R0 0
|
||||
090005D0 # MOVE R13 R0
|
||||
3C00ffac # JUMP @EditorLoop
|
||||
# :EditorLoop_2
|
||||
|
@ -258,7 +258,7 @@ A0200000 # CMPSKIP.E R0 0
|
|||
# :GetRoot_0
|
||||
# ;; Get Head->Prev
|
||||
18100004 # LOAD32 R1 R0 4
|
||||
A0310000 # CMPSKIP.NE R1 0
|
||||
A0310000 # CMPSKIPI.NE R1 0
|
||||
3C00000c # JUMP @GetRoot_1
|
||||
09000501 # MOVE R0 R1
|
||||
3C00fff0 # JUMP @GetRoot_0
|
||||
|
@ -281,7 +281,7 @@ A0310000 # CMPSKIP.NE R1 0
|
|||
18200000 # LOAD32 R2 R0 0 ; Store Head->Next in R2
|
||||
18000008 # LOAD32 R0 R0 8 ; Set R0 to Head->Text
|
||||
2D0F0024 # CALLI R15 @PrintLine ; Prints Head->Text
|
||||
A0320000 # CMPSKIP.NE R2 0 ; If Head->Next is NULL
|
||||
A0320000 # CMPSKIPI.NE R2 0 ; If Head->Next is NULL
|
||||
3C00000c # JUMP @PrintAll_1 ; Stop Looping
|
||||
09000502 # MOVE R0 R2 ; Otherwise Move to Next Node
|
||||
3C00ffe8 # JUMP @PrintAll_0 ; And Loop
|
||||
|
@ -307,12 +307,12 @@ A0320000 # CMPSKIP.NE R2 0 ; If Head->Next is NULL
|
|||
09000520 # MOVE R2 R0
|
||||
0D000023 # FALSE R3
|
||||
# ;; Deal with NULL Pointer
|
||||
A0320000 # CMPSKIP.NE R2 0
|
||||
A0320000 # CMPSKIPI.NE R2 0
|
||||
3C00001c # JUMP @PrintLine_1
|
||||
# :PrintLine_0
|
||||
0503A023 # LOADXU8 R0 R2 R3 ; Load char from string
|
||||
# ;; Don't print NULLs
|
||||
A0300000 # CMPSKIP.NE R0 0
|
||||
A0300000 # CMPSKIPI.NE R0 0
|
||||
3C000010 # JUMP @PrintLine_1
|
||||
42100200 # FPUTC
|
||||
# ; Print the char
|
||||
|
@ -344,7 +344,7 @@ A0300000 # CMPSKIP.NE R0 0
|
|||
2D0Ffe40 # CALLI R15 @malloc
|
||||
# ;; Check if head->Next is null
|
||||
18210000 # LOAD32 R2 R1 0
|
||||
A0220000 # CMPSKIP.E R2 0 ; If head->Next is something
|
||||
A0220000 # CMPSKIPI.E R2 0 ; If head->Next is something
|
||||
23020004 # STORE32 R0 R2 4 ; Set head->next->prev to p
|
||||
# ;; Setup p and head
|
||||
23200000 # STORE32 R2 R0 0 ; p->next = head->next
|
||||
|
@ -374,7 +374,7 @@ A0220000 # CMPSKIP.E R2 0 ; If head->Next is something
|
|||
2D0Ffe00 # CALLI R15 @malloc
|
||||
# ;; Check if Head->Prev is Null
|
||||
18210004 # LOAD32 R2 R1 4
|
||||
A0220000 # CMPSKIP.E R2 0 ; If head->prev is something
|
||||
A0220000 # CMPSKIPI.E R2 0 ; If head->prev is something
|
||||
23020000 # STORE32 R0 R2 0 ; Set head->prev->next to p
|
||||
# ;; Setup p and head
|
||||
23200004 # STORE32 R2 R0 4 ; p->prev = head->prev
|
||||
|
@ -400,12 +400,12 @@ A0220000 # CMPSKIP.E R2 0 ; If head->prev is something
|
|||
18010004 # LOAD32 R0 R1 4 ; put p->prev in R0
|
||||
18210000 # LOAD32 R2 R1 0 ; put p->next in R2
|
||||
# ;; Keep links
|
||||
A0200000 # CMPSKIP.E R0 0 ; If p->prev is not null
|
||||
A0200000 # CMPSKIPI.E R0 0 ; If p->prev is not null
|
||||
23200000 # STORE32 R2 R0 0 ; p->prev->next = p->next
|
||||
A0220000 # CMPSKIP.E R2 0 ; If p->next is not null
|
||||
A0220000 # CMPSKIPI.E R2 0 ; If p->next is not null
|
||||
23020004 # STORE32 R0 R2 4 ; p->next->prev = p->prev
|
||||
# ;; Attempt to save what is left of the list
|
||||
A0300000 # CMPSKIP.NE R0 0 ; If p->prev is null
|
||||
A0300000 # CMPSKIPI.NE R0 0 ; If p->prev is null
|
||||
09000502 # MOVE R0 R2 ; return p->next
|
||||
# ;; Restore Registers
|
||||
0902802F # POPR R2 R15
|
||||
|
|
|
@ -70,30 +70,30 @@ FFFFFFFF # HALT
|
|||
:Readline_0
|
||||
42100100 # FGETC ; Read a Char
|
||||
# ;; Flag if reached EOF
|
||||
A0100000 # CMPSKIP.GE R0 0
|
||||
A0100000 # CMPSKIPI.GE R0 0
|
||||
0D00003E # TRUE R14
|
||||
# ;; Stop if EOF
|
||||
A0100000 # CMPSKIP.GE R0 0
|
||||
A0100000 # CMPSKIPI.GE R0 0
|
||||
3C00 @Readline_2 # JUMP @Readline_2
|
||||
# ;; Handle Backspace
|
||||
A020007f # CMPSKIP.E R0 127
|
||||
A020007f # CMPSKIPI.E R0 127
|
||||
3C00 @Readline_1 # JUMP @Readline_1
|
||||
# ;; Move back 1 character if R3 > 0
|
||||
A0430000 # CMPSKIP.LE R3 0
|
||||
A0430000 # CMPSKIPI.LE R3 0
|
||||
11330001 # SUBUI R3 R3 1
|
||||
# ;; Hopefully they keep typing
|
||||
3C00 @Readline_0 # JUMP @Readline_0
|
||||
:Readline_1
|
||||
# ;; Replace all CR with LF
|
||||
A030000d # CMPSKIP.NE R0 13
|
||||
A030000d # CMPSKIPI.NE R0 13
|
||||
2D20000a # LOADUI R0 10
|
||||
# ;; Store the Byte
|
||||
05049023 # STOREX8 R0 R2 R3
|
||||
# ;; Check for EOL
|
||||
A030000a # CMPSKIP.NE R0 10
|
||||
A030000a # CMPSKIPI.NE R0 10
|
||||
3C00 @Readline_2 # JUMP @Readline_2
|
||||
# ;; Prevent lines from exceeding 255 chars
|
||||
A04300ff # CMPSKIP.LE R3 255
|
||||
A04300ff # CMPSKIPI.LE R3 255
|
||||
3C00 @Readline_2 # JUMP @Readline_2
|
||||
# ;; Prep for next loop
|
||||
0F330001 # ADDUI R3 R3 1
|
||||
|
@ -156,7 +156,7 @@ A04300ff # CMPSKIP.LE R3 255
|
|||
# ;; Get current malloc pointer
|
||||
2E01 @malloc_pointer # LOADR R1 @malloc_pointer
|
||||
# ;; Deal with special case
|
||||
A0310000 # CMPSKIP.NE R1 0 ; If Zero set to our start of heap space
|
||||
A0310000 # CMPSKIPI.NE R1 0 ; If Zero set to our start of heap space
|
||||
2D214000 # LOADUI R1 0x4000
|
||||
# ;; update malloc pointer
|
||||
09000301 # SWAP R0 R1
|
||||
|
@ -180,7 +180,7 @@ A0310000 # CMPSKIP.NE R1 0 ; If Zero set to our start of heap space
|
|||
0D000021 # FALSE R1 ; Read from tty
|
||||
42100100 # FGETC ; Read a Char
|
||||
# ;; Quit if q
|
||||
A0300071 # CMPSKIP.NE R0 113
|
||||
A0300071 # CMPSKIPI.NE R0 113
|
||||
0D01001F # RET R15
|
||||
# ;; Print if p
|
||||
1FE00070 # CMPUI R14 R0 112
|
||||
|
@ -195,7 +195,7 @@ A0300071 # CMPSKIP.NE R0 113
|
|||
2C6E @EditorLoop_1 # JUMP.NE R14 @EditorLoop_1
|
||||
180D0000 # LOAD32 R0 R13 0 ; Load head->next
|
||||
# ;; If head->next isn't null make it the new head
|
||||
A0200000 # CMPSKIP.E R0 0
|
||||
A0200000 # CMPSKIPI.E R0 0
|
||||
090005D0 # MOVE R13 R0
|
||||
3C00 @EditorLoop # JUMP @EditorLoop
|
||||
:EditorLoop_1
|
||||
|
@ -204,7 +204,7 @@ A0200000 # CMPSKIP.E R0 0
|
|||
2C6E @EditorLoop_2 # JUMP.NE R14 @EditorLoop_2
|
||||
180D0004 # LOAD32 R0 R13 4 ; Load head->prev
|
||||
# ;; If head->prev isn't null make it the new head
|
||||
A0200000 # CMPSKIP.E R0 0
|
||||
A0200000 # CMPSKIPI.E R0 0
|
||||
090005D0 # MOVE R13 R0
|
||||
3C00 @EditorLoop # JUMP @EditorLoop
|
||||
:EditorLoop_2
|
||||
|
@ -266,7 +266,7 @@ A0200000 # CMPSKIP.E R0 0
|
|||
:GetRoot_0
|
||||
# ;; Get Head->Prev
|
||||
18100004 # LOAD32 R1 R0 4
|
||||
A0310000 # CMPSKIP.NE R1 0
|
||||
A0310000 # CMPSKIPI.NE R1 0
|
||||
3C00 @GetRoot_1 # JUMP @GetRoot_1
|
||||
09000501 # MOVE R0 R1
|
||||
3C00 @GetRoot_0 # JUMP @GetRoot_0
|
||||
|
@ -290,7 +290,7 @@ A0310000 # CMPSKIP.NE R1 0
|
|||
18200000 # LOAD32 R2 R0 0 ; Store Head->Next in R2
|
||||
18000008 # LOAD32 R0 R0 8 ; Set R0 to Head->Text
|
||||
2D0F @PrintLine # CALLI R15 @PrintLine ; Prints Head->Text
|
||||
A0320000 # CMPSKIP.NE R2 0 ; If Head->Next is NULL
|
||||
A0320000 # CMPSKIPI.NE R2 0 ; If Head->Next is NULL
|
||||
3C00 @PrintAll_1 # JUMP @PrintAll_1 ; Stop Looping
|
||||
09000502 # MOVE R0 R2 ; Otherwise Move to Next Node
|
||||
3C00 @PrintAll_0 # JUMP @PrintAll_0 ; And Loop
|
||||
|
@ -317,12 +317,12 @@ A0320000 # CMPSKIP.NE R2 0 ; If Head->Next is NULL
|
|||
09000520 # MOVE R2 R0
|
||||
0D000023 # FALSE R3
|
||||
# ;; Deal with NULL Pointer
|
||||
A0320000 # CMPSKIP.NE R2 0
|
||||
A0320000 # CMPSKIPI.NE R2 0
|
||||
3C00 @PrintLine_1 # JUMP @PrintLine_1
|
||||
:PrintLine_0
|
||||
0503A023 # LOADXU8 R0 R2 R3 ; Load char from string
|
||||
# ;; Don't print NULLs
|
||||
A0300000 # CMPSKIP.NE R0 0
|
||||
A0300000 # CMPSKIPI.NE R0 0
|
||||
3C00 @PrintLine_1 # JUMP @PrintLine_1
|
||||
42100200 # FPUTC
|
||||
# ; Print the char
|
||||
|
@ -354,7 +354,7 @@ A0300000 # CMPSKIP.NE R0 0
|
|||
2D0F @malloc # CALLI R15 @malloc
|
||||
# ;; Check if head->Next is null
|
||||
18210000 # LOAD32 R2 R1 0
|
||||
A0220000 # CMPSKIP.E R2 0 ; If head->Next is something
|
||||
A0220000 # CMPSKIPI.E R2 0 ; If head->Next is something
|
||||
23020004 # STORE32 R0 R2 4 ; Set head->next->prev to p
|
||||
# ;; Setup p and head
|
||||
23200000 # STORE32 R2 R0 0 ; p->next = head->next
|
||||
|
@ -384,7 +384,7 @@ A0220000 # CMPSKIP.E R2 0 ; If head->Next is something
|
|||
2D0F @malloc # CALLI R15 @malloc
|
||||
# ;; Check if Head->Prev is Null
|
||||
18210004 # LOAD32 R2 R1 4
|
||||
A0220000 # CMPSKIP.E R2 0 ; If head->prev is something
|
||||
A0220000 # CMPSKIPI.E R2 0 ; If head->prev is something
|
||||
23020000 # STORE32 R0 R2 0 ; Set head->prev->next to p
|
||||
# ;; Setup p and head
|
||||
23200004 # STORE32 R2 R0 4 ; p->prev = head->prev
|
||||
|
@ -410,12 +410,12 @@ A0220000 # CMPSKIP.E R2 0 ; If head->prev is something
|
|||
18010004 # LOAD32 R0 R1 4 ; put p->prev in R0
|
||||
18210000 # LOAD32 R2 R1 0 ; put p->next in R2
|
||||
# ;; Keep links
|
||||
A0200000 # CMPSKIP.E R0 0 ; If p->prev is not null
|
||||
A0200000 # CMPSKIPI.E R0 0 ; If p->prev is not null
|
||||
23200000 # STORE32 R2 R0 0 ; p->prev->next = p->next
|
||||
A0220000 # CMPSKIP.E R2 0 ; If p->next is not null
|
||||
A0220000 # CMPSKIPI.E R2 0 ; If p->next is not null
|
||||
23020004 # STORE32 R0 R2 4 ; p->next->prev = p->prev
|
||||
# ;; Attempt to save what is left of the list
|
||||
A0300000 # CMPSKIP.NE R0 0 ; If p->prev is null
|
||||
A0300000 # CMPSKIPI.NE R0 0 ; If p->prev is null
|
||||
09000502 # MOVE R0 R2 ; return p->next
|
||||
# ;; Restore Registers
|
||||
0902802F # POPR R2 R15
|
||||
|
|
42
stage1/SET.s
42
stage1/SET.s
|
@ -75,19 +75,19 @@
|
|||
FGETC ; Read a Char
|
||||
|
||||
;; Flag if reached EOF
|
||||
CMPSKIP.GE R0 0
|
||||
CMPSKIPI.GE R0 0
|
||||
TRUE R14
|
||||
|
||||
;; Stop if EOF
|
||||
CMPSKIP.GE R0 0
|
||||
CMPSKIPI.GE R0 0
|
||||
JUMP @Readline_2
|
||||
|
||||
;; Handle Backspace
|
||||
CMPSKIP.E R0 127
|
||||
CMPSKIPI.E R0 127
|
||||
JUMP @Readline_1
|
||||
|
||||
;; Move back 1 character if R3 > 0
|
||||
CMPSKIP.LE R3 0
|
||||
CMPSKIPI.LE R3 0
|
||||
SUBUI R3 R3 1
|
||||
|
||||
;; Hopefully they keep typing
|
||||
|
@ -95,7 +95,7 @@
|
|||
|
||||
:Readline_1
|
||||
;; Replace all CR with LF
|
||||
CMPSKIP.NE R0 13
|
||||
CMPSKIPI.NE R0 13
|
||||
LOADUI R0 10
|
||||
|
||||
;; Store the Byte
|
||||
|
@ -105,7 +105,7 @@
|
|||
ADDUI R3 R3 1
|
||||
|
||||
;; Check for EOL
|
||||
CMPSKIP.NE R0 10
|
||||
CMPSKIPI.NE R0 10
|
||||
JUMP @Readline_2
|
||||
|
||||
;; Otherwise loop
|
||||
|
@ -113,7 +113,7 @@
|
|||
|
||||
:Readline_2
|
||||
;; Set Text pointer
|
||||
CMPSKIP.E R3 0 ; Don't bother for Empty strings
|
||||
CMPSKIPI.E R3 0 ; Don't bother for Empty strings
|
||||
STORE32 R2 R4 8
|
||||
;; Correct Malloc
|
||||
MOVE R0 R3 ; Ensure actually allocates exactly
|
||||
|
@ -158,7 +158,7 @@
|
|||
;; Handle case of Head->next not being NULL
|
||||
LOAD32 R0 R0 0 ; Move to next node
|
||||
LOAD32 R2 R0 0 ; Get node->next
|
||||
CMPSKIP.E R2 0 ; If it is not null
|
||||
CMPSKIPI.E R2 0 ; If it is not null
|
||||
JUMP @addline_1 ; Move to the next node and try again
|
||||
JUMP @addline_0 ; Else simply act as if we got this node
|
||||
; in the first place
|
||||
|
@ -181,7 +181,7 @@
|
|||
;; Get current malloc pointer
|
||||
LOADR R1 @malloc_pointer
|
||||
;; Deal with special case
|
||||
CMPSKIP.NE R1 0 ; If Zero set to our start of heap space
|
||||
CMPSKIPI.NE R1 0 ; If Zero set to our start of heap space
|
||||
LOADUI R1 0x4000
|
||||
|
||||
;; update malloc pointer
|
||||
|
@ -208,7 +208,7 @@
|
|||
FGETC ; Read a Char
|
||||
|
||||
;; Quit if q
|
||||
CMPSKIP.NE R0 113
|
||||
CMPSKIPI.NE R0 113
|
||||
RET R15
|
||||
|
||||
;; Print if p
|
||||
|
@ -226,7 +226,7 @@
|
|||
LOAD32 R0 R13 0 ; Load head->next
|
||||
|
||||
;; If head->next isn't null make it the new head
|
||||
CMPSKIP.E R0 0
|
||||
CMPSKIPI.E R0 0
|
||||
MOVE R13 R0
|
||||
JUMP @EditorLoop
|
||||
|
||||
|
@ -237,7 +237,7 @@
|
|||
LOAD32 R0 R13 4 ; Load head->prev
|
||||
|
||||
;; If head->prev isn't null make it the new head
|
||||
CMPSKIP.E R0 0
|
||||
CMPSKIPI.E R0 0
|
||||
MOVE R13 R0
|
||||
JUMP @EditorLoop
|
||||
|
||||
|
@ -311,7 +311,7 @@
|
|||
;; Get Head->Prev
|
||||
LOAD32 R1 R0 4
|
||||
|
||||
CMPSKIP.NE R1 0
|
||||
CMPSKIPI.NE R1 0
|
||||
JUMP @GetRoot_1
|
||||
|
||||
MOVE R0 R1
|
||||
|
@ -337,7 +337,7 @@
|
|||
LOAD32 R2 R0 0 ; Store Head->Next in R2
|
||||
LOAD32 R0 R0 8 ; Set R0 to Head->Text
|
||||
CALLI R15 @PrintLine ; Prints Head->Text
|
||||
CMPSKIP.NE R2 0 ; If Head->Next is NULL
|
||||
CMPSKIPI.NE R2 0 ; If Head->Next is NULL
|
||||
JUMP @PrintAll_1 ; Stop Looping
|
||||
MOVE R0 R2 ; Otherwise Move to Next Node
|
||||
JUMP @PrintAll_0 ; And Loop
|
||||
|
@ -364,12 +364,12 @@
|
|||
MOVE R2 R0
|
||||
FALSE R3
|
||||
;; Deal with NULL Pointer
|
||||
CMPSKIP.NE R2 0
|
||||
CMPSKIPI.NE R2 0
|
||||
JUMP @PrintLine_1
|
||||
:PrintLine_0
|
||||
LOADXU8 R0 R2 R3 ; Load char from string
|
||||
;; Don't print NULLs
|
||||
CMPSKIP.NE R0 0
|
||||
CMPSKIPI.NE R0 0
|
||||
JUMP @PrintLine_1
|
||||
|
||||
FPUTC ; Print the char
|
||||
|
@ -403,7 +403,7 @@
|
|||
|
||||
;; Check if head->Next is null
|
||||
LOAD32 R2 R1 0
|
||||
CMPSKIP.E R2 0 ; If head->Next is something
|
||||
CMPSKIPI.E R2 0 ; If head->Next is something
|
||||
STORE32 R0 R2 4 ; Set head->next->prev to p
|
||||
|
||||
;; Setup p and head
|
||||
|
@ -436,7 +436,7 @@
|
|||
|
||||
;; Check if Head->Prev is Null
|
||||
LOAD32 R2 R1 4
|
||||
CMPSKIP.E R2 0 ; If head->prev is something
|
||||
CMPSKIPI.E R2 0 ; If head->prev is something
|
||||
STORE32 R0 R2 0 ; Set head->prev->next to p
|
||||
|
||||
;; Setup p and head
|
||||
|
@ -465,14 +465,14 @@
|
|||
LOAD32 R2 R1 0 ; put p->next in R2
|
||||
|
||||
;; Keep links
|
||||
CMPSKIP.E R0 0 ; If p->prev is not null
|
||||
CMPSKIPI.E R0 0 ; If p->prev is not null
|
||||
STORE32 R2 R0 0 ; p->prev->next = p->next
|
||||
|
||||
CMPSKIP.E R2 0 ; If p->next is not null
|
||||
CMPSKIPI.E R2 0 ; If p->next is not null
|
||||
STORE32 R0 R2 4 ; p->next->prev = p->prev
|
||||
|
||||
;; Attempt to save what is left of the list
|
||||
CMPSKIP.NE R0 0 ; If p->prev is null
|
||||
CMPSKIPI.NE R0 0 ; If p->prev is null
|
||||
MOVE R0 R2 ; return p->next
|
||||
|
||||
;; Restore Registers
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
2D211100 # LOADUI R1 0x1100 ; Read from tape_01
|
||||
42100100 # FGETC ; Read a Char
|
||||
# ;; Check for EOF
|
||||
A0100000 # CMPSKIP.GE R0 0
|
||||
A0100000 # CMPSKIPI.GE R0 0
|
||||
3C000010 # JUMP @main_1
|
||||
# ;; Process that byte
|
||||
2D0F0020 # CALLI R15 @dehex
|
||||
|
@ -45,7 +45,7 @@ FFFFFFFF # HALT
|
|||
0902000F # PUSHR R0 R15 ; Save byte until after address
|
||||
B00E0003 # ANDI R0 R14 3 ; Get mod 4 of address
|
||||
2D211101 # LOADUI R1 0x1101 ; We want it on TAPE_02
|
||||
A0200000 # CMPSKIP.E R0 0 ; if not zero
|
||||
A0200000 # CMPSKIPI.E R0 0 ; if not zero
|
||||
3C000024 # JUMP @dehex_0 ; Skip placing address
|
||||
# ;; Prepend new line
|
||||
2D20000a # LOADUI R0 10 ; First print line feed
|
||||
|
@ -90,7 +90,7 @@ A0200000 # CMPSKIP.E R0 0 ; if not zero
|
|||
# :hex4
|
||||
B000000f # ANDI R0 R0 0x000F ; isolate nybble
|
||||
0F000030 # ADDUI R0 R0 48 ; convert to ascii
|
||||
A0400039 # CMPSKIP.LE R0 57 ; If nybble was greater than '9'
|
||||
A0400039 # CMPSKIPI.LE R0 57 ; If nybble was greater than '9'
|
||||
0F000007 # ADDUI R0 R0 7 ; Shift it into 'A' range of ascii
|
||||
42100200 # FPUTC ; Print char
|
||||
0D01001F # RET R15 ; Get next nybble or return if done
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
FGETC ; Read a Char
|
||||
|
||||
;; Check for EOF
|
||||
CMPSKIP.GE R0 0
|
||||
CMPSKIPI.GE R0 0
|
||||
JUMP @main_1
|
||||
|
||||
;; Process that byte
|
||||
|
@ -52,7 +52,7 @@
|
|||
PUSHR R0 R15 ; Save byte until after address
|
||||
ANDI R0 R14 3 ; Get mod 4 of address
|
||||
LOADUI R1 0x1101 ; We want it on TAPE_02
|
||||
CMPSKIP.E R0 0 ; if not zero
|
||||
CMPSKIPI.E R0 0 ; if not zero
|
||||
JUMP @dehex_0 ; Skip placing address
|
||||
|
||||
;; Prepend new line
|
||||
|
@ -102,7 +102,7 @@
|
|||
:hex4
|
||||
ANDI R0 R0 0x000F ; isolate nybble
|
||||
ADDUI R0 R0 48 ; convert to ascii
|
||||
CMPSKIP.LE R0 57 ; If nybble was greater than '9'
|
||||
CMPSKIPI.LE R0 57 ; If nybble was greater than '9'
|
||||
ADDUI R0 R0 7 ; Shift it into 'A' range of ascii
|
||||
FPUTC ; Print char
|
||||
RET R15 ; Get next nybble or return if done
|
||||
|
|
|
@ -8,16 +8,16 @@
|
|||
2D211100 # LOADUI R1 0x1100
|
||||
42100100 # FGETC
|
||||
# ;; Check for EOF
|
||||
A0100000 # CMPSKIP.GE R0 0
|
||||
A0100000 # CMPSKIPI.GE R0 0
|
||||
3C000028 # JUMP @main_1
|
||||
# ;; Write the Byte
|
||||
0D000021 # FALSE R1
|
||||
42100200 # FPUTC
|
||||
# ;; Check for LF
|
||||
A030000a # CMPSKIP.NE R0 10 ; Skip if not line feed
|
||||
A030000a # CMPSKIPI.NE R0 10 ; Skip if not line feed
|
||||
10220001 # SUBI R2 R2 1 ; Decrement on line feed
|
||||
# ;; Loop if not Zero
|
||||
A0220000 # CMPSKIP.E R2 0 ; Skip if counter is zero
|
||||
A0220000 # CMPSKIPI.E R2 0 ; Skip if counter is zero
|
||||
3C00ffdc # JUMP @main
|
||||
# ;; Otherwise provide main loop functionality
|
||||
42100100 # FGETC ; Wait for key press
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
FGETC
|
||||
|
||||
;; Check for EOF
|
||||
CMPSKIP.GE R0 0
|
||||
CMPSKIPI.GE R0 0
|
||||
JUMP @main_1
|
||||
|
||||
;; Write the Byte
|
||||
|
@ -22,11 +22,11 @@
|
|||
FPUTC
|
||||
|
||||
;; Check for LF
|
||||
CMPSKIP.NE R0 10 ; Skip if not line feed
|
||||
CMPSKIPI.NE R0 10 ; Skip if not line feed
|
||||
SUBI R2 R2 1 ; Decrement on line feed
|
||||
|
||||
;; Loop if not Zero
|
||||
CMPSKIP.E R2 0 ; Skip if counter is zero
|
||||
CMPSKIPI.E R2 0 ; Skip if counter is zero
|
||||
JUMP @main
|
||||
|
||||
;; Otherwise provide main loop functionality
|
||||
|
|
|
@ -22,11 +22,11 @@
|
|||
42100100 # FGETC ; Read a Char
|
||||
|
||||
# ;; Check for EOF
|
||||
A0100000 # CMPSKIP.GE R0 0
|
||||
A0100000 # CMPSKIPI.GE R0 0
|
||||
3C00005c # JUMP @stage2
|
||||
|
||||
# ;; Check for Label
|
||||
A030003a # CMPSKIP.NE R0 58 ; If the Char is : the next char is the label
|
||||
A030003a # CMPSKIPI.NE R0 58 ; If the Char is : the next char is the label
|
||||
2D0D0040 # CALLI R13 @storeLabel
|
||||
|
||||
# ;; Check for pointer to label
|
||||
|
@ -42,7 +42,7 @@ A030003a # CMPSKIP.NE R0 58 ; If the Char is : the next char is the label
|
|||
# .L0
|
||||
# ;; Otherwise attempt to process
|
||||
2D0D00fc # CALLI R13 @hex ; Convert it
|
||||
A0100000 # CMPSKIP.GE R0 0 ; Don't record, nonhex values
|
||||
A0100000 # CMPSKIPI.GE R0 0 ; Don't record, nonhex values
|
||||
3C00ffc8 # JUMP @getLables ; Move onto Next char
|
||||
|
||||
# ;; Determine if we got a full byte
|
||||
|
@ -88,7 +88,7 @@ A0100000 # CMPSKIP.GE R0 0 ; Don't record, nonhex values
|
|||
42100100 # FGETC ; Read a Char
|
||||
|
||||
# ;; Check for EOF
|
||||
A0100000 # CMPSKIP.GE R0 0
|
||||
A0100000 # CMPSKIPI.GE R0 0
|
||||
3C000128 # JUMP @finish
|
||||
|
||||
# ;; Check for Label
|
||||
|
|
|
@ -23,11 +23,11 @@
|
|||
42100100 # FGETC ; Read a Char
|
||||
|
||||
# ;; Check for EOF
|
||||
A0100000 # CMPSKIP.GE R0 0
|
||||
A0100000 # CMPSKIPI.GE R0 0
|
||||
3C00 @e # JUMP @stage2
|
||||
|
||||
# ;; Check for Label
|
||||
A030003a # CMPSKIP.NE R0 58 ; If the Char is : the next char is the label
|
||||
A030003a # CMPSKIPI.NE R0 58 ; If the Char is : the next char is the label
|
||||
2D0D @d # CALLI R13 @storeLabel
|
||||
|
||||
# ;; Check for pointer to label
|
||||
|
@ -44,7 +44,7 @@ A030003a # CMPSKIP.NE R0 58 ; If the Char is : the next char is the label
|
|||
:b
|
||||
# ;; Otherwise attempt to process
|
||||
2D0D @k # CALLI R13 @hex ; Convert it
|
||||
A0100000 # CMPSKIP.GE R0 0 ; Don't record, nonhex values
|
||||
A0100000 # CMPSKIPI.GE R0 0 ; Don't record, nonhex values
|
||||
3C00 @a # JUMP @getLables ; Move onto Next char
|
||||
|
||||
# ;; Determine if we got a full byte
|
||||
|
@ -94,7 +94,7 @@ A0100000 # CMPSKIP.GE R0 0 ; Don't record, nonhex values
|
|||
42100100 # FGETC ; Read a Char
|
||||
|
||||
# ;; Check for EOF
|
||||
A0100000 # CMPSKIP.GE R0 0
|
||||
A0100000 # CMPSKIPI.GE R0 0
|
||||
3C00 @q # JUMP @finish
|
||||
|
||||
# ;; Check for Label
|
||||
|
|
|
@ -23,11 +23,11 @@
|
|||
FGETC ; Read a Char
|
||||
|
||||
;; Check for EOF
|
||||
CMPSKIP.GE R0 0
|
||||
CMPSKIPI.GE R0 0
|
||||
JUMP @stage2
|
||||
|
||||
;; Check for Label
|
||||
CMPSKIP.NE R0 58 ; If the Char is : the next char is the label
|
||||
CMPSKIPI.NE R0 58 ; If the Char is : the next char is the label
|
||||
CALLI R13 @storeLabel
|
||||
|
||||
;; Check for pointer to label
|
||||
|
@ -44,7 +44,7 @@
|
|||
:.L0
|
||||
;; Otherwise attempt to process
|
||||
CALLI R13 @hex ; Convert it
|
||||
CMPSKIP.GE R0 0 ; Don't record, nonhex values
|
||||
CMPSKIPI.GE R0 0 ; Don't record, nonhex values
|
||||
JUMP @getLables ; Move onto Next char
|
||||
|
||||
;; Determine if we got a full byte
|
||||
|
@ -90,7 +90,7 @@
|
|||
FGETC ; Read a Char
|
||||
|
||||
;; Check for EOF
|
||||
CMPSKIP.GE R0 0
|
||||
CMPSKIPI.GE R0 0
|
||||
JUMP @finish
|
||||
|
||||
;; Check for Label
|
||||
|
|
|
@ -45,24 +45,24 @@ FFFFFFFF # HALT
|
|||
2D211100 # LOADUI R1 0x1100 ; Read from tape_01
|
||||
42100100 # FGETC ; Read a Char
|
||||
# ;; Check for EOF
|
||||
A0100000 # CMPSKIP.GE R0 0
|
||||
A0100000 # CMPSKIPI.GE R0 0
|
||||
0D01001F # RET R15
|
||||
# ;; Check for and deal with label (:)
|
||||
A030003a # CMPSKIP.NE R0 58
|
||||
A030003a # CMPSKIPI.NE R0 58
|
||||
3C0000ac # JUMP @storeLabel
|
||||
# ;; Check for and deal with pointers to labels
|
||||
# ;; Starting with (@)
|
||||
A0300040 # CMPSKIP.NE R0 64
|
||||
A0300040 # CMPSKIPI.NE R0 64
|
||||
3C000298 # JUMP @ThrowAwayPointer
|
||||
# ;; Then dealing with ($)
|
||||
A0300024 # CMPSKIP.NE R0 36
|
||||
A0300024 # CMPSKIPI.NE R0 36
|
||||
3C000290 # JUMP @ThrowAwayPointer
|
||||
# ;; Now check for absolute addresses (&)
|
||||
A0300026 # CMPSKIP.NE R0 38
|
||||
A0300026 # CMPSKIPI.NE R0 38
|
||||
3C000294 # JUMP @ThrowAwayAddress
|
||||
# ;; Otherwise attempt to process
|
||||
2D0F02c8 # CALLI R15 @hex ; Convert it
|
||||
A0100000 # CMPSKIP.GE R0 0 ; Don't record, nonhex values
|
||||
A0100000 # CMPSKIPI.GE R0 0 ; Don't record, nonhex values
|
||||
3C00ffc8 # JUMP @first_pass ; Move onto Next char
|
||||
# ;; Determine if we got a full byte
|
||||
2C9A000c # JUMP.Z R10 @first_pass_0 ; Jump if toggled
|
||||
|
@ -85,21 +85,21 @@ A0100000 # CMPSKIP.GE R0 0 ; Don't record, nonhex values
|
|||
2D211100 # LOADUI R1 0x1100 ; Read from tape_01
|
||||
42100100 # FGETC ; Read a Char
|
||||
# ;; Check for EOF
|
||||
A0100000 # CMPSKIP.GE R0 0
|
||||
A0100000 # CMPSKIPI.GE R0 0
|
||||
0D01001F # RET R15
|
||||
# ;; Check for and deal with label
|
||||
A030003a # CMPSKIP.NE R0 58
|
||||
A030003a # CMPSKIPI.NE R0 58
|
||||
3C000264 # JUMP @ThrowAwayLabel
|
||||
# ;; Check for and deal with Pointers to labels
|
||||
A0300040 # CMPSKIP.NE R0 64 ; @ for relative
|
||||
A0300040 # CMPSKIPI.NE R0 64 ; @ for relative
|
||||
3C000078 # JUMP @StoreRelativePointer
|
||||
A0300024 # CMPSKIP.NE R0 36 ; $ for absolute
|
||||
A0300024 # CMPSKIPI.NE R0 36 ; $ for absolute
|
||||
3C000098 # JUMP @StoreAbsolutePointer
|
||||
A0300026 # CMPSKIP.NE R0 38 ; & for address
|
||||
A0300026 # CMPSKIPI.NE R0 38 ; & for address
|
||||
3C0000b0 # JUMP @StoreAbsoluteAddress
|
||||
# ;; Process everything else
|
||||
2D0F0274 # CALLI R15 @hex ; Attempt to Convert it
|
||||
A0100000 # CMPSKIP.GE R0 0 ; Don't record, nonhex values
|
||||
A0100000 # CMPSKIPI.GE R0 0 ; Don't record, nonhex values
|
||||
3C00ffc8 # JUMP @second_pass ; Move onto Next char
|
||||
# ;; Determine if we got a full byte
|
||||
2C9A0010 # JUMP.Z R10 @second_pass_0 ; Jump if toggled
|
||||
|
@ -126,7 +126,7 @@ A0100000 # CMPSKIP.GE R0 0 ; Don't record, nonhex values
|
|||
# ;; Returns to first pass when done
|
||||
# :storeLabel
|
||||
2E000024 # LOADR R0 @current_index ; Get address of first open index
|
||||
A0300000 # CMPSKIP.NE R0 0 ; If zero intialize from R13
|
||||
A0300000 # CMPSKIPI.NE R0 0 ; If zero intialize from R13
|
||||
0900040D # COPY R0 R13
|
||||
# ;; Store the PC of the label
|
||||
23B00000 # STORE32 R11 R0 0
|
||||
|
@ -229,11 +229,11 @@ A0300000 # CMPSKIP.NE R0 0 ; If zero intialize from R13
|
|||
# :writeout_token_0
|
||||
42100100 # FGETC ; Get another byte
|
||||
# ;; Deal with termination cases
|
||||
A0300020 # CMPSKIP.NE R0 32 ; Finished if space
|
||||
A0300020 # CMPSKIPI.NE R0 32 ; Finished if space
|
||||
3C000020 # JUMP @writeout_token_done
|
||||
A0300009 # CMPSKIP.NE R0 9 ; Finished if tab
|
||||
A0300009 # CMPSKIPI.NE R0 9 ; Finished if tab
|
||||
3C000018 # JUMP @writeout_token_done
|
||||
A030000a # CMPSKIP.NE R0 10 ; Finished if newline
|
||||
A030000a # CMPSKIPI.NE R0 10 ; Finished if newline
|
||||
3C000010 # JUMP @writeout_token_done
|
||||
# ;; Deal with valid input
|
||||
21020000 # STORE8 R0 R2 0 ; Write out the byte
|
||||
|
@ -327,7 +327,7 @@ A030000a # CMPSKIP.NE R0 10 ; Finished if newline
|
|||
0503A134 # LOADXU8 R1 R3 R4 ; Get a byte of our second string
|
||||
0F440001 # ADDUI R4 R4 1 ; Prep for next loop
|
||||
05004101 # CMP R1 R0 R1 ; Compare the bytes
|
||||
A0200000 # CMPSKIP.E R0 0 ; Stop if byte is NULL
|
||||
A0200000 # CMPSKIPI.E R0 0 ; Stop if byte is NULL
|
||||
2C51ffec # JUMP.E R1 @cmpbyte ; Loop if bytes are equal
|
||||
# ;; Done
|
||||
09000501 # MOVE R0 R1 ; Prepare for return
|
||||
|
@ -406,13 +406,13 @@ A0200000 # CMPSKIP.E R0 0 ; Stop if byte is NULL
|
|||
2D211100 # LOADUI R1 0x1100 ; Read from tape_01
|
||||
42100100 # FGETC ; Read a Char
|
||||
# ;; Stop looping if space
|
||||
A0300020 # CMPSKIP.NE R0 32
|
||||
A0300020 # CMPSKIPI.NE R0 32
|
||||
0D01001F # RET R15
|
||||
# ;; Stop looping if tab
|
||||
A0300009 # CMPSKIP.NE R0 9
|
||||
A0300009 # CMPSKIPI.NE R0 9
|
||||
0D01001F # RET R15
|
||||
# ;; Stop looping if newline
|
||||
A030000a # CMPSKIP.NE R0 10
|
||||
A030000a # CMPSKIPI.NE R0 10
|
||||
0D01001F # RET R15
|
||||
# ;; Otherwise keep looping
|
||||
3C00ffe0 # JUMP @throwAwayToken
|
||||
|
|
|
@ -49,24 +49,24 @@ FFFFFFFF # HALT
|
|||
2D211100 # LOADUI R1 0x1100 ; Read from tape_01
|
||||
42100100 # FGETC ; Read a Char
|
||||
# ;; Check for EOF
|
||||
A0100000 # CMPSKIP.GE R0 0
|
||||
A0100000 # CMPSKIPI.GE R0 0
|
||||
0D01001F # RET R15
|
||||
# ;; Check for and deal with label (:)
|
||||
A030003a # CMPSKIP.NE R0 58
|
||||
A030003a # CMPSKIPI.NE R0 58
|
||||
3C00 @5 # JUMP @storeLabel
|
||||
# ;; Check for and deal with pointers to labels
|
||||
# ;; Starting with (@)
|
||||
A0300040 # CMPSKIP.NE R0 64
|
||||
A0300040 # CMPSKIPI.NE R0 64
|
||||
3C00 @6 # JUMP @ThrowAwayPointer
|
||||
# ;; Then dealing with ($)
|
||||
A0300024 # CMPSKIP.NE R0 36
|
||||
A0300024 # CMPSKIPI.NE R0 36
|
||||
3C00 @6 # JUMP @ThrowAwayPointer
|
||||
# ;; Now check for absolute addresses (&)
|
||||
A0300026 # CMPSKIP.NE R0 38
|
||||
A0300026 # CMPSKIPI.NE R0 38
|
||||
3C00 @v # JUMP @ThrowAwayAddress
|
||||
# ;; Otherwise attempt to process
|
||||
2D0F @7 # CALLI R15 @hex ; Convert it
|
||||
A0100000 # CMPSKIP.GE R0 0 ; Don't record, nonhex values
|
||||
A0100000 # CMPSKIPI.GE R0 0 ; Don't record, nonhex values
|
||||
3C00 @2 # JUMP @first_pass ; Move onto Next char
|
||||
# ;; Determine if we got a full byte
|
||||
2C9A @8 # JUMP.Z R10 @first_pass_0 ; Jump if toggled
|
||||
|
@ -91,21 +91,21 @@ A0100000 # CMPSKIP.GE R0 0 ; Don't record, nonhex values
|
|||
2D211100 # LOADUI R1 0x1100 ; Read from tape_01
|
||||
42100100 # FGETC ; Read a Char
|
||||
# ;; Check for EOF
|
||||
A0100000 # CMPSKIP.GE R0 0
|
||||
A0100000 # CMPSKIPI.GE R0 0
|
||||
0D01001F # RET R15
|
||||
# ;; Check for and deal with label
|
||||
A030003a # CMPSKIP.NE R0 58
|
||||
A030003a # CMPSKIPI.NE R0 58
|
||||
3C00 @9 # JUMP @ThrowAwayLabel
|
||||
# ;; Check for and deal with Pointers to labels
|
||||
A0300040 # CMPSKIP.NE R0 64 ; @ for relative
|
||||
A0300040 # CMPSKIPI.NE R0 64 ; @ for relative
|
||||
3C00 @a # JUMP @StoreRelativePointer
|
||||
A0300024 # CMPSKIP.NE R0 36 ; $ for absolute
|
||||
A0300024 # CMPSKIPI.NE R0 36 ; $ for absolute
|
||||
3C00 @b # JUMP @StoreAbsolutePointer
|
||||
A0300026 # CMPSKIP.NE R0 38 ; & for address
|
||||
A0300026 # CMPSKIPI.NE R0 38 ; & for address
|
||||
3C00 @w # JUMP @StoreAbsoluteAddress
|
||||
# ;; Process everything else
|
||||
2D0F @7 # CALLI R15 @hex ; Attempt to Convert it
|
||||
A0100000 # CMPSKIP.GE R0 0 ; Don't record, nonhex values
|
||||
A0100000 # CMPSKIPI.GE R0 0 ; Don't record, nonhex values
|
||||
3C00 @4 # JUMP @second_pass ; Move onto Next char
|
||||
# ;; Determine if we got a full byte
|
||||
2C9A @c # JUMP.Z R10 @second_pass_0 ; Jump if toggled
|
||||
|
@ -134,7 +134,7 @@ A0100000 # CMPSKIP.GE R0 0 ; Don't record, nonhex values
|
|||
#:storeLabel
|
||||
:5
|
||||
2E00 @d # LOADR R0 @current_index ; Get address of first open index
|
||||
A0300000 # CMPSKIP.NE R0 0 ; If zero intialize from R13
|
||||
A0300000 # CMPSKIPI.NE R0 0 ; If zero intialize from R13
|
||||
0900040D # COPY R0 R13
|
||||
# ;; Store the PC of the label
|
||||
23B00000 # STORE32 R11 R0 0
|
||||
|
@ -243,11 +243,11 @@ A0300000 # CMPSKIP.NE R0 0 ; If zero intialize from R13
|
|||
:j
|
||||
42100100 # FGETC ; Get another byte
|
||||
# ;; Deal with termination cases
|
||||
A0300020 # CMPSKIP.NE R0 32 ; Finished if space
|
||||
A0300020 # CMPSKIPI.NE R0 32 ; Finished if space
|
||||
3C00 @i # JUMP @writeout_token_done
|
||||
A0300009 # CMPSKIP.NE R0 9 ; Finished if tab
|
||||
A0300009 # CMPSKIPI.NE R0 9 ; Finished if tab
|
||||
3C00 @i # JUMP @writeout_token_done
|
||||
A030000a # CMPSKIP.NE R0 10 ; Finished if newline
|
||||
A030000a # CMPSKIPI.NE R0 10 ; Finished if newline
|
||||
3C00 @i # JUMP @writeout_token_done
|
||||
# ;; Deal with valid input
|
||||
21020000 # STORE8 R0 R2 0 ; Write out the byte
|
||||
|
@ -349,7 +349,7 @@ A030000a # CMPSKIP.NE R0 10 ; Finished if newline
|
|||
0503A134 # LOADXU8 R1 R3 R4 ; Get a byte of our second string
|
||||
0F440001 # ADDUI R4 R4 1 ; Prep for next loop
|
||||
05004101 # CMP R1 R0 R1 ; Compare the bytes
|
||||
A0200000 # CMPSKIP.E R0 0 ; Stop if byte is NULL
|
||||
A0200000 # CMPSKIPI.E R0 0 ; Stop if byte is NULL
|
||||
2C51 @o # JUMP.E R1 @cmpbyte ; Loop if bytes are equal
|
||||
# ;; Done
|
||||
09000501 # MOVE R0 R1 ; Prepare for return
|
||||
|
@ -434,13 +434,13 @@ A0200000 # CMPSKIP.E R0 0 ; Stop if byte is NULL
|
|||
2D211100 # LOADUI R1 0x1100 ; Read from tape_01
|
||||
42100100 # FGETC ; Read a Char
|
||||
# ;; Stop looping if space
|
||||
A0300020 # CMPSKIP.NE R0 32
|
||||
A0300020 # CMPSKIPI.NE R0 32
|
||||
0D01001F # RET R15
|
||||
# ;; Stop looping if tab
|
||||
A0300009 # CMPSKIP.NE R0 9
|
||||
A0300009 # CMPSKIPI.NE R0 9
|
||||
0D01001F # RET R15
|
||||
# ;; Stop looping if newline
|
||||
A030000a # CMPSKIP.NE R0 10
|
||||
A030000a # CMPSKIPI.NE R0 10
|
||||
0D01001F # RET R15
|
||||
# ;; Otherwise keep looping
|
||||
3C00 @p # JUMP @throwAwayToken
|
||||
|
|
|
@ -46,24 +46,24 @@ FFFFFFFF # HALT
|
|||
2D211100 # LOADUI R1 0x1100 ; Read from tape_01
|
||||
42100100 # FGETC ; Read a Char
|
||||
# ;; Check for EOF
|
||||
A0100000 # CMPSKIP.GE R0 0
|
||||
A0100000 # CMPSKIPI.GE R0 0
|
||||
0D01001F # RET R15
|
||||
# ;; Check for and deal with label (:)
|
||||
A030003a # CMPSKIP.NE R0 58
|
||||
A030003a # CMPSKIPI.NE R0 58
|
||||
3C00 @storeLabel # JUMP @storeLabel
|
||||
# ;; Check for and deal with pointers to labels
|
||||
# ;; Starting with (@)
|
||||
A0300040 # CMPSKIP.NE R0 64
|
||||
A0300040 # CMPSKIPI.NE R0 64
|
||||
3C00 @ThrowAwayPointer # JUMP @ThrowAwayPointer
|
||||
# ;; Then dealing with ($)
|
||||
A0300024 # CMPSKIP.NE R0 36
|
||||
A0300024 # CMPSKIPI.NE R0 36
|
||||
3C00 @ThrowAwayPointer # JUMP @ThrowAwayPointer
|
||||
# ;; Now check for absolute addresses (&)
|
||||
A0300026 # CMPSKIP.NE R0 38
|
||||
A0300026 # CMPSKIPI.NE R0 38
|
||||
3C00 @ThrowAwayAddress # JUMP @ThrowAwayAddress
|
||||
# ;; Otherwise attempt to process
|
||||
2D0F @hex # CALLI R15 @hex ; Convert it
|
||||
A0100000 # CMPSKIP.GE R0 0 ; Don't record, nonhex values
|
||||
A0100000 # CMPSKIPI.GE R0 0 ; Don't record, nonhex values
|
||||
3C00 @first_pass # JUMP @first_pass ; Move onto Next char
|
||||
# ;; Determine if we got a full byte
|
||||
2C9A @first_pass_0 # JUMP.Z R10 @first_pass_0 ; Jump if toggled
|
||||
|
@ -86,21 +86,21 @@ A0100000 # CMPSKIP.GE R0 0 ; Don't record, nonhex values
|
|||
2D211100 # LOADUI R1 0x1100 ; Read from tape_01
|
||||
42100100 # FGETC ; Read a Char
|
||||
# ;; Check for EOF
|
||||
A0100000 # CMPSKIP.GE R0 0
|
||||
A0100000 # CMPSKIPI.GE R0 0
|
||||
0D01001F # RET R15
|
||||
# ;; Check for and deal with label
|
||||
A030003a # CMPSKIP.NE R0 58
|
||||
A030003a # CMPSKIPI.NE R0 58
|
||||
3C00 @ThrowAwayLabel # JUMP @ThrowAwayLabel
|
||||
# ;; Check for and deal with Pointers to labels
|
||||
A0300040 # CMPSKIP.NE R0 64 ; @ for relative
|
||||
A0300040 # CMPSKIPI.NE R0 64 ; @ for relative
|
||||
3C00 @StoreRelativePointer # JUMP @StoreRelativePointer
|
||||
A0300024 # CMPSKIP.NE R0 36 ; $ for absolute
|
||||
A0300024 # CMPSKIPI.NE R0 36 ; $ for absolute
|
||||
3C00 @StoreAbsolutePointer # JUMP @StoreAbsolutePointer
|
||||
A0300026 # CMPSKIP.NE R0 38 ; & for address
|
||||
A0300026 # CMPSKIPI.NE R0 38 ; & for address
|
||||
3C00 @StoreAbsoluteAddress # JUMP @StoreAbsoluteAddress
|
||||
# ;; Process everything else
|
||||
2D0F @hex # CALLI R15 @hex ; Attempt to Convert it
|
||||
A0100000 # CMPSKIP.GE R0 0 ; Don't record, nonhex values
|
||||
A0100000 # CMPSKIPI.GE R0 0 ; Don't record, nonhex values
|
||||
3C00 @second_pass # JUMP @second_pass ; Move onto Next char
|
||||
# ;; Determine if we got a full byte
|
||||
2C9A @second_pass_0 # JUMP.Z R10 @second_pass_0 ; Jump if toggled
|
||||
|
@ -127,7 +127,7 @@ A0100000 # CMPSKIP.GE R0 0 ; Don't record, nonhex values
|
|||
# ;; Returns to first pass when done
|
||||
:storeLabel
|
||||
2E00 @current_index # LOADR R0 @current_index ; Get address of first open index
|
||||
A0300000 # CMPSKIP.NE R0 0 ; If zero intialize from R13
|
||||
A0300000 # CMPSKIPI.NE R0 0 ; If zero intialize from R13
|
||||
0900040D # COPY R0 R13
|
||||
# ;; Store the PC of the label
|
||||
23B00000 # STORE32 R11 R0 0
|
||||
|
@ -230,11 +230,11 @@ A0300000 # CMPSKIP.NE R0 0 ; If zero intialize from R13
|
|||
:writeout_token_0
|
||||
42100100 # FGETC ; Get another byte
|
||||
# ;; Deal with termination cases
|
||||
A0300020 # CMPSKIP.NE R0 32 ; Finished if space
|
||||
A0300020 # CMPSKIPI.NE R0 32 ; Finished if space
|
||||
3C00 @writeout_token_done # JUMP @writeout_token_done
|
||||
A0300009 # CMPSKIP.NE R0 9 ; Finished if tab
|
||||
A0300009 # CMPSKIPI.NE R0 9 ; Finished if tab
|
||||
3C00 @writeout_token_done # JUMP @writeout_token_done
|
||||
A030000a # CMPSKIP.NE R0 10 ; Finished if newline
|
||||
A030000a # CMPSKIPI.NE R0 10 ; Finished if newline
|
||||
3C00 @writeout_token_done # JUMP @writeout_token_done
|
||||
# ;; Deal with valid input
|
||||
21020000 # STORE8 R0 R2 0 ; Write out the byte
|
||||
|
@ -328,7 +328,7 @@ A030000a # CMPSKIP.NE R0 10 ; Finished if newline
|
|||
0503A134 # LOADXU8 R1 R3 R4 ; Get a byte of our second string
|
||||
0F440001 # ADDUI R4 R4 1 ; Prep for next loop
|
||||
05004101 # CMP R1 R0 R1 ; Compare the bytes
|
||||
A0200000 # CMPSKIP.E R0 0 ; Stop if byte is NULL
|
||||
A0200000 # CMPSKIPI.E R0 0 ; Stop if byte is NULL
|
||||
2C51 @cmpbyte # JUMP.E R1 @cmpbyte ; Loop if bytes are equal
|
||||
# ;; Done
|
||||
09000501 # MOVE R0 R1 ; Prepare for return
|
||||
|
@ -408,13 +408,13 @@ A0200000 # CMPSKIP.E R0 0 ; Stop if byte is NULL
|
|||
2D211100 # LOADUI R1 0x1100 ; Read from tape_01
|
||||
42100100 # FGETC ; Read a Char
|
||||
# ;; Stop looping if space
|
||||
A0300020 # CMPSKIP.NE R0 32
|
||||
A0300020 # CMPSKIPI.NE R0 32
|
||||
0D01001F # RET R15
|
||||
# ;; Stop looping if tab
|
||||
A0300009 # CMPSKIP.NE R0 9
|
||||
A0300009 # CMPSKIPI.NE R0 9
|
||||
0D01001F # RET R15
|
||||
# ;; Stop looping if newline
|
||||
A030000a # CMPSKIP.NE R0 10
|
||||
A030000a # CMPSKIPI.NE R0 10
|
||||
0D01001F # RET R15
|
||||
# ;; Otherwise keep looping
|
||||
3C00 @throwAwayToken # JUMP @throwAwayToken
|
||||
|
|
|
@ -54,29 +54,29 @@
|
|||
FGETC ; Read a Char
|
||||
|
||||
;; Check for EOF
|
||||
CMPSKIP.GE R0 0
|
||||
CMPSKIPI.GE R0 0
|
||||
RET R15
|
||||
|
||||
;; Check for and deal with label (:)
|
||||
CMPSKIP.NE R0 58
|
||||
CMPSKIPI.NE R0 58
|
||||
JUMP @storeLabel
|
||||
|
||||
;; Check for and deal with pointers to labels
|
||||
;; Starting with (@)
|
||||
CMPSKIP.NE R0 64
|
||||
CMPSKIPI.NE R0 64
|
||||
JUMP @ThrowAwayPointer
|
||||
|
||||
;; Then dealing with ($)
|
||||
CMPSKIP.NE R0 36
|
||||
CMPSKIPI.NE R0 36
|
||||
JUMP @ThrowAwayPointer
|
||||
|
||||
;; Now check for absolute addresses (&)
|
||||
CMPSKIP.NE R0 38
|
||||
CMPSKIPI.NE R0 38
|
||||
JUMP @ThrowAwayAddress
|
||||
|
||||
;; Otherwise attempt to process
|
||||
CALLI R15 @hex ; Convert it
|
||||
CMPSKIP.GE R0 0 ; Don't record, nonhex values
|
||||
CMPSKIPI.GE R0 0 ; Don't record, nonhex values
|
||||
JUMP @first_pass ; Move onto Next char
|
||||
|
||||
;; Determine if we got a full byte
|
||||
|
@ -103,26 +103,26 @@
|
|||
FGETC ; Read a Char
|
||||
|
||||
;; Check for EOF
|
||||
CMPSKIP.GE R0 0
|
||||
CMPSKIPI.GE R0 0
|
||||
RET R15
|
||||
|
||||
;; Check for and deal with label
|
||||
CMPSKIP.NE R0 58
|
||||
CMPSKIPI.NE R0 58
|
||||
JUMP @ThrowAwayLabel
|
||||
|
||||
;; Check for and deal with Pointers to labels
|
||||
CMPSKIP.NE R0 64 ; @ for relative
|
||||
CMPSKIPI.NE R0 64 ; @ for relative
|
||||
JUMP @StoreRelativePointer
|
||||
|
||||
CMPSKIP.NE R0 36 ; $ for absolute
|
||||
CMPSKIPI.NE R0 36 ; $ for absolute
|
||||
JUMP @StoreAbsolutePointer
|
||||
|
||||
CMPSKIP.NE R0 38 ; & for address
|
||||
CMPSKIPI.NE R0 38 ; & for address
|
||||
JUMP @StoreAbsoluteAddress
|
||||
|
||||
;; Process everything else
|
||||
CALLI R15 @hex ; Attempt to Convert it
|
||||
CMPSKIP.GE R0 0 ; Don't record, nonhex values
|
||||
CMPSKIPI.GE R0 0 ; Don't record, nonhex values
|
||||
JUMP @second_pass ; Move onto Next char
|
||||
|
||||
;; Determine if we got a full byte
|
||||
|
@ -152,7 +152,7 @@
|
|||
;; Returns to first pass when done
|
||||
:storeLabel
|
||||
LOADR R0 @current_index ; Get address of first open index
|
||||
CMPSKIP.NE R0 0 ; If zero intialize from R13
|
||||
CMPSKIPI.NE R0 0 ; If zero intialize from R13
|
||||
COPY R0 R13
|
||||
|
||||
;; Store the PC of the label
|
||||
|
@ -262,11 +262,11 @@
|
|||
FGETC ; Get another byte
|
||||
|
||||
;; Deal with termination cases
|
||||
CMPSKIP.NE R0 32 ; Finished if space
|
||||
CMPSKIPI.NE R0 32 ; Finished if space
|
||||
JUMP @writeout_token_done
|
||||
CMPSKIP.NE R0 9 ; Finished if tab
|
||||
CMPSKIPI.NE R0 9 ; Finished if tab
|
||||
JUMP @writeout_token_done
|
||||
CMPSKIP.NE R0 10 ; Finished if newline
|
||||
CMPSKIPI.NE R0 10 ; Finished if newline
|
||||
JUMP @writeout_token_done
|
||||
|
||||
;; Deal with valid input
|
||||
|
@ -365,7 +365,7 @@
|
|||
LOADXU8 R1 R3 R4 ; Get a byte of our second string
|
||||
ADDUI R4 R4 1 ; Prep for next loop
|
||||
CMP R1 R0 R1 ; Compare the bytes
|
||||
CMPSKIP.E R0 0 ; Stop if byte is NULL
|
||||
CMPSKIPI.E R0 0 ; Stop if byte is NULL
|
||||
JUMP.E R1 @cmpbyte ; Loop if bytes are equal
|
||||
;; Done
|
||||
MOVE R0 R1 ; Prepare for return
|
||||
|
@ -448,15 +448,15 @@
|
|||
FGETC ; Read a Char
|
||||
|
||||
;; Stop looping if space
|
||||
CMPSKIP.NE R0 32
|
||||
CMPSKIPI.NE R0 32
|
||||
RET R15
|
||||
|
||||
;; Stop looping if tab
|
||||
CMPSKIP.NE R0 9
|
||||
CMPSKIPI.NE R0 9
|
||||
RET R15
|
||||
|
||||
;; Stop looping if newline
|
||||
CMPSKIP.NE R0 10
|
||||
CMPSKIPI.NE R0 10
|
||||
RET R15
|
||||
|
||||
;; Otherwise keep looping
|
||||
|
|
20
vm.h
20
vm.h
|
@ -193,16 +193,16 @@ void CMPJUMPU_G(struct lilith* vm, struct Instruction* c);
|
|||
void CMPJUMPU_GE(struct lilith* vm, struct Instruction* c);
|
||||
void CMPJUMPU_LE(struct lilith* vm, struct Instruction* c);
|
||||
void CMPJUMPU_L(struct lilith* vm, struct Instruction* c);
|
||||
void CMPSKIP_G(struct lilith* vm, struct Instruction* c);
|
||||
void CMPSKIP_GE(struct lilith* vm, struct Instruction* c);
|
||||
void CMPSKIP_E(struct lilith* vm, struct Instruction* c);
|
||||
void CMPSKIP_NE(struct lilith* vm, struct Instruction* c);
|
||||
void CMPSKIP_LE(struct lilith* vm, struct Instruction* c);
|
||||
void CMPSKIP_L(struct lilith* vm, struct Instruction* c);
|
||||
void CMPSKIPU_G(struct lilith* vm, struct Instruction* c);
|
||||
void CMPSKIPU_GE(struct lilith* vm, struct Instruction* c);
|
||||
void CMPSKIPU_LE(struct lilith* vm, struct Instruction* c);
|
||||
void CMPSKIPU_L(struct lilith* vm, struct Instruction* c);
|
||||
void CMPSKIPI_G(struct lilith* vm, struct Instruction* c);
|
||||
void CMPSKIPI_GE(struct lilith* vm, struct Instruction* c);
|
||||
void CMPSKIPI_E(struct lilith* vm, struct Instruction* c);
|
||||
void CMPSKIPI_NE(struct lilith* vm, struct Instruction* c);
|
||||
void CMPSKIPI_LE(struct lilith* vm, struct Instruction* c);
|
||||
void CMPSKIPI_L(struct lilith* vm, struct Instruction* c);
|
||||
void CMPSKIPUI_G(struct lilith* vm, struct Instruction* c);
|
||||
void CMPSKIPUI_GE(struct lilith* vm, struct Instruction* c);
|
||||
void CMPSKIPUI_LE(struct lilith* vm, struct Instruction* c);
|
||||
void CMPSKIPUI_L(struct lilith* vm, struct Instruction* c);
|
||||
void PUSHR(struct lilith* vm, struct Instruction* c);
|
||||
void PUSH8(struct lilith* vm, struct Instruction* c);
|
||||
void PUSH16(struct lilith* vm, struct Instruction* c);
|
||||
|
|
80
vm_decode.c
80
vm_decode.c
|
@ -2212,114 +2212,114 @@ bool eval_Integer_1OPI(struct lilith* vm, struct Instruction* c)
|
|||
STORER32(vm, c);
|
||||
break;
|
||||
}
|
||||
case 0xA00: /* CMPSKIP.G */
|
||||
case 0xA00: /* CMPSKIPI.G */
|
||||
{
|
||||
#ifdef DEBUG
|
||||
strncpy(Name, "CMPSKIP.G", 19);
|
||||
strncpy(Name, "CMPSKIPI.G", 19);
|
||||
#elif TRACE
|
||||
record_trace("CMPSKIP.G");
|
||||
record_trace("CMPSKIPI.G");
|
||||
#endif
|
||||
|
||||
CMPSKIP_G(vm, c);
|
||||
CMPSKIPI_G(vm, c);
|
||||
break;
|
||||
}
|
||||
case 0xA01: /* CMPSKIP.GE */
|
||||
case 0xA01: /* CMPSKIPI.GE */
|
||||
{
|
||||
#ifdef DEBUG
|
||||
strncpy(Name, "CMPSKIP.GE", 19);
|
||||
strncpy(Name, "CMPSKIPI.GE", 19);
|
||||
#elif TRACE
|
||||
record_trace("CMPSKIP.GE");
|
||||
record_trace("CMPSKIPI.GE");
|
||||
#endif
|
||||
|
||||
CMPSKIP_GE(vm, c);
|
||||
CMPSKIPI_GE(vm, c);
|
||||
break;
|
||||
}
|
||||
case 0xA02: /* CMPSKIP.E */
|
||||
case 0xA02: /* CMPSKIPI.E */
|
||||
{
|
||||
#ifdef DEBUG
|
||||
strncpy(Name, "CMPSKIP.E", 19);
|
||||
strncpy(Name, "CMPSKIPI.E", 19);
|
||||
#elif TRACE
|
||||
record_trace("CMPSKIP.E");
|
||||
record_trace("CMPSKIPI.E");
|
||||
#endif
|
||||
|
||||
CMPSKIP_E(vm, c);
|
||||
CMPSKIPI_E(vm, c);
|
||||
break;
|
||||
}
|
||||
case 0xA03: /* CMPSKIP.NE */
|
||||
case 0xA03: /* CMPSKIPI.NE */
|
||||
{
|
||||
#ifdef DEBUG
|
||||
strncpy(Name, "CMPSKIP.NE", 19);
|
||||
strncpy(Name, "CMPSKIPI.NE", 19);
|
||||
#elif TRACE
|
||||
record_trace("CMPSKIP.NE");
|
||||
record_trace("CMPSKIPI.NE");
|
||||
#endif
|
||||
|
||||
CMPSKIP_NE(vm, c);
|
||||
CMPSKIPI_NE(vm, c);
|
||||
break;
|
||||
}
|
||||
case 0xA04: /* CMPSKIP.LE */
|
||||
case 0xA04: /* CMPSKIPI.LE */
|
||||
{
|
||||
#ifdef DEBUG
|
||||
strncpy(Name, "CMPSKIP.LE", 19);
|
||||
strncpy(Name, "CMPSKIPI.LE", 19);
|
||||
#elif TRACE
|
||||
record_trace("CMPSKIP.LE");
|
||||
record_trace("CMPSKIPI.LE");
|
||||
#endif
|
||||
|
||||
CMPSKIP_LE(vm, c);
|
||||
CMPSKIPI_LE(vm, c);
|
||||
break;
|
||||
}
|
||||
case 0xA05: /* CMPSKIP.L */
|
||||
case 0xA05: /* CMPSKIPI.L */
|
||||
{
|
||||
#ifdef DEBUG
|
||||
strncpy(Name, "CMPSKIP.L", 19);
|
||||
strncpy(Name, "CMPSKIPI.L", 19);
|
||||
#elif TRACE
|
||||
record_trace("CMPSKIP.L");
|
||||
record_trace("CMPSKIPI.L");
|
||||
#endif
|
||||
|
||||
CMPSKIP_L(vm, c);
|
||||
CMPSKIPI_L(vm, c);
|
||||
break;
|
||||
}
|
||||
case 0xA10: /* CMPSKIPU.G */
|
||||
case 0xA10: /* CMPSKIPUI.G */
|
||||
{
|
||||
#ifdef DEBUG
|
||||
strncpy(Name, "CMPSKIPU.G", 19);
|
||||
strncpy(Name, "CMPSKIPUI.G", 19);
|
||||
#elif TRACE
|
||||
record_trace("CMPSKIPU.G");
|
||||
record_trace("CMPSKIPUI.G");
|
||||
#endif
|
||||
|
||||
CMPSKIPU_G(vm, c);
|
||||
CMPSKIPUI_G(vm, c);
|
||||
break;
|
||||
}
|
||||
case 0xA11: /* CMPSKIPU.GE */
|
||||
case 0xA11: /* CMPSKIPUI.GE */
|
||||
{
|
||||
#ifdef DEBUG
|
||||
strncpy(Name, "CMPSKIPU.GE", 19);
|
||||
strncpy(Name, "CMPSKIPUI.GE", 19);
|
||||
#elif TRACE
|
||||
record_trace("CMPSKIPU.GE");
|
||||
record_trace("CMPSKIPUI.GE");
|
||||
#endif
|
||||
|
||||
CMPSKIPU_GE(vm, c);
|
||||
CMPSKIPUI_GE(vm, c);
|
||||
break;
|
||||
}
|
||||
case 0xA14: /* CMPSKIPU.LE */
|
||||
case 0xA14: /* CMPSKIPUI.LE */
|
||||
{
|
||||
#ifdef DEBUG
|
||||
strncpy(Name, "CMPSKIPU.LE", 19);
|
||||
strncpy(Name, "CMPSKIPUI.LE", 19);
|
||||
#elif TRACE
|
||||
record_trace("CMPSKIPU.LE");
|
||||
record_trace("CMPSKIPUI.LE");
|
||||
#endif
|
||||
|
||||
CMPSKIPU_LE(vm, c);
|
||||
CMPSKIPUI_LE(vm, c);
|
||||
break;
|
||||
}
|
||||
case 0xA15: /* CMPSKIPU.L */
|
||||
case 0xA15: /* CMPSKIPUI.L */
|
||||
{
|
||||
#ifdef DEBUG
|
||||
strncpy(Name, "CMPSKIPU.L", 19);
|
||||
strncpy(Name, "CMPSKIPUI.L", 19);
|
||||
#elif TRACE
|
||||
record_trace("CMPSKIPU.L");
|
||||
record_trace("CMPSKIPUI.L");
|
||||
#endif
|
||||
|
||||
CMPSKIPU_L(vm, c);
|
||||
CMPSKIPUI_L(vm, c);
|
||||
break;
|
||||
}
|
||||
default: return true;
|
||||
|
|
|
@ -1741,7 +1741,7 @@ void CMPJUMPU_L(struct lilith* vm, struct Instruction* c)
|
|||
}
|
||||
}
|
||||
|
||||
void CMPSKIP_G(struct lilith* vm, struct Instruction* c)
|
||||
void CMPSKIPI_G(struct lilith* vm, struct Instruction* c)
|
||||
{
|
||||
int32_t tmp1, tmp2;
|
||||
tmp1 = (int32_t)(vm->reg[c->reg0]);
|
||||
|
@ -1753,7 +1753,7 @@ void CMPSKIP_G(struct lilith* vm, struct Instruction* c)
|
|||
}
|
||||
}
|
||||
|
||||
void CMPSKIP_GE(struct lilith* vm, struct Instruction* c)
|
||||
void CMPSKIPI_GE(struct lilith* vm, struct Instruction* c)
|
||||
{
|
||||
int32_t tmp1, tmp2;
|
||||
tmp1 = (int32_t)(vm->reg[c->reg0]);
|
||||
|
@ -1765,7 +1765,7 @@ void CMPSKIP_GE(struct lilith* vm, struct Instruction* c)
|
|||
}
|
||||
}
|
||||
|
||||
void CMPSKIP_E(struct lilith* vm, struct Instruction* c)
|
||||
void CMPSKIPI_E(struct lilith* vm, struct Instruction* c)
|
||||
{
|
||||
uint16_t utmp1;
|
||||
|
||||
|
@ -1777,7 +1777,7 @@ void CMPSKIP_E(struct lilith* vm, struct Instruction* c)
|
|||
}
|
||||
}
|
||||
|
||||
void CMPSKIP_NE(struct lilith* vm, struct Instruction* c)
|
||||
void CMPSKIPI_NE(struct lilith* vm, struct Instruction* c)
|
||||
{
|
||||
uint16_t utmp1;
|
||||
|
||||
|
@ -1789,7 +1789,7 @@ void CMPSKIP_NE(struct lilith* vm, struct Instruction* c)
|
|||
}
|
||||
}
|
||||
|
||||
void CMPSKIP_LE(struct lilith* vm, struct Instruction* c)
|
||||
void CMPSKIPI_LE(struct lilith* vm, struct Instruction* c)
|
||||
{
|
||||
int32_t tmp1, tmp2;
|
||||
tmp1 = (int32_t)(vm->reg[c->reg0]);
|
||||
|
@ -1801,7 +1801,7 @@ void CMPSKIP_LE(struct lilith* vm, struct Instruction* c)
|
|||
}
|
||||
}
|
||||
|
||||
void CMPSKIP_L(struct lilith* vm, struct Instruction* c)
|
||||
void CMPSKIPI_L(struct lilith* vm, struct Instruction* c)
|
||||
{
|
||||
int32_t tmp1, tmp2;
|
||||
tmp1 = (int32_t)(vm->reg[c->reg0]);
|
||||
|
@ -1813,7 +1813,7 @@ void CMPSKIP_L(struct lilith* vm, struct Instruction* c)
|
|||
}
|
||||
}
|
||||
|
||||
void CMPSKIPU_G(struct lilith* vm, struct Instruction* c)
|
||||
void CMPSKIPUI_G(struct lilith* vm, struct Instruction* c)
|
||||
{
|
||||
uint16_t utmp1;
|
||||
|
||||
|
@ -1825,7 +1825,7 @@ void CMPSKIPU_G(struct lilith* vm, struct Instruction* c)
|
|||
}
|
||||
}
|
||||
|
||||
void CMPSKIPU_GE(struct lilith* vm, struct Instruction* c)
|
||||
void CMPSKIPUI_GE(struct lilith* vm, struct Instruction* c)
|
||||
{
|
||||
uint16_t utmp1;
|
||||
|
||||
|
@ -1837,7 +1837,7 @@ void CMPSKIPU_GE(struct lilith* vm, struct Instruction* c)
|
|||
}
|
||||
}
|
||||
|
||||
void CMPSKIPU_LE(struct lilith* vm, struct Instruction* c)
|
||||
void CMPSKIPUI_LE(struct lilith* vm, struct Instruction* c)
|
||||
{
|
||||
uint16_t utmp1;
|
||||
|
||||
|
@ -1849,7 +1849,7 @@ void CMPSKIPU_LE(struct lilith* vm, struct Instruction* c)
|
|||
}
|
||||
}
|
||||
|
||||
void CMPSKIPU_L(struct lilith* vm, struct Instruction* c)
|
||||
void CMPSKIPUI_L(struct lilith* vm, struct Instruction* c)
|
||||
{
|
||||
uint16_t utmp1;
|
||||
|
||||
|
|
Loading…
Reference in New Issue