summaryrefslogtreecommitdiff
path: root/programs/sub-suite/declare.s
diff options
context:
space:
mode:
Diffstat (limited to 'programs/sub-suite/declare.s')
-rw-r--r--programs/sub-suite/declare.s238
1 files changed, 157 insertions, 81 deletions
diff --git a/programs/sub-suite/declare.s b/programs/sub-suite/declare.s
index 8054956..55ccc2b 100644
--- a/programs/sub-suite/declare.s
+++ b/programs/sub-suite/declare.s
@@ -113,9 +113,9 @@ scr_row:
.res 1
scr_col:
.res 1
-scr_trow:
+scr_str:
.res 1
-scr_tcol:
+scr_end:
.res 1
scr_ptr:
.res 2
@@ -148,9 +148,9 @@ end:
.res 8
bitmask:
.res 1
-scr_str:
+scr_trow:
.res 1
-scr_end:
+scr_tcol:
.res 1
wrapped:
.res 1
@@ -287,311 +287,387 @@ bits:
.byte $80, $40, $20, $10, $08, $04, $02, $01
-; Instruction mnemonics, and opcodes.
+; Instruction table.
; Format.
;
-; String : Mnemonic.
; 2 bytes: Addressing mode bits.
; 1 byte : Base value, used to generate the actual opcode.
-mne:
- .byte "ADC"
+inst:
+ ; ADC
.word IMM|ZM|ABS|BREG
.byte $01
- .byte "AND"
+ ; AND
.word IMM|ZM|ABS|BREG
.byte $41
- .byte "ASR"
+ ; ASR
.word IMM|ZM|ABS|BREG
.byte $62
- .byte "BCC"
+ ; BCC
.word REL
.byte $A0
- .byte "BCS"
+ ; BCS
.word REL
.byte $90
- .byte "BEQ"
+ ; BEQ
.word REL
.byte $B0
- .byte "BNE"
+ ; BNE
.word REL
.byte $C0
- .byte "BNG"
+ ; BNG
.word REL
.byte $80
- .byte "BPO"
+ ; BPO
.word REL
.byte $70
- .byte "BRA"
+ ; BRA
.word REL
.byte $F0
- .byte "BRK"
+ ; BRK
.word IMPL
.byte $69
- .byte "BVC"
+ ; BVC
.word REL
.byte $E0
- .byte "BVS"
+ ; BVS
.word REL
.byte $D0
- .byte "CLC"
+ ; CLC
.word IMPL
.byte $09
- .byte "CLI"
+ ; CLI
.word IMPL
.byte $29
- .byte "CLV"
+ ; CLV
.word IMPL
.byte $49
- .byte "CMP"
+ ; CMP
.word IMM|ZM|IND|INDY|ABS|BREG|INDX2
.byte $82
- .byte "CPB"
+ ; CPB
.word IMM|ZM|IND|INDY|ABS|INDX2
.byte $04
- .byte "CPS"
+ ; CPS
.word IMPL
.byte $00
- .byte "CPX"
+ ; CPX
.word IMM|ZM|IND|ABS
.byte $24
- .byte "CPY"
+ ; CPY
.word IMM|ZM|IND|ABS
.byte $44
- .byte "DEB"
+ ; DEB
.word IMPL
.byte $99
- .byte "DEC"
+ ; DEC
.word IMPL|ZM|ABS
.byte $84
- .byte "DEX"
+ ; DEX
.word IMPL
.byte $B9
- .byte "DEY"
+ ; DEY
.word IMPL
.byte $79
- .byte "DIV"
+ ; DIV
.word IMM|ZM|ABS|BREG
.byte $42
- .byte "INB"
+ ; INB
.word IMPL
.byte $A9
- .byte "INC"
+ ; INC
.word IMPL|ZM|ABS
.byte $A4
- .byte "INX"
+ ; INX
.word IMPL
.byte $C9
- .byte "INY"
+ ; INY
.word IMPL
.byte $89
- .byte "JMP"
+ ; JMP
.word ABS|IND|ZM2
.byte $00
- .byte "JSR"
+ ; JSR
.word ABS|IND|ZM2
.byte $20
- .byte "LDA"
+ ; LDA
.word IMM|ZM|ZMX|ZMY|IND|INDX|INDY|ABS
.byte $C2
- .byte "LDB"
+ ; LDB
.word IMM|ZM|ZMX|ZMY|IND|INDX|INDY|ABS
.byte $E2
- .byte "LDX"
+ ; LDX
.word IMM|ZM|IND|ABS
.byte $64
- .byte "LDY"
+ ; LDY
.word IMM|ZM|IND|ABS
.byte $A2
- .byte "LSL"
+ ; LSL
.word IMM|ZM|ABS|BREG
.byte $A1
- .byte "LSR"
+ ; LSR
.word IMM|ZM|ABS|BREG
.byte $C1
- .byte "MUL"
+ ; MUL
.word IMM|ZM|ABS|BREG
.byte $22
- .byte "NOP"
+ ; NOP
.word IMPL
.byte $EA
- .byte "ORA"
+ ; ORA
.word IMM|ZM|ABS|BREG
.byte $61
- .byte "PHA"
+ ; PHA
.word IMPL
.byte $8E
- .byte "PHB"
+ ; PHB
.word IMPL
.byte $AE
- .byte "PHP"
+ ; PHP
.word IMPL
.byte $6E
- .byte "PHX"
+ ; PHX
.word IMPL
.byte $EE
- .byte "PHY"
+ ; PHY
.word IMPL
.byte $CE
- .byte "PLA"
+ ; PLA
.word IMPL
.byte $9E
- .byte "PLB"
+ ; PLB
.word IMPL
.byte $BE
- .byte "PLP"
+ ; PLP
.word IMPL
.byte $7E
- .byte "PLX"
+ ; PLX
.word IMPL
.byte $FE
- .byte "PLY"
+ ; PLY
.word IMPL
.byte $DE
- .byte "ROL"
+ ; ROL
.word IMM|ZM|ABS|BREG
.byte $E1
- .byte "ROR"
+ ; ROR
.word IMM|ZM|ABS|BREG
.byte $02
- .byte "RTI"
+ ; RTI
.word IMPL
.byte $60
- .byte "RTS"
+ ; RTS
.word IMPL
.byte $50
- .byte "SBC"
+ ; SBC
.word IMM|ZM|ABS|BREG
.byte $21
- .byte "SEC"
+ ; SEC
.word IMPL
.byte $19
- .byte "SEI"
+ ; SEI
.word IMPL
.byte $39
- .byte "STA"
+ ; STA
.word ZM|ZMX|ZMY|IND|INDX|INDY|ABS
.byte $28
- .byte "STB"
+ ; STB
.word ZM|ZMX|ZMY|IND|INDX|INDY|ABS
.byte $48
- .byte "STX"
+ ; STX
.word ZM|IND|ABS
.byte $68
- .byte "STY"
+ ; STY
.word ZM|IND|ABS
.byte $08
- .byte "TAB"
+ ; TAB
.word IMPL
.byte $0A
- .byte "TAX"
+ ; TAX
.word IMPL
.byte $4A
- .byte "TAY"
+ ; TAY
.word IMPL
.byte $2A
- .byte "TBA"
+ ; TBA
.word IMPL
.byte $1A
- .byte "TSX"
+ ; TSX
.word IMPL
.byte $8A
- .byte "TXA"
+ ; TXA
.word IMPL
.byte $5A
- .byte "TXS"
+ ; TXS
.word IMPL|IMM
.byte $9A
- .byte "TXY"
+ ; TXY
.word IMPL
.byte $7A
- .byte "TYA"
+ ; TYA
.word IMPL
.byte $3A
- .byte "TYX"
+ ; TYX
.word IMPL
.byte $6A
- .byte "WAI"
+ ; WAI
.word IMPL
.byte $59
- .byte "XOR"
+ ; XOR
.word IMM|ZM|ABS|BREG
.byte $81
+; Mnemonic Table.
+mne:
+ .byte "ADC"
+ .byte "AND"
+ .byte "ASR"
+ .byte "BCC"
+ .byte "BCS"
+ .byte "BEQ"
+ .byte "BNE"
+ .byte "BNG"
+ .byte "BPO"
+ .byte "BRA"
+ .byte "BRK"
+ .byte "BVC"
+ .byte "BVS"
+ .byte "CLC"
+ .byte "CLI"
+ .byte "CLV"
+ .byte "CMP"
+ .byte "CPB"
+ .byte "CPS"
+ .byte "CPX"
+ .byte "CPY"
+ .byte "DEB"
+ .byte "DEC"
+ .byte "DEX"
+ .byte "DEY"
+ .byte "DIV"
+ .byte "INB"
+ .byte "INC"
+ .byte "INX"
+ .byte "INY"
+ .byte "JMP"
+ .byte "JSR"
+ .byte "LDA"
+ .byte "LDB"
+ .byte "LDX"
+ .byte "LDY"
+ .byte "LSL"
+ .byte "LSR"
+ .byte "MUL"
+ .byte "NOP"
+ .byte "ORA"
+ .byte "PHA"
+ .byte "PHB"
+ .byte "PHP"
+ .byte "PHX"
+ .byte "PHY"
+ .byte "PLA"
+ .byte "PLB"
+ .byte "PLP"
+ .byte "PLX"
+ .byte "PLY"
+ .byte "ROL"
+ .byte "ROR"
+ .byte "RTI"
+ .byte "RTS"
+ .byte "SBC"
+ .byte "SEC"
+ .byte "SEI"
+ .byte "STA"
+ .byte "STB"
+ .byte "STX"
+ .byte "STY"
+ .byte "TAB"
+ .byte "TAX"
+ .byte "TAY"
+ .byte "TBA"
+ .byte "TSX"
+ .byte "TXA"
+ .byte "TXS"
+ .byte "TXY"
+ .byte "TYA"
+ .byte "TYX"
+ .byte "WAI"
+ .byte "XOR"
+
; Command subroutine table.
cmd_srt: