;;; -*- TI-Asm -*- ;;; ;;; Mimas - Assembly language IDE for the TI-83 Plus ;;; ;;; Copyright (C) 2010 Benjamin Moody ;;; ;;; This program is free software: you can redistribute it and/or ;;; modify it under the terms of the GNU General Public License as ;;; published by the Free Software Foundation; either version 3 of the ;;; License, or (at your option) any later version. ;;; ;;; This program is distributed in the hope that it will be useful, ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;;; General Public License for more details. ;;; ;;; You should have received a copy of the GNU General Public License ;;; along with this program. If not, see . ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; ;;; Error messages ;;; emsg_NoProgramsFound: db 1, 69 db 12, 0DEh,070h,0F9h,087h,0F4h,081h,0F8h,090h,0F3h,07Fh,0B6h,020h ; No programs found emsg_FileNotFound: db 2, 55 db 4, 0D6h,045h,030h,0B6h ; File & db 8, 027h,039h,006h,07Ah,003h,0FEh,049h,0A0h ; does not exist emsg_FileInvalid: db 2, 55 db 4, 0D6h,045h,030h,0B6h ; File & db 7, 049h,006h,07Ah,00Fh,0C1h,054h,020h ; is not valid emsg_TooManyPasses: db 2, 69 db 11, 0DDh,01Fh,0E4h,0F8h,0FBh,0F8h,006h,0FBh,0F8h,0F1h,038h ; Maximum number db 11, 07Fh,030h,0F9h,019h,093h,090h,03Fh,0EFh,023h,032h,032h ; of passes exceeded emsg_ProgramEmpty: db 1, 59 db 10, 0EFh,087h,0F4h,081h,0F8h,003h,0F8h,0F9h,0AFh,0F0h ; Program empty emsg_AssertionFailed: db 1, 59 db 9, 0D1h,099h,038h,0A4h,076h,00Fh,031h,045h,032h ; Assertion failed emsg_MissingENDIF: db 1, 50 db 10, 0DDh,049h,094h,06Fh,040h,0D5h,0DEh,0D4h,0D9h,0D6h ; Missing ENDIF emsg_UnmatchedENDIF: db 1, 65 db 12, 0EAh,06Fh,081h,0AFh,02Fh,053h,020h,0D5h,0DEh,0D4h,0D9h,0D6h ; Unmatched ENDIF emsg_UnmatchedELSE: db 1, 61 db 11, 0EAh,06Fh,081h,0AFh,02Fh,053h,020h,0D5h,0DCh,0ECh,0D5h ; Unmatched ELSE emsg_TooManyConditionals: db 2, 48 db 6, 0EBh,077h,00Fh,081h,06Fh,0F0h ; Too many db 7, 0F2h,076h,024h,0A4h,076h,015h,090h ; conditionals ; emsg_InvalidArgument: ; db 2, 61 ; db 9, 0D1h,08Fh,04Fh,0BFh,083h,06Ah,00Bh,03Fh,050h ; Argument #h ; db 6, 049h,004h,06Fh,0C1h,054h,020h ; is invalid emsg_ArgOutOfRange: db 2, 61 db 9, 0D1h,08Fh,04Fh,0BFh,083h,06Ah,00Bh,03Fh,050h ; Argument #h db 8, 07Fh,0BAh,007h,0F3h,008h,016h,0F4h,030h ; out of range emsg_SymbolUndefined: db 2, 80 db 10, 0DCh,01Fh,013h,050h,0FBh,062h,03Fh,034h,063h,020h ; Label undefined db 3, 0B8h,0E0h,0B9h ; (_) emsg_SymbolRedefined: db 2, 80 db 9, 0DCh,01Fh,013h,050h,083h,023h,0F3h,046h,032h ; Label redefined db 3, 0B8h,0E0h,0B9h ; (_) emsg_DivideBy0: db 1, 41 db 8, 0D4h,04Fh,0C4h,023h,00Fh,01Fh,0F0h,0CFh ; Divide by 0 emsg_CodeTooLarge: db 2, 48 db 8, 0D3h,072h,030h,0A7h,070h,051h,08Fh,043h ; Code too large db 8, 0B8h,0EFh,0D3h,00Ch,020h,0B3h,0F5h,0B9h ; (PC = #h) emsg_SyntaxError: db 1, 51 db 8, 0ECh,0FFh,06Ah,01Fh,0E0h,038h,087h,080h ; Syntax error emsg_ReservedName: db 2, 65 db 11, 0D3h,016h,067h,0A0h,0FBh,093h,00Fh,01Fh,0B4h,05Ah,046h ; Cannot use builtin db 10, 0F2h,076h,09Ah,016h,0A0h,019h,005h,01Fh,013h,050h ; constant as label emsg_UnknownInstruction: db 1, 75 db 12, 0EAh,06Fh,076h,07Fh,0D6h,004h,069h,0A8h,0FBh,0F2h,0A4h,076h ; Unknown instruction emsg_UnknownArguments: db 1, 69 db 11, 0D9h,06Fh,0C1h,054h,020h,018h,0F4h,0FBh,0F8h,036h,0A9h ; Invalid arguments emsg_ExpressionTooComplex: db 2, 48 db 7, 0D5h,0FEh,0F9h,083h,099h,047h,060h ; Expression db 8, 0A7h,070h,0F2h,07Fh,08Fh,095h,03Fh,0E0h ; too complex emsg_ExpressionNotConstant: db 2, 48 db 7, 0D5h,0FEh,0F9h,083h,099h,047h,060h ; Expression db 7, 067h,0A0h,0F2h,076h,09Ah,016h,0A0h ; not constant emsg_BytecodeError: db 2, 58 db 8, 0D9h,06Ah,038h,061h,050h,038h,087h,080h ; Internal error db 8, 0B8h,0F1h,0FFh,0A3h,0F2h,072h,03Bh,090h ; (bytecode) emsg_StackOverflow: db 2, 58 db 8, 0D9h,06Ah,038h,061h,050h,038h,087h,080h ; Internal error db 8, 0B8h,07Fh,0C3h,08Fh,035h,07Fh,0DBh,090h ; (overflow) emsg_OutOfMemory: db 1, 55 db 10, 0DFh,0FBh,0A0h,07Fh,030h,0F8h,03Fh,087h,08Fh,0F0h ; Out of memory emsg_CannotUnarchive: db 2, 56 db 11, 0DEh,07Ah,003h,067h,0FBh,0F4h,0F5h,00Eh,0DDh,01Dh,0D0h ; Not enough RAM db 8, 0A7h,00Fh,0B6h,018h,0F2h,0F5h,04Fh,0C3h ; to unarchive emsg_SectionNotEmpty: db 1, 66 db 11, 0ECh,03Fh,02Ah,047h,060h,067h,0A0h,03Fh,08Fh,09Ah,0FFh ; Section not empty emsg_UnknownError: db 2, 58 db 8, 0EAh,06Fh,076h,07Fh,0D6h,003h,088h,078h ; Unknown error db 3, 0B8h,0B3h,0B9h ; (#) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; ;;; Instruction parsing/printing data ;;; ;;; Argument categories bcdehlmaRegs: bcdehlaRegs: db X_REG_H, X_REG_L bcdeaRegs: db X_REG_A, X_REG_B, X_REG_C, X_REG_D, X_REG_E regihlbyte: db X_REG_iHL bdsRegs: bdhsRegs: db X_REG_SP bdhaRegs: db X_REG_BC, X_REG_DE, X_REG_HL, X_REG_AF ixhlRegs: db X_REG_IXH, X_REG_IXL iyhlRegs: db X_REG_IYH, X_REG_IYL zcpsRegs: db X_COND_PO, X_COND_PE, X_COND_P, X_COND_M zcRegs: db X_COND_NZ, X_COND_Z, X_COND_NC condcbyte: db X_COND_C argumentCategoryTable: db 8 dw bcdehlmaRegs ; AC_BCDEHLMA db 7 dw bcdehlaRegs ; AC_BCDEHLA db 5 dw bcdeaRegs ; AC_BCDEA db 4 dw bdhsRegs ; AC_BDHS db 4 dw bdhaRegs ; AC_BDHA db 3 dw bdsRegs ; AC_BDS db 2 dw ixhlRegs ; AC_IXHL db 2 dw iyhlRegs ; AC_IYHL db 8 dw zcpsRegs ; AC_ZCPS db 4 dw zcRegs ; AC_ZC NO_BYTE_CARRY argumentCategoryTable ;;; Binary operator tables (keep these synchronized with the X_BINARY ;;; values in defs.inc) ;;; Table mapping binary operators to their character values ;;; (Note that LSHIFT and RSHIFT require special handling) binaryOperatorCharTable: db Lcross, "/%+-<>><", LGE, LLE, "=", LNE, "&^|" NO_BYTE_CARRY binaryOperatorCharTable ;;; Table indicating when binary operators should be parenthesized. ;;; (First byte is operator's parenthesization class; second byte is ;;; the list of classes which should be parenthesized as a left child. ;;; As a right child, the mask is the OR of the two bytes.) Note that ;;; this is a bit stricter than the precedence levels require; it will ;;; add extra parentheses to potentially-confusing expressions such as ;;; "1 & 2 + 3". binaryOperatorParenTable: db 10000000b, 01111111b ; * db 01000000b, 01111111b ; / db 01000000b, 01111111b ; % db 00100000b, 00011111b ; + db 00100000b, 00011111b ; - db 00010000b, 00111111b ; << db 00010000b, 00111111b ; >> db 00001000b, 00001111b ; > db 00001000b, 00001111b ; < db 00001000b, 00001111b ; >= db 00001000b, 00001111b ; <= db 00001000b, 00001111b ; == db 00001000b, 00001111b ; != db 00000100b, 11111011b ; & db 00000010b, 11111101b ; ^ db 00000001b, 11111110b ; | NO_BYTE_CARRY binaryOperatorParenTable ;;; Table mapping precedence levels to binary operators ;;; (each entry is first op number followed by number of ops) precedenceTable: db 0, 3 ; X_MUL, X_DIV, X_MOD db 3, 2 ; X_ADD, X_SUB db 5, 2 ; X_LSHIFT, X_RSHIFT db 7, 4 ; X_GREATER, X_LESS, X_GE, X_LE db 11, 2 ; X_EQUAL, X_NE db 13, 1 ; X_AND db 14, 1 ; X_XOR db 15, 1 ; X_OR NO_BYTE_CARRY precedenceTable ;;; Miscellaneous strings EQUStr: db "EQU",0 MSBStr: db "MSB",0 LSBStr: db "LSB",0 LPCStr: db "L" PCStr: db "PC",0 ;PicStr: db "Pic" ; not ZT quote_prgmStr: db Lquote prgmStr: db "prgm" nullStr: db 0 ;;; Register names regNameStrings: ; NOTE: must be preceded by a zero db X_REG_A, "A", 0 db X_REG_AF, "AF", 0 db X_REG_B, "B", 0 db X_REG_BC, "BC", 0 db X_REG_C, "C", 0 db X_REG_D, "D", 0 db X_REG_DE, "DE", 0 db X_REG_E, "E", 0 db X_REG_H, "H", 0 db X_REG_HL, "HL", 0 db X_REG_I, "I", 0 db X_REG_IX, "IX", 0 db X_REG_IXH, "IXH", 0 db X_REG_IXL, "IXL", 0 db X_REG_IY, "IY", 0 db X_REG_IYH, "IYH", 0 db X_REG_IYL, "IYL", 0 db X_REG_L, "L", 0 db X_COND_M, "M", 0 db X_COND_NC, "NC", 0 db X_COND_NZ, "NZ", 0 db X_COND_P, "P", 0 db X_COND_PE, "PE", 0 db X_COND_PO, "PO", 0 db X_REG_R, "R", 0 db X_REG_SP, "SP", 0 db X_COND_Z, "Z", 0 regNameStringsDefaultEnd: regNameAF2: db X_REG_AF2, "AF'", 0 db X_REG_iHL, "(HL)", 0 db X_COND_C, "C", 0 regNameStringsSize equ $ - regNameStrings ;;; Normal instruction mnemonics normalMnemonics: ; NOTE: must be preceded by a byte ; with bit 7 clear rorg 0 mnem_ADC: db 'A'+80h,'D'+80h,'C' mnem_ADD: db 'A'+80h,'D'+80h,'D' mnem_AND: db 'A'+80h,'N'+80h,'D' mnem_BIT: db 'B'+80h,'I'+80h,'T' mnem_CALL: db 'C'+80h,'A'+80h,'L'+80h,'L' mnem_CCF: db 'C'+80h,'C'+80h,'F' mnem_CP: db 'C'+80h,'P' mnem_CPD: db 'C'+80h,'P'+80h,'D' mnem_CPDR: db 'C'+80h,'P'+80h,'D'+80h,'R' mnem_CPI: db 'C'+80h,'P'+80h,'I' mnem_CPIR: db 'C'+80h,'P'+80h,'I'+80h,'R' mnem_CPL: db 'C'+80h,'P'+80h,'L' mnem_DAA: db 'D'+80h,'A'+80h,'A' mnem_DEC: db 'D'+80h,'E'+80h,'C' mnem_DI: db 'D'+80h,'I' mnem_DJNZ: db 'D'+80h,'J'+80h,'N'+80h,'Z' mnem_EI: db 'E'+80h,'I' mnem_EX: db 'E'+80h,'X' mnem_EXX: db 'E'+80h,'X'+80h,'X' mnem_HALT: db 'H'+80h,'A'+80h,'L'+80h,'T' mnem_IM: db 'I'+80h,'M' mnem_IN: db 'I'+80h,'N' mnem_INC: db 'I'+80h,'N'+80h,'C' mnem_IND: db 'I'+80h,'N'+80h,'D' mnem_INDR: db 'I'+80h,'N'+80h,'D'+80h,'R' mnem_INI: db 'I'+80h,'N'+80h,'I' mnem_INIR: db 'I'+80h,'N'+80h,'I'+80h,'R' mnem_JP: db 'J'+80h,'P' mnem_JR: db 'J'+80h,'R' mnem_LD: db 'L'+80h,'D' mnem_LDD: db 'L'+80h,'D'+80h,'D' mnem_LDDR: db 'L'+80h,'D'+80h,'D'+80h,'R' mnem_LDI: db 'L'+80h,'D'+80h,'I' mnem_LDIR: db 'L'+80h,'D'+80h,'I'+80h,'R' mnem_NEG: db 'N'+80h,'E'+80h,'G' mnem_NOP: db 'N'+80h,'O'+80h,'P' mnem_OR: db 'O'+80h,'R' mnem_OTDR: db 'O'+80h,'T'+80h,'D'+80h,'R' mnem_OTIR: db 'O'+80h,'T'+80h,'I'+80h,'R' mnem_OUT: db 'O'+80h,'U'+80h,'T' mnem_OUTD: db 'O'+80h,'U'+80h,'T'+80h,'D' mnem_OUTI: db 'O'+80h,'U'+80h,'T'+80h,'I' mnem_POP: db 'P'+80h,'O'+80h,'P' mnem_PUSH: db 'P'+80h,'U'+80h,'S'+80h,'H' mnem_RES: db 'R'+80h,'E'+80h,'S' mnem_RET: db 'R'+80h,'E'+80h,'T' mnem_RETI: db 'R'+80h,'E'+80h,'T'+80h,'I' mnem_RETN: db 'R'+80h,'E'+80h,'T'+80h,'N' mnem_RL: db 'R'+80h,'L' mnem_RLA: db 'R'+80h,'L'+80h,'A' mnem_RLC: db 'R'+80h,'L'+80h,'C' mnem_RLCA: db 'R'+80h,'L'+80h,'C'+80h,'A' mnem_RLD: db 'R'+80h,'L'+80h,'D' mnem_RR: db 'R'+80h,'R' mnem_RRA: db 'R'+80h,'R'+80h,'A' mnem_RRC: db 'R'+80h,'R'+80h,'C' mnem_RRCA: db 'R'+80h,'R'+80h,'C'+80h,'A' mnem_RRD: db 'R'+80h,'R'+80h,'D' mnem_RST: db 'R'+80h,'S'+80h,'T' mnem_SBC: db 'S'+80h,'B'+80h,'C' mnem_SCF: db 'S'+80h,'C'+80h,'F' mnem_SET: db 'S'+80h,'E'+80h,'T' mnem_SLA: db 'S'+80h,'L'+80h,'A' mnem_SLIA: db 'S'+80h,'L'+80h,'I'+80h,'A' mnem_SRA: db 'S'+80h,'R'+80h,'A' mnem_SRL: db 'S'+80h,'R'+80h,'L' mnem_SUB: db 'S'+80h,'U'+80h,'B' mnem_XOR: db 'X'+80h,'O'+80h,'R' normalMnemonicsEnd equ $$ mnem_xxx: db 'x'+80h,'x'+80h,'x' mnem_JQ: db 'J'+80h,'Q' rorg $$ ;;; Special instruction mnemonics specialMnemonics: ; NOTE: must be preceded by a byte ; with bit 7 clear rorg 0 smnem_ALIGN: db 'A'+80h,'L'+80h,'I'+80h,'G'+80h,'N' smnem_ASSERT: db 'A'+80h,'S'+80h,'S'+80h,'E'+80h,'R'+80h,'T' smnem_BCALL: db 'B'+80h,'C'+80h,'A'+80h,'L'+80h,'L' smnem_BJUMP: db 'B'+80h,'J'+80h,'U'+80h,'M'+80h,'P' smnem_BREAK: db 'B'+80h,'R'+80h,'E'+80h,'A'+80h,'K' smnem_DB: db 'D'+80h,'B' smnem_DS: db 'D'+80h,'S' smnem_DW: db 'D'+80h,'W' smnem_ELSE: db 'E'+80h,'L'+80h,'S'+80h,'E' smnem_ENDIF: db 'E'+80h,'N'+80h,'D'+80h,'I'+80h,'F' smnem_IF: db 'I'+80h,'F' smnem_IFDEF: db 'I'+80h,'F'+80h,'D'+80h,'E'+80h,'F' smnem_IFNDEF: db 'I'+80h,'F'+80h,'N'+80h,'D'+80h,'E'+80h,'F' smnem_INCBIN: db 'I'+80h,'N'+80h,'C'+80h,'B'+80h,'I'+80h,'N' smnem_JQ: db 'J'+80h,'Q' smnem_ORG: db 'O'+80h,'R'+80h,'G' smnem_RORG: db 'R'+80h,'O'+80h,'R'+80h,'G' rorg $$ specialMnemonicsEnd: ;;; Special instruction tables (keep these synchronized with the S_xx ;;; values in defs.inc) ;;; Table mapping special instructions to assembler subroutines specialInstructionTable: dw DoASCII dw DoASCIZ dw DoHEX dw DoINCBIN dw DoBCALL dw DoBJUMP dw DoBREAK0 dw DoBREAK1 dw DoEQU dw DoJQ1 dw DoJQ2 dw DoALIGN dw DoASSERT dw DoBLOCK dw DoBYTE dw DoELSE dw DoENDIF dw DoIF dw DoIFDEF dw DoIFNDEF dw DoORG dw DoRORG dw DoWORD NO_BYTE_CARRY specialInstructionTable ;;; Table mapping special instructions to their mnemonics (note that ;;; special handling is needed for EQU) specialInstructionMnemonicTable: db smnem_DB db smnem_DB db smnem_DB db smnem_INCBIN db smnem_BCALL db smnem_BJUMP db smnem_BREAK db smnem_BREAK db 0 db smnem_JQ db smnem_JQ db smnem_ALIGN db smnem_ASSERT db smnem_DS db smnem_DB db smnem_ELSE db smnem_ENDIF db smnem_IF db smnem_IFDEF db smnem_IFNDEF db smnem_ORG db smnem_RORG db smnem_DW ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; ;;; New program templates ;;; emptyProgramData: rorg 0 ;;; Program header (keep synchronized with mimas.inc) sourceFileSignature equ $$ db "MimS", 1 db PROGTYPE_TI83P ; TYPE dw 0 ; FLAGS dw emptyProgSymbols ; SYMBOL_START dw emptyProgStrings ; SYMBOL_STRING_START dw emptyProgConstants ; CONSTANT_START dw emptyProgImports ; IMPORT_START dw emptyProgSectStart ; SECTION_TABLE_START dw emptyProgSectEnd ; SECTION_TABLE_END ;;; Initial code section emptyProgS1Start: emptyProgS1End: ;;; Symbol table emptyProgSymbols: db 2, 0, 1 ; initial symbol stored at string ; offset 2; 1 reference ;;; String table emptyProgStrings: db 0 ; sentinel db 1, 0ECh,0A1h,08Ah,0 ; symbol #0 (hint = 0*2 + 1), name = "Start" ;;; Constant table (empty) emptyProgConstants: ;;; Import table (empty) emptyProgImports: ;;; Section table emptyProgSectStart: db SECTION_CODE ; SECTION_TYPE dw emptyProgS1Start ; DATA_START dw emptyProgS1End ; DATA_END db "MAIN", 0, 0, 0, 0 ; NAME emptyProgSectEnd: emptyProgramSize: rorg $$ ;;; Code templates: ;;; - First byte is a mask of program types ;;; - Second byte is length of the template data newProgramTemplates: NPT_ASM equ 80h NPT_ION equ 40h NPT_MIRAGE equ 20h NPT_DOORSCS equ 10h ;;; Origin and 'tasmCmp' token (all program types) db NPT_ASM | NPT_ION | NPT_MIRAGE | NPT_DOORSCS db templateAsmHeaderSize templateAsmHeader: db T_SPECIAL | 5, S_ORG db X_SUB, X_SYSADDR, 95h,9Dh, X_DEC6 + 2 db T_SPECIAL | 4, S_BYTE db X_HEX8, 0BBh db X_HEX8, 06Dh templateAsmHeaderSize equ $ - templateAsmHeader ;;; MirageOS header db NPT_MIRAGE db templateMirageHeaderSize templateMirageHeader: db T_NORMAL, I_RET db T_SPECIAL | 1, S_BYTE db X_DEC6 + 1 db T_SPECIAL | 30, S_HEX db 00000000b,00000000b db 00000000b,00000000b db 00000000b,00000000b db 00000000b,00000000b db 00000000b,00000000b db 00100011b,01000100b db 01010100b,01101100b db 01110010b,01010100b db 01010001b,01000100b db 01010110b,01000100b db 00000000b,00000000b db 00000000b,00000000b db 00000000b,00000000b db 00000000b,00000000b db 00000000b,00000000b templateMirageHeaderSize equ $ - templateMirageHeader ;;; Ion header (note the extra ref to the Start label) db NPT_ION db templateIonHeaderSize templateIonHeader: db T_NORMAL, I_RET db T_NORMAL | 3, I_JR_cc_n db X_COND_NC db 0, 0 templateIonHeaderSize equ $ - templateIonHeader ;;; DoorsCS header (note the extra ref to the Start label) db NPT_DOORSCS db templateDoorsCSHeaderSize templateDoorsCSHeader: db T_NORMAL | 1, I_XOR_r db X_REG_D db T_NORMAL, I_RET db T_NORMAL | 2, I_JR_n db 0, 0 db T_COMMENT | 6 db 0D4h,039h,0F2h,084h,0F9h,0A4h,076h db T_SPECIAL | 1, S_WORD db X_DEC6 + 0 db T_SPECIAL | 2, S_BYTE db X_DEC6 + 7, X_DEC6 + 0 db T_COMMENT | 2 db 0D9h,0F2h,076h db T_SPECIAL | 1, S_WORD db X_DEC6 + 0 db T_COMMENT | 2 db 0D1h,0DCh,0D5h db T_SPECIAL | 1, S_WORD db X_DEC6 + 0 templateDoorsCSHeaderSize equ $ - templateDoorsCSHeader ;;; Program description (Ion/MirageOS) db NPT_ION | NPT_MIRAGE db templateDescriptionSize templateDescription: db T_SPECIAL | 8, S_ASCIZ db "Untitled" templateDescriptionSize equ $ - templateDescription ;;; Start label (all program types) db NPT_ASM | NPT_ION | NPT_MIRAGE | NPT_DOORSCS db templateStartLabelSize templateStartLabel: db T_LABEL | 1, 0, 0 templateStartLabelSize equ $ - templateStartLabel db 0 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; ;;; Debug file information ;;; debugFileName: db AppVarObj, "mimasdbg" debugHeaderInitData: db "MimD", 1 ; dw 0 ; SYMBOL_START ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; ;;; GUI data ;;; ;;; Text editor textEditScrollLeftBitmap: db 4 ;;;SPRITE 8x7x1 db 00001000b db 00001010b db 00000110b db 00001110b db 00000110b db 00001010b db 00001000b textEditScrollRightBitmap: db 4 ;;;SPRITE 8x7x1 db 00000001b db 00000101b db 00000110b db 00000111b db 00000110b db 00000101b db 00000001b shortcutKeyTable: numShortcutKeys equ 17 db kAdd db kSub db kMul db kDiv db kExpon db kLParen db kRParen db kStore db kComma db kChs db kInv db kSin db kCos db kTan db kSquare db kLn db kLog db mnem_ADD db mnem_SUB db mnem_AND db mnem_OR db mnem_XOR db mnem_CALL db mnem_RET db mnem_LD db mnem_JQ db mnem_CP db mnem_DEC db mnem_SET db mnem_RES db mnem_BIT db mnem_INC db mnem_PUSH db mnem_POP ;;; Dialogs dialogOptionArrowStr: db ' ',Lleft,' ',' ',0 db ' ',' ',Lconvert,0 dialogSoftKeys: db 26, 43, 60, 77 db 1, 4, 0D3h, 16h, 0F2h, 35h db 84, 2, 0DFh, 0DBh db 0 ;;; Popup messages errorTitle: db 3, 0D5h, 88h, 78h successTitle: db 6, 0ECh,0FBh,0F2h,0F2h,039h,090h ;;; Main menu mainScreenText: db 7, 0DDh,04Fh,081h,090h,0CFh,0BEh,0CEh db 10, 0D2h,036h,0F6h,01Fh,084h,060h,0DDh,077h,02Fh,0F0h db 14, 0F3h,057h,0F9h,0F9h,0FBh,09Dh,00Fh,04Fh,081h,045h,0BEh,0F2h,07Fh,080h deathStarBitmap: ;;;SPRITE 16x14x1 db 00000001b,11100000b db 00000110b,00011000b db 00001011b,00011100b db 00010110b,10011110b db 00011100b,10011110b db 00101101b,00011111b db 00100110b,00111111b db 00110000b,00111111b db 00100100b,01111111b db 00010001b,11111110b db 00010000b,11111110b db 00001001b,11111100b db 00000111b,11111000b db 00000001b,11100000b mainMenuInfo: db 3, 64 newProgramLabel: db 8, 0DEh,03Fh,0D0h,0EFh,087h,0F4h,081h,0F8h ; New Program openProgramLabel: db 9, 0DFh,0F9h,036h,00Eh,0F8h,07Fh,048h,01Fh,080h ; Open Program db 3, 0EEh,0FBh,04Ah ; Quit ;;; New Program dialog newProgramDlgInfo: DLG_TEXT progNameLabel, newProgramName + 1, 51h, 8 DLG_OPTION progTypeLabel, newProgramType, progTypeOptions DLG_END progNameLabel: sectionNameLabel: db 4, 0DEh,01Fh,083h,0C5h ; Name: progTypeLabel: sectionTypeLabel: db 6, 0EBh,0FFh,0F9h,03Ch,050h,000h ; Type: progTypeOptions: db 4 db 10, 0DCh,04Fh,018h,018h,0FFh,0BFh,0DFh,0AFh,053h,080h ; Library/Other db 4, 0D1h,09Fh,08Bh,080h ; Asm( db 2, 0D9h,076h ; Ion db 6, 0DDh,048h,01Fh,043h,0DFh,0ECh ; MirageOS db 6, 0D4h,077h,089h,0D3h,0ECh,0C8h ; DoorsCS7 ;;; Section editor sectionEditLabel: db 7, 0EFh,087h,0F4h,081h,0F8h,0C5h,000h ; Program: sectionEditSoftKeys: db 17, 34, 51, 77 db 2, 3, 0D5h,024h,0A0h ; Edit db 21, 2, 0D9h,069h ; Ins db 38, 2, 0D4h,035h ; Del db 80, 3, 0DDh,036h,0FBh ; Menu db 0 sectionEditMenuInfo: db 5, 72 importEditLabel: db 6, 0DCh,04Fh,018h,018h,043h,090h ; Libraries compileProgramLabel: db 11, 0D3h,07Fh,08Fh,094h,053h,00Eh,0F8h,07Fh,048h,01Fh,080h ; Compile Program db 11, 0D1h,08Fh,02Fh,054h,0FCh,030h,0EFh,087h,0F4h,081h,0F8h ; Archive Program db 9, 0D3h,057h,093h,00Eh,0F8h,07Fh,048h,01Fh,080h ; Close Program db 3, 0EEh,0FBh,04Ah ; Quit programArchivedMsg: db 1, 68 db 11, 0EFh,087h,0F4h,081h,0F8h,001h,08Fh,02Fh,054h,0FCh,032h ; Program archived ;;; New Section dialog insertSectionDlgInfo: DLG_TEXT sectionNameLabel, newSectionHeader + SECTHEADER_NAME, 58h, 8 DLG_OPTION sectionTypeLabel, newSectionHeader + SECTHEADER_SECTION_TYPE, sectionTypeOptions DLG_END newSectionLabel: sectionEditEmptyLabel: db 8, 0DEh,03Fh,0D0h,0ECh,03Fh,02Ah,047h,060h ; New Section sectionTypeOptions: db 3 db 4, 0D8h,031h,023h,080h ; Header db 3, 0D3h,072h,030h ; Code db 3, 0D4h,01Ah,010h ; Data db 4, 0D6h,077h,0A3h,080h ; Footer ;;; Compile Program dialog compileProgramDlgInfo: DLG_TEXT progNameLabel, asmOutputFileName + 1, 51h, 8 DLG_OPTION checkCodeSegmentLabel, asmAllowPCBankC, noYesOptions DLG_END checkCodeSegmentLabel: db 13, 0D1h,055h,07Fh,0D0h,0EFh,0D3h,00Ch,010h,0D2h,0D6h,0D6h,0D6h,0C5h ; Allow PC > BFFF: ; outputTypeOptions: ; db 1 ; db 5, 0EFh,087h,0F4h,081h,0F8h ; Program ; db 5, 0D1h,0F9h,0F9h,0E9h,018h ; AppVar noYesOptions: db 1 db 2, 0DEh,070h ; No db 2, 0E6h,039h ; Yes compilationFinishedMsg: db 1, 71 db 12, 0EFh,087h,0F4h,081h,0F8h,00Fh,027h,0F8h,0F9h,045h,032h,0B1h ; Program compiled! overwriteFileTitle: db 7, 0D6h,045h,030h,03Fh,0E4h,09Ah,090h ; File exists overwriteFileMsg: db 1, 65 db 13, 0DFh,0FCh,038h,0FDh,084h,0A3h,0C0h,00Bh,08Eh,06Bh,0FDh,0EBh,090h ; Overwrite? (Y/N) ;;; Assembly editor asmEditSoftKeys: db 15, 32, 52, 77 db 2, 3, 0DCh, 0F1h,050h db 19, 3, 0ECh,0FFh,090h db 35, 3, 0D3h,0F5h,018h db 80, 3, 0D4h,076h,030h db 0 asmEditBuiltinMenuInfo: db 4, 72 db 10, 0ECh,0FFh,09Ah,03Fh,080h,0EDh,07Fh,0BAh,046h,039h ; System Routines db 10, 0ECh,0FFh,09Ah,03Fh,080h,0D1h,022h,083h,099h,039h ; System Addresses db 5, 0D3h,076h,09Ah,016h,0A9h ; Constants db 4, 0D6h,051h,0F4h,090h ; Flags asmEditOperatorMenuInfo: db 3, 54 db 7, 0D1h,084h,0AFh,05Fh,083h,0A4h,0F2h ; Arithmetic db 5, 0D2h,04Ah,0FDh,049h,030h ; Bitwise db 8, 0EBh,039h,0ABh,0FDh,0C7h,0F4h,04Fh,020h ; Test/Logic asmEditArithmeticMenuInfo: db 6, 48 db 0, '+' db 0, '-' db 0, Lcross db 0, '/' db 0, '%' db 0, Lneg asmEditBitwiseMenuInfo: db 8, 48 db 2, 0C3h,0C3h ; << db 2, 0C1h,0C1h ; >> db 0, '&' db 0, '|' db 0, '^' db 0, '~' db 3, 059h,0F1h,0B8h ; lsb( db 4, 0F8h,09Fh,01Bh,080h ; msb( asmEditTestMenuInfo: db 7, 48 db 0, '=' db 0, LNE db 0, '>' db 0, LGE db 0, '<' db 0, LLE db 0, '!' asmEditSpecialCharMenuInfo: db 8, 48 db 0, Lapostrophe db 0, '@' db 0, '#' db 0, '$' db 0, '*' db 0, Lbackslash db 0, Lsemicolon db 0, '?' ;;; Import editor importMenuSoftKeys: db 18, 36, 57, 77 db 3, 2, 0D1h,022h ; Add db 22, 2, 0D4h,035h ; Del db 80, 3, 0D4h,076h,030h ; Done db 0 addLibraryLabel: db 8, 0D1h,022h,00Dh,0C4h,0F1h,081h,08Fh,0F0h ; Add Library