; SuBAsm ; The Sux Bootstrapped Assembler. ; ; by mr b0nk 500 .org $A000 ; String Constants. prg_name: .byte "SuBAsm" ver_txt: .byte ", version " ver_num: .byte "0.1" ; Directives. dir: .byte "org" .byte "byte" .byte "word" .byte "dword" .byte "qword" tok: .byte '.' .byte '#' .byte '$' .byte '%' .byte '(' .byte ')' .byte ',' mne: .byte "AAB" .byte "ABA" .byte "ADC" .byte "AND" .byte "ARB" .byte "ASR" .byte "BCC" .byte "BCS" .byte "BEQ" .byte "BNE" .byte "BNG" .byte "BPO" .byte "BRK" .byte "BVC" .byte "BVS" .byte "CAB" .byte "CLC" .byte "CLI" .byte "CLV" .byte "CMP" .byte "CPB" .byte "CPS" .byte "CPX" .byte "CPY" .byte "DAB" .byte "DEB" .byte "DEC" .byte "DEX" .byte "DEY" .byte "DIV" .byte "ENT" .byte "INB" .byte "INC" .byte "INX" .byte "INY" .byte "JMP" .byte "JSL" .byte "JSR" .byte "LDA" .byte "LDB" .byte "LDX" .byte "LDY" .byte "LLB" .byte "LRB" .byte "LSL" .byte "LSR" .byte "MAB" .byte "MUL" .byte "NOP" .byte "OAB" .byte "ORA" .byte "PHA" .byte "PHB" .byte "PHP" .byte "PHX" .byte "PHY" .byte "PLA" .byte "PLB" .byte "PLP" .byte "PLX" .byte "PLY" .byte "RLB" .byte "ROL" .byte "ROR" .byte "RRB" .byte "RTI" .byte "RTL" .byte "RTS" .byte "SAB" .byte "SBC" .byte "SEC" .byte "SEI" .byte "STA" .byte "STB" .byte "STT" .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 "XAB" .byte "XOR" ; Start of program code. .org $8600 subasm: ldb #0 lda.w #tok sta.q ptr2 tba jsl chk_tok jsl chk_mne chk_tok: phy #2 txy lda (ptr6), y cmp (ptr2), y ply #2 cpx #7 beq tok_false tok_true: inb tok_false: stb f tok_end: ldb #0 rtl chk_mne: ply #2