diff --git a/SP_128.ASM b/SP_128.ASM index 117d2df..321f47f 100644 --- a/SP_128.ASM +++ b/SP_128.ASM @@ -691,9 +691,9 @@ CHAR_SET EQU #3D00 DEFW adr ENDM - DEFINE START_PAUSE #0000 + DEFINE START_PAUSE #0001 INCLUDE 'shared_includes/constants/sp2000.inc' - INCLUDE 'inc/char_codes.inc' + INCLUDE 'shared_includes/constants/zx_char_codes.inc' ;[^]..................................................................................................................... SP2000 [^] ; ----------------------- @@ -876,9 +876,9 @@ NMI_POINT: ; BLOCK #6B-$,0 -; ============ -; RAM ROUTINES -; ============ +; ============ +; RAM ROUTINES +; ============ ; The following code will be copied to locations #5B00 to #5B57, within the old ZX Printer buffer. ; ----------------- @@ -922,6 +922,7 @@ NMI_POINT: ; ENT ;SWAP_ROM +RAM_ROUTINES: L006B: PUSH AF ; Save AF and BC. PUSH BC ; LD BC,#7FFD ; @@ -1012,7 +1013,9 @@ L00B5: EX AF,AF' ; Save AF registers. For a read, A holds the byte read OUT (C),A ; Switch back to original paging configuration. EI ; EX AF,AF' ; Restore AF registers. For a read, A holds the byte read and the flags the success status. - RET ; <<< End of RAM Routines >>> + RET +RAM_ROUTINES.Size EQU $-RAM_ROUTINES +;<<<<<<<<<<<<<<<<<<<<<<<<< End of RAM Routines >>>>>>>>>>>>>>>>>>>>>>>>>; ; =============================== @@ -1142,10 +1145,10 @@ L0137: LD B,D ; Complete setting up the sound chip registers. LD A,#FF ; Disable AY-3-8912 sound channels. OUT (C),A ; - LD DE,SWAP_ROM ; #5B00. Copy the various paging routines to the old printer buffer. - LD HL,L006B ; The source is in this ROM. - LD BC,L006B.Size; There are eighty eight bytes to copy. - LDIR ; Copy the block of bytes. + LD DE,SWAP_ROM ; #5B00. Copy the various paging routines to the old printer buffer. + LD HL,RAM_ROUTINES ; The source is in this ROM. + LD BC,RAM_ROUTINES.Size ; There are eighty eight bytes to copy. + LDIR ; Copy the block of bytes. LD A,#CF ; Load A with the code for the Z80 instruction 'RST #08'. LD (RAMRST),A ; #5B5D. Insert into new System Variable RAMRST. @@ -10027,7 +10030,7 @@ L2584: CALL L28BE ; Reset Cursor Position. ; -------------- ; Show Main Menu ; -------------- - + BLOCK #259F-$,#FF; стандартный адрес L259F: LD HL,TSTACK ; #5BFF. LD (OLDSP),HL ; #5B81. @@ -10555,7 +10558,7 @@ L27EB: M_COM: BYTE 6,0 WORD TRDOS BYTE 1 - WORD HARDWARE ;ISDOS + WORD HARDWARE BYTE 2 WORD L286C BYTE 3 @@ -10635,25 +10638,36 @@ L281C: LD HL,#EC0D ; Editor flags. ; JP L1AF1 ; Run the tape loader. L2831: ED_COM: BYTE 10 ; Number of entries. - BYTE #0B ; Key code: Cursor up. + ; + BYTE #0B ; Key code: Cursor up. DEFW L272E ; MENU-UP handler routine. - BYTE #0A ; Key code: Cursor dow + ; + BYTE #0A ; Key code: Cursor down DEFW L2731 ; MENU-DOWN handler routine. - BYTE #0D ; Key code: Enter. + ; + BYTE #0D ; Key code: Enter. DEFW L2717 ; MENU-SELECT handler routine. + ; BYTE '8' ; на синклер-джойстике вниз DEFW L2731 ; MENU-DOWN handler routine. - BYTE '9' ; на синклер-джойстике вверх + ; + BYTE '9' ; на синклер-джойстике вверх DEFW L272E ; MENU-UP handler routine. - BYTE '0' ; на синклер-джойстике enter + ; + ; + BYTE '0' ; на синклер-джойстике enter DEFW L2717 ; MENU-SELECT handler routine. - BYTE '6' ; на синклер-джойстике влево Page Up + ; + BYTE '6' ; на синклер-джойстике влево Page Up DEFW LEFT_E ; MENU-PageUp - BYTE #08 ; Key code: Cursor left + ; + BYTE #08 ; Key code: Cursor left DEFW LEFT ; MENU-PageUp - BYTE '7' ; [x] было 7 + ; + BYTE '7' ; [x] было 7 DEFW RIGHT_E ; MENU-PageDown - BYTE #09 ; Key code: Cursor right + ; + BYTE #09 ; Key code: Cursor right DEFW RIGHT ; MENU-PageDown ; DB #1A ; просто стереть эту строчку, не нужна diff --git a/SP_TRDOS.ASM b/SP_TRDOS.ASM index 2b35ae2..bce2e2f 100644 --- a/SP_TRDOS.ASM +++ b/SP_TRDOS.ASM @@ -3,79 +3,104 @@ ;╟────────────────────────────┴─────────────────────────────╢ ;║ RE-SOURCE'd by Z80MU PROFESSIONAL version 5.2b ║ ;╚══════════════════════════════════════════════════════════╝ +;!TODO использовать внешние порты #E0 и #E3 для сохранения регистров при перехвате всяких #3D2F + +; [ ] boot loader from TR-DOS vROM + DEFINE DEFtrd_boot_small 0 + LUA PASS1 + -- --define + local sjasmplus_run = "sjasmplus --nologo --syntax=f --fullpath --color=on --exp=trdos/boot/boot.inc --lst=Build/boot.lst --raw=Build/boot.bin trdos/boot/boot.asm --define DEFtrd_boot_small=" .. sj.get_define("DEFtrd_boot_small") + compiling_boot = (os.execute(sjasmplus_run)) + if compiling_boot then + print("--[ BOOT Build OK ]--") + else + print("--[ BOOT Build ERROR!!! ]--") + os.exit(1) + end + ENDLUA + + DEVICE ZXSPECTRUM128 ORG 0 ;*************************************** - INCLUDE 'INC/SPRINT00.INC' -;*************************************** -;CNF_PORT EQU #74 -AUTO_4000 EQU 04000H -AUTO_4010 EQU 04010H -AUTO_4011 EQU 04011H -AUTO_4020 EQU 04020H -AUTO_4080 EQU 04080H -AUTO_40E1 EQU 040E1H -AUTO_40E3 EQU 040E3H -AUTO_40E4 EQU 040E4H -AUTO_40E5 EQU 040E5H -AUTO_40F0 EQU 040F0H -AUTO_40F1 EQU 040F1H -AUTO_40FF EQU 040FFH -AUTO_4100 EQU 04100H -AUTO_4101 EQU 04101H -AUTO_4102 EQU 04102H -AUTO_4103 EQU 04103H -AUTO_4110 EQU 04110H -AUTO_4111 EQU 04111H -AUTO_4118 EQU 04118H -AUTO_4119 EQU 04119H -AUTO_411B EQU 0411BH -AUTO_411D EQU 0411DH -AUTO_411E EQU 0411EH -AUTO_4130 EQU 04130H -AUTO_4140 EQU 04140H -AUTO_41FF EQU 041FFH -AUTO_5220 EQU 05220H -AUTO_58E8 EQU 058E8H + INCLUDE 'Shared_Includes/constants/sp2000.inc' + INCLUDE 'inc/rom_routines.inc' + INCLUDE 'Shared_Includes/constants/zx_char_codes.inc' + INCLUDE 'Shared_Includes/constants/BIOS_equ.inc' + INCLUDE 'Shared_Includes/constants/ZX_VARS.inc' + INCLUDE 'Shared_Includes/macroses/macros.z80' + MODULE vROM_Boot + INCLUDE 'trdos/boot/boot.inc' + ENDMODULE -AUTO_5E34 EQU 05E34H -AUTO_5F00 EQU 05F00H -AUTO_5F10 EQU 05F10H -AUTO_5F12 EQU 05F12H -AUTO_6000 EQU 06000H -PORT_128 EQU 07FFDH -AUTO_A1DB EQU 0A1DBH -AUTO_B0ED EQU 0B0EDH -AUTO_B8ED EQU 0B8EDH -AUTO_C000 EQU 0C000H -AUTO_C130 EQU 0C130H -AUTO_C308 EQU 0C308H -AUTO_C916 EQU 0C916H -AUTO_FE15 EQU 0FE15H -AUTO_FF00 EQU 0FF00H -AUTO_FFFF EQU 0FFFFH +TRDOS_ROM_CMD: +.READ_BPB EQU BIOS.HDD_READ_BPB and #BF +.READ EQU BIOS.HDD_READ and #BF +.WRITE EQU BIOS.HDD_WRITE and #BF +;*************************************** + + +;CNF_PORT EQU #74 +AUTO_4000 EQU #4000 +AUTO_4010 EQU #4010 +AUTO_4011 EQU #4011 +AUTO_4020 EQU #4020 +AUTO_4080 EQU #4080 +AUTO_40E1 EQU #40E1 +AUTO_40E3 EQU #40E3 +AUTO_40E4 EQU #40E4 +AUTO_40E5 EQU #40E5 +AUTO_40F0 EQU #40F0 +AUTO_40F1 EQU #40F1 +AUTO_40FF EQU #40FF +AUTO_4100 EQU #4100 +AUTO_4101 EQU #4101 +AUTO_4102 EQU #4102 +AUTO_4103 EQU #4103 +AUTO_4110 EQU #4110 +AUTO_4111 EQU #4111 +AUTO_4118 EQU #4118 +AUTO_4119 EQU #4119 +AUTO_411B EQU #411B +AUTO_411D EQU #411D +AUTO_411E EQU #411E +AUTO_4130 EQU #4130 +AUTO_4140 EQU #4140 +AUTO_41FF EQU #41FF + +AUTO_5E34 EQU #5E34 +AUTO_5F00 EQU #5F00 +AUTO_5F10 EQU #5F10 +AUTO_5F12 EQU #5F12 +PORT_128 EQU #7FFD +AUTO_A1DB EQU #A1DB +AUTO_B0ED EQU #B0ED +AUTO_C000 EQU #C000 +AUTO_C130 EQU #C130 ;**************************************** - - DISPLAY "Start." -START: - DI - LD DE,0FFFFh +START: DI + LD DE,#FFFF LD A,7 JR CONT_1 -RST08: - NOP -CONT_1: - OUT (0FEH),A +RST08: NOP +CONT_1: OUT (#FE),A LD A,'?' JR CONT_2 - NOP + +//////////////////////////////////////////////////////////////////////// + _mInfoBLOCK #10-$,0 RST10: JP PRINT_SYM +//////////////////////////////////////////////////////////////////////// + CONT_2: LD I,A JP CONT_3 + +//////////////////////////////////////////////////////////////////////// + _mInfoBLOCK #18-$,0 PRINT_LN: JP PRINT_L CONT_3: @@ -84,32 +109,39 @@ CONT_3: NOP AUTO_001E: JR CONT_4 + +//////////////////////////////////////////////////////////////////////// + _mInfoBLOCK #20-$,0 RST20: JP RST20_EXE RET +//////////////////////////////////////////////////////////////////////// + CONT_4: LD H,D LD L,E JR CONT_5 + +//////////////////////////////////////////////////////////////////////// + _mInfoBLOCK #28-$,0 RST28: JP RST28_EXE +//////////////////////////////////////////////////////////////////////// + CONT_5: LD (HL),2 DEC HL CP H JR NZ,CONT_5 JR CONT_6 + +//////////////////////////////////////////////////////////////////////// REDIR_RST38: + _mInfoBLOCK #38-$,#FF ; JP RST38X ; EI ; RET - RST 38H - RST 38H - RST 38H - RST 38H - RST 38H -R38: - EI +R38: EI RET CONT_6: OR A @@ -123,26 +155,31 @@ CONT_6: JR Z,CONT_6 CONT_7: DEC HL - LD (P_RAMTOP),HL - LD DE,3EAFh - LD BC,00A8h + LD (ZX_VARS.P_RAMTOP),HL + LD DE,#3EAF + LD BC,#00A8 LD A,E EX DE,HL - LD SP,6000h + LD SP,#6000 LD (AUTO_5F00),HL LD HL,RET_1 PUSH HL - LD HL,3D2Fh + LD HL,#3D2F PUSH HL - LD HL,0B8EDh + LD HL,#B8ED ;код команды LDDR AUTO_0064: JR CONT_8 +//////////////////////////////////////////////////////////////////////// + +//////////////////////////////////////////////////////////////////////// + _mInfoBLOCK #66-$,0 ;********** MAGIC *********** ; JP MAGIC_1 ;AUTO_2A56 RETN NOP -;********************************* +//////////////////////////////////////////////////////////////////////// + CONT_8: LD (AUTO_5F10),HL PUSH AF @@ -154,73 +191,70 @@ CONT_8: RET_1: EX DE,HL INC HL - LD (UDG),HL + LD (ZX_VARS.UDG),HL DEC HL - LD BC,AUTO_0540 - LD (ERR_BEEP),BC - LD (TOP_CLEAR),HL - LD HL,03C00h - LD (ZG),HL - LD HL,(TOP_CLEAR) + LD BC,AUTO_0540 ;!FIXIT check disasm + LD (ZX_VARS.ERR_BEEP),BC + LD (ZX_VARS.TOP_CLEAR),HL + LD HL,#3C00 + LD (ZX_VARS.ZG),HL + LD HL,(ZX_VARS.TOP_CLEAR) LD (HL),'>' DEC HL LD SP,HL DEC HL DEC HL - LD (ERR_SP),HL + LD (ZX_VARS.ERR_SP),HL LD DE,01303h PUSH DE IM 1 - LD IY,ERR_NR - LD HL,BEG_ADRESS + LD IY,ZX_VARS.ERR_NR + LD HL,ZX_VARS.BEG_ADRESS AUTO_00A8: - LD (CHANS),HL - LD DE,AUTO_15AF - LD BC,15h + LD (ZX_VARS.CHANS),HL + LD DE,#15AF ;!HARDCODE адрес области описателей каналов в ПЗУ бейсика + LD BC,#15 EX DE,HL CALL AUTO_0117 EX DE,HL DEC HL - LD (DATA_ADR),HL + LD (ZX_VARS.DATA_ADR),HL INC HL - LD (BAS_PROG),HL - LD (BAS_VARS),HL + LD (ZX_VARS.BAS_PROG),HL + LD (ZX_VARS.BAS_VARS),HL LD (HL),128 INC HL - LD (E_LINE),HL - DB 54 -AUTO_00C8: - DEC C + LD (ZX_VARS.E_LINE),HL + LD (HL),"\r" INC HL LD (HL),128 INC HL - LD (WORK_SP),HL - LD (STK_BOT),HL - LD (STK_END),HL + LD (ZX_VARS.WORK_SPACE),HL + LD (ZX_VARS.STK_BOT),HL + LD (ZX_VARS.STK_END),HL LD A,'8' - LD (ATTR_P),A - LD (ATTR_T),A - LD (BORDER),A + LD (ZX_VARS.ATTR_P),A + LD (ZX_VARS.ATTR_T),A + LD (ZX_VARS.BORDER),A LD HL,0223h - LD (KEY_TIME),HL + LD (ZX_VARS.KEY_TIME),HL DEC (IY-58) DEC (IY-54) - LD HL,015C6h - LD DE,REP_K_TYME + LD HL,#15C6 + LD DE,ZX_VARS.REP_K_TYME LD BC,14 CALL AUTO_0117 SET 1,(IY+1) - LD HL,RET_INS + LD HL,ZX_VARS.RET_INS AUTO_0100: LD (HL),201 - RST RST20 - DW 00EDFH - LD HL,L_SCR_SIZE + RST_ROM BASIC_FN.x48.clear_prb + LD HL,ZX_VARS.SCR_SIZE LD (HL),2 LD HL,AUTO_128B PUSH HL LD A,170 - LD (PR_BUFER),A + LD (ZX_VARS.PRINTER_BUFFER),A EI JP AUTO_3D31 AUTO_0117: @@ -235,7 +269,7 @@ AUTO_0124: AUTO_012A: CALL AUTO_20E5 CALL AUTO_1D97 - LD HL,(E_LINE) + LD HL,(ZX_VARS.E_LINE) INC HL LD E,(HL) INC HL @@ -245,51 +279,49 @@ AUTO_012A: EX DE,HL JR Z,AUTO_0140 XOR A - LD (ERR_3D00),A + LD (ZX_VARS.ERR_3D00),A AUTO_0140: PUSH HL CALL AUTO_0232 POP HL - LD (NEW_PPC),HL + LD (ZX_VARS.NEW_PPC),HL XOR A - LD (NEW_S_PPC),A - RST RST20 - DW 016B0H - LD HL,(BAS_PROG) + LD (ZX_VARS.NEW_S_PPC),A + RST_ROM BASIC_FN.x48.set_min + LD HL,(ZX_VARS.BAS_PROG) DEC HL - LD (DATA_ADR),HL - LD SP,(ERR_SP) - LD A,(ERR_3D00) + LD (ZX_VARS.DATA_ADR),HL + LD SP,(ZX_VARS.ERR_SP) + LD A,(ZX_VARS.ERR_3D00) OR A LD HL,AUTO_1B76 JR Z,AUTO_0166 - RST RST20 - DW 01BB0H + RST_ROM BASIC_FN.x48.report_0 AUTO_0166: PUSH HL - LD HL,RET_INS + LD HL,ZX_VARS.RET_INS PUSH HL RET AUTO_016C: ; вход через 3D03 CALL xchg_intf1 CALL BUFER_ON LD A,255 - LD (MSG_FLAG),A + LD (ZX_VARS.MSG_FLAG),A XOR A - LD (DOS_FLAG),A + LD (ZX_VARS.DOS_FLAG),A LD A,170 - LD (FLAG_BOOT),A + LD (ZX_VARS.FLAG_BOOT),A LD HL,AUTO_0201 - LD (ADR_RET),HL + LD (ZX_VARS.ADR_RET),HL LD HL,0 ADD HL,SP - LD (DOS_SP),HL + LD (ZX_VARS.DOS_SP),HL DEC HL DEC HL LD SP,HL CALL AUTO_021D - LD HL,(TOP_CLEAR) - LD DE,(CH_ADR) + LD HL,(ZX_VARS.TOP_CLEAR) + LD DE,(ZX_VARS.CH_ADR) SBC HL,DE EX DE,HL JR NC,AUTO_01A5 @@ -297,7 +329,7 @@ AUTO_016C: ; LD DE,101h SBC HL,DE AUTO_01A5: - LD (CH_ADR),HL + LD (ZX_VARS.CH_ADR),HL AUTO_01A8: CALL AUTO_01C7 AUTO_01AB: @@ -311,7 +343,7 @@ AUTO_01AB: JP NZ,AUTO_01D3 INC HL CALL AUTO_3048 ; convert words - LD HL,(ADR_DOS_COM) + LD HL,(ZX_VARS.ADR_DOS_COM) JP AUTO_030A AUTO_01C7: LD A,(HL) @@ -324,12 +356,12 @@ AUTO_01C7: CALL AUTO_1E43 AUTO_01D3: LD HL,0 - LD (DISK_1_FLG),HL + LD (ZX_VARS.DISK_1_FLG),HL CALL AUTO_20E5 CALL AUTO_1D63 - LD HL,FLAG_BOOT + LD HL,ZX_VARS.FLAG_BOOT LD (HL),170 - LD HL,FL_NUMBER+1 + LD HL,ZX_VARS.FL_NUMBER+1 LD A,(HL) OR A LD (HL),0 @@ -337,9 +369,9 @@ AUTO_01D3: CALL AUTO_1E1C CALL AUTO_0212 AUTO_01F3: - LD SP,(DOS_SP) - LD HL,(ADR_RET) - LD BC,(DOS_ERR_2) + LD SP,(ZX_VARS.DOS_SP) + LD HL,(ZX_VARS.ADR_RET) + LD BC,(ZX_VARS.DOS_ERR_2) LD B,0 AUTO_0200: JP (HL) @@ -347,8 +379,8 @@ AUTO_0201: CALL AUTO_0232 BIT 7,(IY+0) RET NZ - LD DE,RET_INS - LD SP,(ERR_SP) + LD DE,ZX_VARS.RET_INS + LD SP,(ZX_VARS.ERR_SP) PUSH DE RET AUTO_0212: @@ -358,35 +390,35 @@ AUTO_0212: CALL BASIC_RST20 JR AUTO_0212 AUTO_021D: - LD HL,(ERR_SP) - LD (ERR_SP_COPY),HL - LD HL,(DOS_SP) + LD HL,(ZX_VARS.ERR_SP) + LD (ZX_VARS.ERR_SP_COPY),HL + LD HL,(ZX_VARS.DOS_SP) DEC HL DEC HL - LD (ERR_SP),HL + LD (ZX_VARS.ERR_SP),HL LD DE,AUTO_3D16 LD (HL),E INC HL LD (HL),D RET AUTO_0232: - LD HL,(ERR_SP_COPY) - LD (ERR_SP),HL + LD HL,(ZX_VARS.ERR_SP_COPY) + LD (ZX_VARS.ERR_SP),HL RET AUTO_0239: ; вход через 3D00 LD HL,0 - LD (DOS_FLAG),HL + LD (ZX_VARS.DOS_FLAG),HL ADD HL,SP - LD (DOS_SP),HL + LD (ZX_VARS.DOS_SP),HL DEC HL DEC HL LD SP,HL CALL LOAD_CR - LD HL,FLAG_BOOT + LD HL,ZX_VARS.FLAG_BOOT LD A,(HL) CP 170 LD A,0 - LD (DOS_ERR_2),A + LD (ZX_VARS.DOS_ERR_2),A JP Z,AUTO_02CB LD (HL),170 CALL AUTO_1D97 @@ -394,22 +426,22 @@ AUTO_0239: ; LD HL,NEW_NAME RST PRINT_LN CALL INIT_2X80 - LD A,(BEG_ADRESS) + LD A,(ZX_VARS.BEG_ADRESS) CP 244 JR Z,AUTO_0271 LD HL,AUTO_1000 -AUTO_0270: +;AUTO_0270: RST PRINT_LN AUTO_0271: - LD A,(PR_BUFER) + LD A,(ZX_VARS.PRINTER_BUFFER) CP 170 JR NZ,AUTO_02CB CALL xchg_intf1 AUTO_027B: - LD HL,(E_LINE) + LD HL,(ZX_VARS.E_LINE) LD A,254 AUTO_0280: - LD (BAS_DOS_FLG),A + LD (ZX_VARS.BAS_DOS_FLG),A LD (HL),247 INC HL LD (HL),'"' @@ -424,15 +456,15 @@ AUTO_0280: INC HL LD (HL),'"' INC HL -CMD_NEW_EXEC: - LD (K_CUR),HL +CMD_NEW_EXEC:;!TODO + LD (ZX_VARS.K_CUR),HL LD (HL),13 INC HL LD (HL),128 INC HL - LD (WORK_SP),HL - LD (STK_BOT),HL - LD (STK_END),HL + LD (ZX_VARS.WORK_SPACE),HL + LD (ZX_VARS.STK_BOT),HL + LD (ZX_VARS.STK_END),HL SET 3,(IY+1) JR AUTO_02EF AUTO_02B0: @@ -449,7 +481,7 @@ AUTO_02B9: AUTO_02BB: PUSH BC XOR 8 - OUT (P_DOS_FF),A + OUT (FDC_93.DrvCTRL),A PUSH AF LD A,5 CALL pause_1ms @@ -458,33 +490,33 @@ AUTO_02BB: DJNZ AUTO_02BB RET AUTO_02CB: - LD HL,(DOS_SP) + LD HL,(ZX_VARS.DOS_SP) DEC HL DEC HL LD SP,HL CALL xchg_intf1 CALL OPEN_CH0 - LD A,(PDOS_COPY) + LD A,(ZX_VARS.PDOS_COPY) OR 3 CALL AUTO_02B9 - LD A,(PDOS_COPY) + LD A,(ZX_VARS.PDOS_COPY) CALL AUTO_02B9 XOR A - LD (MSG_FLAG),A + LD (ZX_VARS.MSG_FLAG),A CALL INPUT_LINE CALL AUTO_3032 ; ПРЕОБРАЗОВАНИЕ СТРОКИ AUTO_02EF: CALL AUTO_1D9F ; ФУНКЦИЯ BASIC ??? ( CLS LOW SCR ) LD HL,AUTO_02CB - LD (ADR_RET),HL + LD (ZX_VARS.ADR_RET),HL XOR A - LD (DOS_ERR_2),A - LD HL,(E_LINE) + LD (ZX_VARS.DOS_ERR_2),A + LD HL,(ZX_VARS.E_LINE) PUSH HL - LD DE,COM_LN_COPY + LD DE,ZX_VARS.COM_LN_COPY CALL AUTO_02B0 POP HL - LD (ADR_DOS_COM),HL + LD (ZX_VARS.ADR_DOS_COM),HL AUTO_030A: LD A,(HL) LD B,A @@ -494,16 +526,16 @@ AUTO_030A: CP 254 ; RETURN JR Z,AUTO_031A PUSH AF - CALL AUTO_3DC8 ; SET CONT_DISK + CALL AUTO_3DC8 ; SET ZX_VARS.CONT_DISK POP AF AUTO_031A: - LD HL,AUTO_2FF3 ; СПИСОК КОМАНД + LD HL,TRDOS_CMD.LIST ; СПИСОК КОМАНД DEC HL LD C,0 AUTO_0320: INC C LD D,A - LD A,22 ; 21 !!! Add new comand !! + LD A,TRDOS_CMD.LIST.Size CP C JP C,AUTO_01D3 ; ЕСЛИ НЕ НАЙДЕНО-ВЫЙТИ LD A,D @@ -513,15 +545,15 @@ AUTO_0320: CP 254 CALL NZ,BUFER_ON ; Включить буфер, если не RETURN LD A,9 - LD (S_NAME_NUM),A + LD (ZX_VARS.S_NAME_NUM),A XOR A - LD (DOS_ERR_2),A - LD (DOS_ERROR),A - LD (ERR_3D00),A - LD HL,FLAGS + LD (ZX_VARS.DOS_ERR_2),A + LD (ZX_VARS.DOS_ERROR),A + LD (ZX_VARS.ERR_3D00),A + LD HL,ZX_VARS.FLAGS RES 7,(HL) LD B,0 - LD HL,AUTO_3008 + LD HL,TRDOS_CMD.TABLE DEC C SLA C ADD HL,BC @@ -534,38 +566,104 @@ AUTO_0320: PUSH DE JP (HL) AUTO_0359: - LD HL,FLAGS + LD HL,ZX_VARS.FLAGS SET 7,(HL) POP HL JP (HL) -NAME_TRD: - DB 127," 1986 Technology Research. " - DB "version 5.05 by Makarchenco Ivan. " - DB " ",0,0 + + + +; [x] 13/06/2025 boot loader from TR-DOS vROM +;███████████████████████████████████████████████████████████████████████ +; PREPARE_TO_vROM_BOOT: +; LD A,(ZX_VARS.RUN_AUTO_BOOT) +; AND A ; признак попытки запуска boot командой RUN без параметров +; JP Z,AUTO_03D9 +; ; +; DI +; JP vROM_BOOT + +vROM_BOOT: LD HL,(ZX_VARS.ADR_RET) + LD (ZX_VARS.FL_START),HL ; временно сохраняем ADR_RET + LD HL,vROM_BOOT.continue ; адрес возврата из AUTO_01D3 + LD (ZX_VARS.ADR_RET),HL + JP AUTO_01D3 + ; +;vROM_BOOT: +.continue: LD HL,(ZX_VARS.FL_START) + LD (ZX_VARS.ADR_RET),HL ; восстанавливаем ADR_RET + ; + IF DEFtrd_boot_small + LD HL,BOOT_PART_1.SIZE + BOOT_PART_2.SIZE + ELSE + LD HL,BOOT_PART_1.SIZE + BOOT_PART_2.SIZE + BOOT_PART_3.SIZE + ENDIF + LD (ZX_VARS.FL_START),HL ; длина программы с переменными. + LD (ZX_VARS.FL_LEN),HL ; длина программы с переменными. + ; + CALL AUTO_1A01 ; Подготовка к загрузке программы на бейсике. + ; + LD HL,.LoadAddr + LD (ZX_VARS.BAS_PROG),HL ; адрес начала программы на бейсике. + ; loading + LD HL,BOOT_PART_1 + LD DE,.LoadAddr + LD BC,BOOT_PART_1.SIZE + LDIR + LD HL,BOOT_PART_2 + LD BC,BOOT_PART_2.SIZE + LDIR + IFN DEFtrd_boot_small + LD HL,BOOT_PART_3 + LD BC,BOOT_PART_3.SIZE + LDIR + ENDIF + + LD HL,vROM_Boot.StartLineNum + LD (ZX_VARS.E_LINE),HL + ; + EI + JP AUTO_012A + ; +.LoadAddr EQU vROM_Boot.org_addr ;#5D3B +.StartAddr EQU vROM_Boot.org_addr ;#5D3B +;███████████████████████████████████████████████████████████████████████ + +;----------------------------------------------------------------------- + _mInfoBLOCK #03AC-$,#FF +; NAME_TRD: +; DB 127," 1986 Technology Research. " +; DB "version 5.05 by Makarchenco Ivan. " +; DB " ",0,0 +;----------------------------------------------------------------------- + + + AUTO_03AC: CALL AUTO_03FD CALL PRINT_CR CALL PRINT_CR AUTO_03B5: - LD BC,(FREE_SEC) + LD BC,(ZX_VARS.FREE_SEC) CALL AUTO_1DA9 LD HL,AUTO_29D2 RST PRINT_LN -AUTO_03C0: +;AUTO_03C0: JP AUTO_01D3 AUTO_03C3: PUSH AF - LD A,(BAS_DOS_FLG) + LD A,(ZX_VARS.BAS_DOS_FLG) CP 254 JR NZ,AUTO_03CD POP AF RET AUTO_03CD: POP AF - LD (DOS_ERR_2),A - LD A,(MSG_FLAG) + LD (ZX_VARS.DOS_ERR_2),A + LD A,(ZX_VARS.MSG_FLAG) OR A CALL Z,PRINT_L +;!FIXIT Ошибка!!! Перед печатью надо открыть поток 0 и очистить низ экрана. RET AUTO_03D9: LD HL,AUTO_2A28 @@ -578,13 +676,13 @@ AUTO_03E4: JP AUTO_1C4A AUTO_03E8: XOR A - LD (CAT_SEC),A + LD (ZX_VARS.CAT_SEC),A AUTO_03EC: - LD DE,(CAT_SEC) + LD DE,(ZX_VARS.CAT_SEC) LD D,0 AUTO_03F2: CALL BUFER_ON - LD HL,BUFER + LD HL,ZX_VARS.BUFFER LD B,1 JP READ_DISK AUTO_03FD: @@ -593,17 +691,24 @@ AUTO_03FD: JR AUTO_03F2 RD_HEAD_DSK: CALL AUTO_03FD - LD A,(CODE_10H) + LD A,(ZX_VARS.CODE_10H) CP 16 JR Z,AUTO_0415 - LD HL,DISK_ERROR_MSG - RST PRINT_LN - JR AUTO_03C0 + ;!TEST + ; Неправильно обрабатывалась ошибка. Программа не получала код + ; ошибки, а внизу экрана совершенно не к месту появлялся DISK ERROR. + ;LD HL,DISK_ERROR_MSG + ;RST PRINT_LN + ;JR AUTO_03C0 + LD HL,DISK_ERROR_MSG + JP RD_HEAD_DSK.FIXED + ; + AUTO_0415: CALL get_disk_type RES 0,(HL) RES 1,(HL) - LD A,(TYPE_DISK) + LD A,(ZX_VARS.TYPE_DISK) BIT 0,A JR NZ,AUTO_0425 SET 0,(HL) @@ -613,7 +718,7 @@ AUTO_0425: SET 1,(HL) RET TEST_CR: - LD HL,(ADR_DOS_COM) + LD HL,(ZX_VARS.ADR_DOS_COM) INC HL LD A,(HL) CP 13 @@ -624,12 +729,12 @@ TEST_CR: CMD_CAT: CALL TEST_CR LD BC,2 - LD (MED_LEN),BC + LD (ZX_VARS.MED_LEN),BC JR Z,AUTO_046A CP '#' JR NZ,AUTO_045D - LD (CH_ADR),HL ; КАНАЛ ДЛЯ CAT + LD (ZX_VARS.CH_ADR),HL ; КАНАЛ ДЛЯ CAT CALL AUTO_1E0B CALL AUTO_1D8C CP 13 @@ -649,27 +754,30 @@ AUTO_0460: CALL SET_DRIVE AUTO_046A: CALL SINTAX_RET - LD A,(OPER_DISK) - LD (DISK_2_FLG),A + LD A,(ZX_VARS.OPER_DISK) + LD (ZX_VARS.DISK_2_FLG),A CALL RD_HEAD_DSK - LD A,(MED_LEN) + LD A,(ZX_VARS.MED_LEN) AUTO_0479: CP 2 PUSH AF CALL Z,AUTO_1D97 POP AF - CP 17 - JP NC,CMD_ERROR + ;!TEST + ;CP 17 + CP #10 + ; + JP NC,CMD_ERROR CALL AUTO_1D84 LD A,255 - LD (DISK_1_FLG),A + LD (ZX_VARS.DISK_1_FLG),A LD HL,AUTO_29F7 RST PRINT_LN - LD HL,DISK_NAME + LD HL,ZX_VARS.DISK_NAME RST PRINT_LN CALL PRINT_CR - LD A,(N_FILES) - LD HL,N_DEL_FL + LD A,(ZX_VARS.N_FILES) + LD HL,ZX_VARS.N_DEL_FL SUB (HL) PUSH HL CALL AUTO_1DA3 @@ -681,11 +789,11 @@ AUTO_0479: LD HL,AUTO_2A1D RST PRINT_LN CALL AUTO_03E8 - LD HL,BUFER + LD HL,ZX_VARS.BUFFER AUTO_04B6: CALL AUTO_04F6 CALL PRINT_CR - LD A,(OPER_DISK) + LD A,(ZX_VARS.OPER_DISK) ADD A,'A' RST RST10 LD B,2 @@ -726,8 +834,8 @@ AUTO_04E8: AUTO_04F6: PUSH HL PUSH BC - LD A,(DISK_2_FLG) - LD HL,OPER_DISK + LD A,(ZX_VARS.DISK_2_FLG) + LD HL,ZX_VARS.OPER_DISK CP (HL) CALL NZ,SET_DISK POP BC @@ -737,6 +845,7 @@ AUTO_0507: LD DE,RST10 ADD HL,DE RET + AUTO_050C: PUSH HL PUSH BC @@ -746,13 +855,14 @@ AUTO_050C: POP BC POP HL RET + AUTO_0517: - LD HL,CAT_SEC + LD HL,ZX_VARS.CAT_SEC INC (HL) CALL AUTO_03EC POP BC POP HL - LD HL,BUFER + LD HL,ZX_VARS.BUFFER RET GET_DISK: AND 223 @@ -776,15 +886,15 @@ CMD_NEW: AUTO_0540: CALL AUTO_102E CALL AUTO_1CB0 - LD A,(OPER_DISK) - LD (DISK_1_FLG),A + LD A,(ZX_VARS.OPER_DISK) + LD (ZX_VARS.DISK_1_FLG),A JP NZ,AUTO_03D9 PUSH BC CALL AUTO_165D CALL AUTO_1CB0 PUSH AF - LD A,(DISK_1_FLG) - LD HL,OPER_DISK + LD A,(ZX_VARS.DISK_1_FLG) + LD HL,ZX_VARS.OPER_DISK CP (HL) JP NZ,CMD_ERROR CALL RD_HEAD_DSK @@ -796,23 +906,23 @@ AUTO_0569: CALL AUTO_1E43 JP AUTO_03E1 AUTO_0572: - LD A,(ERR_3D00) + LD A,(ZX_VARS.ERR_3D00) OR A RET AUTO_0577: - LD A,(N_DEL_FLS) + LD A,(ZX_VARS.N_DEL_FLS) OR A JP Z,AUTO_03D9 JP AUTO_03E1 AUTO_0581: PUSH BC CALL AUTO_1D97 - LD A,(OPER_DISK) + LD A,(ZX_VARS.OPER_DISK) ADD A,'A' CALL PRINT_SYM LD A,':' CALL PRINT_SYM - LD HL,FL_NAME + LD HL,ZX_VARS.FL_NAME CALL AUTO_2938 LD HL,AUTO_2820 CALL PRINT_L @@ -830,54 +940,56 @@ AUTO_0581: XOR A RET AUTO_05B4: - LD A,(FL_TYPE) + LD A,(ZX_VARS.FL_TYPE) CP '#' JR Z,AUTO_05BD XOR A RET AUTO_05BD: LD A,10 - LD (S_NAME_NUM),A + LD (ZX_VARS.S_NAME_NUM),A CALL AUTO_1CB3 LD A,9 - LD (S_NAME_NUM),A + LD (ZX_VARS.S_NAME_NUM),A RET AUTO_05CB: - LD A,(FL_NAME) + LD A,(ZX_VARS.FL_NAME) CP '*' - JP NZ,AUTO_03D9 - CALL BAS_2BF1 + ;JP NZ,AUTO_03D9 + JR Z,.next + RET +.next: CALL BAS_2BF1 EX DE,HL CALL SET_DRIVE LD A,(HL) CP '*' JP NZ,CMD_ERROR - LD A,(OPER_DISK) - LD (DISK_2_FLG),A - LD A,(DISK_2_FLG) + LD A,(ZX_VARS.OPER_DISK) + LD (ZX_VARS.DISK_2_FLG),A + LD A,(ZX_VARS.DISK_2_FLG) CALL SET_DISK CALL RD_HEAD_DSK LD A,255 - LD (BUF_FLAG+1),A + LD (ZX_VARS.BUF_FLAG+1),A AUTO_05F4: - LD A,(DISK_1_FLG) + LD A,(ZX_VARS.DISK_1_FLG) CALL SET_DISK CALL RD_HEAD_DSK - LD A,(BUF_FLAG+1) + LD A,(ZX_VARS.BUF_FLAG+1) INC A - LD (BUF_FLAG+1),A + LD (ZX_VARS.BUF_FLAG+1),A LD C,A CALL AUTO_165D - LD A,(FL_NAME) + LD A,(ZX_VARS.FL_NAME) CP 0 JP Z,AUTO_03E1 CP 1 JR Z,AUTO_05F4 - LD HL,FL_START - LD DE,VAR_2 - LD BC,START+7 + LD HL,ZX_VARS.FL_START + LD DE,ZX_VARS.VAR_2 + LD BC,7 LDIR - LD A,(DISK_2_FLG) + LD A,(ZX_VARS.DISK_2_FLG) CALL SET_DISK CALL AUTO_1CB3 JR NZ,AUTO_0634 @@ -891,36 +1003,36 @@ AUTO_0634: JR AUTO_05F4 AUTO_063C: CALL AUTO_03FD - LD A,(N_FILES) + LD A,(ZX_VARS.N_FILES) CP 128 - JP Z,AUTO_1C45 - LD HL,VAR_2 - LD DE,FL_START - LD BC,START+7 + JP Z,AUTO_2723 + LD HL,ZX_VARS.VAR_2 + LD DE,ZX_VARS.FL_START + LD BC,7 LDIR - LD DE,(FL_SIZE) + LD DE,(ZX_VARS.FL_SIZE) LD D,0 OR A - LD HL,(FREE_SEC) + LD HL,(ZX_VARS.FREE_SEC) SBC HL,DE JP C,AUTO_1C45 - LD (FREE_SEC),HL - LD HL,(CLEAR_SEC) - LD (FL_PLACE),HL + LD (ZX_VARS.FREE_SEC),HL + LD HL,(ZX_VARS.CLEAR_SEC) + LD (ZX_VARS.FL_PLACE),HL PUSH HL CALL AUTO_072F POP HL - LD (FL_PLACE),HL - LD HL,(CONT_SEC) - LD (CLEAR_SEC),HL - LD HL,N_FILES + LD (ZX_VARS.FL_PLACE),HL + LD HL,(ZX_VARS.CONT_SEC) + LD (ZX_VARS.CLEAR_SEC),HL + LD HL,ZX_VARS.N_FILES INC (HL) LD C,(HL) DEC C LD B,0 PUSH BC LD DE,CONT_1 - LD (CONT_SEC),DE + LD (ZX_VARS.CONT_SEC),DE CALL AUTO_1E43 POP BC CALL AUTO_166B @@ -929,7 +1041,7 @@ AUTO_063C: ; ; CMD_COPY: - LD HL,(ADR_DOS_COM) + LD HL,(ZX_VARS.ADR_DOS_COM) INC HL LD A,(HL) AND 223 @@ -942,23 +1054,27 @@ CMD_COPY: CALL AUTO_166F CALL AUTO_102E CALL AUTO_1CB0 - LD A,(OPER_DISK) - LD (DISK_1_FLG),A - JP NZ,AUTO_05CB + LD A,(ZX_VARS.OPER_DISK) + LD (ZX_VARS.DISK_1_FLG),A + ;!TEST Ошибка!!! COPY "*","*" надо проверять всегда, иначе при + ; наличии на диске файла с именем "*" скопируется только этот файл + ;JP NZ,AUTO_05CB + CALL CMD_COPY.FIXED + ; CALL AUTO_165D - LD HL,FL_START - LD DE,VAR_2 - LD BC,START+7 + LD HL,ZX_VARS.FL_START + LD DE,ZX_VARS.VAR_2 + LD BC,7 LDIR CALL AUTO_1CB0 PUSH AF PUSH BC - LD A,(OPER_DISK) - LD (DISK_2_FLG),A - LD A,(DISK_1_FLG) + LD A,(ZX_VARS.OPER_DISK) + LD (ZX_VARS.DISK_2_FLG),A + LD A,(ZX_VARS.DISK_1_FLG) CALL SET_DISK CALL RD_HEAD_DSK - LD A,(DISK_2_FLG) + LD A,(ZX_VARS.DISK_2_FLG) CALL SET_DISK CALL RD_HEAD_DSK POP BC @@ -971,72 +1087,72 @@ CMD_COPY: AUTO_06F3: CALL AUTO_063C CALL AUTO_1E43 - LD A,(FL_TYPE) + LD A,(ZX_VARS.FL_TYPE) CP '#' JP NZ,AUTO_03E1 LD A,10 - LD (S_NAME_NUM),A - LD HL,FL_START + LD (ZX_VARS.S_NAME_NUM),A + LD HL,ZX_VARS.FL_START INC (HL) - LD A,(DISK_1_FLG) + LD A,(ZX_VARS.DISK_1_FLG) CALL SET_DISK CALL AUTO_05B4 JP NZ,AUTO_03E1 -AUTO_0716: +;AUTO_0716: CALL AUTO_165D - LD HL,FL_START - LD DE,VAR_2 - LD BC,START+7 + LD HL,ZX_VARS.FL_START + LD DE,ZX_VARS.VAR_2 + LD BC,7 LDIR - LD A,(DISK_2_FLG) + LD A,(ZX_VARS.DISK_2_FLG) CALL SET_DISK CALL RD_HEAD_DSK JR AUTO_06F3 AUTO_072F: - LD A,(VAR_2_0) + LD A,(ZX_VARS.VAR_2_0) OR A RET Z PUSH HL - LD HL,L_5D23 + LD HL,ZX_VARS.WORK_SPACE.Size SUB (HL) POP HL JR NC,AUTO_0775 - LD A,(VAR_2_0) + LD A,(ZX_VARS.VAR_2_0) LD B,A XOR A - LD (VAR_2_0),A + LD (ZX_VARS.VAR_2_0),A AUTO_0744: PUSH BC - LD A,(DISK_1_FLG) + LD A,(ZX_VARS.DISK_1_FLG) CALL SET_DISK POP BC PUSH BC - LD HL,(VAR_1) + LD HL,(ZX_VARS.VAR_1) PUSH HL - LD DE,(VAR_2_1) + LD DE,(ZX_VARS.VAR_2_1) CALL READ_DISK - LD HL,(CONT_SEC) - LD (VAR_2_1),HL - LD A,(DISK_2_FLG) + LD HL,(ZX_VARS.CONT_SEC) + LD (ZX_VARS.VAR_2_1),HL + LD A,(ZX_VARS.DISK_2_FLG) CALL SET_DISK POP HL POP BC - LD DE,(FL_PLACE) + LD DE,(ZX_VARS.FL_PLACE) CALL WRITE_DISK - LD HL,(CONT_SEC) - LD (FL_PLACE),HL + LD HL,(ZX_VARS.CONT_SEC) + LD (ZX_VARS.FL_PLACE),HL JR AUTO_072F AUTO_0775: - LD (VAR_2_0),A + LD (ZX_VARS.VAR_2_0),A PUSH HL - LD HL,L_5D23 + LD HL,ZX_VARS.WORK_SPACE.Size LD B,(HL) POP HL XOR A JR AUTO_0744 AUTO_0781: XOR A - LD (N_DEL_FLS),A + LD (ZX_VARS.N_DEL_FLS),A JR AUTO_07A0 ; ; @@ -1046,31 +1162,31 @@ CMD_ERASE: CALL SINTAX_RET CALL AUTO_102E XOR A - LD (N_DEL_FLS),A + LD (ZX_VARS.N_DEL_FLS),A CALL AUTO_292F CALL AUTO_07A0 JP NZ,AUTO_0577 JP AUTO_03E1 AUTO_07A0: - LD A,(FL_NAME) - LD (FST_SYM_NAME),A + LD A,(ZX_VARS.FL_NAME) + LD (ZX_VARS.FST_SYM_NAME),A RET NZ - LD HL,N_DEL_FLS + LD HL,ZX_VARS.N_DEL_FLS INC (HL) PUSH BC CALL AUTO_03FD - LD A,(N_FILES) + LD A,(ZX_VARS.N_FILES) POP BC INC C CP C JR NZ,AUTO_07BC DEC A - LD (N_FILES),A + LD (ZX_VARS.N_FILES),A XOR A AUTO_07BC: PUSH AF JR Z,AUTO_07C3 - LD HL,N_DEL_FL + LD HL,ZX_VARS.N_DEL_FL INC (HL) AUTO_07C3: PUSH BC @@ -1082,11 +1198,11 @@ AUTO_07C3: JP Z,AUTO_07D2 LD A,1 AUTO_07D2: - LD (FL_NAME),A + LD (ZX_VARS.FL_NAME),A PUSH AF CALL AUTO_1E40 - LD A,(FST_SYM_NAME) - LD (FL_NAME),A + LD A,(ZX_VARS.FST_SYM_NAME) + LD (ZX_VARS.FL_NAME),A POP AF JR Z,AUTO_07E7 CALL AUTO_1CB3 @@ -1094,86 +1210,99 @@ AUTO_07D2: ; AUTO_07E7: - BLOCK #07E7-$,255 + _mInfoBLOCK #07E7-$,255 CALL AUTO_03FD - LD HL,(FL_PLACE) - LD (CLEAR_SEC),HL - LD DE,(FL_SIZE) - LD HL,(FREE_SEC) + LD HL,(ZX_VARS.FL_PLACE) + LD (ZX_VARS.CLEAR_SEC),HL + LD DE,(ZX_VARS.FL_SIZE) + LD HL,(ZX_VARS.FREE_SEC) LD D,0 ADD HL,DE - LD (FREE_SEC),HL + LD (ZX_VARS.FREE_SEC),HL JP AUTO_1E43 WG93_EXE_: AND 252 JP WG93_EXE ;************************************** - DISPLAY "2k" - BLOCK #0840-$,255 + + +;************************************** +;███████████████████████████████████████████████████████████████████████ +; [x] 13/06/2025 boot loader from TR-DOS vROM + IFN DEFtrd_boot_small +BOOT_PART_3: INCBIN 'build/boot.bin',429 +.SIZE EQU $-BOOT_PART_3 + ENDIF +;███████████████████████████████████████████████████████████████████████ +;************************************** + + +;************************************** + ;INCLUDE 'trdos/tr_HDD_4.asz' +; _mInfoBLOCK #0840-$,255 INCLUDE 'trdos/tr_msd_3.asz' - BLOCK #0B00-$,255 -ZG_RUS: - DB 3 ; идентификатор версии TR-DOS ??? +; _mInfoBLOCK #0B00-$,255 +;!TODO russian charset +;ZG_RUS: DB 3 ; идентификатор версии TR-DOS ??? ;************************************** - INCLUDE 'trdos/tr_msd_2.asz' + ;INCLUDE 'trdos/tr_msd_2.asz' ; DSS 0E00h,255 ;************************************** -; +;!TODO russian charset ; Русский знакогенератор - 40h..7Fh символы. ; ; DSS 0E00h,255 -; DB 0,0,76,82,114,82,76,0,0,0,56,4,60,68 -; DB 60,0,0,0,120,64,120,68,120,0,0,0,72 -; DB 72,72,72,124,4,0,0,24,40,40,40,124,68 -; DB 0,0,56,68,120,64,60,0,0,16,56,84,84 -; DB 56,16,0,0,0,124,64,64,64,64,0,0,0,68 -; DB 40,16,40,68,0,0,0,68,76,84,100,68,0 -; DB 0,16,68,76,84,100,68,0,0,0,72,80,112 -; DB 72,68,0,0,0,28,36,36,36,68,0,0,0,68 -; DB 108,84,84,68,0,0,0,68,68,124,68,68,0 -; DB 0,0,56,68,68,68,56,0,0,0,124,68,68,68 -; DB 68,0,0,0,60,68,60,36,68,0,0,0,120,68 -; DB 68,120,64,64,0,0,56,64,64,64,56,0,0 -; DB 0,124,16,16,16,16,0,0,0,68,68,60,4,56 -; DB 0,0,0,84,84,56,84,84,0,0,0,120,68,120 -; DB 68,120,0,0,0,64,64,120,68,120,0,0,0 -; DB 68,68,116,76,116,0,0,0,56,68,24,68,56 -; DB 0,0,0,84,84,84,84,124,0,0,0,56,4,28 -; DB 4,56,0,0,0,84,84,84,84,126,2,0,0,68 -; DB 68,60,4,4,0,0,0,96,32,56,36,56,0,0,76 -; DB 82,114,82,82,76,0,0,60,66,66,126,66 -; DB 66,0,0,124,64,124,66,66,124,0,0,68,68 -; DB 68,68,68,126,2,0,24,36,36,36,36,126 -; DB 66,0,126,64,124,64,64,126,0,0,56,84 -; DB 84,56,16,16,0,0,126,64,64,64,64,64,0 -; DB 0,66,36,24,24,36,66,0,0,66,70,74,82 -; DB 98,66,0,0,90,70,74,82,98,66,0,0,68,72 -; DB 112,72,68,66,0,0,30,34,34,34,34,66,0 -; DB 0,66,102,90,66,66,66,0,0,66,66,126,66 -; DB 66,66,0,0,60,66,66,66,66,60,0,0,126 -; DB 66,66,66,66,66,0,0,62,66,66,62,34,66 -; DB 0,0,124,66,66,124,64,64,0,0,60,66,64 -; DB 64,66,60,0,0,254,16,16,16,16,16,0,0 -; DB 66,66,62,2,66,60,0,0,84,84,56,84,84 -; DB 84,0,0,124,66,124,66,66,124,0,0,64,64 -; DB 124,66,66,124,0,0,66,66,114,74,74,114 -; DB 0,0,60,66,12,2,66,60,0,0,84,84,84,84 -; DB 84,124,0,0,60,66,14,2,66,60,0,0,84,84 -; DB 84,84,84,126,2,0,66,66,66,126,2,2,0 -; DB 60,66,153,161,161,153,66,60 + ; DB 0,0,76,82,114,82,76,0,0,0,56,4,60,68 + ; DB 60,0,0,0,120,64,120,68,120,0,0,0,72 + ; DB 72,72,72,124,4,0,0,24,40,40,40,124,68 + ; DB 0,0,56,68,120,64,60,0,0,16,56,84,84 + ; DB 56,16,0,0,0,124,64,64,64,64,0,0,0,68 + ; DB 40,16,40,68,0,0,0,68,76,84,100,68,0 + ; DB 0,16,68,76,84,100,68,0,0,0,72,80,112 + ; DB 72,68,0,0,0,28,36,36,36,68,0,0,0,68 + ; DB 108,84,84,68,0,0,0,68,68,124,68,68,0 + ; DB 0,0,56,68,68,68,56,0,0,0,124,68,68,68 + ; DB 68,0,0,0,60,68,60,36,68,0,0,0,120,68 + ; DB 68,120,64,64,0,0,56,64,64,64,56,0,0 + ; DB 0,124,16,16,16,16,0,0,0,68,68,60,4,56 + ; DB 0,0,0,84,84,56,84,84,0,0,0,120,68,120 + ; DB 68,120,0,0,0,64,64,120,68,120,0,0,0 + ; DB 68,68,116,76,116,0,0,0,56,68,24,68,56 + ; DB 0,0,0,84,84,84,84,124,0,0,0,56,4,28 + ; DB 4,56,0,0,0,84,84,84,84,126,2,0,0,68 + ; DB 68,60,4,4,0,0,0,96,32,56,36,56,0,0,76 + ; DB 82,114,82,82,76,0,0,60,66,66,126,66 + ; DB 66,0,0,124,64,124,66,66,124,0,0,68,68 + ; DB 68,68,68,126,2,0,24,36,36,36,36,126 + ; DB 66,0,126,64,124,64,64,126,0,0,56,84 + ; DB 84,56,16,16,0,0,126,64,64,64,64,64,0 + ; DB 0,66,36,24,24,36,66,0,0,66,70,74,82 + ; DB 98,66,0,0,90,70,74,82,98,66,0,0,68,72 + ; DB 112,72,68,66,0,0,30,34,34,34,34,66,0 + ; DB 0,66,102,90,66,66,66,0,0,66,66,126,66 + ; DB 66,66,0,0,60,66,66,66,66,60,0,0,126 + ; DB 66,66,66,66,66,0,0,62,66,66,62,34,66 + ; DB 0,0,124,66,66,124,64,64,0,0,60,66,64 + ; DB 64,66,60,0,0,254,16,16,16,16,16,0,0 + ; DB 66,66,62,2,66,60,0,0,84,84,56,84,84 + ; DB 84,0,0,124,66,124,66,66,124,0,0,64,64 + ; DB 124,66,66,124,0,0,66,66,114,74,74,114 + ; DB 0,0,60,66,12,2,66,60,0,0,84,84,84,84 + ; DB 84,124,0,0,60,66,14,2,66,60,0,0,84,84 + ; DB 84,84,84,126,2,0,66,66,66,126,2,2,0 + ; DB 60,66,153,161,161,153,66,60 ; ;************************************** ;************************************** - BLOCK #1000 - $,255 + INCLUDE 'trdos/tr_HDD_4.asz' + _mInfoBLOCK #1000 - $,255 ;************************************** - DISPLAY "4k" - AUTO_1000: DB 22,9,5,"Interface one fitted",0 ; @@ -1185,12 +1314,12 @@ CMD_STAR: CALL AUTO_0531 LD A,(DE) CALL GET_DISK - LD (CONT_DISK),A + LD (ZX_VARS.CONT_DISK),A CALL SET_DISK JP AUTO_03E1 AUTO_102E: LD B,'C' - LD A,(DOS_ERROR) + LD A,(ZX_VARS.DOS_ERROR) OR A JR NZ,AUTO_104D CALL AUTO_1D8C @@ -1205,7 +1334,7 @@ AUTO_102E: JR Z,AUTO_104D LD B,'B' AUTO_104D: - LD HL,FL_TYPE + LD HL,ZX_VARS.FL_TYPE LD (HL),B RET AUTO_1052: @@ -1214,26 +1343,23 @@ AUTO_1052: PUSH BC PUSH DE AUTO_1056: - RST RST20 - DW 0028EH -AUTO_1059: + RST_ROM BASIC_FN.x48.key_scan +;AUTO_1059: LD C,0 JR NZ,AUTO_1056 - RST RST20 - DW 0031EH + RST_ROM BASIC_FN.x48.key_test JR NC,AUTO_1056 DEC D LD E,A - RST RST20 - DW 00333H + RST_ROM BASIC_FN.x48.key_decode POP DE POP BC POP HL - AND 223 + AND %1101'1111 EI RET AUTO_106E: - LD HL,AUTO_58E8 + LD HL,#58E8 ;адрес линии атрибутов LD B,10 AUTO_1073: LD (HL),7 @@ -1241,15 +1367,13 @@ AUTO_1073: DJNZ AUTO_1073 LD (HL),2 INC HL - LD (HL),22 + LD (HL),#16 INC HL - DB 54 -AUTO_107F: - INC (HL) + LD (HL),#34 INC HL - LD (HL),'%' + LD (HL),#25 INC HL - LD (HL),'(' + LD (HL),#28 INC HL LD (HL),7 LD HL,AUTO_40F1 @@ -1298,8 +1422,8 @@ AUTO_112E: DB 13,13," File Name Start Length " DB "Line",0 AUTO_1151: - LD HL,(WORK_SP) - LD (VAR_1),HL + LD HL,(ZX_VARS.WORK_SPACE) + LD (ZX_VARS.VAR_1),HL LD BC,AUTO_021D+5 JP AUTO_1E23 AUTO_115D: @@ -1361,8 +1485,8 @@ AUTO_11A8: AUTO_11B0: PUSH HL PUSH BC - LD A,(DISK_2_FLG) - LD HL,OPER_DISK + LD A,(ZX_VARS.DISK_2_FLG) + LD HL,ZX_VARS.OPER_DISK CP (HL) CALL NZ,SET_DISK POP BC @@ -1380,12 +1504,12 @@ AUTO_11B0: ; CMD_LIST: CALL TEST_CR - LD BC,START+2 - LD (MED_LEN),BC + LD BC,2 + LD (ZX_VARS.MED_LEN),BC JR Z,AUTO_1205 CP '#' JR NZ,AUTO_11F8 - LD (CH_ADR),HL + LD (ZX_VARS.CH_ADR),HL CALL AUTO_1E0B CALL AUTO_1D8C CP 13 @@ -1404,46 +1528,46 @@ AUTO_11FB: CALL SET_DRIVE AUTO_1205: CALL SINTAX_RET - LD A,(OPER_DISK) - LD (DISK_2_FLG),A + LD A,(ZX_VARS.OPER_DISK) + LD (ZX_VARS.DISK_2_FLG),A CALL RD_HEAD_DSK - LD A,(MED_LEN) + LD A,(ZX_VARS.MED_LEN) CP 2 PUSH AF CALL Z,AUTO_1D97 POP AF - CP 17 + CP 16 + 1 JP NC,CMD_ERROR CALL AUTO_1D84 - LD A,255 - LD (DISK_1_FLG),A - CALL AUTO_1151 - LD HL,CLEAR_SEC - LD DE,(VAR_1) + LD A,#FF + LD (ZX_VARS.DISK_1_FLG),A + CALL AUTO_1151 ; !FIXIT выделяет память, но не освобождает + LD HL,ZX_VARS.CLEAR_SEC + LD DE,(ZX_VARS.VAR_1) LD BC,RST20 LDIR CALL AUTO_03E8 - LD HL,BUFER + LD HL,ZX_VARS.BUFFER PUSH HL AUTO_123E: LD HL,AUTO_10B3 PUSH BC RST PRINT_LN - LD HL,(VAR_1) + LD HL,(ZX_VARS.VAR_1) LD BC,CONT_2+1 ADD HL,BC RST PRINT_LN LD HL,AUTO_10BA RST PRINT_LN - LD A,(OPER_DISK) + LD A,(ZX_VARS.OPER_DISK) ADD A,'A' CALL PRINT_SYM CALL PRINT_CR - LD HL,(VAR_1) - LD BC,START+3 + LD HL,(ZX_VARS.VAR_1) + LD BC,3 ADD HL,BC LD A,(HL) - LD HL,(VAR_1) + LD HL,(ZX_VARS.VAR_1) LD BC,CONT_2 ADD HL,BC SUB (HL) @@ -1451,8 +1575,8 @@ AUTO_123E: CALL AUTO_1DA3 LD HL,AUTO_10AA RST PRINT_LN - LD HL,(VAR_1) - LD BC,START+2 + LD HL,(ZX_VARS.VAR_1) + LD BC,2 ADD HL,BC LD A,(HL) LD HL,AUTO_10CE @@ -1475,8 +1599,8 @@ AUTO_1292: RST PRINT_LN LD HL,AUTO_111E RST PRINT_LN - LD HL,(VAR_1) - LD BC,START+4 + LD HL,(ZX_VARS.VAR_1) + LD BC,4 ADD HL,BC LD C,(HL) INC HL @@ -1537,9 +1661,9 @@ AUTO_12D9: CALL AUTO_115D POP HL PUSH HL - LD BC,RST08 + LD BC,8 ADD HL,BC -AUTO_1303: +;AUTO_1303: LD A,(HL) CP 'B' CALL Z,AUTO_131B @@ -1553,7 +1677,7 @@ AUTO_1303: CALL PRINT_CR JP AUTO_123E AUTO_131B: - LD BC,START+5 + LD BC,5 ADD HL,BC LD B,(HL) INC HL @@ -1574,7 +1698,7 @@ AUTO_132C: AUTO_1333: DJNZ AUTO_132C AUTO_1335: - LD HL,(VAR_1) + LD HL,(ZX_VARS.VAR_1) LD BC,RST20+1 ADD HL,BC LD B,2 @@ -1617,13 +1741,13 @@ AUTO_1375: CALL AUTO_1CB0 JP NZ,AUTO_03D9 CALL AUTO_13B7 - LD A,(FL_TYPE) + LD A,(ZX_VARS.FL_TYPE) CP '#' JP NZ,AUTO_03E1 AUTO_1393: LD A,10 - LD (S_NAME_NUM),A - LD HL,FL_START + LD (ZX_VARS.S_NAME_NUM),A + LD HL,ZX_VARS.FL_START INC (HL) CALL AUTO_1D97 LD HL,AUTO_27AA @@ -1638,30 +1762,30 @@ AUTO_13A5: JR AUTO_1393 AUTO_13B7: CALL AUTO_165D - LD HL,FL_START - LD DE,VAR_2 - LD BC,START+7 + LD HL,ZX_VARS.FL_START + LD DE,ZX_VARS.VAR_2 + LD BC,7 LDIR - LD A,(VAR_2_0) - LD (ERR_3D00),A + LD A,(ZX_VARS.VAR_2_0) + LD (ZX_VARS.ERR_3D00),A CALL RD_HEAD_DSK CALL get_disk_type - LD (DOS_CH_ADR),A + LD (ZX_VARS.DOS_CH_ADR),A LD A,255 - LD (COM_LN_COPY+1),A + LD (ZX_VARS.COM_LN_COPY+1),A CALL AUTO_1451 - LD HL,(FL_NUMBER+1) - LD (FL_PLACE),HL - LD HL,(CONT_SEC) - LD (CLEAR_SEC),HL - LD HL,N_FILES + LD HL,(ZX_VARS.FL_NUMBER+1) + LD (ZX_VARS.FL_PLACE),HL + LD HL,(ZX_VARS.CONT_SEC) + LD (ZX_VARS.CLEAR_SEC),HL + LD HL,ZX_VARS.N_FILES INC (HL) LD C,(HL) DEC C LD B,0 PUSH BC LD DE,CONT_1 - LD (CONT_SEC),DE + LD (ZX_VARS.CONT_SEC),DE CALL AUTO_1E43 POP BC CALL AUTO_166B @@ -1669,39 +1793,39 @@ AUTO_13B7: RET AUTO_1403: XOR A - LD (COM_LN_COPY+1),A + LD (ZX_VARS.COM_LN_COPY+1),A CALL RD_HEAD_DSK CALL get_disk_type - LD (DOS_CH_ADR+1),A + LD (ZX_VARS.DOS_CH_ADR+1),A CALL AUTO_1CB3 JP Z,AUTO_1C50 CALL AUTO_03FD - LD A,(N_FILES) + LD A,(ZX_VARS.N_FILES) CP 128 JP Z,AUTO_2723 - LD HL,VAR_2 - LD DE,FL_START - LD BC,START+7 + LD HL,ZX_VARS.VAR_2 + LD DE,ZX_VARS.FL_START + LD BC,7 LDIR CALL AUTO_03FD - LD A,(ERR_3D00) - LD (FL_SIZE),A - LD DE,(FL_SIZE) + LD A,(ZX_VARS.ERR_3D00) + LD (ZX_VARS.FL_SIZE),A + LD DE,(ZX_VARS.FL_SIZE) LD D,0 OR A - LD HL,(FREE_SEC) + LD HL,(ZX_VARS.FREE_SEC) SBC HL,DE JP C,AUTO_1C45 - LD (FREE_SEC),HL - LD HL,(CLEAR_SEC) - LD (FL_PLACE),HL - LD (FL_NUMBER+1),HL + LD (ZX_VARS.FREE_SEC),HL + LD HL,(ZX_VARS.CLEAR_SEC) + LD (ZX_VARS.FL_PLACE),HL + LD (ZX_VARS.FL_NUMBER+1),HL RET AUTO_1451: - LD A,(VAR_2_0) + LD A,(ZX_VARS.VAR_2_0) OR A RET Z - LD A,(COM_LN_COPY+1) + LD A,(ZX_VARS.COM_LN_COPY+1) OR A JR NZ,AUTO_146F CALL AUTO_1D97 @@ -1713,28 +1837,28 @@ AUTO_1465: JR NZ,AUTO_1465 CALL AUTO_1D9F AUTO_146F: - LD A,(VAR_2_0) + LD A,(ZX_VARS.VAR_2_0) OR A RET Z PUSH HL - LD HL,L_5D23 + LD HL,ZX_VARS.WORK_SPACE.Size SUB (HL) POP HL JR NC,AUTO_14CB - LD A,(VAR_2_0) + LD A,(ZX_VARS.VAR_2_0) LD B,A XOR A - LD (VAR_2_0),A + LD (ZX_VARS.VAR_2_0),A AUTO_1484: PUSH BC - LD (RD_WR_COM),A - LD HL,(VAR_1) + LD (ZX_VARS.RD_WR_COM),A + LD HL,(ZX_VARS.VAR_1) PUSH HL - LD DE,(VAR_2_1) + LD DE,(ZX_VARS.VAR_2_1) CALL AUTO_14D8 CALL READ_DISK - LD HL,(CONT_SEC) - LD (VAR_2_1),HL + LD HL,(ZX_VARS.CONT_SEC) + LD (ZX_VARS.VAR_2_1),HL CALL AUTO_1D97 LD HL,AUTO_2785 CALL PRINT_L @@ -1743,21 +1867,21 @@ AUTO_14A5: CP 'Y' JR NZ,AUTO_14A5 CALL AUTO_1D9F - LD A,(COM_LN_COPY+1) + LD A,(ZX_VARS.COM_LN_COPY+1) OR A CALL NZ,AUTO_1403 POP HL POP BC - LD DE,(FL_PLACE) + LD DE,(ZX_VARS.FL_PLACE) CALL AUTO_14E4 CALL WRITE_DISK - LD HL,(CONT_SEC) - LD (FL_PLACE),HL + LD HL,(ZX_VARS.CONT_SEC) + LD (ZX_VARS.FL_PLACE),HL JP AUTO_1451 AUTO_14CB: - LD (VAR_2_0),A + LD (ZX_VARS.VAR_2_0),A PUSH HL - LD HL,L_5D23 + LD HL,ZX_VARS.WORK_SPACE.Size LD B,(HL) POP HL XOR A @@ -1766,7 +1890,7 @@ AUTO_14D8: PUSH HL PUSH DE CALL get_disk_type - LD A,(DOS_CH_ADR) + LD A,(ZX_VARS.DOS_CH_ADR) LD (HL),A POP DE POP HL @@ -1775,19 +1899,19 @@ AUTO_14E4: PUSH HL PUSH DE CALL get_disk_type - LD A,(DOS_CH_ADR+1) + LD A,(ZX_VARS.DOS_CH_ADR+1) LD (HL),A POP DE POP HL RET AUTO_14F0: XOR A - LD (COM_LN_COPY+1),A + LD (ZX_VARS.COM_LN_COPY+1),A CALL RD_HEAD_DSK CALL get_disk_type - LD (DOS_CH_ADR+1),A - LD A,(TYPE_DISK) - LD (FL_START+1),A + LD (ZX_VARS.DOS_CH_ADR+1),A + LD A,(ZX_VARS.TYPE_DISK) + LD (ZX_VARS.FL_START+1),A LD HL,AUTO_0280 CP 25 JR Z,AUTO_151F @@ -1801,8 +1925,8 @@ AUTO_14F0: JR Z,AUTO_151F JP CMD_ERROR AUTO_151F: - LD (FL_NAME),HL - LD BC,(FL_N_2) + LD (ZX_VARS.FL_NAME),HL + LD BC,(ZX_VARS.FL_N_2) SBC HL,BC JP C,AUTO_1C45 RET @@ -1819,11 +1943,11 @@ AUTO_153E: JR NZ,AUTO_153E CALL AUTO_1D9F LD A,255 - LD (COM_LN_COPY+1),A + LD (ZX_VARS.COM_LN_COPY+1),A CALL RD_HEAD_DSK CALL get_disk_type - LD (DOS_CH_ADR),A - LD A,(TYPE_DISK) + LD (ZX_VARS.DOS_CH_ADR),A + LD A,(ZX_VARS.TYPE_DISK) CP 25 LD HL,AUTO_0280 JR Z,AUTO_1575 @@ -1837,36 +1961,35 @@ AUTO_153E: JR Z,AUTO_1575 JP CMD_ERROR AUTO_1575: - LD BC,(FREE_SEC) + LD BC,(ZX_VARS.FREE_SEC) SBC HL,BC - LD (FL_TYPE),HL - LD (FL_N_2),HL - LD HL,START - LD (FL_N_4),HL - LD (FL_N_6),HL + LD (ZX_VARS.FL_TYPE),HL + LD (ZX_VARS.FL_N_2),HL + LD HL,0 + LD (ZX_VARS.FL_N_4),HL + LD (ZX_VARS.FL_N_6),HL CALL AUTO_15B8 CALL RD_HEAD_DSK - LD A,(FL_START+1) - LD (TYPE_DISK),A - LD HL,(FL_NAME) - LD BC,(FL_N_2) + LD A,(ZX_VARS.FL_START+1) + LD (ZX_VARS.TYPE_DISK),A + LD HL,(ZX_VARS.FL_NAME) + LD BC,(ZX_VARS.FL_N_2) SBC HL,BC - LD (FREE_SEC),HL + LD (ZX_VARS.FREE_SEC),HL CALL AUTO_14E4 LD DE,CONT_1 - LD (CONT_SEC),DE + LD (ZX_VARS.CONT_SEC),DE CALL AUTO_1E43 -AUTO_15AF: JP AUTO_03E1 AUTO_15B2: - LD HL,(FL_TYPE) + LD HL,(ZX_VARS.FL_TYPE) LD A,H OR L RET AUTO_15B8: CALL AUTO_15B2 RET Z - LD A,(COM_LN_COPY+1) + LD A,(ZX_VARS.COM_LN_COPY+1) OR A JR NZ,AUTO_15DB CALL AUTO_1D97 @@ -1884,26 +2007,26 @@ AUTO_15DB: RET Z PUSH BC PUSH HL - LD HL,L_5D23 + LD HL,ZX_VARS.WORK_SPACE.Size LD C,(HL) LD B,0 POP HL SBC HL,BC POP BC JP NC,AUTO_1644 - LD BC,(FL_TYPE) - LD HL,START - LD (FL_TYPE),HL + LD BC,(ZX_VARS.FL_TYPE) + LD HL,0 + LD (ZX_VARS.FL_TYPE),HL AUTO_15F8: PUSH BC - LD HL,(VAR_1) + LD HL,(ZX_VARS.VAR_1) PUSH HL CALL AUTO_14D8 - LD DE,(FL_N_4) + LD DE,(ZX_VARS.FL_N_4) LD B,C CALL READ_DISK - LD HL,(CONT_SEC) - LD (FL_N_4),HL + LD HL,(ZX_VARS.CONT_SEC) + LD (ZX_VARS.FL_N_4),HL CALL AUTO_1D97 LD HL,AUTO_2779 CALL PRINT_L @@ -1914,30 +2037,30 @@ AUTO_161D: CP 'Y' JR NZ,AUTO_161D CALL AUTO_1D9F - LD A,(COM_LN_COPY+1) + LD A,(ZX_VARS.COM_LN_COPY+1) AUTO_162A: OR A CALL NZ,AUTO_14F0 POP HL POP BC - LD DE,(FL_N_6) + LD DE,(ZX_VARS.FL_N_6) LD B,C CALL AUTO_14E4 CALL WRITE_DISK - LD HL,(CONT_SEC) - LD (FL_N_6),HL + LD HL,(ZX_VARS.CONT_SEC) + LD (ZX_VARS.FL_N_6),HL JP AUTO_15B8 AUTO_1644: - LD (FL_TYPE),HL + LD (ZX_VARS.FL_TYPE),HL PUSH HL - LD HL,L_5D23 + LD HL,ZX_VARS.WORK_SPACE.Size LD C,(HL) LD B,0 POP HL XOR A JP AUTO_15F8 CALL AUTO_165D - LD A,(FL_NAME) + LD A,(ZX_VARS.FL_NAME) CP 1 RET AUTO_165C: @@ -1959,15 +2082,14 @@ AUTO_166B: JR AUTO_165E AUTO_166F: LD A,255 - LD (BAS_DOS_FLG),A + LD (ZX_VARS.BAS_DOS_FLG),A CALL AUTO_1680 - LD HL,(WORK_SP) - LD (VAR_1),HL + LD HL,(ZX_VARS.WORK_SPACE) + LD (ZX_VARS.VAR_1),HL JP AUTO_1E23 AUTO_1680: - RST RST20 - DW 01F1AH - LD HL,0FFFFh + RST_ROM BASIC_FN.x48.free_mem + LD HL,#FFFF SBC HL,BC LD A,H CP 16 @@ -1975,17 +2097,18 @@ AUTO_1680: LD A,17 AUTO_168F: DEC A - LD (L_5D23),A + LD (ZX_VARS.WORK_SPACE.Size),A LD B,A LD C,0 RET - LD (MED_START),HL - LD (MED_LEN),HL - LD DE,(FL_SIZE) - LD HL,(DOS_CH_ADR) + ; + LD (ZX_VARS.MED_START),HL + LD (ZX_VARS.MED_LEN),HL + LD DE,(ZX_VARS.FL_SIZE) + LD HL,(ZX_VARS.DOS_CH_ADR) LD D,0 ADD HL,DE - LD (DOS_CH_ADR),HL + LD (ZX_VARS.DOS_CH_ADR),HL RET ; ; @@ -1995,29 +2118,29 @@ CMD_MOVE: JP NZ,AUTO_1775 CALL SINTAX_RET CALL AUTO_166F - LD HL,(VAR_1) - LD (FL_N_4),HL + LD HL,(ZX_VARS.VAR_1) + LD (ZX_VARS.FL_N_4),HL LD DE,0900h ADD HL,DE - LD (VAR_1),HL - LD A,(L_5D23) + LD (ZX_VARS.VAR_1),HL + LD A,(ZX_VARS.WORK_SPACE.Size) SUB 9 - LD (L_5D23),A - LD HL,(FL_N_4) - LD DE,START + LD (ZX_VARS.WORK_SPACE.Size),A + LD HL,(ZX_VARS.FL_N_4) + LD DE,0 LD B,9 CALL READ_DISK - LD HL,(FL_N_4) - LD (FL_N_2),HL + LD HL,(ZX_VARS.FL_N_4) + LD (ZX_VARS.FL_N_2),HL LD HL,AUTO_0100 - LD (MED_START),HL - LD (FL_NAME),HL + LD (ZX_VARS.MED_START),HL + LD (ZX_VARS.FL_NAME),HL XOR A - LD (FL_N_6),HL - LD (FL_N_7),A + LD (ZX_VARS.FL_N_6),HL + LD (ZX_VARS.FL_N_7),A CALL MOVE_X00 - LD DE,(FL_N_4) - LD HL,(FL_N_2) + LD DE,(ZX_VARS.FL_N_4) + LD HL,(ZX_VARS.FL_N_2) EX DE,HL LD BC,WG93_EXE_ ADD HL,BC @@ -2032,13 +2155,13 @@ CMD_MOVE: INC DE LD (HL),0 LDIR - LD HL,(FL_N_4) + LD HL,(ZX_VARS.FL_N_4) LD DE,08E1h ADD HL,DE LD E,(HL) INC HL LD D,(HL) - LD BC,(MED_START) + LD BC,(ZX_VARS.MED_START) LD (HL),B DEC HL LD (HL),C @@ -2061,8 +2184,8 @@ CMD_MOVE: ADD A,L LD L,A ADD HL,BC - LD BC,(MED_START) - LD (MED_START),HL + LD BC,(ZX_VARS.MED_START) + LD (ZX_VARS.MED_START),HL LD L,B LD H,0 ADD HL,HL @@ -2074,7 +2197,7 @@ CMD_MOVE: ADD A,L LD C,A LD B,H - LD HL,(MED_START) + LD HL,(ZX_VARS.MED_START) AND A SBC HL,BC EX DE,HL @@ -2082,20 +2205,20 @@ CMD_MOVE: DEC HL LD (HL),E DEC HL - LD A,(FL_N_6) + LD A,(ZX_VARS.FL_N_6) LD (HL),A LD DE,RST10 ADD HL,DE LD (HL),0 - LD HL,(FL_N_4) - LD DE,START + LD HL,(ZX_VARS.FL_N_4) + LD DE,0 LD B,9 CALL WRITE_DISK - LD A,(L_5D23) + LD A,(ZX_VARS.WORK_SPACE.Size) ADD A,9 LD B,A LD C,0 - LD HL,(VAR_1) + LD HL,(ZX_VARS.VAR_1) CALL AUTO_1E2E JP AUTO_03E1 AUTO_1775: @@ -2103,9 +2226,9 @@ AUTO_1775: CALL SINTAX_RET CALL AUTO_1C57 CALL AUTO_03FD - LD HL,FL_NAME - LD DE,DISK_NAME - LD BC,RST08 + LD HL,ZX_VARS.FL_NAME + LD DE,ZX_VARS.DISK_NAME + LD BC,8 LDIR CALL AUTO_1E43 JP AUTO_03E1 @@ -2129,44 +2252,44 @@ AUTO_1775: RST R38 RST R38 AUTO_17A5: - LD A,(AUTO_5CD3) + LD A,(ZX_VARS.AUTO_5CD3) OR A RET Z PUSH HL - LD HL,L_5D23 + LD HL,ZX_VARS.WORK_SPACE.Size SUB (HL) POP HL JR NC,AUTO_17DD - LD A,(AUTO_5CD3) + LD A,(ZX_VARS.AUTO_5CD3) LD B,A XOR A - LD (AUTO_5CD3),A + LD (ZX_VARS.AUTO_5CD3),A AUTO_17BA: PUSH BC - LD HL,(VAR_1) + LD HL,(ZX_VARS.VAR_1) PUSH HL - LD DE,(AUTO_5CD5) + LD DE,(ZX_VARS.AUTO_5CD5) CALL READ_DISK - LD HL,(CONT_SEC) - LD (AUTO_5CD5),HL + LD HL,(ZX_VARS.CONT_SEC) + LD (ZX_VARS.AUTO_5CD5),HL POP HL POP BC - LD DE,(MED_START) + LD DE,(ZX_VARS.MED_START) CALL WRITE_DISK - LD HL,(CONT_SEC) - LD (MED_START),HL + LD HL,(ZX_VARS.CONT_SEC) + LD (ZX_VARS.MED_START),HL JR AUTO_17A5 AUTO_17DD: - LD (AUTO_5CD3),A + LD (ZX_VARS.AUTO_5CD3),A PUSH HL - LD HL,L_5D23 + LD HL,ZX_VARS.WORK_SPACE.Size LD B,(HL) POP HL XOR A JR AUTO_17BA AUTO_17E9: PUSH AF - LD HL,CAT_SEC + LD HL,ZX_VARS.CAT_SEC LD (HL),0 LD A,C AUTO_17F0: @@ -2182,7 +2305,7 @@ AUTO_17F7: POP BC POP AF CALL AUTO_1CA4 - LD DE,FL_NAME + LD DE,ZX_VARS.FL_NAME LD BC,RST10 OR A JR Z,AUTO_180D @@ -2190,13 +2313,12 @@ AUTO_17F7: AUTO_180D: LDIR RET - DISPLAY "6k" ; ; ; CMD_VERIFY: LD A,255 - LD (DISK_2_FLG),A + LD (ZX_VARS.DISK_2_FLG),A ; ; ; @@ -2206,11 +2328,11 @@ AUTO_1818: CALL AUTO_1836 CALL SINTAX_RET LD A,255 - LD (ERR_3D00),A - LD A,(DISK_2_FLG) + LD (ZX_VARS.ERR_3D00),A + LD A,(ZX_VARS.DISK_2_FLG) CP 255 JP Z,AUTO_03E1 - LD A,(FL_TYPE) + LD A,(ZX_VARS.FL_TYPE) CP 'B' JP Z,AUTO_012A JP AUTO_03E1 @@ -2220,34 +2342,34 @@ AUTO_1836: CALL AUTO_18AB JP AUTO_1921 AUTO_1842: - LD HL,(CH_ADR) + LD HL,(ZX_VARS.CH_ADR) INC HL LD A,(HL) CP 13 RET Z LD A,1 - LD (DOS_ERROR),A + LD (ZX_VARS.DOS_ERROR),A CALL AUTO_1DEB AUTO_1852: XOR A - LD (ERR_3D00),A + LD (ZX_VARS.ERR_3D00),A RET AUTO_1857: CALL AUTO_102E LD A,'B' CP B JR NZ,AUTO_1866 - LD HL,(CH_ADR) + LD HL,(ZX_VARS.CH_ADR) DEC HL - LD (CH_ADR),HL + LD (ZX_VARS.CH_ADR),HL AUTO_1866: CALL AUTO_1DEB - LD HL,(DOS_CH_ADR) - LD (MED_START),HL - LD HL,(MED_LEN) - LD (DOS_CH_ADR),HL + LD HL,(ZX_VARS.DOS_CH_ADR) + LD (ZX_VARS.MED_START),HL + LD HL,(ZX_VARS.MED_LEN) + LD (ZX_VARS.DOS_CH_ADR),HL XOR A - LD (DOS_ERROR),A + LD (ZX_VARS.DOS_ERROR),A RET AUTO_187A: CALL TEST_CR @@ -2267,27 +2389,30 @@ AUTO_187A: CALL SINTAX_RET CALL AUTO_292F AUTO_18A4: - JP NZ,AUTO_03D9 + ; [x] 13/06/2025 boot loader from TR-DOS vROM + ;JP NZ,AUTO_03D9 + JP NZ,PREPARE_TO_vROM_BOOT + ; CALL AUTO_165D RET AUTO_18AB: CALL TYPE_FL_X00 OR A - LD HL,(FL_START) + LD HL,(ZX_VARS.FL_START) JR Z,AUTO_18B7 - LD HL,(DOS_CH_ADR) + LD HL,(ZX_VARS.DOS_CH_ADR) AUTO_18B7: - LD DE,(FL_PLACE) + LD DE,(ZX_VARS.FL_PLACE) CP 3 - LD A,(FL_SIZE) + LD A,(ZX_VARS.FL_SIZE) PUSH DE - LD DE,(FL_LEN) + LD DE,(ZX_VARS.FL_LEN) JR NZ,AUTO_18CB - LD DE,(MED_LEN) + LD DE,(ZX_VARS.MED_LEN) AUTO_18CB: LD B,A - LD (MED_LEN),DE - LD A,(FL_TYPE) + LD (ZX_VARS.MED_LEN),DE + LD A,(ZX_VARS.FL_TYPE) CP 'C' LD A,B JR NZ,AUTO_18FD @@ -2298,15 +2423,15 @@ AUTO_18CB: CP D LD A,B JR Z,AUTO_18F6 - LD A,(DOS_ERROR) + LD A,(ZX_VARS.DOS_ERROR) CP 3 LD A,B JR Z,AUTO_18F6 XOR A - LD (DOS_ERROR),A + LD (ZX_VARS.DOS_ERROR),A LD D,B LD E,0 - LD (MED_LEN),DE + LD (ZX_VARS.MED_LEN),DE JR AUTO_18F9 AUTO_18F6: CALL AUTO_191B @@ -2315,7 +2440,7 @@ AUTO_18F9: CALL AUTO_1EAC AUTO_18FD: LD B,A - LD A,(FL_TYPE) + LD A,(ZX_VARS.FL_TYPE) CP 'C' POP DE RET Z @@ -2327,13 +2452,13 @@ AUTO_18FD: CP 'D' CALL Z,AUTO_1A4C CALL AUTO_191B - LD A,(MED_LEN+1) + LD A,(ZX_VARS.MED_LEN+1) LD B,A POP DE RET AUTO_191B: LD A,3 - LD (DOS_ERROR),A + LD (ZX_VARS.DOS_ERROR),A RET AUTO_1921: CALL AUTO_0572 @@ -2349,47 +2474,47 @@ AUTO_192D: JR Z,AUTO_1937 JP WRITE_DISK AUTO_1937: - LD A,(DOS_ERROR) + LD A,(ZX_VARS.DOS_ERROR) CP 3 CALL Z,AUTO_1946 - LD HL,(E_LINE) + LD HL,(ZX_VARS.E_LINE) DEC HL LD (HL),128 RET AUTO_1946: - LD A,(DISK_2_FLG) + LD A,(ZX_VARS.DISK_2_FLG) CP 255 JP NZ,AUTO_2FDE - LD A,(MED_LEN) + LD A,(ZX_VARS.MED_LEN) OR A RET Z LD C,A LD B,1 - LD DE,(CONT_SEC) + LD DE,(ZX_VARS.CONT_SEC) JR AUTO_196A AUTO_195C: - LD A,(DISK_2_FLG) + LD A,(ZX_VARS.DISK_2_FLG) CP 255 JP NZ,READ_DISK - LD (CONT_SEC),DE + LD (ZX_VARS.CONT_SEC),DE LD C,0 AUTO_196A: LD A,B OR A RET Z - LD (MED_START),HL - LD (DOS_CH_ADR),DE + LD (ZX_VARS.MED_START),HL + LD (ZX_VARS.DOS_CH_ADR),DE AUTO_1974: PUSH BC LD B,1 - LD DE,(DOS_CH_ADR) - LD HL,BUFER + LD DE,(ZX_VARS.DOS_CH_ADR) + LD HL,ZX_VARS.BUFFER CALL READ_DISK - LD HL,(CONT_SEC) - LD (DOS_CH_ADR),HL + LD HL,(ZX_VARS.CONT_SEC) + LD (ZX_VARS.DOS_CH_ADR),HL POP BC - LD HL,(MED_START) - LD DE,BUFER + LD HL,(ZX_VARS.MED_START) + LD DE,ZX_VARS.BUFFER AUTO_198E: LD A,(DE) CP (HL) @@ -2398,7 +2523,7 @@ AUTO_198E: INC DE DEC C JR NZ,AUTO_198E - LD (MED_START),HL + LD (ZX_VARS.MED_START),HL DJNZ AUTO_1974 RET AUTO_199D: @@ -2417,40 +2542,38 @@ CMD_PEEK: CMD_POKE: LD A,238 AUTO_19AB: - LD (ERR_3D00),A + LD (ZX_VARS.ERR_3D00),A JP AUTO_1818 ; ; ; CMD_MERGE: LD A,255 - LD (FL_NUMBER+1),A + LD (ZX_VARS.FL_NUMBER+1),A CALL AUTO_187A CALL SINTAX_RET - LD A,(FL_TYPE) + LD A,(ZX_VARS.FL_TYPE) CP 'B' JP NZ,CMD_ERROR - LD BC,(FL_START) - LD (MED_LEN),BC + LD BC,(ZX_VARS.FL_START) + LD (ZX_VARS.MED_LEN),BC PUSH BC INC BC - RST RST20 - DW 00030H -AUTO_19D1: + RST_ROM BASIC_FN.x48.bc_spaces +;AUTO_19D1: LD (HL),128 EX DE,HL POP DE PUSH HL - LD DE,(FL_PLACE) + LD DE,(ZX_VARS.FL_PLACE) CALL AUTO_191B - LD A,(MED_LEN+1) + LD A,(ZX_VARS.MED_LEN+1) LD B,A CALL AUTO_1852 CALL AUTO_1921 POP HL - LD DE,(BAS_PROG) - RST RST20 - DW 008D2H + LD DE,(ZX_VARS.BAS_PROG) + RST_ROM BASIC_FN.x48.me_new_lp JP AUTO_03E1 AUTO_19F2: EX DE,HL @@ -2462,29 +2585,28 @@ AUTO_19F2: LD B,H LD C,L AUTO_19FD: - RST RST20 - DW 01F05H + RST_ROM BASIC_FN.x48.test_room RET AUTO_1A01: - LD DE,(BAS_PROG) - LD HL,(E_LINE) + LD DE,(ZX_VARS.BAS_PROG) + LD HL,(ZX_VARS.E_LINE) DEC HL PUSH HL PUSH DE SBC HL,DE - LD DE,(FL_START) + LD DE,(ZX_VARS.FL_START) PUSH DE PUSH HL - LD HL,START - LD A,(DISK_2_FLG) + LD HL,0 + LD A,(ZX_VARS.DISK_2_FLG) CP 255 JR Z,AUTO_1A20 - LD HL,START+5 + LD HL,5 AUTO_1A20: ADD HL,DE - LD (MED_LEN),HL + LD (ZX_VARS.MED_LEN),HL POP HL - LD A,(DISK_2_FLG) + LD A,(ZX_VARS.DISK_2_FLG) CP 255 JR NZ,AUTO_1A31 POP DE @@ -2497,51 +2619,50 @@ AUTO_1A31: POP DE POP HL PUSH BC - RST RST20 - DW 019E5H + RST_ROM BASIC_FN.x48.reclaim_1 POP BC CALL AUTO_1E32 INC HL - LD BC,(FL_LEN) + LD BC,(ZX_VARS.FL_LEN) ADD HL,BC - LD (BAS_VARS),HL + LD (ZX_VARS.BAS_VARS),HL AUTO_1A48: - LD HL,(BAS_PROG) + LD HL,(ZX_VARS.BAS_PROG) RET AUTO_1A4C: - LD DE,(FL_LEN) - LD (MED_LEN),DE - LD HL,(MED_START) - LD A,(DISK_2_FLG) + LD DE,(ZX_VARS.FL_LEN) + LD (ZX_VARS.MED_LEN),DE + LD HL,(ZX_VARS.MED_START) + LD A,(ZX_VARS.DISK_2_FLG) CP 255 RET Z - LD HL,(DOS_CH_ADR) + LD HL,(ZX_VARS.DOS_CH_ADR) PUSH HL CALL AUTO_19F2 POP HL LD A,H OR L JR Z,AUTO_1A79 - LD HL,(MED_START) + LD HL,(ZX_VARS.MED_START) DEC HL DEC HL DEC HL - LD BC,(DOS_CH_ADR) + LD BC,(ZX_VARS.DOS_CH_ADR) INC BC INC BC INC BC CALL AUTO_1E2E AUTO_1A79: - LD HL,(E_LINE) + LD HL,(ZX_VARS.E_LINE) DEC HL - LD BC,(FL_LEN) + LD BC,(ZX_VARS.FL_LEN) PUSH BC INC BC INC BC INC BC CALL AUTO_1E32 INC HL - LD A,(AUTO_5CD2) + LD A,(ZX_VARS.AUTO_5CD2) LD (HL),A INC HL POP DE @@ -2551,7 +2672,7 @@ AUTO_1A79: INC HL RET AUTO_1A94: - LD A,(DOS_CH_ADR) + LD A,(ZX_VARS.DOS_CH_ADR) LD C,B LD B,A LD A,C @@ -2573,7 +2694,7 @@ AUTO_1AAE: DJNZ AUTO_1AA7 AUTO_1AB0: LD B,1 - LD HL,(MED_START) + LD HL,(ZX_VARS.MED_START) RET AUTO_1AB6: LD HL,AUTO_29ED @@ -2584,7 +2705,7 @@ AUTO_1ABE: CALL Z,SET_7_TYPE AUTO_1AC4: CALL AUTO_03FD - LD A,(N_FILES) + LD A,(ZX_VARS.N_FILES) CP 128 JP Z,AUTO_2723 RET @@ -2593,8 +2714,8 @@ AUTO_1AC4: ; CMD_SAVE: CALL AUTO_1852 - LD HL,START - LD (AUTO_5CD1),HL + LD HL,0 + LD (ZX_VARS.AUTO_5CD1),HL CALL INPUT_TXT CALL AUTO_1D8C CP 175 @@ -2603,26 +2724,23 @@ CMD_SAVE: JR NZ,AUTO_1AF8 CALL AUTO_1E0B CALL SINTAX_RET - LD HL,(MED_LEN) - LD (AUTO_5CD1),HL - LD HL,FL_TYPE + LD HL,(ZX_VARS.MED_LEN) + LD (ZX_VARS.AUTO_5CD1),HL + LD HL,ZX_VARS.FL_TYPE JR AUTO_1B1F AUTO_1AF8: - CP 170 + CP ZX_Token.screen_dollar JR NZ,AUTO_1B0D - LD HL,AUTO_4000 - DB 34 -AUTO_1B00: - RST RST10 - LD E,H - LD HL,AUTO_1B00 - LD (DOS_CH_ADR),HL - LD (MED_LEN),HL + LD HL,AUTO_4000 ;начало файла - #4000 + LD (#5CD7),HL + LD HL,#1B00 ;его длина - #1B00 байтов + LD (ZX_VARS.DOS_CH_ADR),HL + LD (ZX_VARS.MED_LEN),HL JR AUTO_1B48 AUTO_1B0D: CALL SINTAX_RET CALL AUTO_1D8C - LD HL,FL_TYPE + LD HL,ZX_VARS.FL_TYPE CP 228 JR Z,AUTO_1B2C CP 13 @@ -2642,23 +2760,23 @@ AUTO_1B2C: JP C,CMD_ERROR AUTO_1B39: CALL AUTO_1DE5 - LD HL,(DOS_CH_ADR) - LD (MED_START),HL - LD HL,(MED_LEN) - LD (DOS_CH_ADR),HL + LD HL,(ZX_VARS.DOS_CH_ADR) + LD (ZX_VARS.MED_START),HL + LD HL,(ZX_VARS.MED_LEN) + LD (ZX_VARS.DOS_CH_ADR),HL AUTO_1B48: CALL SINTAX_RET LD A,'C' - LD (FL_TYPE),A + LD (ZX_VARS.FL_TYPE),A CALL AUTO_1ABE AUTO_1B53: CALL OWERWR_X01 JP AUTO_0569 AUTO_1B59: - LD HL,(MED_START) - LD (FL_START),HL + LD HL,(ZX_VARS.MED_START) + LD (ZX_VARS.FL_START),HL EX DE,HL - LD HL,(DOS_CH_ADR) + LD HL,(ZX_VARS.DOS_CH_ADR) LD A,L OR H JP Z,CMD_ERROR @@ -2668,7 +2786,7 @@ AUTO_1B59: INC H AUTO_1B6D: LD A,H - LD (FL_SIZE),A + LD (ZX_VARS.FL_SIZE),A LD E,A LD D,0 DB 42,10 @@ -2677,32 +2795,32 @@ AUTO_1B76: SBC HL,DE JP C,AUTO_1C45 PUSH HL - LD HL,(E_LINE) + LD HL,(ZX_VARS.E_LINE) LD (HL),170 INC HL - LD DE,(AUTO_5CD1) + LD DE,(ZX_VARS.AUTO_5CD1) LD (HL),E INC HL LD (HL),D - LD HL,(MED_LEN) - LD (FL_LEN),HL - LD HL,(CLEAR_SEC) - LD (FL_PLACE),HL + LD HL,(ZX_VARS.MED_LEN) + LD (ZX_VARS.FL_LEN),HL + LD HL,(ZX_VARS.CLEAR_SEC) + LD (ZX_VARS.FL_PLACE),HL EX DE,HL - LD HL,(FL_START) - LD A,(FL_SIZE) + LD HL,(ZX_VARS.FL_START) + LD A,(ZX_VARS.FL_SIZE) LD B,A CALL WRITE_DISK - LD HL,(CONT_SEC) + LD HL,(ZX_VARS.CONT_SEC) PUSH HL CALL AUTO_03FD POP HL - LD (CLEAR_SEC),HL + LD (ZX_VARS.CLEAR_SEC),HL POP HL - LD (FREE_SEC),HL - LD HL,N_FILES + LD (ZX_VARS.FREE_SEC),HL + LD HL,ZX_VARS.N_FILES LD A,(HL) - LD (FL_NUMBER),A + LD (ZX_VARS.FL_NUMBER),A INC (HL) PUSH HL CALL AUTO_1E43 @@ -2710,40 +2828,40 @@ AUTO_1B76: LD C,(HL) DEC C AUTO_1BBF: - LD A,(FL_TYPE) + LD A,(ZX_VARS.FL_TYPE) CP 'B' CALL Z,AUTO_1BC8 RET AUTO_1BC8: - LD HL,(E_LINE) - LD DE,(BAS_PROG) + LD HL,(ZX_VARS.E_LINE) + LD DE,(ZX_VARS.BAS_PROG) SCF SBC HL,DE - LD (FL_START),HL - LD HL,(BAS_VARS) + LD (ZX_VARS.FL_START),HL + LD HL,(ZX_VARS.BAS_VARS) SBC HL,DE - LD (FL_LEN),HL + LD (ZX_VARS.FL_LEN),HL RET AUTO_1BDE: - LD HL,(BAS_VARS) - LD DE,(BAS_PROG) + LD HL,(ZX_VARS.BAS_VARS) + LD DE,(ZX_VARS.BAS_PROG) SBC HL,DE - LD (MED_LEN),HL - LD HL,(BAS_PROG) - LD (MED_START),HL - LD HL,(E_LINE) + LD (ZX_VARS.MED_LEN),HL + LD HL,(ZX_VARS.BAS_PROG) + LD (ZX_VARS.MED_START),HL + LD HL,(ZX_VARS.E_LINE) INC HL INC HL INC HL SBC HL,DE - LD (DOS_CH_ADR),HL + LD (ZX_VARS.DOS_CH_ADR),HL RET AUTO_1BFC: CALL AUTO_1C1B RET NC - LD HL,START - LD (DOS_CH_ADR),HL - LD A,(DISK_2_FLG) + LD HL,0 + LD (ZX_VARS.DOS_CH_ADR),HL + LD A,(ZX_VARS.DISK_2_FLG) CP 255 RET NZ JP AUTO_1C13 @@ -2759,7 +2877,7 @@ AUTO_1C1B: CALL AUTO_1D9B SET 7,C LD A,C - LD (AUTO_5CD2),A + LD (ZX_VARS.AUTO_5CD2),A JR NC,AUTO_1C2B AUTO_1C29: SCF @@ -2771,9 +2889,9 @@ AUTO_1C2B: INC HL LD D,(HL) INC HL - LD (MED_START),HL - LD (MED_LEN),DE - LD (DOS_CH_ADR),DE + LD (ZX_VARS.MED_START),HL + LD (ZX_VARS.MED_LEN),DE + LD (ZX_VARS.DOS_CH_ADR),DE CALL BASIC_RST20 CP ')' JR NZ,AUTO_1C2B @@ -2789,7 +2907,7 @@ AUTO_1C50: LD A,2 JR AUTO_1C4A AUTO_1C57: - LD HL,FL_NAME + LD HL,ZX_VARS.FL_NAME LD B,8 AUTO_1C5C: LD (HL),' ' @@ -2808,7 +2926,7 @@ AUTO_1C73: LD A,(HL) CP ' ' JP C,CMD_ERROR - LD DE,FL_NAME + LD DE,ZX_VARS.FL_NAME PUSH BC LDIR POP BC @@ -2835,7 +2953,7 @@ SET_DRIVE: RET AUTO_1C98: DEC HL - LD A,(CONT_DISK) + LD A,(ZX_VARS.CONT_DISK) PUSH BC PUSH HL @@ -2850,7 +2968,7 @@ AUTO_1CA4: ADD HL,HL ADD HL,HL ADD HL,HL - LD BC,BUFER + LD BC,ZX_VARS.BUFFER ADD HL,BC RET AUTO_1CB0: @@ -2872,8 +2990,8 @@ AUTO_1CBA: LD C,0 JR AUTO_1CBA AUTO_1CCD: - LD DE,FL_NAME - LD A,(S_NAME_NUM) + LD DE,ZX_VARS.FL_NAME + LD A,(ZX_VARS.S_NAME_NUM) LD B,A XOR A CP (HL) @@ -2893,12 +3011,12 @@ AUTO_1CE7: LD A,128 SUB B LD C,A - LD (FL_NUMBER),A + LD (ZX_VARS.FL_NUMBER),A XOR A RET Z AUTO_1CF0: CALL AUTO_1CB3 - LD HL,DOS_ERR_2 + LD HL,ZX_VARS.DOS_ERR_2 LD (HL),C RET Z LD (HL),255 @@ -2911,29 +3029,30 @@ CMD_RETURN: CALL AUTO_20E5 RES 3,(IY+1) CALL AUTO_0232 - LD SP,(DOS_SP) - LD HL,(ERR_SP) + LD SP,(ZX_VARS.DOS_SP) + LD HL,(ZX_VARS.ERR_SP) DEC HL LD A,18 CP (HL) JR NZ,AUTO_1D19 DEC HL - LD (ERR_SP),HL + LD (ZX_VARS.ERR_SP),HL AUTO_1D19: RET CMD_ERROR: BIT 7,(IY+0) JR Z,AUTO_1D25 LD A,11 - LD (ERR_NR),A + LD (ZX_VARS.ERR_NR),A AUTO_1D25: INC A LD HL,AUTO_29B2 ERR_EXIT: CALL AUTO_03C3 JP AUTO_01D3 + AUTO_1D2F: - LD A,(ERR_NR) + LD A,(ZX_VARS.ERR_NR) LD HL,AUTO_27CA CP 20 JR Z,ERR_EXIT @@ -2953,23 +3072,22 @@ CMD_RUN: CALL AUTO_1852 CALL AUTO_1836 CALL SINTAX_RET - LD HL,(FL_START) - LD A,(FL_TYPE) + LD HL,(ZX_VARS.FL_START) + LD A,(ZX_VARS.FL_TYPE) CP 'B' JP Z,AUTO_012A PUSH HL RET AUTO_1D63: - LD HL,BAS_DOS_FLG + LD HL,ZX_VARS.BAS_DOS_FLG LD A,(HL) - DB 254 -AUTO_1D68: - RST R38 + CP #FF LD (HL),0 RET NZ - RST RST20 - DW 016BFH + RST_ROM BASIC_FN.x48.set_work RET +; Проверка, идет ли проверка строки на синтаксис или выполнение команды. +; Если идет выполнение, то флаг Z будет сброшен, иначе установлен. AUTO_1D70: BIT 7,(IY+1) RET @@ -2985,32 +3103,28 @@ AUTO_1D7B: OPEN_CH0: XOR A AUTO_1D84: - RST RST20 - DW 01601H + RST_ROM BASIC_FN.x48.chan_open RET OPEN_CH2: LD A,2 JR AUTO_1D84 AUTO_1D8C: - RST RST20 - DW 00018H -AUTO_1D8F: + RST_ROM BASIC_FN.x48.get_char +;AUTO_1D8F: RET + +GET_CMD: CALL OPEN_CH0 - RST RST20 - DW 00F2CH + RST_ROM BASIC_FN.x48.editor RET AUTO_1D97: - RST RST20 - DW 00D6BH + RST_ROM BASIC_FN.x48.cls RET AUTO_1D9B: - RST RST20 - DW 028B2H + RST_ROM BASIC_FN.x48.look_vars RET AUTO_1D9F: - RST RST20 - DW 00D6EH + RST_ROM BASIC_FN.x48.cls_lower RET AUTO_1DA3: LD C,A @@ -3021,31 +3135,26 @@ AUTO_1DA9: PUSH BC CALL xchg_intf1 POP BC - RST RST20 - DW 01A1BH + RST_ROM BASIC_FN.x48.out_num_1 CALL xchg_intf1 RET BAS_2BF1: - RST RST20 - DW 02BF1H + RST_ROM BASIC_FN.x48.stack_fetch RET AUTO_1DB9: - RST RST20 - DW 01E99H + RST_ROM BASIC_FN.x48.find_int2 RET AUTO_1DBD: - RST RST20 - DW 01C8CH + RST_ROM BASIC_FN.x48.expt_exp RET AUTO_1DC1: - RST RST20 - DW 01C82H + RST_ROM BASIC_FN.x48.expt_1num RET AUTO_1DC5: - LD HL,(ADR_DOS_COM) + LD HL,(ZX_VARS.ADR_DOS_COM) AUTO_1DC8: INC HL - LD (CH_ADR),HL + LD (ZX_VARS.CH_ADR),HL RET AUTO_1DCD: CALL INPUT_TXT @@ -3067,8 +3176,8 @@ AUTO_1DEB: CALL AUTO_1D7B JR Z,AUTO_1DFB CALL AUTO_1DB9 - LD (DOS_CH_ADR),BC - LD (MED_LEN),BC + LD (ZX_VARS.DOS_CH_ADR),BC + LD (ZX_VARS.MED_LEN),BC AUTO_1DFB: CALL AUTO_1D8C CP ',' @@ -3081,38 +3190,33 @@ AUTO_1E0B: CALL AUTO_1D7B RET Z CALL AUTO_1DB9 - LD (MED_LEN),BC + LD (ZX_VARS.MED_LEN),BC LD A,3 - LD (DOS_ERROR),A + LD (ZX_VARS.DOS_ERROR),A RET AUTO_1E1C: - LD HL,(ADR_DOS_COM) - RST RST20 - DW 011A7H + LD HL,(ZX_VARS.ADR_DOS_COM) + RST_ROM BASIC_FN.x48.remove_fp RET AUTO_1E23: - LD HL,(WORK_SP) - RST RST20 - DW 00030H + LD HL,(ZX_VARS.WORK_SPACE) + RST_ROM BASIC_FN.x48.bc_spaces AUTO_1E29: RET BASIC_RST20: - RST RST20 - DW 00020H + RST_ROM BASIC_FN.x48.next_char AUTO_1E2D: RET AUTO_1E2E: - RST RST20 - DW 019E8H + RST_ROM BASIC_FN.x48.reclaim_2 RET AUTO_1E32: - RST RST20 - DW 01655H + RST_ROM BASIC_FN.x48.make_room RET READ_TRK_NUM: CALL READ_ADR_LABL LD A,H - OUT (WG_TRK),A + OUT (FDC_93.Track),A RET READ_DISK: XOR A @@ -3120,10 +3224,10 @@ READ_DISK: AUTO_1E40: CALL AUTO_166B AUTO_1E43: - LD DE,(CONT_SEC) + LD DE,(ZX_VARS.CONT_SEC) DEC DE LD B,1 - LD HL,BUFER + LD HL,ZX_VARS.BUFFER WRITE_DISK: PUSH HL PUSH DE @@ -3140,13 +3244,13 @@ AUTO_1E60: AUTO_1E62: LD A,255 AUTO_1E64: - LD (RD_WR_COM),A + LD (ZX_VARS.RD_WR_COM),A AUTO_1E67: - LD (CONT_SEC),DE + LD (ZX_VARS.CONT_SEC),DE JP R_W_REDIR - LD (HL),30 ; НЕ исп. !!! - + ;LD (HL),30 ; НЕ исп. !!! + _mInfoBLOCK #1E70-$,0 AUTO_1E70: POP HL POP BC @@ -3157,11 +3261,11 @@ AUTO_1E75: PUSH BC PUSH HL CALL save_bufer - LD A,(CONT_SEC) + LD A,(ZX_VARS.CONT_SEC) CALL save_sector - LD A,(CONT_TRK) + LD A,(ZX_VARS.CONT_TRK) CALL Global_trk - LD A,(RD_WR_COM) + LD A,(ZX_VARS.RD_WR_COM) OR A PUSH AF CALL Z,AUTO_3F0E @@ -3172,12 +3276,12 @@ AUTO_1E75: ADD HL,DE PUSH HL LD A,16 - LD HL,CONT_SEC + LD HL,ZX_VARS.CONT_SEC INC (HL) CP (HL) JR NZ,AUTO_1EA7 LD (HL),0 - LD HL,CONT_TRK + LD HL,ZX_VARS.CONT_TRK INC (HL) AUTO_1EA7: POP HL @@ -3199,17 +3303,17 @@ AUTO_1EAC: RET AUTO_1EBC: XOR A - LD (DOS_ERROR),A + LD (ZX_VARS.DOS_ERROR),A SCF RET ; ; ; CMD_FORMAT: - LD HL,START - LD (MED_START),HL - LD (DOS_CH_ADR),HL - LD (AUTO_5CD1),HL + LD HL,0 + LD (ZX_VARS.MED_START),HL + LD (ZX_VARS.DOS_CH_ADR),HL + LD (ZX_VARS.AUTO_5CD1),HL CALL TEST_CR JP Z,CMD_ERROR ; FORMATER ; !!!!! ( CMD_ERROR ) CALL FORM_STATE ; 1/2/3 INPUT_TXT @@ -3222,7 +3326,7 @@ AUTO_1EE0: JR Z,AUTO_1EE8 LD A,'P' AUTO_1EE8: - LD (MED_START),A + LD (ZX_VARS.MED_START),A CALL AUTO_3D98 CALL set_side_1 CALL pause_750ms @@ -3231,7 +3335,7 @@ AUTO_1EE8: CALL set_side_0 LD E,0 CALL AUTO_1FFD - LD A,(FL_NAME) + LD A,(ZX_VARS.FL_NAME) CP '$' JR Z,AUTO_1F1B CALL set_side_1 @@ -3241,16 +3345,16 @@ AUTO_1EE8: CP 1 JR NZ,AUTO_1F1B LD A,128 - LD (DOS_CH_ADR+1),A + LD (ZX_VARS.DOS_CH_ADR+1),A AUTO_1F1B: CALL FORM_X02 ; форматирование !!! - LD HL,BUFER + LD HL,ZX_VARS.BUFFER LD (HL),0 - LD DE,BUFER+1 + LD DE,ZX_VARS.BUFFER+1 LD BC,0FFh LDIR - LD BC,MED_START - LD DE,DOS_CH_ADR+1 + LD BC,ZX_VARS.MED_START + LD DE,ZX_VARS.DOS_CH_ADR+1 LD A,(BC) CP 'P' JR Z,AUTO_1F49 @@ -3273,37 +3377,37 @@ AUTO_1F49: LD A,22 LD HL,09F0h AUTO_1F55: - LD (TYPE_DISK),A - LD (FREE_SEC),HL + LD (ZX_VARS.TYPE_DISK),A + LD (ZX_VARS.FREE_SEC),HL LD A,1 - LD (CLEAR_TRK),A + LD (ZX_VARS.CLEAR_TRK),A LD A,16 - LD (CODE_10H),A - LD HL,DISK_MRK_1 - LD DE,DISK_ALT_NM - LD BC,RST08 + LD (ZX_VARS.CODE_10H),A + LD HL,ZX_VARS.DISK_MRK_1 + LD DE,ZX_VARS.DISK_ALT_NM + LD BC,8 LD (HL),' ' LDIR - LD HL,FL_NAME - LD DE,DISK_NAME - LD BC,RST08 + LD HL,ZX_VARS.FL_NAME + LD DE,ZX_VARS.DISK_NAME + LD BC,8 LDIR CALL set_side_0 LD B,1 LD DE,8 - LD HL,BUFER + LD HL,ZX_VARS.BUFFER CALL AUTO_1E62 - LD A,(DOS_ERROR) + LD A,(ZX_VARS.DOS_ERROR) PUSH AF XOR A - LD (FL_TYPE),A - LD HL,(FREE_SEC) - LD (MED_START),HL - LD HL,FL_NAME + LD (ZX_VARS.FL_TYPE),A + LD HL,(ZX_VARS.FREE_SEC) + LD (ZX_VARS.MED_START),HL + LD HL,ZX_VARS.FL_NAME RST PRINT_LN LD A,13 RST RST10 - LD HL,(MED_START) + LD HL,(ZX_VARS.MED_START) POP AF PUSH HL LD D,0 @@ -3318,48 +3422,46 @@ AUTO_1F55: CALL AUTO_1DA9 JP AUTO_01D3 AUTO_1FB9: - DB 1,9,2,10,3,11,4,12,5,13,6,14,7,15,8 - DB 16,1 +;Адрес #1FB9. Таблица секторов для форматирования обычного диска. Используется также с адреса #1FBA для проверки дорожки. + DB 1 + DB 9,2,#A,3,#B,4,#C,5,#D,6,#E,7,#F,8,#10,1 + test_d_traks: CALL get_disk_time OR 17 LD B,A - LD A,'2' + LD A,#32 CALL Goto_trk LD A,2 CALL Goto_trk CALL pause_50ms - IN A,(WG_COM) + IN A,(FDC_93.Command) AND 4 - LD A,'P' + LD A,#50 JR Z,AUTO_1FE7 - LD A,'(' + LD A,#28 AUTO_1FE7: - LD (MED_START),A + LD (ZX_VARS.MED_START),A RET set_side_0: - LD A,(PDOS_COPY) - OR '<' ; 3C - сторона 0 3C..3F + LD A,(ZX_VARS.PDOS_COPY) + OR #3C ; сторона 0 3C..3F AUTO_1FF0: - LD (PDOS_COPY),A - OUT (P_DOS_FF),A + LD (ZX_VARS.PDOS_COPY),A + OUT (FDC_93.DrvCTRL),A RET set_side_1: - LD A,(PDOS_COPY) - AND 'o' ; 06Fh - сторона 1 2C..2F + LD A,(ZX_VARS.PDOS_COPY) + AND #6F ; сторона 1 2C..2F JR AUTO_1FF0 ; ld a,(pdos_copy) AUTO_1FFD: ; add a,0C0h DI ; ld d,0 LD A,244 ; rl d AUTO_2000: ; - OUT (WG_COM),A ; - LD HL,(FL_START) ; + OUT (FDC_93.Command),A ; + LD HL,(ZX_VARS.FL_START) ; LD C,127 - - -;//////////////////////////////////// - -AUTO_2007: +;AUTO_2007: LD B,3Eh ; первый пробел LD D,'N' CALL AUTO_20B1 @@ -3405,13 +3507,13 @@ FORM_TR_LOOP: INC HL CP 16 ; проверка на посл. сектор JR NZ,FORM_TR_LOOP ; если нет, то продолжать - IN A,(WG_COM) + IN A,(FDC_93.Command) AND '@' JP NZ,AUTO_3F39 LD A,216 - OUT (WG_COM),A + OUT (FDC_93.Command),A LD A,208 - OUT (WG_COM),A + OUT (FDC_93.Command),A ;////////////////////////////////////// @@ -3419,30 +3521,30 @@ FORM_TR_LOOP: NOP NOP AUTO_207D: - LD A,(MED_START+1) + LD A,(ZX_VARS.MED_START+1) OR A RET NZ LD C,127 LD A,E - OUT (WG_TRK),A + OUT (FDC_93.Track),A CALL SUB_HL_14 AUTO_208A: LD B,3 LD A,(HL) - OUT (WG_SEC),A + OUT (FDC_93.Sector),A PUSH HL AUTO_2090: DI LD A,128 - OUT (WG_COM),A + OUT (FDC_93.Command),A PUSH BC CALL AUTO_3FE5 - IN A,(WG_COM) + IN A,(FDC_93.Command) AND 127 POP BC JR Z,AUTO_20A6 DJNZ AUTO_2090 - LD HL,DOS_ERROR + LD HL,ZX_VARS.DOS_ERROR INC (HL) AUTO_20A6: POP HL @@ -3455,7 +3557,7 @@ AUTO_20A6: AUTO_20AF: LD B,1 AUTO_20B1: - IN A,(P_DOS_FF) + IN A,(FDC_93.DrvCTRL) AND 192 JR Z,AUTO_20B1 RET M @@ -3464,7 +3566,7 @@ AUTO_20B1: RET FORMAT_ALL: - LD HL,MED_START + LD HL,ZX_VARS.MED_START LD B,(HL) CALL FORM_F01 LD E,255 @@ -3476,7 +3578,7 @@ AUTO_20C6: CALL PRINT_TRK CALL set_side_0 ; SET SIDE 0 CALL PRINT_SIDE0 ; FORMATING ! - LD A,(DOS_CH_ADR+1) + LD A,(ZX_VARS.DOS_CH_ADR+1) CP 128 JR NZ,AUTO_20E1 CALL set_side_1 ; SET SIDE 1 @@ -3488,34 +3590,34 @@ AUTO_20E1: AUTO_20E5: PUSH AF - LD A,(DISK_1_FLG) + LD A,(ZX_VARS.DISK_1_FLG) CP 255 JR Z,AUTO_211C POP AF CALL BUFER_OFF xchg_intf1: PUSH AF - LD A,(BEG_ADRESS) - CP 244 + LD A,(ZX_VARS.BEG_ADRESS) + CP #F4 JR Z,AUTO_211C XOR A - LD HL,INT_1_VAR + LD HL,ZX_VARS.INT_1_VAR OR (HL) LD (HL),255 JR Z,AUTO_211C - LD A,(BUF_FLAG) + LD A,(ZX_VARS.BUF_FLAG) OR A - LD HL,AUTO_5CC3 - LD DE,AUTO_5D33 + LD HL,ZX_VARS.AUTO_5CC3 + LD DE,ZX_VARS.AUTO_5D33 JR NZ,AUTO_2111 LD DE,AUTO_5E34 AUTO_2111: - LD B,'-' + LD B,#2D AUTO_2113: LD C,(HL) LD A,(DE) LD (HL),A -AUTO_2116: +;AUTO_2116: LD A,C LD (DE),A INC HL @@ -3526,60 +3628,60 @@ AUTO_211C: RET AUTO_211E: - LD HL,(E_LINE) + LD HL,(ZX_VARS.E_LINE) LD (HL),13 - LD (K_CUR),HL + LD (ZX_VARS.K_CUR),HL INC HL LD (HL),128 RET AUTO_212A: - LD DE,(E_LINE) - LD HL,COM_LN_COPY + LD DE,(ZX_VARS.E_LINE) + LD HL,ZX_VARS.COM_LN_COPY CALL AUTO_02B0 RET INPUT_LINE: - LD A,(DOS_ERR_2) + LD A,(ZX_VARS.DOS_ERR_2) OR A PUSH AF CALL NZ,AUTO_212A POP AF CALL Z,AUTO_211E - LD HL,(E_LINE) + LD HL,(ZX_VARS.E_LINE) CALL PRINT_CR - LD A,(CONT_DISK) + LD A,(ZX_VARS.CONT_DISK) ADD A,'A' RST RST10 LD A,'>' RST RST10 LD (IY+0),255 EI - JP EDIT_X00 + JP EDIT_X00 ;!FIXIT зачем вместо #1D90 EDIT_X00??? AUTO_2158: CALL BASIC_RST20 CALL AUTO_1D8C CP ',' JP NZ,CMD_ERROR - LD HL,(MED_LEN) - LD (DOS_CH_ADR),HL + LD HL,(ZX_VARS.MED_LEN) + LD (ZX_VARS.DOS_CH_ADR),HL CALL AUTO_1E0B CALL SINTAX_RET - LD HL,(MED_LEN) + LD HL,(ZX_VARS.MED_LEN) LD A,H OR A JP NZ,CMD_ERROR INC HL - LD (MED_START),HL - LD HL,(DOS_CH_ADR) - LD (MED_LEN),HL + LD (ZX_VARS.MED_START),HL + LD HL,(ZX_VARS.DOS_CH_ADR) + LD (ZX_VARS.MED_LEN),HL RET ; ; ; CMD_OPEN: - LD HL,(ADR_DOS_COM) - LD (CH_ADR),HL + LD HL,(ZX_VARS.ADR_DOS_COM) + LD (ZX_VARS.CH_ADR),HL CALL AUTO_1E0B CALL AUTO_1DD0 AUTO_218E: @@ -3600,12 +3702,12 @@ AUTO_219A: CP 'W' JP NZ,CMD_ERROR AUTO_21AE: - LD (VAR_3),A + LD (ZX_VARS.VAR_3),A CALL SINTAX_RET LD A,'#' - LD (FL_TYPE),A + LD (ZX_VARS.FL_TYPE),A LD A,0 - LD (FL_START),A + LD (ZX_VARS.FL_START),A CALL AUTO_21DB PUSH AF CALL AUTO_220F @@ -3614,28 +3716,28 @@ AUTO_21AE: CALL NZ,AUTO_2288 POP AF CALL AUTO_2242 - LD HL,(ADR_DOS_COM) + LD HL,(ZX_VARS.ADR_DOS_COM) LD BC,AUTO_0124 ADD HL,BC - LD (ADR_DOS_COM),HL + LD (ZX_VARS.ADR_DOS_COM),HL JP AUTO_01D3 AUTO_21DB: LD A,10 - LD (S_NAME_NUM),A + LD (ZX_VARS.S_NAME_NUM),A CALL AUTO_1CB0 PUSH AF CALL RD_HEAD_DSK POP AF JR NZ,AUTO_2206 - LD A,(VAR_3) + LD A,(ZX_VARS.VAR_3) CP 'R' JR Z,AUTO_2201 AUTO_21F1: - LD HL,FL_START + LD HL,ZX_VARS.FL_START INC (HL) CALL AUTO_1CB3 JR Z,AUTO_21F1 - LD HL,FL_START + LD HL,ZX_VARS.FL_START DEC (HL) CALL AUTO_1CB3 AUTO_2201: @@ -3643,21 +3745,20 @@ AUTO_2201: XOR A RET AUTO_2206: - LD A,(VAR_3) + LD A,(ZX_VARS.VAR_3) CP 'R' RET NZ JP AUTO_03D9 AUTO_220F: - LD A,(MED_LEN) - RST RST20 - DW 01727H + LD A,(ZX_VARS.MED_LEN) + RST_ROM BASIC_FN.x48.str_data1 LD A,B OR C JP NZ,AUTO_221B RET AUTO_221B: LD A,25 - LD (ERR_NR),A + LD (ZX_VARS.ERR_NR),A LD HL,AUTO_2804 LD A,10 AUTO_2225: @@ -3670,7 +3771,7 @@ AUTO_222F: PUSH HL LD C,' ' RST RST28 - LD A,(MED_START) + LD A,(ZX_VARS.MED_START) LD (HL),A INC HL XOR A @@ -3686,19 +3787,19 @@ AUTO_2242: PUSH AF CALL AUTO_220F EX DE,HL - LD HL,(BAS_PROG) - LD BC,(CHANS) + LD HL,(ZX_VARS.BAS_PROG) + LD BC,(ZX_VARS.CHANS) SBC HL,BC EX DE,HL LD (HL),E INC HL LD (HL),D CALL AUTO_22B2 - LD A,(VAR_3) + LD A,(ZX_VARS.VAR_3) CP 165 CALL Z,AUTO_222F JR Z,AUTO_226B - LD A,(VAR_3) + LD A,(ZX_VARS.VAR_3) CP 'R' LD A,255 JR NZ,AUTO_226B @@ -3724,27 +3825,27 @@ AUTO_2270: CALL Z,READ_DISK RET AUTO_2288: - LD HL,(MED_START) + LD HL,(ZX_VARS.MED_START) PUSH HL LD HL,AUTO_2000 - LD (MED_START),HL + LD (ZX_VARS.MED_START),HL CALL AUTO_229A POP HL - LD (MED_START),HL + LD (ZX_VARS.MED_START),HL RET AUTO_229A: LD HL,AUTO_1000 - LD (DOS_CH_ADR),HL + LD (ZX_VARS.DOS_CH_ADR),HL CALL AUTO_1AC4 CALL AUTO_1B59 - LD HL,START - LD (FL_LEN),HL + LD HL,0 + LD (ZX_VARS.FL_LEN),HL CALL AUTO_166B JP AUTO_1E43 AUTO_22B2: - LD HL,(BAS_PROG) + LD HL,(ZX_VARS.BAS_PROG) DEC HL - LD (CUR_CHL),HL + LD (ZX_VARS.CUR_CHL),HL PUSH HL LD BC,AUTO_0124 CALL AUTO_1E32 @@ -3776,23 +3877,23 @@ AUTO_22C4: INC HL LD (HL),1 INC HL - LD A,(OPER_DISK) + LD A,(ZX_VARS.OPER_DISK) LD (HL),A INC HL - LD A,(FL_NUMBER) + LD A,(ZX_VARS.FL_NUMBER) LD (HL),A INC HL - LD A,(VAR_3) + LD A,(ZX_VARS.VAR_3) CP 'R' LD (HL),0 JR Z,AUTO_22FC - LD A,(FL_LEN) + LD A,(ZX_VARS.FL_LEN) LD (HL),A AUTO_22FC: INC HL LD (HL),B JR Z,AUTO_2304 - LD A,(FL_LEN+1) + LD A,(ZX_VARS.FL_LEN+1) LD (HL),A AUTO_2304: INC HL @@ -3802,7 +3903,7 @@ AUTO_2304: LD DE,RST10 ADD HL,DE EX DE,HL - LD HL,FL_NAME + LD HL,ZX_VARS.FL_NAME LD BC,RST10 LDIR POP HL @@ -3819,7 +3920,7 @@ AUTO_2321: LD C,'$' RST28_EXE: LD B,0 - LD HL,(CUR_CHL) + LD HL,(ZX_VARS.CUR_CHL) ADD HL,BC RET AUTO_232A: @@ -3846,7 +3947,7 @@ AUTO_232A: CP 127 POP HL JR Z,AUTO_2358 - LD HL,(CUR_CHL) + LD HL,(ZX_VARS.CUR_CHL) CALL AUTO_26E1 LD C,14 RST RST28 @@ -3869,24 +3970,24 @@ AUTO_2367: RET AUTO_2370: CALL AUTO_2367 - LD (MED_START),DE + LD (ZX_VARS.MED_START),DE JR AUTO_2381 AUTO_2379: CALL AUTO_2367 INC E - LD (MED_START),DE + LD (ZX_VARS.MED_START),DE AUTO_2381: CALL AUTO_229A CALL BUFER_OFF LD C,16 RST RST28 EX DE,HL - LD HL,FL_NAME + LD HL,ZX_VARS.FL_NAME LD BC,RST10 LDIR LD C,12 RST RST28 - LD A,(FL_NUMBER) + LD A,(ZX_VARS.FL_NUMBER) LD (HL),A RET AUTO_239B: @@ -3931,7 +4032,7 @@ AUTO_23CF: INC (HL) LD C,16 RST RST28 - LD DE,FL_NAME + LD DE,ZX_VARS.FL_NAME LD BC,RST10 LDIR CALL AUTO_1CB3 @@ -3941,12 +4042,12 @@ AUTO_23E4: LD C,16 RST RST28 EX DE,HL - LD HL,FL_NAME + LD HL,ZX_VARS.FL_NAME LD BC,RST10 LDIR LD C,12 RST RST28 - LD A,(FL_NUMBER) + LD A,(ZX_VARS.FL_NUMBER) LD (HL),A XOR A RET @@ -3974,7 +4075,7 @@ AUTO_2418: LD B,1 JP READ_DISK AUTO_2423: - LD HL,(CUR_CHL) + LD HL,(ZX_VARS.CUR_CHL) LD BC,AUTO_001E ADD HL,BC LD E,(HL) @@ -4005,14 +4106,14 @@ AUTO_2443: LD A,(HL) JP SET_DISK AUTO_244A: - LD HL,RET_INS + LD HL,ZX_VARS.RET_INS PUSH HL LD HL,xchg_intf1 PUSH HL PUSH AF CALL xchg_intf1 LD A,10 - LD (S_NAME_NUM),A + LD (ZX_VARS.S_NAME_NUM),A POP AF CALL AUTO_24A2 PUSH AF @@ -4037,7 +4138,7 @@ AUTO_246E: ADD HL,BC CP (HL) RET NZ - LD HL,BEG_ADRESS + LD HL,ZX_VARS.BEG_ADRESS LD A,(HL) CP 244 JR Z,AUTO_2492 @@ -4049,10 +4150,9 @@ AUTO_246E: AUTO_2492: LD A,7 AUTO_2494: - LD (ERR_NR),A + LD (ZX_VARS.ERR_NR),A CALL AUTO_20E5 - RST RST20 - DW 00058H + RST_ROM BASIC_FN.x48.error_4 RET AUTO_249E: LD A,23 @@ -4086,7 +4186,7 @@ AUTO_24C2: LD C,(HL) LD A,D EX DE,HL - LD HL,(VAR_1) + LD HL,(ZX_VARS.VAR_1) ADD HL,BC CP 6 LD (HL),A @@ -4129,23 +4229,23 @@ AUTO_24F2: LD A,D RET AUTO_24F8: - LD HL,(WORK_SP) - LD (VAR_1),HL + LD HL,(ZX_VARS.WORK_SPACE) + LD (ZX_VARS.VAR_1),HL LD BC,RST10 JP AUTO_1E23 AUTO_2504: LD (HL),13 - LD HL,(CH_ADR) - LD (MED_START),HL - LD HL,(VAR_1) - LD (CH_ADR),HL - LD HL,FLAGS + LD HL,(ZX_VARS.CH_ADR) + LD (ZX_VARS.MED_START),HL + LD HL,(ZX_VARS.VAR_1) + LD (ZX_VARS.CH_ADR),HL + LD HL,ZX_VARS.FLAGS RES 7,(HL) CALL AUTO_1DC1 - LD HL,FLAGS + LD HL,ZX_VARS.FLAGS SET 7,(HL) - LD HL,(VAR_1) - LD (CH_ADR),HL + LD HL,(ZX_VARS.VAR_1) + LD (ZX_VARS.CH_ADR),HL CALL AUTO_1DC1 CALL AUTO_1DB9 PUSH BC @@ -4154,26 +4254,26 @@ AUTO_2504: RST RST28 LD B,(HL) XOR A - LD HL,START - LD (MED_LEN),HL + LD HL,0 + LD (ZX_VARS.MED_LEN),HL AUTO_2538: ADD HL,DE JR NC,AUTO_2544 PUSH HL - LD HL,(MED_LEN) + LD HL,(ZX_VARS.MED_LEN) INC HL - LD (MED_LEN),HL + LD (ZX_VARS.MED_LEN),HL POP HL AUTO_2544: DJNZ AUTO_2538 - LD (DOS_CH_ADR),HL - LD A,(MED_LEN) - LD HL,DOS_CH_ADR+1 + LD (ZX_VARS.DOS_CH_ADR),HL + LD A,(ZX_VARS.MED_LEN) + LD HL,ZX_VARS.DOS_CH_ADR+1 RRD AND 15 - LD (MED_LEN),A - LD HL,(MED_START) - LD (CH_ADR),HL + LD (ZX_VARS.MED_LEN),A + LD HL,(ZX_VARS.MED_START) + LD (ZX_VARS.CH_ADR),HL CALL AUTO_2568 LD C,'!' RST RST28 @@ -4185,30 +4285,30 @@ AUTO_2544: AUTO_2568: LD C,25 RST RST28 - LD A,(DOS_CH_ADR+1) + LD A,(ZX_VARS.DOS_CH_ADR+1) CP (HL) JP NZ,AUTO_2584 LD C,14 RST RST28 - LD A,(MED_LEN) + LD A,(ZX_VARS.MED_LEN) CP (HL) JP NZ,AUTO_25A7 AUTO_257C: LD C,13 RST RST28 - LD A,(DOS_CH_ADR) + LD A,(ZX_VARS.DOS_CH_ADR) LD (HL),A RET AUTO_2584: CALL AUTO_25CA CALL NZ,AUTO_25C3 - LD A,(DOS_CH_ADR+1) + LD A,(ZX_VARS.DOS_CH_ADR+1) LD C,25 RST RST28 LD (HL),A LD C,16 RST RST28 - LD DE,FL_NAME + LD DE,ZX_VARS.FL_NAME LD BC,RST10 LDIR CALL AUTO_1CB3 @@ -4219,7 +4319,7 @@ AUTO_25A7: CALL AUTO_25CA CALL NZ,AUTO_25C3 AUTO_25AD: - LD A,(MED_LEN) + LD A,(ZX_VARS.MED_LEN) LD C,14 RST RST28 LD (HL),A @@ -4228,7 +4328,7 @@ AUTO_25AD: CALL AUTO_2418 POP HL DEC HL - LD A,(DOS_CH_ADR) + LD A,(ZX_VARS.DOS_CH_ADR) LD (HL),A JR AUTO_257C AUTO_25C3: @@ -4243,40 +4343,40 @@ AUTO_25CA: LD (HL),0 RET AUTO_25D2: - LD HL,(DOS_CH_ADR+1) + LD HL,(ZX_VARS.DOS_CH_ADR+1) LD H,' ' - LD (MED_START),HL - LD HL,(DOS_CH_ADR) + LD (ZX_VARS.MED_START),HL + LD HL,(ZX_VARS.DOS_CH_ADR) PUSH HL - LD HL,(MED_LEN) + LD HL,(ZX_VARS.MED_LEN) PUSH HL CALL AUTO_2381 POP HL - LD (MED_LEN),HL + LD (ZX_VARS.MED_LEN),HL POP HL - LD (DOS_CH_ADR),HL + LD (ZX_VARS.DOS_CH_ADR),HL JR AUTO_25AD AUTO_25EF: CALL xchg_intf1 - LD HL,TV_FLAG + LD HL,ZX_VARS.TV_FLAG RES 3,(HL) - LD HL,(ERR_SP) + LD HL,(ZX_VARS.ERR_SP) LD E,(HL) INC HL LD D,(HL) OR A - LD HL,AUTO_107F + LD HL,BASIC_FN.x48.ed_error ;48 basic routine SBC HL,DE JR NZ,AUTO_2626 - LD SP,(ERR_SP) + LD SP,(ZX_VARS.ERR_SP) POP DE POP DE - LD (ERR_SP),DE + LD (ZX_VARS.ERR_SP),DE AUTO_260F: CALL AUTO_262B JR C,AUTO_261D AUTO_2614: - LD HL,RET_INS + LD HL,ZX_VARS.RET_INS PUSH HL LD HL,AUTO_20E5 PUSH HL @@ -4284,15 +4384,14 @@ AUTO_2614: AUTO_261D: CP 13 JR Z,AUTO_2614 - RST RST20 - DW 00F85H + RST_ROM BASIC_FN.x48.add_char_keeping_current_mode JR AUTO_260F AUTO_2626: CALL AUTO_262B JR AUTO_2614 AUTO_262B: LD A,10 - LD (S_NAME_NUM),A + LD (ZX_VARS.S_NAME_NUM),A CALL AUTO_2650 JR Z,AUTO_2642 CP 127 @@ -4321,18 +4420,17 @@ AUTO_2650: ; ; CMD_CLOSE: - LD HL,(ADR_DOS_COM) - LD (CH_ADR),HL + LD HL,(ZX_VARS.ADR_DOS_COM) + LD (ZX_VARS.CH_ADR),HL CALL AUTO_1E0B CALL SINTAX_RET - LD A,(MED_LEN) - RST RST20 - DW 01727H + LD A,(ZX_VARS.MED_LEN) + RST_ROM BASIC_FN.x48.str_data1 LD A,B OR C JP Z,AUTO_01D3 PUSH HL - LD HL,(CHANS) + LD HL,(ZX_VARS.CHANS) ADD HL,BC LD A,(HL) LD HL,AUTO_3D0E @@ -4342,20 +4440,20 @@ CMD_CLOSE: LD (HL),0 INC HL LD (HL),0 - LD (DOS_CH_ADR),BC - LD HL,(CHANS) + LD (ZX_VARS.DOS_CH_ADR),BC + LD HL,(ZX_VARS.CHANS) ADD HL,BC DEC HL - LD (MED_START),HL + LD (ZX_VARS.MED_START),HL CALL AUTO_26CE - LD HL,(MED_START) + LD HL,(ZX_VARS.MED_START) LD BC,AUTO_0124 CALL AUTO_1E2E - LD HL,REP_K_TYME + LD HL,ZX_VARS.REP_K_TYME LD B,16 AUTO_269D: PUSH BC - LD BC,(DOS_CH_ADR) + LD BC,(ZX_VARS.DOS_CH_ADR) LD E,(HL) INC HL LD D,(HL) @@ -4381,10 +4479,10 @@ AUTO_26BC: INC HL POP BC DJNZ AUTO_269D - LD HL,(ADR_DOS_COM) + LD HL,(ZX_VARS.ADR_DOS_COM) LD BC,AUTO_0124 SBC HL,BC - LD (ADR_DOS_COM),HL + LD (ZX_VARS.ADR_DOS_COM),HL JP AUTO_01D3 AUTO_26CE: LD BC,CONT_1+6 @@ -4392,8 +4490,8 @@ AUTO_26CE: LD A,(HL) OR A RET Z - LD HL,(MED_START) - LD (CUR_CHL),HL + LD HL,(ZX_VARS.MED_START) + LD (ZX_VARS.CUR_CHL),HL CALL AUTO_26E1 JP AUTO_23FC AUTO_26E1: @@ -4409,7 +4507,7 @@ AUTO_26E1: LD (HL),D LD C,16 RST RST28 - LD DE,FL_NAME + LD DE,ZX_VARS.FL_NAME LD BC,RST10 LDIR CALL AUTO_2443 @@ -4450,32 +4548,32 @@ set_error_26: JR AUTO_2731 LD A,18 AUTO_2731: - LD (ERR_NR),A + LD (ZX_VARS.ERR_NR),A RET LD A,3 JR AUTO_2731 AUTO_2739: XOR A - LD (MED_START+1),A - LD (DOS_ERROR),A - IN A,(WG_COM) - LD (DRV_READY),A + LD (ZX_VARS.MED_START+1),A + LD (ZX_VARS.DOS_ERROR),A + IN A,(FDC_93.Command) + LD (ZX_VARS.DRV_READY),A LD E,D PUSH DE LD A,E - OUT (WG_DATA),A + OUT (FDC_93.Data),A LD A,24 CALL WG93_EXE - LD A,(DRV_READY) + LD A,(ZX_VARS.DRV_READY) AND 128 CALL NZ,pause_750ms POP DE CALL AUTO_207D - LD A,(DOS_ERROR) + LD A,(ZX_VARS.DOS_ERROR) OR A RET Z LD A,7 - LD (DOS_ERR_2),A + LD (ZX_VARS.DOS_ERR_2),A RET AUTO_2766: DB "O.K.",0 @@ -4484,8 +4582,8 @@ AUTO_276B: AUTO_2779: DB "BACKUP DISK",141 AUTO_2785: - DB "Insert Destination disk",13,"then " - DB "press Y",0 + DB "Insert Destination disk",13 + DB "then press Y",0 AUTO_27AA: DB "Insert Source disk then press Y",0 AUTO_27CA: @@ -4498,29 +4596,29 @@ AUTO_27ED: DB "Directory full",141 AUTO_27FC: DB "No disk",141 - DISPLAY "10k" AUTO_2804: DB "Stream opened",141 AUTO_2812: DB "Not disk file",141 AUTO_2820: - DB "File exists",13,"Over write?(Y/N",169 + DB "File exists",13 + DC "Over write?(Y/N)" AUTO_283C: PUSH AF PUSH BC - LD (WORK_4),DE - LD (WORK_2),HL + LD (ZX_VARS.WORK_4),DE + LD (ZX_VARS.WORK_2),HL CALL xchg_intf1 LD A,255 - LD (MSG_FLAG),A - LD (FL_NUMBER+1),A + LD (ZX_VARS.MSG_FLAG),A + LD (ZX_VARS.FL_NUMBER+1),A POP BC POP AF LD HL,AUTO_0201 - LD (ADR_RET),HL - LD HL,START + LD (ZX_VARS.ADR_RET),HL + LD HL,0 ADD HL,SP - LD (DOS_SP),HL + LD (ZX_VARS.DOS_SP),HL DEC HL DEC HL LD SP,HL @@ -4539,8 +4637,8 @@ AUTO_2869: LD HL,AUTO_01D3 PUSH HL PUSH DE - LD HL,(WORK_2) - LD DE,(WORK_4) + LD HL,(ZX_VARS.WORK_2) + LD DE,(ZX_VARS.WORK_4) RET AUTO_287F: CP 255 @@ -4615,7 +4713,7 @@ AUTO_28E0: AUTO_28E3: LD A,255 AUTO_28E5: - LD DE,FL_NAME + LD DE,ZX_VARS.FL_NAME LD BC,RST10 OR A JR Z,AUTO_28EF @@ -4628,18 +4726,18 @@ AUTO_28F2: CALL AUTO_1AC4 JP AUTO_1B27 AUTO_28FB: - LD (MED_START),HL - LD (DOS_CH_ADR),DE - LD (MED_LEN),DE + LD (ZX_VARS.MED_START),HL + LD (ZX_VARS.DOS_CH_ADR),DE + LD (ZX_VARS.MED_LEN),DE JP TYPE_FL_X02 CALL AUTO_1AC4 ; ??? JP FORM_X04 ; ??? AUTO_290F: OR A - LD (DOS_ERROR),A - LD (DOS_CH_ADR),HL - LD (MED_LEN),DE + LD (ZX_VARS.DOS_ERROR),A + LD (ZX_VARS.DOS_CH_ADR),HL + LD (ZX_VARS.MED_LEN),DE CALL AUTO_1CB3 CALL AUTO_18A4 CALL AUTO_18AB @@ -4673,7 +4771,7 @@ BUFER_ON: PUSH DE PUSH BC PUSH AF - LD HL,BUF_FLAG + LD HL,ZX_VARS.BUF_FLAG LD A,(HL) OR A JR Z,AUTO_2992 @@ -4684,9 +4782,9 @@ BUFER_ON: POP BC POP HL LD (HL),0 - LD HL,BUFER + LD HL,ZX_VARS.BUFFER CALL AUTO_1E32 - LD HL,(ADR_DOS_COM) + LD HL,(ZX_VARS.ADR_DOS_COM) LD BC,AUTO_0100+1 ADD HL,BC JR AUTO_298F @@ -4695,20 +4793,20 @@ BUFER_OFF: PUSH DE PUSH BC PUSH AF - LD HL,BUF_FLAG + LD HL,ZX_VARS.BUF_FLAG LD A,(HL) OR A JR NZ,AUTO_2992 LD (HL),255 - LD HL,BUFER + LD HL,ZX_VARS.BUFFER LD BC,AUTO_0100+1 CALL AUTO_1E2E OR A LD BC,AUTO_0100+1 - LD HL,(ADR_DOS_COM) + LD HL,(ZX_VARS.ADR_DOS_COM) SBC HL,BC AUTO_298F: - LD (ADR_DOS_COM),HL + LD (ZX_VARS.ADR_DOS_COM),HL AUTO_2992: POP AF POP BC @@ -4717,59 +4815,47 @@ AUTO_2992: RET ; ; -; -CMD_40: - XOR A - - +; Выполнение команды "40". Установите #5D11 и #5C3B. Используется также с адреса: +;#2998 (выполнение команды установки типа дисковода; установите все для #2997 плюс в A тип дисковода). +CMD_40: XOR A ;дисковод 40-дорожечный односторонний +;Ошибка!!! Во-первых, почему дисковод односторонний? +; во-вторых, надо проверять возможность использования дисковода в требуемом режиме. AUTO_2998: - BLOCK #2998 - $,255 - LD (MED_START),A - CALL SINTAX_RET - CALL TEST_CR - JP Z,CMD_ERROR - CALL get_disk_type - LD A,(MED_START) - LD (HL),A - JP AUTO_03E1 -; -; -; -CMD_80: - LD A,128 + LD (ZX_VARS.MED_START),A ;сохранение типа дисковода + CALL SINTAX_RET ;если идет проверка на синтакси + CALL TEST_CR ;проверка второго символа строк + JP Z,CMD_ERROR ;если это ENTER, то *ERROR* + CALL get_disk_type ;берем адрес ячейки с типом дис + LD A,(ZX_VARS.MED_START) ;установка типа дисковода + LD (HL),A + JP AUTO_03E1 ;сообщение O.K. + ; Выполнение команды "80". Установите #5D11 и #5C3B. +CMD_80: LD A,#80 ;дисковод 80-дорожечный односторонний +;Ошибка!!! Во-первых, почему дисковод односторонний? +; во-вторых, надо проверять возможность использования дисковода в требуемом режиме. JR AUTO_2998 -AUTO_29B2: - DB 13,"*ERROR*",141 -AUTO_29BB: - DB 13,"No space",141 -AUTO_29C5: - DB 13,"File exists",141 -AUTO_29D2: - DB " Free",141 -READ_ONLY_MSG: - DB 13,"Read Onl",249 -DISK_ERROR_MSG: - DB 13,"Disc Erro",242 -AUTO_29ED: - DB 13,"Rec. O/",198 -AUTO_29F7: - DB "Title:",160 -AUTO_29FE: - DB 13,"Retry,Abort,Ignore?",0 -AUTO_2A13: - DB 13,"Trk",160 -AUTO_2A18: - DB " sec",160 -AUTO_2A1D: - DB " Del. File",141 -AUTO_2A28: - DB 13,"No" -AUTO_2A2B: - DB " File(s)",141,0 +; +; +; +;Адрес #29B2. Тексты сообщений TR-DOS. +AUTO_29B2: DB 13, "*ERROR*", 141 +AUTO_29BB: DB 13, "No space", 141 +AUTO_29C5: DB 13, "File exists", 141 +AUTO_29D2: DB " Free", 141 +READ_ONLY_MSG: DC 13, "Read Only" +DISK_ERROR_MSG: DC 13, "Disk Error" +AUTO_29ED: DC 13, "Rec. O/F" +AUTO_29F7: DC "Title: " +AUTO_29FE: DZ 13, "Retry,Abort,Ignore?" +AUTO_2A13: DC 13, "Trk " +AUTO_2A18: DC " sec " +AUTO_2A1D: DB " Del. File", 141 +AUTO_2A28: DB 13, "No" +AUTO_2A2B: DZ " File(s)", 141 AUTO_2A35: LD HL,AUTO_2A41 LD DE,AUTO_4080 - LD BC,RST20 + LD BC,20 LDIR RET ; @@ -4777,18 +4863,18 @@ AUTO_2A35: ; AUTO_2A41: LD A,(AUTO_03B5) - CP 243 + CP #F3 LD A,16 JR Z,AUTO_2A4B XOR A AUTO_2A4B: - LD (K_STATE+1),A + LD (ZX_VARS.K_STATE+1),A LD BC,PORT_128 LD A,16 OUT (C),A RET MAGIC_2: -AUTO_2A56: +;AUTO_2A56: PUSH AF PUSH BC PUSH DE @@ -4805,19 +4891,19 @@ AUTO_2A56: PUSH AF LD A,R PUSH AF - LD HL,START + LD HL,0 ADD HL,SP PUSH HL LD A,3Ch - OUT (P_DOS_FF),A + OUT (FDC_93.DrvCTRL),A LD A,'?' LD I,A - IN A,(WG_COM) + IN A,(FDC_93.Command) AND 128 RRCA RRCA RRCA - LD (K_STATE+1),A + LD (ZX_VARS.K_STATE+1),A CALL AUTO_2F65 CALL pause_750ms CALL pause_750ms @@ -4830,11 +4916,11 @@ AUTO_2A56: CALL AUTO_2D73 POP HL PUSH HL - LD DE,RST08 + LD DE,8 CALL AUTO_2F1B LD HL,AUTO_40E3 LD A,(HL) - LD (K_STATE),A + LD (ZX_VARS.K_STATE),A INC HL LD A,(HL) INC (HL) @@ -4848,7 +4934,7 @@ AUTO_2A56: SBC HL,DE LD (AUTO_40E5),HL LD HL,AUTO_4000 - LD DE,RST08 + LD DE,8 CALL AUTO_2D73 POP HL LD DE,(AUTO_40E1) @@ -4858,11 +4944,11 @@ AUTO_2A56: POP DE CALL AUTO_2D4C PUSH DE - LD A,3Ch - OUT (P_DOS_FF),A + LD A,#3C + OUT (FDC_93.DrvCTRL),A CALL AUTO_2F65 LD HL,AUTO_4000 - LD DE,RST08 + LD DE,8 LD B,1 CALL AUTO_2F1B POP DE @@ -4870,7 +4956,7 @@ AUTO_2A56: LD (AUTO_40E1),DE PUSH HL LD HL,AUTO_4000 - LD DE,RST08 + LD DE,8 LD B,1 CALL AUTO_2D73 LD A,(AUTO_40E4) @@ -4899,13 +4985,13 @@ AUTO_2B09: INC HL LD (HL),D LD HL,AUTO_4000 - LD DE,START - IN A,(WG_SEC) + LD DE,0 + IN A,(FDC_93.Sector) DEC A LD E,A LD B,1 CALL AUTO_2D73 - LD HL,START + LD HL,0 ADD HL,SP LD (AUTO_4140),HL LD SP,AUTO_41FF @@ -4935,7 +5021,7 @@ AUTO_2B58: LD A,170 LD (AUTO_4130),A LD D,5 - LD A,(K_STATE+1) + LD A,(ZX_VARS.K_STATE+1) OR D LD D,A OUT (C),D @@ -4982,7 +5068,7 @@ AUTO_2B95: INC A LD (AUTO_40E4),A LD HL,(AUTO_40E5) - LD DE,START+1 + LD DE,1 SBC HL,DE LD (AUTO_40E5),HL RET C @@ -5014,7 +5100,7 @@ AUTO_2B95: LD BC,RST10 EX DE,HL LDIR - IN A,(WG_SEC) + IN A,(FDC_93.Sector) DEC A LD E,A LD D,0 @@ -5119,7 +5205,7 @@ AUTO_2C7E: LD BC,RST10 EX DE,HL LDIR - IN A,(WG_SEC) + IN A,(FDC_93.Sector) DEC A LD E,A LD D,0 @@ -5173,12 +5259,12 @@ AUTO_2D1E: RET AUTO_2D2A: LD HL,AUTO_4000 - LD DE,RST08 + LD DE,8 CALL AUTO_2F1B RET AUTO_2D34: LD HL,AUTO_4000 - LD DE,RST08 + LD DE,8 CALL AUTO_2D73 RET AUTO_2D3E: @@ -5186,14 +5272,14 @@ AUTO_2D3E: LD C,D CALL AUTO_2F3A LD HL,AUTO_C000 - LD B,'@' + LD B,#40 JR AUTO_2D58 AUTO_2D4C: CALL AUTO_2F65 LD C,D CALL AUTO_2F3A LD HL,AUTO_4000 - LD B,192 + LD B,#C0 AUTO_2D58: PUSH BC PUSH DE @@ -5216,7 +5302,7 @@ AUTO_2D6F: AUTO_2D73: LD A,E INC A - OUT (WG_SEC),A + OUT (FDC_93.Sector),A PUSH HL LD D,20 PUSH DE @@ -5224,11 +5310,11 @@ AUTO_2D7B: DI LD C,127 LD A,160 - OUT (WG_COM),A + OUT (FDC_93.Command),A CALL AUTO_3FCA POP DE POP HL - IN A,(WG_COM) + IN A,(FDC_93.Command) AND 127 RET Z DEC D @@ -5237,9 +5323,9 @@ AUTO_2D7B: JR NZ,AUTO_2D7B HALT AUTO_2D92: - LD HL,(FL_START) - LD DE,(FL_PLACE) - LD A,(FL_SIZE) + LD HL,(ZX_VARS.FL_START) + LD DE,(ZX_VARS.FL_PLACE) + LD A,(ZX_VARS.FL_SIZE) LD B,A CALL READ_DISK RET @@ -5258,7 +5344,7 @@ CMD_GOTO: CALL RD_HEAD_DSK CALL AUTO_1CB3 JP NZ,AUTO_03D9 - LD HL,FL_NAME + LD HL,ZX_VARS.FL_NAME LD BC,(AUTO_4020) ADD HL,BC LD (HL),'8' @@ -5285,7 +5371,7 @@ AUTO_2DE3: OUT (C),A POP AF ADD A,'0' - LD HL,FL_NAME + LD HL,ZX_VARS.FL_NAME LD BC,(AUTO_4020) ADD HL,BC LD (HL),A @@ -5297,7 +5383,7 @@ AUTO_2E05: POP BC DJNZ AUTO_2DE3 LD A,' ' - LD HL,FL_NAME + LD HL,ZX_VARS.FL_NAME LD BC,(AUTO_4020) ADD HL,BC LD (HL),A @@ -5319,7 +5405,7 @@ AUTO_2E33: JP NZ,AUTO_03D9 CALL AUTO_165D AUTO_2E39: - LD A,(FL_NAME) + LD A,(ZX_VARS.FL_NAME) CP '$' DI JR NZ,AUTO_2E43 @@ -5328,11 +5414,11 @@ AUTO_2E43: LD SP,AUTO_40F0 CALL get_disk_type LD (AUTO_4010),A - LD A,(PDOS_COPY) + LD A,(ZX_VARS.PDOS_COPY) LD (AUTO_4011),A - LD HL,(FL_START) + LD HL,(ZX_VARS.FL_START) PUSH HL - LD DE,(FL_PLACE) + LD DE,(ZX_VARS.FL_PLACE) PUSH DE INC E LD A,E @@ -5399,7 +5485,7 @@ AUTO_2EBC: JP PO,AUTO_2ECC LD A,0 AUTO_2ECC: - LD (K_STATE),A + LD (ZX_VARS.K_STATE),A POP AF POP HL POP DE @@ -5411,35 +5497,36 @@ AUTO_2ECC: POP HL POP DE POP BC - LD A,(BORDER) + LD A,(ZX_VARS.BORDER) AND '8' RRCA RRCA RRCA - OUT (0FEH),A - LD A,(AUTO_5B08) - CP 238 - JR NZ,AUTO_2EF7 + OUT (BorderColor),A + LD A,(ZX_VARS.SWAP_ROM_PRESENCE) ;берем байт из #5B08 + CP #EE ;там #EE? опкод XOR в процедуре переключения банок ROM Basic 48<->128 + ;Ошибка!!! Число #EE по адресу #5B08 еще ни о чем не говоpит. + JR NZ,AUTO_2EF7 ;если нет, то системных переменных 128К нет PUSH BC LD BC,PORT_128 - LD A,(AUTO_5B5C) + LD A,(ZX_VARS.COPY_P128) OUT (C),A POP BC AUTO_2EF7: - LD A,(K_STATE) + LD A,(ZX_VARS.K_STATE) ;берем флаг прерываний OR A - LD A,201 - LD (K_STATE),A + LD A,#C9 ;установка переключателя ПЗУ на бейсик + LD (ZX_VARS.K_STATE),A JR NZ,AUTO_2F03 EI AUTO_2F03: POP AF - JP K_STATE + JP ZX_VARS.K_STATE AUTO_2F07: LD A,(AUTO_4011) - OR 3Ch + OR #3C AUTO_2F0C: - OUT (P_DOS_FF),A + OUT (FDC_93.DrvCTRL),A RET AUTO_2F0F: LD A,C @@ -5453,7 +5540,7 @@ AUTO_2F0F: AUTO_2F1B: LD A,E INC A - OUT (WG_SEC),A + OUT (FDC_93.Sector),A PUSH HL LD D,20 PUSH DE @@ -5461,11 +5548,11 @@ AUTO_2F23: DI LD C,127 LD A,128 - OUT (WG_COM),A + OUT (FDC_93.Command),A CALL AUTO_3FE5 POP DE POP HL - IN A,(WG_COM) + IN A,(FDC_93.Command) AND 127 RET Z DEC D @@ -5475,8 +5562,8 @@ AUTO_2F23: HALT AUTO_2F3A: LD A,3Ch - OUT (P_DOS_FF),A - LD A,(K_STATE) + OUT (FDC_93.DrvCTRL),A + LD A,(ZX_VARS.K_STATE) AND 8 JR NZ,AUTO_2F4F LD A,C @@ -5485,17 +5572,17 @@ AUTO_2F3A: LD C,A JR NC,AUTO_2F4F LD A,2Ch - OUT (P_DOS_FF),A + OUT (FDC_93.DrvCTRL),A AUTO_2F4F: LD A,C AUTO_2F50: - OUT (WG_DATA),A + OUT (FDC_93.Data),A CALL pause_50ms LD A,24 AUTO_2F57: - OUT (WG_COM),A + OUT (FDC_93.Command),A AUTO_2F59: - IN A,(P_DOS_FF) + IN A,(FDC_93.DrvCTRL) AND 128 JR Z,AUTO_2F59 PUSH BC @@ -5506,7 +5593,7 @@ AUTO_2F65: LD A,8 JR AUTO_2F57 AUTO_2F69: - LD HL,(DOS_SP) + LD HL,(ZX_VARS.DOS_SP) DEC HL DEC HL LD SP,HL @@ -5515,8 +5602,8 @@ AUTO_2F69: ; RST20 procedure ; RST20_EXE: - LD (WORK_2),HL - LD (WORK_4),DE + LD (ZX_VARS.WORK_2),HL + LD (ZX_VARS.WORK_4),DE POP HL LD E,(HL) INC HL @@ -5526,36 +5613,36 @@ RST20_EXE: LD HL,AUTO_3D2F PUSH HL PUSH DE - LD HL,RET_INS + LD HL,ZX_VARS.RET_INS PUSH HL - LD HL,(WORK_2) - LD DE,(WORK_4) + LD HL,(ZX_VARS.WORK_2) + LD DE,(ZX_VARS.WORK_4) RET ; ; INIT DOS VARS ; AUTO_2F90: ; INIT DATA DOS LD HL,0FFFFh - LD (TIME_A),HL - LD (TIME_C),HL - LD (DISK_C),HL + LD (ZX_VARS.TIME_A),HL + LD (ZX_VARS.TIME_C),HL + LD (ZX_VARS.DISK_C),HL CALL INIT_2X80_1 ; *** !!! *** -; LD (DISK_A),HL +; LD (ZX_VARS.DISK_A),HL XOR A - LD (FLAG_BOOT),A - LD (CONT_DISK),A - LD (INT_1_VAR),A - LD (DOS_ERR_2),A - LD (FL_NUMBER+1),A + LD (ZX_VARS.FLAG_BOOT),A + LD (ZX_VARS.CONT_DISK),A + LD (ZX_VARS.INT_1_VAR),A + LD (ZX_VARS.DOS_ERR_2),A + LD (ZX_VARS.FL_NUMBER+1),A LD A,255 - OUT (P_DOS_FF),A - LD (ERR_NR),A - LD (PDOS_COPY),A - LD (BUF_FLAG),A + OUT (FDC_93.DrvCTRL),A + LD (ZX_VARS.ERR_NR),A + LD (ZX_VARS.PDOS_COPY),A + LD (ZX_VARS.BUF_FLAG),A LD A,201 - LD (RET_INS),A + LD (ZX_VARS.RET_INS),A LD A,0D0h - OUT (WG_COM),A + OUT (FDC_93.Command),A RET ; ; @@ -5574,83 +5661,106 @@ AUTO_2FC6: ; AUTO_2FD6: LD B,1 - LD HL,BUFER + LD HL,ZX_VARS.BUFFER JP AUTO_1E67 AUTO_2FDE: PUSH HL - LD DE,(CONT_SEC) + LD DE,(ZX_VARS.CONT_SEC) CALL AUTO_2FD6 - LD A,(MED_LEN) + LD A,(ZX_VARS.MED_LEN) POP DE OR A RET Z LD C,A - LD HL,BUFER + LD HL,ZX_VARS.BUFFER LDIR RET -; -; COMANDS -; -AUTO_2FF3: - DB 207,42,208,209 - DB 230,210,239,248 - DB 254,190,244,213 - DB 247,211,212,255 - DB 52,236,56,240 - DB 214,'/' -AUTO_3008: - DW CMD_CAT - DW CMD_STAR - DW CMD_FORMAT - DW CMD_MOVE - DW CMD_NEW - DW CMD_ERASE - DW CMD_LOAD - DW CMD_SAVE - - DW CMD_RETURN - DW CMD_PEEK - DW CMD_POKE - DW CMD_MERGE - - DW CMD_RUN - DW CMD_OPEN - DW CMD_CLOSE - DW CMD_COPY - - DW CMD_40 - DW CMD_GOTO - DW CMD_80 - DW CMD_LIST - - DW CMD_VERIFY - DW CMD_MSDOS +//////////////////////////////////////////// +TRDOS_CMD: ; Таблица команд TR-DOS. +.LIST: DB ZX_Token.cat + DB '*' + DB ZX_Token.format + DB ZX_Token.move + ; + DB ZX_Token.new + DB ZX_Token.erase + DB ZX_Token.load + DB ZX_Token.save + ; + DB ZX_Token.return + DB ZX_Token.peek + DB ZX_Token.poke + DB ZX_Token.merge + ; + DB ZX_Token.run + DB ZX_Token.open_channel + DB ZX_Token.close_channel + DB ZX_Token.copy + ; + DB '4' + DB ZX_Token.go_to + DB '8' + DB ZX_Token.list + ; + DB ZX_Token.verify + DB '/' + ; +.LIST.Size EQU $ - TRDOS_CMD.LIST + ; Таблица адресов подпрограмм, выполняющих команды TR-DOS. +.TABLE: DW CMD_CAT + DW CMD_STAR + DW CMD_FORMAT + DW CMD_MOVE + ; + DW CMD_NEW + DW CMD_ERASE + DW CMD_LOAD + DW CMD_SAVE + ; + DW CMD_RETURN + DW CMD_PEEK + DW CMD_POKE + DW CMD_MERGE + ; + DW CMD_RUN + DW CMD_OPEN + DW CMD_CLOSE + DW CMD_COPY + ; + DW CMD_40 + DW CMD_GOTO + DW CMD_80 + DW CMD_LIST + ; + DW CMD_VERIFY + DW CMD_MSDOS +//////////////////////////////////////////// ; ; ; AUTO_3032: - LD HL,(E_LINE) - LD (ADR_DOS_COM),HL - LD (DOS_CH_ADR),HL + LD HL,(ZX_VARS.E_LINE) + LD (ZX_VARS.ADR_DOS_COM),HL + LD (ZX_VARS.DOS_CH_ADR),HL LD A,255 - LD (DOS_ERROR),A - LD HL,MED_LEN + LD (ZX_VARS.DOS_ERROR),A + LD HL,ZX_VARS.MED_LEN JR AUTO_3054 -; LD (MED_START),HL ; 3 байта заняты списком команд +; LD (ZX_VARS.MED_START),HL ; 3 байта заняты списком команд ; nop ; nop ; nop AUTO_3048: - LD (ADR_DOS_COM),HL - LD (DOS_CH_ADR),HL + LD (ZX_VARS.ADR_DOS_COM),HL + LD (ZX_VARS.DOS_CH_ADR),HL CALL AUTO_30E1 RET NZ INC HL INC HL AUTO_3054: JP REDIR_LINE_CODING -; LD (MED_START),HL +; LD (ZX_VARS.MED_START),HL AUTO_3057: ; преобразование командной строки !!! CALL AUTO_30A9 ; поиск слова JR NZ,AUTO_3087 ; если нет, выход @@ -5660,20 +5770,18 @@ AUTO_3057: ; LD HL,AUTO_31C8 ADD HL,BC LD A,(HL) - LD HL,(DOS_CH_ADR) + LD HL,(ZX_VARS.DOS_CH_ADR) LD (HL),A INC HL EX DE,HL - RST RST20 - DW 019DDH + RST_ROM BASIC_FN.x48.differ PUSH BC - RST RST20 - DW 019E8H + RST_ROM BASIC_FN.x48.reclaim_2 POP BC - LD A,(DOS_ERROR) + LD A,(ZX_VARS.DOS_ERROR) OR A JR NZ,AUTO_3087 - LD HL,(MED_START) + LD HL,(ZX_VARS.MED_START) LD E,(HL) INC HL LD D,(HL) @@ -5685,12 +5793,12 @@ AUTO_3057: ; DEC HL LD (HL),E AUTO_3087: - LD HL,(DOS_CH_ADR) + LD HL,(ZX_VARS.DOS_CH_ADR) LD A,(HL) CP 13 RET Z INC HL ; следующее слово - LD (DOS_CH_ADR),HL + LD (ZX_VARS.DOS_CH_ADR),HL LD A,(HL) CP 13 RET Z @@ -5704,10 +5812,10 @@ AUTO_309A: CP '"' JR NZ,AUTO_309A INC HL - LD (DOS_CH_ADR),HL + LD (ZX_VARS.DOS_CH_ADR),HL JR AUTO_3057 AUTO_30A9: - LD HL,(DOS_CH_ADR) + LD HL,(ZX_VARS.DOS_CH_ADR) LD DE,AUTO_30FD LD C,0 AUTO_30B1: @@ -5735,7 +5843,7 @@ AUTO_30C8: RET Z AUTO_30CD: INC C - LD HL,(DOS_CH_ADR) + LD HL,(ZX_VARS.DOS_CH_ADR) INC DE LD A,(DE) CP 255 @@ -5749,23 +5857,22 @@ AUTO_30D9: JR Z,AUTO_30D9 JR AUTO_30CD AUTO_30E1: - LD HL,(PPC) + LD HL,(ZX_VARS.PPC) INC HL INC HL LD A,H OR L JR Z,AUTO_30F4 XOR A - LD (DOS_ERROR),A + LD (ZX_VARS.DOS_ERROR),A DEC HL DEC HL - RST RST20 - DW 0196EH + RST_ROM BASIC_FN.x48.line_addr RET AUTO_30F4: LD A,255 - LD (DOS_ERROR),A - LD HL,(E_LINE) + LD (ZX_VARS.DOS_ERROR),A + LD HL,(ZX_VARS.E_LINE) RET ; ; @@ -5830,37 +5937,34 @@ AUTO_31C8: ; ; ; + _mInfoBLOCK #31F3 - $,255 AUTO_31F3: - BLOCK #31F3 - $,255 - LD HL,(CHANS) + LD HL,(ZX_VARS.CHANS) OR A - LD BC,BUFER + LD BC,ZX_VARS.BUFFER SBC HL,BC RET - RST R38 - RST R38 - RST R38 -; -; -; + + + _mInfoBLOCK #3200-$,#FF INIT_2X80: JP AUTO_106E INIT_2X80_1: XOR A - LD (OPER_DISK),A - LD A,3Ch - LD (PDOS_COPY),A - OUT (P_DOS_FF),A - LD HL,8383h - LD (DISK_A),HL - LD (DISK_B),HL - LD (DISK_C),HL - LD (DISK_D),HL - LD HL,303H - LD (TIME_A),HL - LD (TIME_B),HL - LD (TIME_C),HL - LD (TIME_D),HL + LD (ZX_VARS.OPER_DISK),A + LD A,#3C + LD (ZX_VARS.PDOS_COPY),A + OUT (FDC_93.DrvCTRL),A + LD HL,#8383 + LD (ZX_VARS.DISK_A),HL + LD (ZX_VARS.DISK_B),HL + LD (ZX_VARS.DISK_C),HL + LD (ZX_VARS.DISK_D),HL + LD HL,#0303 + LD (ZX_VARS.TIME_A),HL + LD (ZX_VARS.TIME_B),HL + LD (ZX_VARS.TIME_C),HL + LD (ZX_VARS.TIME_D),HL ; CALL INIT_SYS_PAGE RET ; @@ -5868,7 +5972,7 @@ INIT_2X80_1: ; LOAD_CR: LD A,13 - LD (COM_LN_COPY),A + LD (ZX_VARS.COM_LN_COPY),A JP AUTO_021D ; ; @@ -5879,9 +5983,9 @@ PRINT_TRK: PUSH AF PUSH DE LD A,207 - LD (SCR_PL_L),A + LD (ZX_VARS.SCR_PL_L),A LD A,15 - LD (SCR_POS_L),A + LD (ZX_VARS.SCR_POS_L),A LD A,E JR CONV1 ; @@ -5939,28 +6043,28 @@ MSG_AT00: FORM_STATE: CALL INPUT_TXT CALL SINTAX_RET - LD HL,(CH_ADR) + LD HL,(ZX_VARS.CH_ADR) LD A,(HL) CP '"' JR NZ,FORM_NO_NEXT INC HL LD A,(HL) FORM_NO_NEXT: - CP 0Dh + CP #0D RET Z - CP 80H + CP #80 RET Z JP NC,CMD_ERROR CP ' ' JP C,CMD_ERROR - AND 0DFh - LD (MED_START+1),A + AND #DF + LD (ZX_VARS.MED_START+1),A RET ; ; FORM_F01: INC HL - LD A,(FL_LEN) + LD A,(ZX_VARS.FL_LEN) LD (HL),A XOR A RET @@ -5976,9 +6080,9 @@ PRINT_SIDE0: PR_SIDE_X: PUSH AF LD A,219 - LD (SCR_PL_L),A + LD (ZX_VARS.SCR_PL_L),A LD A,27 - LD (SCR_POS_L),A + LD (ZX_VARS.SCR_POS_L),A POP AF RST RST10 POP AF @@ -6005,12 +6109,12 @@ PAUSE_X01: PRINT_NAME: - LD A,(OPER_DISK) + LD A,(ZX_VARS.OPER_DISK) ADD A,'A' RST RST10 LD A,':' RST RST10 - LD HL,FL_NAME + LD HL,ZX_VARS.FL_NAME JP AUTO_2938 @@ -6027,7 +6131,7 @@ REWR_CONT1: SET_7_TYPE: CALL AUTO_165D - LD HL,FL_TYPE + LD HL,ZX_VARS.FL_TYPE SET 7,(HL) RET @@ -6042,19 +6146,18 @@ FORM_X02: RET FORM_X03: - LD A,(MED_START+1) + LD A,(ZX_VARS.MED_START+1) CP 15H CALL AUTO_1C57 CALL AUTO_1D97 LD A,2 - RST RST20 - DW 01601H + RST_ROM BASIC_FN.x48.chan_open LD HL,NEW_NAME RST PRINT_LN FORM_X04: CALL AUTO_106E - LD A,(MED_START+1) + LD A,(ZX_VARS.MED_START+1) AND A JR NZ,FORM_NO_Q CALL DISK_REDIR @@ -6069,7 +6172,7 @@ FORM_X05: AND A JP Z,AUTO_01D3 FORM_NO_Q: - LD (MED_START+1),A + LD (ZX_VARS.MED_START+1),A SUB 11H JR Z,F_ORIGINAL JR C,FORM_X05 @@ -6086,8 +6189,8 @@ F_ORIGINAL: ; Original FORMAT FORM_X07: XOR A FORM_X08: - LD (FL_LEN),A - LD (FL_START),HL + LD (ZX_VARS.FL_LEN),A + LD (ZX_VARS.FL_START),HL CALL LOW_CLS_AT00 RET @@ -6101,8 +6204,7 @@ F_FAST: ; Turbo/FAST FORMAT JR FORM_X08 F_TURBO_DT: - DB 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 - DB 16,1 + DB 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,1 SUB_HL_14: @@ -6114,13 +6216,12 @@ SUB_HL_14: RET LOW_CLS_AT00: - RST RST20 - DW 00D6EH + RST_ROM BASIC_FN.x48.cls_lower LD HL,MSG_AT00 JP PRINT_LINE TYPE_FL_X00: - LD A,(FL_TYPE) + LD A,(ZX_VARS.FL_TYPE) CP 'B' JR Z,TYPE_FL_X01 CP 'D' @@ -6128,9 +6229,9 @@ TYPE_FL_X00: CP '#' JR Z,TYPE_FL_X01 LD A,'C' - LD (FL_TYPE),A + LD (ZX_VARS.FL_TYPE),A TYPE_FL_X01: - LD A,(DOS_ERROR) + LD A,(ZX_VARS.DOS_ERROR) RET @@ -6143,7 +6244,7 @@ TYPE_FL_X03: JP AUTO_1B53 OWERWR_X01: - LD HL,FL_TYPE + LD HL,ZX_VARS.FL_TYPE BIT 7,(HL) JR NZ,OWERWR_X02 JP AUTO_1B59 @@ -6151,34 +6252,34 @@ OWERWR_X02: RES 7,(HL) CALL OWERWR_1 JP NZ,AUTO_01D3 - LD DE,(DOS_CH_ADR) + LD DE,(ZX_VARS.DOS_CH_ADR) LD A,E OR A JR Z,OWERWR_X03 INC D OWERWR_X03: - LD A,(FL_SIZE) + LD A,(ZX_VARS.FL_SIZE) CP D JR NC,OWERWR_X04 CALL AUTO_2926 JR TYPE_FL_X03 OWERWR_X04: LD B,D - LD HL,(E_LINE) + LD HL,(ZX_VARS.E_LINE) LD (HL),170 INC HL - LD DE,(AUTO_5CD1) + LD DE,(ZX_VARS.AUTO_5CD1) LD (HL),E INC HL LD (HL),D LD C,6 - LD HL,(MED_LEN) - LD (FL_LEN),HL - LD HL,(MED_START) - LD (FL_START),HL - LD DE,(FL_PLACE) + LD HL,(ZX_VARS.MED_LEN) + LD (ZX_VARS.FL_LEN),HL + LD HL,(ZX_VARS.MED_START) + LD (ZX_VARS.FL_START),HL + LD DE,(ZX_VARS.FL_PLACE) CALL WRITE_DISK - LD BC,(FL_NUMBER) + LD BC,(ZX_VARS.FL_NUMBER) CALL AUTO_1BBF CALL AUTO_1665 RET @@ -6191,12 +6292,12 @@ LABEL_X00: ;/////////////////////////////////// SIDE_FORMAT: ; Для форматирования с номером стороны !!! - LD A,(PDOS_COPY) + LD A,(ZX_VARS.PDOS_COPY) BIT 5,A JR Z,SIDE_OUTS INC D SIDE_OUTS: - IN A,(P_DOS_FF) + IN A,(FDC_93.DrvCTRL) AND 192 JR Z,SIDE_OUTS RET M @@ -6212,7 +6313,7 @@ SIDE_OUTS: ;************************************** MOVE_X00: - LD HL,(FL_N_4) + LD HL,(ZX_VARS.FL_N_4) MOVE_X01: LD A,(HL) CP 0 @@ -6233,31 +6334,31 @@ MOVE_X03: LD E,(HL) INC HL LD D,(HL) - LD HL,(MED_START) + LD HL,(ZX_VARS.MED_START) AND A SBC HL,DE ADD HL,DE JR Z,MOVE_X05 - LD (AUTO_5CD5),DE + LD (ZX_VARS.AUTO_5CD5),DE LD A,C - LD (AUTO_5CD3),A + LD (ZX_VARS.AUTO_5CD3),A CALL AUTO_17A5 MOVE_X04: POP HL PUSH HL - LD DE,(FL_N_2) + LD DE,(ZX_VARS.FL_N_2) LD BC,RST10 LDIR - LD (FL_N_2),DE + LD (ZX_VARS.FL_N_2),DE EX DE,HL - LD DE,(FL_NAME) + LD DE,(ZX_VARS.FL_NAME) DEC HL LD (HL),D DEC HL LD (HL),E - LD HL,(MED_START) - LD (FL_NAME),HL - LD HL,FL_N_6 + LD HL,(ZX_VARS.MED_START) + LD (ZX_VARS.FL_NAME),HL + LD HL,ZX_VARS.FL_N_6 INC (HL) POP HL RET @@ -6279,12 +6380,12 @@ MOVE_X06: AND 15 ADD A,D LD D,A - LD (MED_START),DE + LD (ZX_VARS.MED_START),DE JR MOVE_X04 ;************************************* EDIT_RET: - LD HL,(E_LINE) + LD HL,(ZX_VARS.E_LINE) LD (HL),254 INC HL LD (HL),13 @@ -6292,7 +6393,7 @@ EDIT_RET: LD (HL),80H RET -EDIT_X00: +EDIT_X00: ;!FIXIT зачем вместо #1D90 EDIT_X00??? RES 5,(IY+1) RST RST20 ; ввод клавиши DW 15D4h @@ -6302,18 +6403,18 @@ EDIT_X00: JR NZ,EDIT_X02 CALL BEEP_1 CALL AUTO_212A ; восстановление ком. строки - LD HL,(E_LINE) + LD HL,(ZX_VARS.E_LINE) LD A,13 LD BC,0 CPIR DEC HL - LD (K_CUR),HL + LD (ZX_VARS.K_CUR),HL INC HL INC HL LD (HL),128 EDIT_X01: RST RST20 ; ввод клавиши - DW 015D4H + DW #15D4 EDIT_X02: CALL BEEP_1 CP 24 @@ -6323,11 +6424,11 @@ EDIT_X02: CP 16 ; от 7 до 16 - ред. строки JR C,EDIT_X04 RST RST20 ; ввод спец символов - DW 00F58H + DW #0F58 JR EDIT_X01 EDIT_X03: RST RST20 ; станд. ввод в буфер редактирования - DW 00F81H + DW #0F81 JR EDIT_X01 EDIT_X04: CP 7 ; на 7 - нет операции @@ -6339,7 +6440,7 @@ EDIT_X04: CP 11 JR Z,EDIT_X01 RST RST20 ; выполнить операцию редактирования - DW 00F92H + DW #0F92 JR EDIT_X01 @@ -6349,85 +6450,87 @@ EDIT_X05: ;****************************************** -RUS_PRINT: - AND '?' - LD L,A - LD H,0 - ADD HL,HL - ADD HL,HL - ADD HL,HL - LD BC,ZG_RUS - ADD HL,BC - DB 17 - SUB D - LD E,H - LD BC,RST08 - LDIR - LD A,201 - LD (AUTO_5C9A),A - JP AUTO_5C9A +;!TODO russian charset +; RUS_PRINT: +; AND #3F +; LD L,A +; LD H,0 +; ADD HL,HL +; ADD HL,HL +; ADD HL,HL +; LD BC,ZG_RUS +; ADD HL,BC +; LD DE,#5C92 +; LD BC,8 +; LDIR +; LD A,#C9 +; LD (ZX_VARS.AUTO_5C9A),A +; JP ZX_VARS.AUTO_5C9A ;************************************** - ; DSS 3900H,'#' - +BOOT_PART_1: INCBIN 'build/boot.bin', 0, 248 +.SIZE EQU $-BOOT_PART_1 ;********************************** - DISPLAY "14k" - - BLOCK #3C00 - $,255 - -;********************************************* - + _mInfoBLOCK #3C00 - $,255 AUTO_3C00: RST R38 JR AUTO_3C06 RST R38 JR AUTO_3C09 +; +; + _mInfoBLOCK #3C06 - $,255 AUTO_3C06: JP AUTO_3D00 +; +; + _mInfoBLOCK #3C09 - $,255 AUTO_3C09: JP AUTO_3D03 -;***************************** - BLOCK #3C10 - $,255 -;KBD_EXP: - LD A,D_ROM16OFF - OUT (CNF_PORT),A - RET - NOP - NOP - NOP -;KBD_OFF: - LD A,D_ROM16OFF - OUT (CNF_PORT),A - RET - NOP - NOP - NOP ;************************************ +;!FIXIT not used + _mInfoBLOCK #3C10 - $,255 +;KBD_EXP: + LD A,CNF_PORT.ZX_BIOS + OUT (CNF_PORT.ON),A + RET +; +;************************************ +;!FIXIT not used + _mInfoBLOCK #3C18 - $,255 +;KBD_OFF: + LD A,CNF_PORT.ZX_BIOS + OUT (CNF_PORT.ON),A + RET + +;************************************ +;!FIXIT not used + _mInfoBLOCK #3C20 - $,255 READR_X: - CALL 3E08h + CALL get_disk_time LD B,A - JP 1FEBh - - BLOCK #3C30 - $,255 - - IN A,(WG_COM) + JP set_side_0 +;************************************ +;!FIXIT not used + _mInfoBLOCK #3C30 - $,255 + IN A,(FDC_93.Command) RET ;***************************** NEW_NAME: - DB 22,1,3,"* Sprinter TR-DOS v.7.01 *" - DB 22,3,6, "(c) 2001 PETERS PLUS" - DB 22,5,12, "* R.F.*" + DB 22,1,3, "* Sprinter TR-DOS v.7.03 *" + DB 22,3,6, "(c) 2025 Sprinter Team" + DB 22,5,14, "*R.F.*" DB 22,7,9, "BETA 4Mb",0 ;***************************** ;FORMATER: -; LD DE,(E_LINE) ; LD HL,TX_FORMAT +; LD DE,(ZX_VARS.E_LINE) ; LD BC,LEN_TX_F ; LDIR ; EX DE,HL @@ -6450,20 +6553,63 @@ PRINT_RED: POP BC POP HL RET - ;******************************* - BLOCK #3CC0 - $,255 + +;******************************* +;!TEST 06/01/2024 сохраняем состояние прерываний зачем-то +EXP_FNS_PREPARE: + PUSH HL + PUSH AF + LD A,R + DI + PUSH AF + POP HL + POP AF + EX (SP),HL + CALL EXP_FNS_PREPARE_EXIT + EX (SP),HL + PUSH AF + BIT 2,L + ; LD A,L + ; AND 4 + JR Z,.no_EI + EI +.no_EI: POP AF + POP HL + RET +EXP_FNS_PREPARE_EXIT: + PUSH AF + XOR A ; SYS_PORT.BIOS + JP EXP_FNS_PREPARE_RET +;******************************* + +RD_HEAD_DSK.FIXED: + LD A,7 + JP AUTO_1C4A + +CMD_COPY.FIXED: + PUSH AF + CALL AUTO_05CB + POP AF + RET Z + INC SP + INC SP + JP AUTO_03D9 +;******************************* + _mInfoBLOCK #3CC0 - $,255 MAGIC_1: PUSH AF - LD A,D_ROM16OFF - OUT (CNF_PORT),A + LD A,CNF_PORT.ZX_BIOS + OUT (CNF_PORT.ON),A POP AF JP MAGIC_2 +;******************************* + _mInfoBLOCK #3CC9 - $,255 MAGIC_3: PUSH AF - LD A,D_ROM16OFF - OUT (CNF_PORT),A + LD A,CNF_PORT.ZX_BIOS + OUT (CNF_PORT.ON),A POP AF RETN @@ -6473,8 +6619,7 @@ BEEP_1: LD HL,200 ; BEEP LD D,H LD E,(IY-1) - RST RST20 - DW 03B5h + RST_ROM BASIC_FN.x48.beeper POP AF RET @@ -6494,20 +6639,34 @@ REDIR_3D13: JP NZ,EXP_FNS ;#3FF8 EXP BIT 6,C JP Z,AUTO_283C - RES 6,C - JP HD_CMD ;#3FF0 ROM. DI + ;!TEST 06/01/2024 убираем лишние телодвижения + ;RES 6,C + ;JP HD_CMD ;#3FF0 ROM. DI + JP EXP_FNS + ; - BLOCK #3CFA - $,255 +; [x] 13/06/2025 boot loader from TR-DOS vROM +;███████████████████████████████████████████████████████████████████████ +PREPARE_TO_vROM_BOOT: + LD A,(ZX_VARS.RUN_AUTO_BOOT) + AND A ; признак попытки запуска boot командой RUN без параметров + JP Z,AUTO_03D9 + DI + JP vROM_BOOT +;███████████████████████████████████████████████████████████████████████ ;***************************** - + _mInfoBLOCK #3CFA - $,255 AUTO_3CFA: JP xchg_intf1 ;****** 3D13 redirection ****** + _mInfoBLOCK #3CFD - $,255 AUTO_3CFD: JP REDIR_3D13 ; JP AUTO_283C +;***********************************************************************; + _mInfoBLOCK #3D00-$,#FF AUTO_3D00: NOP @@ -6526,6 +6685,7 @@ AUTO_3D0E: NOP JR AUTO_3CFA ;****** 3D13 point !!! **** + _mInfoBLOCK #3D13-$,#FF NOP JR AUTO_3CFD AUTO_3D16: @@ -6540,7 +6700,7 @@ AUTO_3D21: NOP NOP CALL C,AUTO_3D4C ; если нет, то вызвать программу иниц. - LD HL,RET_INS + LD HL,ZX_VARS.RET_INS RET NOP NOP @@ -6553,8 +6713,8 @@ AUTO_3D31: JP EDIT_X05 AUTO_3D38: XOR A - OUT (#F7),A ;????? - IN A,(#F7) ;????? + OUT (#F7),A ;проверка ИнтерфейсАДЫН))) + IN A,(#F7) CP 30 JR Z,AUTO_3D44 CP 31 @@ -6564,84 +6724,86 @@ AUTO_3D44: RST RST08 DB 49 ;!HARDCODE LD A,1 - LD (INTERF_I),A + LD (ZX_VARS.INTERF_I),A RET .Size EQU $-AUTO_3D44 AUTO_3D4C: XOR A - OUT (P_DOS_FF),A - IN A,(#F6) ;????? + OUT (FDC_93.DrvCTRL),A + IN A,(#F6) ; ничего не даёт LD HL,AUTO_3D38 - LD DE,MEM_BOT + LD DE,ZX_VARS.MEM_BOT LD BC,AUTO_3D38.Size + AUTO_3D44.Size LDIR LD HL,AUTO_3D67 PUSH HL LD HL,AUTO_3D2F PUSH HL - JP MEM_BOT + JP ZX_VARS.MEM_BOT AUTO_3D67: ; получить память для DOS LD HL,AUTO_2F90 ; и вернуться в программу иниц. VARS PUSH HL LD HL,AUTO_3D2F PUSH HL - LD HL,1655h ;!HARDCODE + LD HL,ZX_VARS.PROG.MAKE_ROOM PUSH HL - LD HL,AUTO_5BFF + LD HL,ZX_VARS.TSTACK PUSH HL LD (HL),#C9 ; RET code - LD HL,P_RAMTOP+1 + LD HL,ZX_VARS.P_RAMTOP+1 LD BC,CONT_8+7 RET PRINT_CR: - LD A,13 + LD A,#0D ; enter PRINT_SYM: JP PRINT_RED - RST R38 - RST R38 - NOP - NOP - JP RUS_PRINT - RST R38 - RST R38 - RST R38 - NOP - NOP - RST R38 - RST R38 - RST R38 +;======================================================================= + + + _mInfoBLOCK #3D8F-$,#FF ; ХЕР + DW 0000 ; ЗНАЕТ + _mInfoBLOCK 3,#FF ; ЗАЧЕМ + +;======================================================================= +;!TODO russian charset +; PRINT_CR: +; LD A,#0D ; enter +; PRINT_SYM: +; CP #80 +; JP C,PRINT_RED +; JP RUS_PRINT +;======================================================================= + + AUTO_3D94: - RST RST20 - DW 00010H + RST_ROM BASIC_FN.x48.print_a RET AUTO_3D98: LD A,8 WG93_EXE: - OUT (WG_COM),A + OUT (FDC_93.Command),A AUTO_3D9C: PUSH HL - RST RST20 - DW 01F54H + RST_ROM BASIC_FN.x48.break_key ;RET_1F54: JR C,AUTO_3DA5 - RST RST20 - DW 01B7BH + RST_ROM BASIC_FN.x48.report_l AUTO_3DA5: POP HL - IN A,(P_DOS_FF) + IN A,(FDC_93.DrvCTRL) AND 128 JR Z,AUTO_3D9C RET RESET_WG: LD A,8 CALL WG93_EXE - LD DE,START - IN A,(WG_COM) + LD DE,0 + IN A,(FDC_93.Command) AND 2 LD B,A AUTO_3DBA: - IN A,(WG_COM) + IN A,(FDC_93.Command) AND 2 CP B RET NZ @@ -6651,28 +6813,28 @@ AUTO_3DBA: JR NZ,AUTO_3DBA JP AUTO_3EE7 AUTO_3DC8: - LD A,(CONT_DISK) + LD A,(ZX_VARS.CONT_DISK) SET_DISK: JP RAMD_X12 AUTO_3DCE: - LD HL,PDOS_COPY + LD HL,ZX_VARS.PDOS_COPY LD C,A - LD A,3Ch + LD A,#3C OR C - OUT (P_DOS_FF),A + OUT (FDC_93.DrvCTRL),A LD (HL),A CALL get_disk_time - AND 128 + AND #80 JR Z,AUTO_3DFA CALL RESET_WG CALL test_disk CALL get_disk_type - CP 255 + CP #FF JR NZ,AUTO_3DFA PUSH HL CALL test_d_traks POP HL - CP 'P' + CP #50 LD A,0 JR NZ,AUTO_3DF9 LD A,128 @@ -6681,7 +6843,7 @@ AUTO_3DF9: AUTO_3DFA: CALL READ_TRK_NUM pause_50ms: - LD A,12 ;'P' + LD A,12 ; #50 pause_1ms: LD C,255 AUTO_3E01: @@ -6691,14 +6853,14 @@ AUTO_3E01: JR NZ,pause_1ms RET get_disk_time: - LD DE,TIME_A + LD DE,ZX_VARS.TIME_A AUTO_3E0B: - LD HL,(OPER_DISK) + LD HL,(ZX_VARS.OPER_DISK) ADD HL,DE LD A,(HL) RET get_disk_type: - LD DE,DISK_A + LD DE,ZX_VARS.DISK_A JR AUTO_3E0B test_disk: CALL get_disk_time @@ -6714,12 +6876,12 @@ AUTO_3E1D: LD B,(HL) LD A,1 CALL Goto_trk - IN A,(WG_COM) + IN A,(FDC_93.Command) AND 4 JR NZ,AUTO_3E3F XOR A CALL Goto_trk - IN A,(WG_COM) + IN A,(FDC_93.Command) AND 4 RET NZ AUTO_3E3F: @@ -6728,15 +6890,15 @@ AUTO_3E3F: RET Z JR AUTO_3E1D Goto_trk: - OUT (WG_DATA),A + OUT (FDC_93.Data),A LD A,B OR 24 JP WG93_EXE_ Goto_trkx: - OUT (WG_DATA),A + OUT (FDC_93.Data),A PUSH BC LD B,A - IN A,(WG_TRK) + IN A,(FDC_93.Track) CP B POP BC PUSH AF @@ -6760,11 +6922,11 @@ Global_trk: JR Z,AUTO_3E83 BIT 0,(HL) JR NZ,AUTO_3E83 - IN A,(WG_TRK) + IN A,(FDC_93.Track) CP C JR Z,AUTO_3E82 RLCA - OUT (WG_TRK),A + OUT (FDC_93.Track),A LD A,C RLCA AUTO_3E82: @@ -6772,7 +6934,7 @@ AUTO_3E82: AUTO_3E83: CALL get_disk_time LD B,A - IN A,(WG_TRK) + IN A,(FDC_93.Track) CP C PUSH BC CALL NZ,pause_50ms @@ -6781,12 +6943,12 @@ AUTO_3E83: CALL Goto_trkx POP BC LD A,C - OUT (WG_TRK),A - LD A,(DRV_READY) + OUT (FDC_93.Track),A + LD A,(ZX_VARS.DRV_READY) OR A RET Z XOR A - LD (DRV_READY),A + LD (ZX_VARS.DRV_READY),A pause_750ms: LD B,3 AUTO_3EA2: @@ -6804,10 +6966,10 @@ made_trk_side2: READ_ADR_LABL: CALL set_side_0 ; SET SIDE 0 READ_ADR_LABL2: - IN A,(WG_COM) + IN A,(FDC_93.Command) AND 128 - LD (DRV_READY),A - IN A,(WG_TRK) + LD (ZX_VARS.DRV_READY),A + IN A,(FDC_93.Track) LD H,A ; на текущую дорожку CALL Goto_trk ; позиционирование ; CALL READR_X @@ -6815,11 +6977,11 @@ READ_ADR_LABL2: LD D,1 DI LD A,0C0h ; чтение адресной метки - OUT (WG_COM),A + OUT (FDC_93.Command),A PUSH BC LD B,6 AUTO_3ECE: - IN A,(P_DOS_FF) + IN A,(FDC_93.DrvCTRL) AND 192 JR NZ,AUTO_3EF2 INC DE @@ -6830,32 +6992,32 @@ AUTO_3ECE: POP BC EI LD A,208 ; прервать выполнение - OUT (WG_COM),A - LD A,(AUTO_5CD1) + OUT (FDC_93.Command),A + LD A,(ZX_VARS.AUTO_5CD1) CP 255 RET Z AUTO_3EE7: CALL set_error_26 LD A,255 - LD (FLAG_BOOT),A + LD (ZX_VARS.FLAG_BOOT),A JP exit_No_disk AUTO_3EF2: POP BC IN H,(C) AUTO_3EF5: - IN A,(P_DOS_FF) + IN A,(FDC_93.DrvCTRL) AND 192 JR Z,AUTO_3EF5 EI RET M DI - IN A,(WG_DATA) + IN A,(FDC_93.Data) JR AUTO_3EF5 save_sector: - LD (SEC_NUM),A + LD (ZX_VARS.SEC_NUM),A RET save_bufer: - LD (CONT_BUF_ADR),HL + LD (ZX_VARS.CONT_BUF_ADR),HL RET AUTO_3F0A: LD A,160 @@ -6863,19 +7025,19 @@ AUTO_3F0A: AUTO_3F0E: LD A,128 AUTO_3F10: - LD (COMAND_WG),A + LD (ZX_VARS.COMAND_WG),A AUTO_3F13: LD D,10 AUTO_3F15: PUSH DE DI - LD A,(SEC_NUM) + LD A,(ZX_VARS.SEC_NUM) INC A - OUT (WG_SEC),A - LD HL,(CONT_BUF_ADR) + OUT (FDC_93.Sector),A + LD HL,(ZX_VARS.CONT_BUF_ADR) LD C,127 - LD A,(COMAND_WG) - OUT (WG_COM),A + LD A,(ZX_VARS.COMAND_WG) + OUT (FDC_93.Command),A CP 160 PUSH AF CALL Z,AUTO_3FBA @@ -6883,7 +7045,7 @@ AUTO_3F15: CALL NZ,AUTO_3FD5 POP DE EI - IN A,(WG_COM) + IN A,(FDC_93.Command) LD B,A AND 127 RET Z @@ -6900,14 +7062,14 @@ AUTO_3F48: LD HL,DISK_ERROR_MSG AUTO_3F4B: LD A,208 - OUT (WG_COM),A + OUT (FDC_93.Command),A LD A,B AND 1 JP NZ,AUTO_3EE7 - IN A,(WG_TRK) + IN A,(FDC_93.Track) OR A JR NZ,AUTO_3F5F - IN A,(WG_SEC) + IN A,(FDC_93.Sector) CP 10 RET Z AUTO_3F5F: @@ -6917,11 +7079,11 @@ AUTO_3F5F: RST PRINT_LN LD HL,AUTO_2A13 RST PRINT_LN - IN A,(WG_TRK) + IN A,(FDC_93.Track) CALL AUTO_1DA3 LD HL,AUTO_2A18 RST PRINT_LN - IN A,(WG_SEC) + IN A,(FDC_93.Sector) CALL AUTO_1DA3 LD HL,AUTO_29FE RST PRINT_LN @@ -6935,10 +7097,10 @@ AUTO_3F7B: JR NZ,AUTO_3F7B CALL set_error_26 LD A,7 - LD (DOS_ERR_2),A + LD (ZX_VARS.DOS_ERR_2),A JP AUTO_01D3 AUTO_3F94: - LD A,(CONT_TRK) + LD A,(ZX_VARS.CONT_TRK) CALL Global_trk CALL pause_750ms JP AUTO_3F13 @@ -6952,7 +7114,7 @@ AUTO_3FA0: INC (HL) AUTO_3FAD: CALL AUTO_3D98 - LD A,(CONT_TRK) + LD A,(ZX_VARS.CONT_TRK) CALL Global_trk POP DE JP AUTO_3F15 @@ -6962,7 +7124,7 @@ AUTO_3FAD: AUTO_3FBA: LD B,4 AUTO_3FBC: - IN A,(P_DOS_FF) + IN A,(FDC_93.DrvCTRL) AND 192 JR NZ,AUTO_3FD1 INC DE @@ -6972,7 +7134,7 @@ AUTO_3FBC: DJNZ AUTO_3FBC RET AUTO_3FCA: - IN A,(P_DOS_FF) + IN A,(FDC_93.DrvCTRL) AND 192 JR Z,AUTO_3FCA RET M @@ -6985,7 +7147,7 @@ AUTO_3FD1: AUTO_3FD5: LD B,4 AUTO_3FD7: - IN A,(P_DOS_FF) + IN A,(FDC_93.DrvCTRL) AND 192 JR NZ,AUTO_3FEC INC DE @@ -6995,7 +7157,7 @@ AUTO_3FD7: DJNZ AUTO_3FD7 RET AUTO_3FE5: - IN A,(P_DOS_FF) + IN A,(FDC_93.DrvCTRL) AND 192 JR Z,AUTO_3FE5 RET M @@ -7005,30 +7167,30 @@ AUTO_3FEC: ;****************************************** -;****************************************** - BLOCK #3FF0-$, #FF +;[x]] поправлены номера функций при вызовах API и прыгает сразу в BIOS через #3FF8 +;-------[ From TR-DOS to API 4x ]------- + _mInfoBLOCK #3FF0-$, #FF +HD_CMD: PUSH AF + DI + LD A,SYS_PORT.EXTENSION + OUT (SYS_PORT.ROM),A + POP AF + RET +;--------------------------------------- -HD_CMD: - PUSH AF - DI - LD A,D_ROM16ON - OUT (SYS_PORT_ON),A - POP AF - RET -;****************************************** - - -;****************************************** - BLOCK #3FF8-$, #FF -EXP_FNS: - PUSH AF - DI - XOR A ; D_ROM16OFF - OUT (SYS_PORT_ON),A - POP AF - RET -;****************************************** - BLOCK #4000-$, #FF - DISPLAY "16k..ALL!" +; +;----[ From TR-DOS to API #80..#FF]----- + _mInfoBLOCK #3FF8-$, #FF +EXP_FNS: JP EXP_FNS_PREPARE +EXP_FNS_PREPARE_RET: + OUT (SYS_PORT.ROM),A + POP AF + RET +;--------------------------------------- ; +; + _mInfoBLOCK #4000-$, #FF +; + DISPLAY "\n\rNEW RAMDRV READ = ",/D,NEW_RAMDRV_READ +; \ No newline at end of file diff --git a/SP__48.ASM b/SP__48.ASM index 194685d..8d98aa7 100644 --- a/SP__48.ASM +++ b/SP__48.ASM @@ -42,7 +42,7 @@ ; routines in this ROM. Non-standard entry points have a label beginning ; with X. - ORG $0000 + ORG #0000 ;***************************************** ;** Part 1. RESTART ROUTINES AND TABLES ** @@ -58,7 +58,7 @@ ;; START L0000: DI ; disable interrupts. XOR A ; signal coming from START. - LD DE,$FFFF ; top of possible physical RAM. + LD DE,#FFFF ; top of possible physical RAM. JP L11CB ; jump forward to common code at START-NEW. ; ------------------- @@ -67,14 +67,14 @@ L0000: DI ; disable interrupts. ; The error pointer is made to point to the position of the error to enable ; the editor to show the error if it occurred during syntax checking. ; It is used at 37 places in the program. -; An instruction fetch on address $0008 may page in a peripheral ROM +; An instruction fetch on address #0008 may page in a peripheral ROM ; such as the Sinclair Interface 1 or Disciple Disk Interface. ; This was not however an original design concept and not all errors pass ; through here. ;; ERROR-1 -L0008: LD HL,($5C5D) ; fetch the character address from CH_ADD. - LD ($5C5F),HL ; copy it to the error pointer X_PTR. +L0008: LD HL,(#5C5D) ; fetch the character address from CH_ADD. + LD (#5C5F),HL ; copy it to the error pointer X_PTR. JR L0053 ; forward to continue at ERROR-2. ; ----------------------------- @@ -91,11 +91,11 @@ L0010: JP L15F2 ; jump forward to continue at PRINT-A-2. ; --- -X0013: DEFB $FF ; this byte is used by the SPECTRUM command in +X0013: DEFB #FF ; this byte is used by the SPECTRUM command in ; ROM 0 to generate an error report "0 OK". - DEFB $FF, $FF ; four unused locations. - DEFB $FF, $FF ; + DEFB #FF, #FF ; four unused locations. + DEFB #FF, #FF ; ; ------------------------------- ; THE 'COLLECT CHARACTER' RESTART @@ -110,7 +110,7 @@ X0013: DEFB $FF ; this byte is used by the SPECTRUM command in ; 4) in workspace if accepting input but not that from INPUT LINE. ;; GET-CHAR -L0018: LD HL,($5C5D) ; fetch the address from CH_ADD. +L0018: LD HL,(#5C5D) ; fetch the address from CH_ADD. LD A,(HL) ; use it to pick up current character. ;; TEST-CHAR @@ -131,7 +131,7 @@ L0020: CALL L0074 ; routine CH-ADD+1 fetches the next immediate ; --- - DEFB $FF, $FF, $FF ; unused + DEFB #FF, #FF, #FF ; unused ; ----------------------- ; THE 'CALCULATE' RESTART @@ -145,8 +145,8 @@ L0028: JP L335B ; jump forward to the CALCULATE routine. ; --- - DEFB $FF, $FF, $FF ; spare - note that on the ZX81, space being a - DEFB $FF, $FF ; little cramped, these same locations were + DEFB #FF, #FF, #FF ; spare - note that on the ZX81, space being a + DEFB #FF, #FF ; little cramped, these same locations were ; used for the five-byte end-calc literal. ; ------------------------------ @@ -157,7 +157,7 @@ L0028: JP L335B ; jump forward to the CALCULATE routine. ;; BC-SPACES L0030: PUSH BC ; save number of spaces. - LD HL,($5C61) ; fetch WORKSP. + LD HL,(#5C61) ; fetch WORKSP. PUSH HL ; save address of workspace. JP L169E ; jump forward to continuation code RESERVE. @@ -173,14 +173,14 @@ L0030: PUSH BC ; save number of spaces. ;; MASK-INT L0038: PUSH AF ; save the registers. PUSH HL ; but not IY unfortunately. - LD HL,($5C78) ; fetch two bytes at FRAMES1. + LD HL,(#5C78) ; fetch two bytes at FRAMES1. INC HL ; increment lowest two bytes of counter. - LD ($5C78),HL ; place back in FRAMES1. + LD (#5C78),HL ; place back in FRAMES1. LD A,H ; test if the result OR L ; was zero. JR NZ,L0048 ; forward to KEY-INT if not. - INC (IY+$40) ; otherwise increment FRAMES3 the third byte. + INC (IY+#40) ; otherwise increment FRAMES3 the third byte. ; now save the rest of the main registers and read and decode the keyboard. @@ -215,8 +215,8 @@ L0053: POP HL ; drop the return address - the location ; updated. ;; ERROR-3 -L0055: LD (IY+$00),L ; store it in the system variable ERR_NR. - LD SP,($5C3D) ; ERR_SP points to an error handler on the +L0055: LD (IY+#00),L ; store it in the system variable ERR_NR. + LD SP,(#5C3D) ; ERR_SP points to an error handler on the ; machine stack. There may be a hierarchy ; of routines. ; to MAIN-4 initially at base. @@ -232,9 +232,9 @@ L0055: LD (IY+$00),L ; store it in the system variable ERR_NR. ; --- - DEFB $FF, $FF, $FF ; unused locations - DEFB $FF, $FF, $FF ; before the fixed-position - DEFB $FF ; NMI routine. + DEFB #FF, #FF, #FF ; unused locations + DEFB #FF, #FF, #FF ; before the fixed-position + DEFB #FF ; NMI routine. ; ------------------------------------ ; THE 'NON-MASKABLE INTERRUPT' ROUTINE @@ -252,7 +252,7 @@ L0055: LD (IY+$00),L ; store it in the system variable ERR_NR. ;; RESET L0066: PUSH AF ; save the PUSH HL ; registers. - LD HL,($5CB0) ; fetch the system variable NMIADD. + LD HL,(#5CB0) ; fetch the system variable NMIADD. LD A,H ; test address OR L ; for zero. JR NZ,L0070 ; skip to NO-RESET if NOT ZERO @@ -274,13 +274,13 @@ L0070: POP HL ; restore the ; Both TEMP-PTR1 and TEMP-PTR2 are used by the READ command routine. ;; CH-ADD+1 -L0074: LD HL,($5C5D) ; fetch address from CH_ADD. +L0074: LD HL,(#5C5D) ; fetch address from CH_ADD. ;; TEMP-PTR1 L0077: INC HL ; increase the character address by one. ;; TEMP-PTR2 -L0078: LD ($5C5D),HL ; update CH_ADD with character address. +L0078: LD (#5C5D),HL ; update CH_ADD with character address. X007B: LD A,(HL) ; load character to A from HL. RET ; and return. @@ -302,20 +302,20 @@ X007B: LD A,(HL) ; load character to A from HL. ; 'a number 53 bus' appear the same to the parser. ;; SKIP-OVER -L007D: CP $21 ; test if higher than space. +L007D: CP #21 ; test if higher than space. RET NC ; return with carry clear if so. - CP $0D ; carriage return ? + CP #0D ; carriage return ? RET Z ; return also with carry clear if so. ; all other characters have no relevance ; to the parser and must be returned with ; carry set. - CP $10 ; test if 0-15d + CP #10 ; test if 0-15d RET C ; return, if so, with carry set. - CP $18 ; test if 24-32d + CP #18 ; test if 24-32d CCF ; complement carry flag. RET C ; return with carry set if so. @@ -324,7 +324,7 @@ L007D: CP $21 ; test if higher than space. INC HL ; all above have at least one extra character ; to be stepped over. - CP $16 ; controls 22d ('at') and 23d ('tab') have two. + CP #16 ; controls 22d ('at') and 23d ('tab') have two. JR C,L0090 ; forward to SKIPS with ink, paper, flash, ; bright, inverse or over controls. ; Note. the high byte of tab is for RS232 only. @@ -334,7 +334,7 @@ L007D: CP $21 ; test if higher than space. ;; SKIPS L0090: SCF ; set the carry flag - LD ($5C5D),HL ; update the CH_ADD system variable. + LD (#5C5D),HL ; update the CH_ADD system variable. RET ; return with carry set. @@ -346,155 +346,103 @@ L0090: SCF ; set the carry flag ; the word. The first is an inverted step-over byte. ;; TKN-TABLE -L0095: DC '?' - DC "RND" - DC "INKEY$" +L0095: + DC "?" + DC 'RND' + DC 'INKEY$' DC 'PI' DC 'FN' - DC "POINT" - DC "SCREEN$" - DC "ATTR" + DC 'POINT' + DC 'SCREEN$' + DC 'ATTR' DC 'AT' - DC "TAB" - DC "VAL$" - DC "CODE" - DC "VAL" - DC "LEN" - DC "SIN" - DC "COS" - DC "TAN" - DC "ASN" - DC "ACS" - DC "ATN" + DC 'TAB' + DC 'VAL$' + DC 'CODE' + DC 'VAL' + DC 'LEN' + DC 'SIN' + DC 'COS' + DC 'TAN' + DC 'ASN' + DC 'ACS' + DC 'ATN' DC 'LN' - DC "EXP" - DC "INT" - DC "SQR" - DC "SGN" - DC "ABS" - DC "PEEK" + DC 'EXP' + DC 'INT' + DC 'SQR' + DC 'SGN' + DC 'ABS' + DC 'PEEK' DC 'IN' - DC "USR" - DC "STR$" - DC "CHR$" - DC "NOT" - DC "BIN" + DC 'USR' + DC 'STR$' + DC 'CHR$' + DC 'NOT' + DC 'BIN' ; The previous 32 function-type words are printed without a leading space ; The following have a leading space if they begin with a letter - DEFB 'O','R'+$80 - DEFM "AN" - DEFB 'D'+$80 - DEFB $3C,'='+$80 ; <= - DEFB $3E,'='+$80 ; >= - DEFB $3C,$3E+$80 ; <> - DEFM "LIN" - DEFB 'E'+$80 - DEFM "THE" - DEFB 'N'+$80 - DEFB 'T','O'+$80 - DEFM "STE" - DEFB 'P'+$80 - DEFM "DEF F" - DEFB 'N'+$80 - DEFM "CA" - DEFB 'T'+$80 - DEFM "FORMA" - DEFB 'T'+$80 - DEFM "MOV" - DEFB 'E'+$80 - DEFM "ERAS" - DEFB 'E'+$80 - DEFM "OPEN " - DEFB '#'+$80 - DEFM "CLOSE " - DEFB '#'+$80 - DEFM "MERG" - DEFB 'E'+$80 - DEFM "VERIF" - DEFB 'Y'+$80 - DEFM "BEE" - DEFB 'P'+$80 - DEFM "CIRCL" - DEFB 'E'+$80 - DEFM "IN" - DEFB 'K'+$80 - DEFM "PAPE" - DEFB 'R'+$80 - DEFM "FLAS" - DEFB 'H'+$80 - DEFM "BRIGH" - DEFB 'T'+$80 - DEFM "INVERS" - DEFB 'E'+$80 - DEFM "OVE" - DEFB 'R'+$80 - DEFM "OU" - DEFB 'T'+$80 - DEFM "LPRIN" - DEFB 'T'+$80 - DEFM "LLIS" - DEFB 'T'+$80 - DEFM "STO" - DEFB 'P'+$80 - DEFM "REA" - DEFB 'D'+$80 - DEFM "DAT" - DEFB 'A'+$80 - DEFM "RESTOR" - DEFB 'E'+$80 - DEFM "NE" - DEFB 'W'+$80 - DEFM "BORDE" - DEFB 'R'+$80 - DEFM "CONTINU" - DEFB 'E'+$80 - DEFM "DI" - DEFB 'M'+$80 - DEFM "RE" - DEFB 'M'+$80 - DEFM "FO" - DEFB 'R'+$80 - DEFM "GO T" - DEFB 'O'+$80 - DEFM "GO SU" - DEFB 'B'+$80 - DEFM "INPU" - DEFB 'T'+$80 - DEFM "LOA" - DEFB 'D'+$80 - DEFM "LIS" - DEFB 'T'+$80 - DEFM "LE" - DEFB 'T'+$80 - DEFM "PAUS" - DEFB 'E'+$80 - DEFM "NEX" - DEFB 'T'+$80 - DEFM "POK" - DEFB 'E'+$80 - DEFM "PRIN" - DEFB 'T'+$80 - DEFM "PLO" - DEFB 'T'+$80 - DEFM "RU" - DEFB 'N'+$80 - DEFM "SAV" - DEFB 'E'+$80 - DEFM "RANDOMIZ" - DEFB 'E'+$80 - DEFB 'I','F'+$80 - DEFM "CL" - DEFB 'S'+$80 - DEFM "DRA" - DEFB 'W'+$80 - DEFM "CLEA" - DEFB 'R'+$80 - DEFM "RETUR" - DEFB 'N'+$80 - DEFM "COP" - DEFB 'Y'+$80 + DC "OR" + DC "AND" + DC "<=" + DC ">=" + DC "<>" + DC "LINE" + DC "THEN" + DC "TO" + DC "STEP" + DC "DEF FN" + DC "CAT" + DC "FORMAT" + DC "MOVE" + DC "ERASE" + DC "OPEN #" + DC "CLOSE #" + DC "MERGE" + DC "VERIFY" + DC "BEEP" + DC "CIRCLE" + DC "INK" + DC "PAPER" + DC "FLASH" + DC "BRIGHT" + DC "INVERSE" + DC "OVER" + DC "OUT" + DC "LPRINT" + DC "LLIST" + DC "STOP" + DC "READ" + DC "DATA" + DC "RESTORE" + DC "NEW" + DC "BORDER" + DC "CONTINUE" + DC "DIM" + DC "REM" + DC "FOR" + DC "GO TO" + DC "GO SUB" + DC "INPUT" + DC "LOAD" + DC "LIST" + DC "LET" + DC "PAUSE" + DC "NEXT" + DC "POKE" + DC "PRINT" + DC "PLOT" + DC "RUN" + DC "SAVE" + DC "RANDOMIZE" + DC "IF" + DC "CLS" + DC "DRAW" + DC "CLEAR" + DC "RETURN" + DC "COPY" ; ---------------- ; THE 'KEY' TABLES @@ -503,176 +451,176 @@ L0095: DC '?' ; to decode the key values. ; The first table contains the maps for the 39 keys of the standard -; 40-key Spectrum keyboard. The remaining key [SHIFT $27] is read directly. +; 40-key Spectrum keyboard. The remaining key [SHIFT #27] is read directly. ; The keys consist of the 26 upper-case alphabetic characters, the 10 digit ; keys and the space, ENTER and symbol shift key. -; Unshifted alphabetic keys have $20 added to the value. -; The keywords for the main alphabetic keys are obtained by adding $A5 to +; Unshifted alphabetic keys have #20 added to the value. +; The keywords for the main alphabetic keys are obtained by adding #A5 to ; the values obtained from this table. ;; MAIN-KEYS -L0205: DEFB $42 ; B - DEFB $48 ; H - DEFB $59 ; Y - DEFB $36 ; 6 - DEFB $35 ; 5 - DEFB $54 ; T - DEFB $47 ; G - DEFB $56 ; V - DEFB $4E ; N - DEFB $4A ; J - DEFB $55 ; U - DEFB $37 ; 7 - DEFB $34 ; 4 - DEFB $52 ; R - DEFB $46 ; F - DEFB $43 ; C - DEFB $4D ; M - DEFB $4B ; K - DEFB $49 ; I - DEFB $38 ; 8 - DEFB $33 ; 3 - DEFB $45 ; E - DEFB $44 ; D - DEFB $58 ; X - DEFB $0E ; SYMBOL SHIFT - DEFB $4C ; L - DEFB $4F ; O - DEFB $39 ; 9 - DEFB $32 ; 2 - DEFB $57 ; W - DEFB $53 ; S - DEFB $5A ; Z - DEFB $20 ; SPACE - DEFB $0D ; ENTER - DEFB $50 ; P - DEFB $30 ; 0 - DEFB $31 ; 1 - DEFB $51 ; Q - DEFB $41 ; A +L0205: DEFB "B" + DEFB "H" + DEFB "Y" + DEFB "6" + DEFB "5" + DEFB "T" + DEFB "G" + DEFB "V" + DEFB "N" + DEFB "J" + DEFB "U" + DEFB "7" + DEFB "4" + DEFB "R" + DEFB "F" + DEFB "C" + DEFB "M" + DEFB "K" + DEFB "I" + DEFB "8" + DEFB "3" + DEFB "E" + DEFB "D" + DEFB "X" + DEFB #0E ; SYMBOL SHIFT + DEFB "L" + DEFB "O" + DEFB "9" + DEFB "2" + DEFB "W" + DEFB "S" + DEFB "Z" + DEFB " " + DEFB #0D ; ENTER + DEFB "P" + DEFB "0" + DEFB "1" + DEFB "Q" + DEFB "A" ;; E-UNSHIFT ; The 26 unshifted extended mode keys for the alphabetic characters. ; The green keywords on the original keyboard. -L022C: DEFB $E3 ; READ - DEFB $C4 ; BIN - DEFB $E0 ; LPRINT - DEFB $E4 ; DATA - DEFB $B4 ; TAN - DEFB $BC ; SGN - DEFB $BD ; ABS - DEFB $BB ; SQR - DEFB $AF ; CODE - DEFB $B0 ; VAL - DEFB $B1 ; LEN - DEFB $C0 ; USR - DEFB $A7 ; PI - DEFB $A6 ; INKEY$ - DEFB $BE ; PEEK - DEFB $AD ; TAB - DEFB $B2 ; SIN - DEFB $BA ; INT - DEFB $E5 ; RESTORE - DEFB $A5 ; RND - DEFB $C2 ; CHR$ - DEFB $E1 ; LLIST - DEFB $B3 ; COS - DEFB $B9 ; EXP - DEFB $C1 ; STR$ - DEFB $B8 ; LN +L022C: DEFB #E3 ; READ + DEFB #C4 ; BIN + DEFB #E0 ; LPRINT + DEFB #E4 ; DATA + DEFB #B4 ; TAN + DEFB #BC ; SGN + DEFB #BD ; ABS + DEFB #BB ; SQR + DEFB #AF ; CODE + DEFB #B0 ; VAL + DEFB #B1 ; LEN + DEFB #C0 ; USR + DEFB #A7 ; PI + DEFB #A6 ; INKEY$ + DEFB #BE ; PEEK + DEFB #AD ; TAB + DEFB #B2 ; SIN + DEFB #BA ; INT + DEFB #E5 ; RESTORE + DEFB #A5 ; RND + DEFB #C2 ; CHR$ + DEFB #E1 ; LLIST + DEFB #B3 ; COS + DEFB #B9 ; EXP + DEFB #C1 ; STR$ + DEFB #B8 ; LN ;; EXT-SHIFT ; The 26 shifted extended mode keys for the alphabetic characters. ; The red keywords below keys on the original keyboard. -L0246: DEFB $7E ; ~ - DEFB $DC ; BRIGHT - DEFB $DA ; PAPER - DEFB $5C ; \ - DEFB $B7 ; ATN - DEFB $7B ; { - DEFB $7D ; } - DEFB $D8 ; CIRCLE - DEFB $BF ; IN - DEFB $AE ; VAL$ - DEFB $AA ; SCREEN$ - DEFB $AB ; ATTR - DEFB $DD ; INVERSE - DEFB $DE ; OVER - DEFB $DF ; OUT - DEFB $7F ; (Copyright character) - DEFB $B5 ; ASN - DEFB $D6 ; VERIFY - DEFB $7C ; | - DEFB $D5 ; MERGE - DEFB $5D ; ] - DEFB $DB ; FLASH - DEFB $B6 ; ACS - DEFB $D9 ; INK - DEFB $5B ; [ - DEFB $D7 ; BEEP +L0246: DEFB '~' + DEFB #DC ; BRIGHT + DEFB #DA ; PAPER + DEFB '\' ; + DEFB #B7 ; ATN + DEFB '{' + DEFB '}' + DEFB #D8 ; CIRCLE + DEFB #BF ; IN + DEFB #AE ; VAL$ + DEFB #AA ; SCREEN$ + DEFB #AB ; ATTR + DEFB #DD ; INVERSE + DEFB #DE ; OVER + DEFB #DF ; OUT + DEFB #7F ; (Copyright character) + DEFB #B5 ; ASN + DEFB #D6 ; VERIFY + DEFB '|' + DEFB #D5 ; MERGE + DEFB ']' + DEFB #DB ; FLASH + DEFB #B6 ; ACS + DEFB #D9 ; INK + DEFB '[' + DEFB #D7 ; BEEP ;; CTL-CODES ; The ten control codes assigned to the top line of digits when the shift ; key is pressed. -L0260: DEFB $0C ; DELETE - DEFB $07 ; EDIT - DEFB $06 ; CAPS LOCK - DEFB $04 ; TRUE VIDEO - DEFB $05 ; INVERSE VIDEO - DEFB $08 ; CURSOR LEFT - DEFB $0A ; CURSOR DOWN - DEFB $0B ; CURSOR UP - DEFB $09 ; CURSOR RIGHT - DEFB $0F ; GRAPHICS +L0260: DEFB #0C ; DELETE + DEFB #07 ; EDIT + DEFB #06 ; CAPS LOCK + DEFB #04 ; TRUE VIDEO + DEFB #05 ; INVERSE VIDEO + DEFB #08 ; CURSOR LEFT + DEFB #0A ; CURSOR DOWN + DEFB #0B ; CURSOR UP + DEFB #09 ; CURSOR RIGHT + DEFB #0F ; GRAPHICS ;; SYM-CODES ; The 26 red symbols assigned to the alphabetic characters of the keyboard. ; The ten single-character digit symbols are converted without the aid of ; a table using subtraction and minor manipulation. -L026A: DEFB $E2 ; STOP - DEFB $2A ; * - DEFB $3F ; ? - DEFB $CD ; STEP - DEFB $C8 ; >= - DEFB $CC ; TO - DEFB $CB ; THEN - DEFB $5E ; ^ - DEFB $AC ; AT - DEFB $2D ; - - DEFB $2B ; + - DEFB $3D ; = - DEFB $2E ; . - DEFB $2C ; , - DEFB $3B ; ; - DEFB $22 ; " - DEFB $C7 ; <= - DEFB $3C ; < - DEFB $C3 ; NOT - DEFB $3E ; > - DEFB $C5 ; OR - DEFB $2F ; / - DEFB $C9 ; <> - DEFB $60 ; pound - DEFB $C6 ; AND - DEFB $3A ; : +L026A: DEFB #E2 ; STOP + DEFB '*' + DEFB '?' + DEFB #CD ; STEP + DEFB #C8 ; >= + DEFB #CC ; TO + DEFB #CB ; THEN + DEFB '^' + DEFB #AC ; AT + DEFB '-' + DEFB '+' + DEFB '=' + DEFB '.' + DEFB ',' + DEFB ';' + DEFB '"' + DEFB #C7 ; <= + DEFB '<' + DEFB #C3 ; NOT + DEFB '>' + DEFB #C5 ; OR + DEFB '/' + DEFB #C9 ; <> + DEFB #60 ; pound + DEFB #C6 ; AND + DEFB ':' ; : ;; E-DIGITS ; The ten keywords assigned to the digits in extended mode. ; The remaining red keywords below the keys. -L0284: DEFB $D0 ; FORMAT - DEFB $CE ; DEF FN - DEFB $A8 ; FN - DEFB $CA ; LINE - DEFB $D3 ; OPEN# - DEFB $D4 ; CLOSE# - DEFB $D1 ; MOVE - DEFB $D2 ; ERASE - DEFB $A9 ; POINT - DEFB $CF ; CAT +L0284: DEFB #D0 ; FORMAT + DEFB #CE ; DEF FN + DEFB #A8 ; FN + DEFB #CA ; LINE + DEFB #D3 ; OPEN# + DEFB #D4 ; CLOSE# + DEFB #D1 ; MOVE + DEFB #D2 ; ERASE + DEFB #A9 ; POINT + DEFB #CF ; CAT ;******************************* @@ -694,7 +642,7 @@ L0284: DEFB $D0 ; FORMAT ; FDFE [ A ] [ S ] [ D ] [ F ] [ G ] | [ H ] [ J ] [ K ] [ L ] [ ENT ] BFFE ; ^ | v ; FEFE [SHI] [ Z ] [ X ] [ C ] [ V ] | [ B ] [ N ] [ M ] [sym] [ SPC ] 7FFE -; ^ $27 $18 v +; ^ #27 #18 v ; Start End ; 00100111 00011000 ; @@ -714,19 +662,19 @@ L0284: DEFB $D0 ; FORMAT ; key values 0-39 else 255 ;; KEY-SCAN -L028E: LD L,$2F ; initial key value +L028E: LD L,#2F ; initial key value ; valid values are obtained by subtracting ; eight five times. - LD DE,$FFFF ; a buffer to receive 2 keys. + LD DE,#FFFF ; a buffer to receive 2 keys. - LD BC,$FEFE ; the commencing port address + LD BC,#FEFE ; the commencing port address ; B holds 11111110 initially and is also ; used to count the 8 half-rows ;; KEY-LINE L0296: IN A,(C) ; read the port to A - bits will be reset ; if a key is pressed else set. CPL ; complement - pressed key-bits are now set - AND $1F ; apply 00011111 mask to pick up the + AND #1F ; apply 00011111 mask to pick up the ; relevant set bits. JR Z,L02AB ; forward to KEY-DONE if zero and therefore @@ -741,8 +689,8 @@ L029F: INC D ; now test the key buffer ; then too many so quit. ;; KEY-BITS -L02A1: SUB $08 ; subtract 8 from the key value - ; cycling through key values (top = $27) +L02A1: SUB #08 ; subtract 8 from the key value + ; cycling through key values (top = #27) ; e.g. 2F> 27>1F>17>0F>07 ; 2E> 26>1E>16>0E>06 SRL H ; shift key bits right into carry. @@ -762,19 +710,19 @@ L02AB: DEC L ; cycles 2F>2E>2D>2C>2B>2A>29>28 for LD A,D ; now test if D is still FF ? INC A ; if it is zero we have at most 1 key - ; range now $01-$28 (1-40d) + ; range now #01-#28 (1-40d) RET Z ; return if one key or no key. - CP $28 ; is it capsshift (was $27) ? + CP #28 ; is it capsshift (was #27) ? RET Z ; return if so. - CP $19 ; is it symbol shift (was $18) ? + CP #19 ; is it symbol shift (was #18) ? RET Z ; return also LD A,E ; now test E LD E,D ; but first switch LD D,A ; the two keys. - CP $18 ; is it symbol shift ? + CP #18 ; is it symbol shift ? RET ; return (with zero set if it was). ; but with symbol shift now in D @@ -794,10 +742,10 @@ L02BF: CALL L028E ; routine KEY-SCAN ; then both sets will be free. - LD HL,$5C00 ; point to KSTATE-0 + LD HL,#5C00 ; point to KSTATE-0 ;; K-ST-LOOP -L02C6: BIT 7,(HL) ; is it free ? ($FF) +L02C6: BIT 7,(HL) ; is it free ? (#FF) JR NZ,L02D1 ; forward to K-CH-SET if so INC HL ; address 5-counter @@ -805,12 +753,12 @@ L02C6: BIT 7,(HL) ; is it free ? ($FF) DEC HL ; step back JR NZ,L02D1 ; forward to K-CH-SET if not at end of count - LD (HL),$FF ; else mark it free. + LD (HL),#FF ; else mark it free. ;; K-CH-SET L02D1: LD A,L ; store low address byte. - LD HL,$5C04 ; point to KSTATE-4 - ; (ld l, $04) + LD HL,#5C04 ; point to KSTATE-4 + ; (ld l, #04) CP L ; have 2 been done ? JR NZ,L02C6 ; back to K-ST-LOOP to consider this 2nd set @@ -819,14 +767,14 @@ L02D1: LD A,L ; store low address byte. CALL L031E ; routine K-TEST to get main key in A RET NC ; return if single shift - LD HL,$5C00 ; point to KSTATE-0 + LD HL,#5C00 ; point to KSTATE-0 CP (HL) ; does it match ? JR Z,L0310 ; forward to K-REPEAT if so ; if not consider the second key map. EX DE,HL ; save kstate-0 in de - LD HL,$5C04 ; point to KSTATE-4 + LD HL,#5C04 ; point to KSTATE-4 CP (HL) ; does it match ? JR Z,L0310 ; forward to K-REPEAT if so @@ -847,25 +795,25 @@ L02D1: LD A,L ; store low address byte. L02F1: LD E,A ; store key in E LD (HL),A ; place in free location INC HL ; advance to interrupt counter - LD (HL),$05 ; and initialize to 5 + LD (HL),#05 ; and initialize to 5 INC HL ; advance to delay - LD A,($5C09) ; pick up system variable REPDEL + LD A,(#5C09) ; pick up system variable REPDEL LD (HL),A ; and insert that for first repeat delay. INC HL ; advance to last location of state map. - LD C,(IY+$07) ; pick up MODE (3 bytes) - LD D,(IY+$01) ; pick up FLAGS (3 bytes) + LD C,(IY+#07) ; pick up MODE (3 bytes) + LD D,(IY+#01) ; pick up FLAGS (3 bytes) PUSH HL ; save state map location ; Note. could now have used. - ; ld l,$41; ld c,(hl); ld l,$3B; ld d,(hl). + ; ld l,#41; ld c,(hl); ld l,#3B; ld d,(hl). ; six and two threes of course. CALL L0333 ; routine K-DECODE POP HL ; restore map pointer LD (HL),A ; put decoded key in last location of map. ;; K-END -L0308: LD ($5C08),A ; update LASTK system variable. - SET 5,(IY+$01) ; update FLAGS - signal new key. +L0308: LD (#5C08),A ; update LASTK system variable. + SET 5,(IY+#01) ; update FLAGS - signal new key. RET ; done ; --------------------------- @@ -876,12 +824,12 @@ L0308: LD ($5C08),A ; update LASTK system variable. ;; K-REPEAT L0310: INC HL ; advance - LD (HL),$05 ; maintain interrupt counter at 5 + LD (HL),#05 ; maintain interrupt counter at 5 INC HL ; advance DEC (HL) ; decrease REPDEL value. RET NZ ; return if not yet zero. - LD A,($5C0A) ; REPPER + LD A,(#5C0A) ; REPPER LD (HL),A ; but for subsequent repeats REPPER will be used. INC HL ; advance ; @@ -897,18 +845,18 @@ L0310: INC HL ; advance ;; K-TEST L031E: LD B,D ; load most significant key to B - ; will be $FF if not shift. - LD D,$00 ; and reset D to index into main table + ; will be #FF if not shift. + LD D,#00 ; and reset D to index into main table LD A,E ; load least significant key from E - CP $27 ; is it higher than 39d i.e. FF + CP #27 ; is it higher than 39d i.e. FF RET NC ; return with just a shift (in B now) - CP $18 ; is it symbol shift ? + CP #18 ; is it symbol shift ? JR NZ,L032C ; forward to K-MAIN if not ; but we could have just symbol shift and no other - BIT 7,B ; is other key $FF (ie not shift) + BIT 7,B ; is other key #FF (ie not shift) RET NZ ; return with solitary symbol shift @@ -926,7 +874,7 @@ L032C: LD HL,L0205 ; address: MAIN-KEYS ;; K-DECODE L0333: LD A,E ; pick up the stored main key - CP $3A ; an arbitrary point between digits and letters + CP #3A ; an arbitrary point between digits and letters JR C,L0367 ; forward to K-DIGIT with digits, space, enter. DEC C ; decrease MODE ( 0='KLC', 1='E', 2='G') @@ -936,13 +884,13 @@ L0333: LD A,E ; pick up the stored main key JR Z,L0341 ; to K-E-LET if was 1 for extended letters. ; proceed with graphic codes. -; Note. should selectively drop return address if code > 'U' ($55). +; Note. should selectively drop return address if code > 'U' (#55). ; i.e. abort the KEYBOARD call. ; e.g. cp 'V'; jr c addit; pop af; ;;addit etc. (5 bytes of instruction). ; (s-inkey$ never gets into graphics mode.) ;; addit - ADD A,$4F ; add offset to augment 'A' to graphics A say. + ADD A,#4F ; add offset to augment 'A' to graphics A say. RET ; return. ; Note. ( but [GRAPH] V gives RND, etc ). @@ -951,15 +899,15 @@ L0333: LD A,E ; pick up the stored main key ; the jump was to here with extended mode with uppercase A-Z. ;; K-E-LET -L0341: LD HL,L022C-$41 ; base address of E-UNSHIFT L022c - ; ( $01EB in standard ROM ) +L0341: LD HL,L022C-#41 ; base address of E-UNSHIFT L022c + ; ( #01EB in standard ROM ) INC B ; test B is it empty i.e. not a shift JR Z,L034A ; forward to K-LOOK-UP if neither shift - LD HL,L0246-$41 ; Address: $0205 L0246-$41 EXT-SHIFT base + LD HL,L0246-#41 ; Address: #0205 L0246-#41 EXT-SHIFT base ;; K-LOOK-UP -L034A: LD D,$00 ; prepare to index +L034A: LD D,#00 ; prepare to index ADD HL,DE ; add the main key value LD A,(HL) ; pick up other mode value RET ; return @@ -969,21 +917,21 @@ L034A: LD D,$00 ; prepare to index ; the jump was here with mode = 0 ;; K-KLC-LET -L034F: LD HL,L026A-$41 ; prepare base of sym-codes - BIT 0,B ; shift=$27 sym-shift=$18 +L034F: LD HL,L026A-#41 ; prepare base of sym-codes + BIT 0,B ; shift=#27 sym-shift=#18 JR Z,L034A ; back to K-LOOK-UP with symbol-shift BIT 3,D ; test FLAGS is it 'K' mode (from OUT-CURS) JR Z,L0364 ; skip to K-TOKENS if so - BIT 3,(IY+$30) ; test FLAGS2 - consider CAPS LOCK ? + BIT 3,(IY+#30) ; test FLAGS2 - consider CAPS LOCK ? RET NZ ; return if so with main code. INC B ; is shift being pressed ? ; result zero if not RET NZ ; return if shift pressed. - ADD A,$20 ; else convert the code to lower case. + ADD A,#20 ; else convert the code to lower case. RET ; return. ; --- @@ -991,7 +939,7 @@ L034F: LD HL,L026A-$41 ; prepare base of sym-codes ; the jump was here for tokens ;; K-TOKENS -L0364: ADD A,$A5 ; add offset to main code so that 'A' +L0364: ADD A,#A5 ; add offset to main code so that 'A' ; becomes 'NEW' etc. RET ; return @@ -1000,7 +948,7 @@ L0364: ADD A,$A5 ; add offset to main code so that 'A' ; the jump was here with digits, space, enter and symbol shift (< $xx) ;; K-DIGIT -L0367: CP $30 ; is it '0' or higher ? +L0367: CP #30 ; is it '0' or higher ? RET C ; return with space, enter and symbol-shift DEC C ; test MODE (was 0='KLC', 1='E', 2='G') @@ -1010,18 +958,18 @@ L0367: CP $30 ; is it '0' or higher ? ; continue with extended digits 0-9. - LD HL,L0284-$30 ; $0254 - base of E-DIGITS - BIT 5,B ; test - shift=$27 sym-shift=$18 + LD HL,L0284-#30 ; #0254 - base of E-DIGITS + BIT 5,B ; test - shift=#27 sym-shift=#18 JR Z,L034A ; to K-LOOK-UP if sym-shift - CP $38 ; is character '8' ? + CP #38 ; is character '8' ? JR NC,L0382 ; to K-8-&-9 if greater than '7' - SUB $20 ; reduce to ink range $10-$17 + SUB #20 ; reduce to ink range #10-#17 INC B ; shift ? RET Z ; return if not. - ADD A,$08 ; add 8 to give paper range $18 - $1F + ADD A,#08 ; add 8 to give paper range #18 - #1F RET ; return ; --- @@ -1029,11 +977,11 @@ L0367: CP $30 ; is it '0' or higher ? ; 89 ;; K-8-&-9 -L0382: SUB $36 ; reduce to 02 and 03 bright codes +L0382: SUB #36 ; reduce to 02 and 03 bright codes INC B ; test if shift pressed. RET Z ; return if not. - ADD A,$FE ; subtract 2 setting carry + ADD A,#FE ; subtract 2 setting carry RET ; to give 0 and 1 flash codes. ; --- @@ -1041,23 +989,23 @@ L0382: SUB $36 ; reduce to 02 and 03 bright codes ; graphics mode with digits ;; K-GRA-DGT -L0389: LD HL,L0260-$30 ; $0230 base address of CTL-CODES +L0389: LD HL,L0260-#30 ; #0230 base address of CTL-CODES - CP $39 ; is key '9' ? - JR Z,L034A ; back to K-LOOK-UP - changed to $0F, GRAPHICS. + CP #39 ; is key '9' ? + JR Z,L034A ; back to K-LOOK-UP - changed to #0F, GRAPHICS. - CP $30 ; is key '0' ? - JR Z,L034A ; back to K-LOOK-UP - changed to $0C, delete. + CP #30 ; is key '0' ? + JR Z,L034A ; back to K-LOOK-UP - changed to #0C, delete. ; for keys '0' - '7' we assign a mosaic character depending on shift. - AND $07 ; convert character to number. 0 - 7. - ADD A,$80 ; add offset - they start at $80 + AND #07 ; convert character to number. 0 - 7. + ADD A,#80 ; add offset - they start at #80 INC B ; destructively test for shift RET Z ; and return if not pressed. - XOR $0F ; toggle bits becomes range $88-$8F + XOR #0F ; toggle bits becomes range #88-#8F RET ; return. ; --- @@ -1070,32 +1018,32 @@ L039D: INC B ; return with digit codes if neither BIT 5,B ; test for caps shift. - LD HL,L0260-$30 ; prepare base of table CTL-CODES. + LD HL,L0260-#30 ; prepare base of table CTL-CODES. JR NZ,L034A ; back to K-LOOK-UP if shift pressed. ; must have been symbol shift - SUB $10 ; for ASCII most will now be correct + SUB #10 ; for ASCII most will now be correct ; on a standard typewriter. - CP $22 ; but '@' is not - see below. + CP #22 ; but '@' is not - see below. JR Z,L03B2 ; forward to to K-@-CHAR if so - CP $20 ; '_' is the other one that fails + CP #20 ; '_' is the other one that fails RET NZ ; return if not. - LD A,$5F ; substitute ASCII '_' + LD A,#5F ; substitute ASCII '_' RET ; return. ; --- ;; K-@-CHAR -L03B2: LD A,$40 ; substitute ASCII '@' +L03B2: LD A,#40 ; substitute ASCII '@' RET ; return. ; ------------------------------------------------------------------------ ; The Spectrum Input character keys. One or two are abbreviated. -; From $00 Flash 0 to $FF COPY. The routine above has decoded all these. +; From #00 Flash 0 to #FF COPY. The routine above has decoded all these. ; | 00 Fl0| 01 Fl1| 02 Br0| 03 Br1| 04 In0| 05 In1| 06 CAP| 07 EDT| ; | 08 LFT| 09 RIG| 0A DWN| 0B UP | 0C DEL| 0D ENT| 0E SYM| 0F GRA| @@ -1132,8 +1080,8 @@ L03B2: LD A,$40 ; substitute ASCII '@' ; Note that for simplicity, Sinclair have located all the control codes ; below the space character. -; ASCII DEL, $7F, has been made a copyright symbol. -; Also $60, '`', not used in BASIC but used in other languages, has been +; ASCII DEL, #7F, has been made a copyright symbol. +; Also #60, '`', not used in BASIC but used in other languages, has been ; allocated the local currency symbol for the relevant country - ; ukp in most Spectrums. @@ -1184,19 +1132,19 @@ L03B5: DI ; Disable Interrupts so they don't disturb timin SRL L ; SRL L ; L = medium part of tone period CPL ; - AND $03 ; A = 3 - fine part of tone period + AND #03 ; A = 3 - fine part of tone period LD C,A ; - LD B,$00 ; + LD B,#00 ; LD IX,L03D1 ; Address: BE-IX+3 ADD IX,BC ; IX holds address of entry into the loop ; the loop will contain 0-3 NOPs, implementing ; the fine part of the tone period. - LD A,($5C48) ; BORDCR - AND $38 ; bits 5..3 contain border colour + LD A,(#5C48) ; BORDCR + AND #38 ; bits 5..3 contain border colour RRCA ; border colour bits moved to 2..0 RRCA ; to match border bits on port #FE RRCA ; - OR $08 ; bit 3 set (tape output bit on port #FE) + OR #08 ; bit 3 set (tape output bit on port #FE) ; for loud sound output ;; BE-IX+3 L03D1: NOP ;(4) ; optionally executed NOPs for small @@ -1215,12 +1163,12 @@ L03D4: INC B ;(4) ; L03D6: DEC C ;(4) ; timing loop for duration of JR NZ,L03D6 ;(12/7); high or low pulse of waveform - LD C,$3F ;(7) ; + LD C,#3F ;(7) ; DEC B ;(4) ; JP NZ,L03D6 ;(10) ; to BE-H&L-LP - XOR $10 ;(7) ; toggle output beep bit - OUT ($FE),A ;(11) ; output pulse + XOR #10 ;(7) ; toggle output beep bit + OUT (#FE),A ;(11) ; output pulse LD B,H ;(4) ; B = coarse part of tone period LD C,A ;(4) ; save port #FE output byte BIT 4,A ;(8) ; if new output bit is high, go @@ -1259,19 +1207,19 @@ L03F6: EI ; Enable Interrupts ; ;; beep L03F8: RST 28H ;; FP-CALC - DEFB $31 ;;duplicate ; duplicate pitch - DEFB $27 ;;int ; convert to integer - DEFB $C0 ;;st-mem-0 ; store integer pitch to memory 0 - DEFB $03 ;;subtract ; calculate fractional part of pitch = fp_pitch - int_pitch - DEFB $34 ;;stk-data ; push constant - DEFB $EC ;;Exponent: $7C, Bytes: 4 ; constant = 0.05762265 - DEFB $6C,$98,$1F,$F5 ;;($6C,$98,$1F,$F5) - DEFB $04 ;;multiply ; compute: - DEFB $A1 ;;stk-one ; 1 + 0.05762265 * fraction_part(pitch) - DEFB $0F ;;addition - DEFB $38 ;;end-calc ; leave on calc stack + DEFB #31 ;;duplicate ; duplicate pitch + DEFB #27 ;;int ; convert to integer + DEFB #C0 ;;st-mem-0 ; store integer pitch to memory 0 + DEFB #03 ;;subtract ; calculate fractional part of pitch = fp_pitch - int_pitch + DEFB #34 ;;stk-data ; push constant + DEFB #EC ;;Exponent: #7C, Bytes: 4 ; constant = 0.05762265 + DEFB #6C,#98,#1F,#F5 ;;(#6C,#98,#1F,#F5) + DEFB #04 ;;multiply ; compute: + DEFB #A1 ;;stk-one ; 1 + 0.05762265 * fraction_part(pitch) + DEFB #0F ;;addition + DEFB #38 ;;end-calc ; leave on calc stack - LD HL,$5C92 ; MEM-0: number stored here is in 16 bit integer format (pitch) + LD HL,#5C92 ; MEM-0: number stored here is in 16 bit integer format (pitch) ; 0, 0/FF (pos/neg), LSB, MSB, 0 ; LSB/MSB is stored in two's complement ; In the following, the pitch is checked if it is in the range -128<=p<=127 @@ -1294,7 +1242,7 @@ L03F8: RST 28H ;; FP-CALC JR NZ,L046C ; if no, error REPORT-B ; now we know -128<=p<=127 LD A,B ; A = pitch + 60 - ADD A,$3C ; if -60<=pitch<=67, + ADD A,#3C ; if -60<=pitch<=67, JP P,L0425 ; goto BE-i-OK JP PO,L046C ; if pitch <= 67 goto REPORT-B @@ -1303,42 +1251,42 @@ L03F8: RST 28H ;; FP-CALC ;; BE-I-OK ; here, -60<=pitch<=127 ; and A=pitch+60 -> 0<=A<=187 -L0425: LD B,$FA ; 6 octaves below middle C +L0425: LD B,#FA ; 6 octaves below middle C ;; BE-OCTAVE ; A=# semitones above 5 octaves below middle C L0427: INC B ; increment octave - SUB $0C ; 12 semitones = one octave + SUB #0C ; 12 semitones = one octave JR NC,L0427 ; to BE-OCTAVE - ADD A,$0C ; A = # semitones above C (0-11) + ADD A,#0C ; A = # semitones above C (0-11) PUSH BC ; B = octave displacement from middle C, 2's complement: -5<=B<=10 LD HL,L046E ; Address: semi-tone CALL L3406 ; routine LOC-MEM - ; HL = 5*A + $046E + ; HL = 5*A + #046E CALL L33B4 ; routine STACK-NUM ; read FP value (freq) from semitone table (HL) and push onto calc stack RST 28H ;; FP-CALC - DEFB $04 ;;multiply mult freq by 1 + 0.0576 * fraction_part(pitch) stacked earlier + DEFB #04 ;;multiply mult freq by 1 + 0.0576 * fraction_part(pitch) stacked earlier ;; thus taking into account fractional part of pitch. ;; the number 0.0576*frequency is the distance in Hz to the next ;; note (verify with the frequencies recorded in the semitone ;; table below) so that the fraction_part of the pitch does ;; indeed represent a fractional distance to the next note. - DEFB $38 ;;end-calc HL points to first byte of fp num on stack = middle frequency to generate + DEFB #38 ;;end-calc HL points to first byte of fp num on stack = middle frequency to generate POP AF ; A = octave displacement from middle C, 2's complement: -5<=A<=10 ADD A,(HL) ; increase exponent by A (equivalent to multiplying by 2^A) LD (HL),A ; RST 28H ;; FP-CALC - DEFB $C0 ;;st-mem-0 ; store frequency in memory 0 - DEFB $02 ;;delete ; remove from calc stack - DEFB $31 ;;duplicate ; duplicate duration (seconds) - DEFB $38 ;;end-calc + DEFB #C0 ;;st-mem-0 ; store frequency in memory 0 + DEFB #02 ;;delete ; remove from calc stack + DEFB #31 ;;duplicate ; duplicate duration (seconds) + DEFB #38 ;;end-calc CALL L1E94 ; routine FIND-INT1 ; FP duration to A - CP $0B ; if dur > 10 seconds, + CP #0B ; if dur > 10 seconds, JR NC,L046C ; goto REPORT-B ;;; The following calculation finds the tone period for HL and the cycle count @@ -1351,19 +1299,19 @@ L0427: INC B ; increment octave ;;; below. This is probably an error. RST 28H ;; FP-CALC - DEFB $E0 ;;get-mem-0 ; push frequency - DEFB $04 ;;multiply ; result1: #cycles = duration * frequency - DEFB $E0 ;;get-mem-0 ; push frequency - DEFB $34 ;;stk-data ; push constant - DEFB $80 ;;Exponent $93, Bytes: 3 ; constant = 437500 - DEFB $43,$55,$9F,$80 ;;($55,$9F,$80,$00) - DEFB $01 ;;exchange ; frequency on top - DEFB $05 ;;division ; 437500 / frequency - DEFB $34 ;;stk-data ; push constant - DEFB $35 ;;Exponent: $85, Bytes: 1 ; constant = 30.125 - DEFB $71 ;;($71,$00,$00,$00) - DEFB $03 ;;subtract ; result2: tone_period(HL) = 437500 / freq - 30.125 - DEFB $38 ;;end-calc + DEFB #E0 ;;get-mem-0 ; push frequency + DEFB #04 ;;multiply ; result1: #cycles = duration * frequency + DEFB #E0 ;;get-mem-0 ; push frequency + DEFB #34 ;;stk-data ; push constant + DEFB #80 ;;Exponent #93, Bytes: 3 ; constant = 437500 + DEFB #43,#55,#9F,#80 ;;(#55,#9F,#80,#00) + DEFB #01 ;;exchange ; frequency on top + DEFB #05 ;;division ; 437500 / frequency + DEFB #34 ;;stk-data ; push constant + DEFB #35 ;;Exponent: #85, Bytes: 1 ; constant = 30.125 + DEFB #71 ;;(#71,#00,#00,#00) + DEFB #03 ;;subtract ; result2: tone_period(HL) = 437500 / freq - 30.125 + DEFB #38 ;;end-calc CALL L1E99 ; routine FIND-INT2 PUSH BC ; BC = tone_period(HL) @@ -1383,7 +1331,7 @@ L0427: INC B ; increment octave ;; REPORT-B L046C: RST 08H ; ERROR-1 - DEFB $0A ; Error Report: Integer out of range + DEFB #0A ; Error Report: Integer out of range @@ -1395,18 +1343,18 @@ L046C: RST 08H ; ERROR-1 ; To move n octaves higher or lower, frequencies are multiplied by 2^n. ;; semi-tone five byte fp decimal freq note (middle) -L046E: DEFB $89, $02, $D0, $12, $86; 261.625565290 C - DEFB $89, $0A, $97, $60, $75; 277.182631135 C# - DEFB $89, $12, $D5, $17, $1F; 293.664768100 D - DEFB $89, $1B, $90, $41, $02; 311.126983881 D# - DEFB $89, $24, $D0, $53, $CA; 329.627557039 E - DEFB $89, $2E, $9D, $36, $B1; 349.228231549 F - DEFB $89, $38, $FF, $49, $3E; 369.994422674 F# - DEFB $89, $43, $FF, $6A, $73; 391.995436072 G - DEFB $89, $4F, $A7, $00, $54; 415.304697513 G# - DEFB $89, $5C, $00, $00, $00; 440.000000000 A - DEFB $89, $69, $14, $F6, $24; 466.163761616 A# - DEFB $89, $76, $F1, $10, $05; 493.883301378 B +L046E: DEFB #89, #02, #D0, #12, #86; 261.625565290 C + DEFB #89, #0A, #97, #60, #75; 277.182631135 C# + DEFB #89, #12, #D5, #17, #1F; 293.664768100 D + DEFB #89, #1B, #90, #41, #02; 311.126983881 D# + DEFB #89, #24, #D0, #53, #CA; 329.627557039 E + DEFB #89, #2E, #9D, #36, #B1; 349.228231549 F + DEFB #89, #38, #FF, #49, #3E; 369.994422674 F# + DEFB #89, #43, #FF, #6A, #73; 391.995436072 G + DEFB #89, #4F, #A7, #00, #54; 415.304697513 G# + DEFB #89, #5C, #00, #00, #00; 440.000000000 A + DEFB #89, #69, #14, #F6, #24; 466.163761616 A# + DEFB #89, #76, #F1, #10, #05; 493.883301378 B ;**************************************** @@ -1425,7 +1373,7 @@ L046E: DEFB $89, $02, $D0, $12, $86; 261.625565290 C ;; zx81-name L04AA: CALL L24FB ; routine SCANNING to evaluate expression. - LD A,($5C3B) ; fetch system variable FLAGS. + LD A,(#5C3B) ; fetch system variable FLAGS. ADD A,A ; test bit 7 - syntax, bit 6 - result type. JP M,L1C8A ; to REPORT-C if not string result ; 'Nonsense in BASIC'. @@ -1448,13 +1396,13 @@ L04AA: CALL L24FB ; routine SCANNING to evaluate expression. ; ========================================= ; -; PORT 254 ($FE) +; PORT 254 (#FE) ; ; spk mic { border } ; ___ ___ ___ ___ ___ ___ ___ ___ ; PORT | | | | | | | | | ; 254 | | | | | | | | | -; $FE |___|___|___|___|___|___|___|___| +; #FE |___|___|___|___|___|___|___|___| ; 7 6 5 4 3 2 1 0 ; @@ -1467,7 +1415,7 @@ L04AA: CALL L24FB ; routine SCANNING to evaluate expression. ; On entry - ; HL points to start of data. ; IX points to descriptor. -; The accumulator is set to $00 for a header, $FF for data. +; The accumulator is set to #00 for a header, #FF for data. ;; SA-BYTES L04C2: LD HL,L053F ; address: SA/LD-RET @@ -1475,7 +1423,7 @@ L04C2: LD HL,L053F ; address: SA/LD-RET ; however there is only one non-terminal exit ; point. - LD HL,$1F80 ; a timing constant H=$1F, L=$80 + LD HL,#1F80 ; a timing constant H=#1F, L=#80 ; inner and outer loop counters ; a five second lead-in is used for a header. @@ -1485,7 +1433,7 @@ L04C2: LD HL,L053F ; address: SA/LD-RET ; else is data bytes and a shorter lead-in is used. - LD HL,$0C98 ; another timing value H=$0C, L=$98. + LD HL,#0C98 ; another timing value H=#0C, L=#98. ; a two second lead-in is used for the data. @@ -1496,20 +1444,20 @@ L04D0: EX AF,AF' ; save flag DI ; disable interrupts - LD A,$02 ; select red for border, microphone bit on. + LD A,#02 ; select red for border, microphone bit on. LD B,A ; also does as an initial slight counter value. ;; SA-LEADER L04D8: DJNZ L04D8 ; self loop to SA-LEADER for delay. - ; after initial loop, count is $A4 (or $A3) + ; after initial loop, count is #A4 (or #A3) - OUT ($FE),A ; output byte $02/$0D to tape port. + OUT (#FE),A ; output byte #02/#0D to tape port. - XOR $0F ; switch from RED (mic on) to CYAN (mic off). + XOR #0F ; switch from RED (mic on) to CYAN (mic off). - LD B,$A4 ; hold count. also timed instruction. + LD B,#A4 ; hold count. also timed instruction. - DEC L ; originally $80 or $98. + DEC L ; originally #80 or #98. ; but subsequently cycles 256 times. JR NZ,L04D8 ; back to SA-LEADER until L is zero. @@ -1517,26 +1465,26 @@ L04D8: DJNZ L04D8 ; self loop to SA-LEADER for delay. DEC B ; decrement count DEC H ; originally twelve or thirty-one. - JP P,L04D8 ; back to SA-LEADER until H becomes $FF + JP P,L04D8 ; back to SA-LEADER until H becomes #FF ; now send a synch pulse. At this stage mic is off and A holds value ; for mic on. ; A synch pulse is much shorter than the steady pulses of the lead-in. - LD B,$2F ; another short timed delay. + LD B,#2F ; another short timed delay. ;; SA-SYNC-1 L04EA: DJNZ L04EA ; self loop to SA-SYNC-1 - OUT ($FE),A ; switch to mic on and red. - LD A,$0D ; prepare mic off - cyan - LD B,$37 ; another short timed delay. + OUT (#FE),A ; switch to mic on and red. + LD A,#0D ; prepare mic off - cyan + LD B,#37 ; another short timed delay. ;; SA-SYNC-2 L04F2: DJNZ L04F2 ; self loop to SA-SYNC-2 - OUT ($FE),A ; output mic off, cyan border. - LD BC,$3B0E ; B=$3B time(*), C=$0E, YELLOW, MIC OFF. + OUT (#FE),A ; output mic off, cyan border. + LD BC,#3B0E ; B=#3B time(*), C=#0E, YELLOW, MIC OFF. ; @@ -1544,21 +1492,21 @@ L04F2: DJNZ L04F2 ; self loop to SA-SYNC-2 ; which is 1st byte to be saved. LD L,A ; and transfer to L. - ; the initial parity is A, $FF or $00. + ; the initial parity is A, #FF or #00. JP L0507 ; JUMP forward to SA-START -> ; the mid entry point of loop. ; ------------------------- ; During the save loop a parity byte is maintained in H. ; the save loop begins by testing if reduced length is zero and if so -; the final parity byte is saved reducing count to $FFFF. +; the final parity byte is saved reducing count to #FFFF. ;; SA-LOOP L04FE: LD A,D ; fetch high byte OR E ; test against low byte. JR Z,L050E ; forward to SA-PARITY if zero. - LD L,(IX+$00) ; load currently addressed byte to L. + LD L,(IX+#00) ; load currently addressed byte to L. ;; SA-LOOP-P L0505: LD A,H ; fetch parity byte. @@ -1568,7 +1516,7 @@ L0505: LD A,H ; fetch parity byte. ;; SA-START L0507: LD H,A ; put parity byte in H. - LD A,$01 ; prepare blue, mic=on. + LD A,#01 ; prepare blue, mic=on. SCF ; set carry flag ready to rotate in. JP L0525 ; JUMP forward to SA-8-BITS -8-> @@ -1591,9 +1539,9 @@ L050E: LD L,H ; transfer the running parity byte to L and ;; SA-BIT-2 L0511: LD A,C ; fetch 'mic on and yellow' which is ; held permanently in C. - BIT 7,B ; set the zero flag. B holds $3E. + BIT 7,B ; set the zero flag. B holds #3E. -; entry point to save 1 entire bit. For first bit B holds $3B(*). +; entry point to save 1 entire bit. For first bit B holds #3B(*). ; Carry is set if saved bit is 1. zero is reset NZ on entry. ;; SA-BIT-1 @@ -1603,21 +1551,21 @@ L0514: DJNZ L0514 ; self loop for delay to SA-BIT-1 ; but if bit is 1 then the mic state is held for longer. - LD B,$42 ; set timed delay. (66 decimal) + LD B,#42 ; set timed delay. (66 decimal) ;; SA-SET L051A: DJNZ L051A ; self loop to SA-SET ; (roughly an extra 66*13 clock cycles) ;; SA-OUT -L051C: OUT ($FE),A ; blue and mic on OR yellow and mic off. +L051C: OUT (#FE),A ; blue and mic on OR yellow and mic off. - LD B,$3E ; set up delay + LD B,#3E ; set up delay JR NZ,L0511 ; back to SA-BIT-2 if zero reset NZ (first pass) ; proceed when the blue and yellow bands have been output. - DEC B ; change value $3E to $3D. + DEC B ; change value #3E to #3D. XOR A ; clear carry flag (ready to rotate in). INC A ; reset zero flag ie. NZ. @@ -1633,20 +1581,20 @@ L0525: RL L ; rotate left through carry DEC DE ; decrease length INC IX ; increase byte pointer - LD B,$31 ; set up timing. + LD B,#31 ; set up timing. - LD A,$7F ; test the space key and - IN A,($FE) ; return to common exit (to restore border) + LD A,#7F ; test the space key and + IN A,(#FE) ; return to common exit (to restore border) RRA ; if a space is pressed RET NC ; return to SA/LD-RET. - - > -; now test if byte counter has reached $FFFF. +; now test if byte counter has reached #FFFF. LD A,D ; fetch high byte INC A ; increment. JP NZ,L04FE ; JUMP to SA-LOOP if more bytes. - LD B,$3B ; a final delay. + LD B,#3B ; a final delay. ;; SA-DELAY L053C: DJNZ L053C ; self loop to SA-DELAY @@ -1664,16 +1612,16 @@ L053C: DJNZ L053C ; self loop to SA-DELAY ;; SA/LD-RET L053F: PUSH AF ; preserve accumulator throughout. - LD A,($5C48) ; fetch border colour from BORDCR. - AND $38 ; mask off paper bits. + LD A,(#5C48) ; fetch border colour from BORDCR. + AND #38 ; mask off paper bits. RRCA ; rotate RRCA ; to the RRCA ; range 0-7. - OUT ($FE),A ; change the border colour. + OUT (#FE),A ; change the border colour. - LD A,$7F ; read from port address $7FFE the - IN A,($FE) ; row with the space key at outside. + LD A,#7F ; read from port address #7FFE the + IN A,(#FE) ; row with the space key at outside. RRA ; test for space key pressed. EI ; enable interrupts @@ -1682,7 +1630,7 @@ L053F: PUSH AF ; preserve accumulator throughout. ;; REPORT-Da L0552: RST 08H ; ERROR-1 - DEFB $0C ; Error Report: BREAK - CONT repeats + DEFB #0C ; Error Report: BREAK - CONT repeats ; --- @@ -1693,8 +1641,8 @@ L0554: POP AF ; restore the accumulator. ; ------------------------------------ ; Load header or block of information ; ------------------------------------ -; This routine is used to load bytes and on entry A is set to $00 for a -; header or to $FF for data. IX points to the start of receiving location +; This routine is used to load bytes and on entry A is set to #00 for a +; header or to #FF for data. IX points to the start of receiving location ; and DE holds the length of bytes to be loaded. If, on entry the carry flag ; is set then data is loaded, if reset then it is verified. @@ -1705,8 +1653,8 @@ L0556: INC D ; reset the zero flag without disturbing carry. DI ; disable interrupts - LD A,$0F ; make the border white and mic off. - OUT ($FE),A ; output to port. + LD A,#0F ; make the border white and mic off. + OUT (#FE),A ; output to port. LD HL,L053F ; Address: SA/LD-RET PUSH HL ; is saved on stack as terminating routine. @@ -1714,10 +1662,10 @@ L0556: INC D ; reset the zero flag without disturbing carry. ; the reading of the EAR bit (D6) will always be preceded by a test of the ; space key (D0), so store the initial post-test state. - IN A,($FE) ; read the ear state - bit 6. + IN A,(#FE) ; read the ear state - bit 6. RRA ; rotate to bit 5. - AND $20 ; isolate this bit. - OR $02 ; combine with red border colour. + AND #20 ; isolate this bit. + OR #02 ; combine with red border colour. LD C,A ; and store initial state long-term in C. CP A ; set the zero flag. @@ -1733,7 +1681,7 @@ L056C: CALL L05E7 ; routine LD-EDGE-1 ; but continue when a transition is found on tape. - LD HL,$0415 ; set up 16-bit outer loop counter for + LD HL,#0415 ; set up 16-bit outer loop counter for ; approx 1 second delay. ;; LD-WAIT @@ -1752,11 +1700,11 @@ L0574: DJNZ L0574 ; self loop to LD-WAIT (for 256 times) ; if no edges at all. ;; LD-LEADER -L0580: LD B,$9C ; set timing value. +L0580: LD B,#9C ; set timing value. CALL L05E3 ; routine LD-EDGE-2 JR NC,L056B ; back to LD-BREAK if time-out - LD A,$C6 ; two edges must be spaced apart. + LD A,#C6 ; two edges must be spaced apart. CP B ; compare JR NC,L056C ; back to LD-START if too close together for a ; lead-in. @@ -1768,17 +1716,17 @@ L0580: LD B,$9C ; set timing value. ; Now test every edge looking for the terminal synch signal. ;; LD-SYNC -L058F: LD B,$C9 ; initial timing value in B. +L058F: LD B,#C9 ; initial timing value in B. CALL L05E7 ; routine LD-EDGE-1 JR NC,L056B ; back to LD-BREAK with time-out. LD A,B ; fetch augmented timing value from B. - CP $D4 ; compare + CP #D4 ; compare JR NC,L058F ; back to LD-SYNC if gap too big, that is, ; a normal lead-in edge gap. ; but a short gap will be the synch pulse. -; in which case another edge should appear before B rises to $FF +; in which case another edge should appear before B rises to #FF CALL L05E7 ; routine LD-EDGE-1 RET NC ; return with time-out. @@ -1787,12 +1735,12 @@ L058F: LD B,$C9 ; initial timing value in B. ; We are about to load data so change the border colours. LD A,C ; fetch long-term mask from C - XOR $03 ; and make blue/yellow. + XOR #03 ; and make blue/yellow. LD C,A ; store the new long-term byte. - LD H,$00 ; set up parity byte as zero. - LD B,$B0 ; timing. + LD H,#00 ; set up parity byte as zero. + LD B,#B0 ; timing. JR L05C8 ; forward to LD-MARKER ; the loop mid entry point with the alternate ; zero flag reset to indicate first byte @@ -1808,7 +1756,7 @@ L05A9: EX AF,AF' ; restore entry flags and type in A. JR NC,L05BD ; forward to LD-VERIFY if not to be loaded. - LD (IX+$00),L ; place loaded byte at memory location. + LD (IX+#00),L ; place loaded byte at memory location. JR L05C2 ; forward to LD-NEXT ; --- @@ -1834,7 +1782,7 @@ L05B3: RL C ; preserve carry (verify) flag in long-term ; for verification the byte read from tape is compared with that in memory. ;; LD-VERIFY -L05BD: LD A,(IX+$00) ; fetch byte from memory. +L05BD: LD A,(IX+#00) ; fetch byte from memory. XOR L ; compare with that on tape RET NZ ; return if not zero. @@ -1844,27 +1792,27 @@ L05C2: INC IX ; increment byte pointer. ;; LD-DEC L05C4: DEC DE ; decrement length. EX AF,AF' ; store the flags. - LD B,$B2 ; timing. + LD B,#B2 ; timing. ; when starting to read 8 bits the receiving byte is marked with bit at right. ; when this is rotated out again then 8 bits have been read. ;; LD-MARKER -L05C8: LD L,$01 ; initialize as %00000001 +L05C8: LD L,#01 ; initialize as %00000001 ;; LD-8-BITS L05CA: CALL L05E3 ; routine LD-EDGE-2 increments B relative to ; gap between 2 edges. RET NC ; return with time-out. - LD A,$CB ; the comparison byte. + LD A,#CB ; the comparison byte. CP B ; compare to incremented value of B. ; if B is higher then bit on tape was set. ; if <= then bit on tape is reset. RL L ; rotate the carry bit into L. - LD B,$B0 ; reset the B timer byte. + LD B,#B0 ; reset the B timer byte. JP NC,L05CA ; JUMP back to LD-8-BITS ; when carry set then marker bit has been passed out and byte is complete. @@ -1881,7 +1829,7 @@ L05CA: CALL L05E3 ; routine LD-EDGE-2 increments B relative to ; when all bytes loaded then parity byte should be zero. LD A,H ; fetch parity byte. - CP $01 ; set carry if zero. + CP #01 ; set carry if zero. RET ; return ; in no carry then error as checksum disagrees. @@ -1889,7 +1837,7 @@ L05CA: CALL L05E3 ; routine LD-EDGE-2 increments B relative to ; Check signal being loaded ; ------------------------- ; An edge is a transition from one mic state to another. -; More specifically a change in bit 6 of value input from port $FE. +; More specifically a change in bit 6 of value input from port #FE. ; Graphically it is a change of border colour, say, blue to yellow. ; The first entry point looks for two adjacent edges. The second entry point ; is used to find a single edge. @@ -1911,7 +1859,7 @@ L05E3: CALL L05E7 ; call routine LD-EDGE-1 below. ; when detecting a read-in signal on the tape. ;; LD-EDGE-1 -L05E7: LD A,$16 ; a delay value of twenty two. +L05E7: LD A,#16 ; a delay value of twenty two. ;; LD-DELAY L05E9: DEC A ; decrement counter @@ -1921,15 +1869,15 @@ L05E9: DEC A ; decrement counter ;; LD-SAMPLE L05ED: INC B ; increment the time-out counter. - RET Z ; return with failure when $FF passed. + RET Z ; return with failure when #FF passed. - LD A,$7F ; prepare to read keyboard and EAR port - IN A,($FE) ; row $7FFE. bit 6 is EAR, bit 0 is SPACE key. + LD A,#7F ; prepare to read keyboard and EAR port + IN A,(#FE) ; row #7FFE. bit 6 is EAR, bit 0 is SPACE key. RRA ; test outer key the space. (bit 6 moves to 5) RET NC ; return if space pressed. >>> XOR C ; compare with initial long-term state. - AND $20 ; isolate bit 5 + AND #20 ; isolate bit 5 JR Z,L05ED ; back to LD-SAMPLE if no edge. ; but an edge, a transition of the EAR bit, has been found so switch the @@ -1939,9 +1887,9 @@ L05ED: INC B ; increment the time-out counter. CPL ; switch the bits LD C,A ; and put back in C for long-term. - AND $07 ; isolate new colour bits. - OR $08 ; set bit 3 - MIC off. - OUT ($FE),A ; send to port to effect change of colour. + AND #07 ; isolate new colour bits. + OR #08 ; set bit 3 - MIC off. + OUT (#FE),A ; send to port to effect change of colour. SCF ; set carry flag signaling edge found within ; time allowed. @@ -1953,24 +1901,24 @@ L05ED: INC B ; increment the time-out counter. ; This is the single entry point for the four tape commands. ; The routine first determines in what context it has been called by examining ; the low byte of the Syntax table entry which was stored in T_ADDR. -; Subtracting $EO (the present arrangement) gives a value of -; $00 - SAVE -; $01 - LOAD -; $02 - VERIFY -; $03 - MERGE +; Subtracting #EO (the present arrangement) gives a value of +; #00 - SAVE +; #01 - LOAD +; #02 - VERIFY +; #03 - MERGE ; As with all commands the address STMT-RET is on the stack. ;; SAVE-ETC L0605: POP AF ; discard address STMT-RET. - LD A,($5C74) ; fetch T_ADDR + LD A,(#5C74) ; fetch T_ADDR ; Now reduce the low byte of the Syntax table entry to give command. -; Note. For ZASM use SUB $E0 as next instruction. +; Note. For ZASM use SUB #E0 as next instruction. L0609: SUB low (L1ADF + 1) ; subtract the known offset. - ; ( is SUB $E0 in standard ROM ) + ; ( is SUB #E0 in standard ROM ) - LD ($5C74),A ; and put back in T_ADDR as 0,1,2, or 3 + LD (#5C74),A ; and put back in T_ADDR as 0,1,2, or 3 ; for future reference. CALL L1C8C ; routine EXPT-EXP checks that a string @@ -1980,12 +1928,12 @@ L0609: SUB low (L1ADF + 1) ; subtract the known offset. CALL L2530 ; routine SYNTAX-Z JR Z,L0652 ; forward to SA-DATA if checking syntax. - LD BC,$0011 ; presume seventeen bytes for a header. - LD A,($5C74) ; fetch command from T_ADDR. + LD BC,#0011 ; presume seventeen bytes for a header. + LD A,(#5C74) ; fetch command from T_ADDR. AND A ; test for zero - SAVE. JR Z,L0621 ; forward to SA-SPACE if so. - LD C,$22 ; else double length to thirty four. + LD C,#22 ; else double length to thirty four. ;; SA-SPACE L0621: RST 30H ; BC-SPACES creates 17/34 bytes in workspace. @@ -1996,32 +1944,32 @@ L0621: RST 30H ; BC-SPACES creates 17/34 bytes in workspace. ; ten spaces are required for the default filename but it is simpler to ; overwrite the first file-type indicator byte as well. - LD B,$0B ; set counter to eleven. - LD A,$20 ; prepare a space. + LD B,#0B ; set counter to eleven. + LD A,#20 ; prepare a space. ;; SA-BLANK L0629: LD (DE),A ; set workspace location to space. INC DE ; next location. DJNZ L0629 ; loop back to SA-BLANK till all eleven done. - LD (IX+$01),$FF ; set first byte of ten character filename - ; to $FF as a default to signal null string. + LD (IX+#01),#FF ; set first byte of ten character filename + ; to #FF as a default to signal null string. CALL L2BF1 ; routine STK-FETCH fetches the filename ; parameters from the calculator stack. ; length of string in BC. ; start of string in DE. - LD HL,$FFF6 ; prepare the value minus ten. + LD HL,#FFF6 ; prepare the value minus ten. DEC BC ; decrement length. - ; ten becomes nine, zero becomes $FFFF. + ; ten becomes nine, zero becomes #FFFF. ADD HL,BC ; trial addition. INC BC ; restore true length. JR NC,L064B ; forward to SA-NAME if length is one to ten. ; the filename is more than ten characters in length or the null string. - LD A,($5C74) ; fetch command from T_ADDR. + LD A,(#5C74) ; fetch command from T_ADDR. AND A ; test for zero - SAVE. JR NZ,L0644 ; forward to SA-NULL if not the SAVE command. @@ -2032,7 +1980,7 @@ L0629: LD (DE),A ; set workspace location to space. ;; REPORT-Fa L0642: RST 08H ; ERROR-1 - DEFB $0E ; Error Report: Invalid file name + DEFB #0E ; Error Report: Invalid file name ; continue with LOAD, MERGE, VERIFY and also SAVE within ten character limit. @@ -2042,7 +1990,7 @@ L0644: LD A,B ; test length of filename JR Z,L0652 ; forward to SA-DATA if so using the 255 ; indicator followed by spaces. - LD BC,$000A ; else trim length to ten. + LD BC,#000A ; else trim length to ten. ; other paths rejoin here with BC holding length in range 1 - 10. @@ -2060,14 +2008,14 @@ L064B: PUSH IX ; push start of file descriptor. ;; SA-DATA L0652: RST 18H ; GET-CHAR - CP $E4 ; is character after filename the token 'DATA' ? + CP #E4 ; is character after filename the token 'DATA' ? JR NZ,L06A0 ; forward to SA-SCR$ to consider SCREEN$ if ; not. ; continue to consider DATA. - LD A,($5C74) ; fetch command from T_ADDR - CP $03 ; is it 'VERIFY' ? + LD A,(#5C74) ; fetch command from T_ADDR + CP #03 ; is it 'VERIFY' ? JP Z,L1C8A ; jump forward to REPORT-C if so. ; 'Nonsense in BASIC' ; VERIFY "d" DATA is not allowed. @@ -2083,8 +2031,8 @@ L0652: RST 18H ; GET-CHAR ; comes later. JR NC,L0672 ; forward to SA-V-OLD if variable found. - LD HL,$0000 ; set destination to zero as not fixed. - LD A,($5C74) ; fetch command from T_ADDR + LD HL,#0000 ; set destination to zero as not fixed. + LD A,(#5C74) ; fetch command from T_ADDR DEC A ; test for 1 - LOAD JR Z,L0685 ; forward to SA-V-NEW with LOAD DATA. ; to load a new array. @@ -2093,7 +2041,7 @@ L0652: RST 18H ; GET-CHAR ;; REPORT-2a L0670: RST 08H ; ERROR-1 - DEFB $01 ; Error Report: Variable not found + DEFB #01 ; Error Report: Variable not found ; continue with SAVE/LOAD DATA @@ -2108,28 +2056,28 @@ L0672: JP NZ,L1C8A ; to REPORT-C if not an array variable. INC HL ; step past single character variable name. LD A,(HL) ; fetch low byte of length. - LD (IX+$0B),A ; place in descriptor. + LD (IX+#0B),A ; place in descriptor. INC HL ; point to high byte. LD A,(HL) ; and transfer that - LD (IX+$0C),A ; to descriptor. + LD (IX+#0C),A ; to descriptor. INC HL ; increase pointer within variable. ;; SA-V-NEW -L0685: LD (IX+$0E),C ; place character array name in header. - LD A,$01 ; default to type numeric. +L0685: LD (IX+#0E),C ; place character array name in header. + LD A,#01 ; default to type numeric. BIT 6,C ; test result from look-vars. JR Z,L068F ; forward to SA-V-TYPE if numeric. INC A ; set type to 2 - string array. ;; SA-V-TYPE -L068F: LD (IX+$00),A ; place type 0, 1 or 2 in descriptor. +L068F: LD (IX+#00),A ; place type 0, 1 or 2 in descriptor. ;; SA-DATA-1 L0692: EX DE,HL ; save var pointer in DE RST 20H ; NEXT-CHAR - CP $29 ; is character ')' ? + CP #29 ; is character ')' ? JR NZ,L0672 ; back if not to SA-V-OLD to report ; 'Nonsense in BASIC' @@ -2144,11 +2092,11 @@ L0692: EX DE,HL ; save var pointer in DE ; the branch was here to consider a 'SCREEN$', the display file. ;; SA-SCR$ -L06A0: CP $AA ; is character the token 'SCREEN$' ? +L06A0: CP #AA ; is character the token 'SCREEN$' ? JR NZ,L06C3 ; forward to SA-CODE if not. - LD A,($5C74) ; fetch command from T_ADDR - CP $03 ; is it MERGE ? + LD A,(#5C74) ; fetch command from T_ADDR + CP #03 ; is it MERGE ? JP Z,L1C8A ; jump to REPORT-C if so. ; 'Nonsense in BASIC' @@ -2160,24 +2108,24 @@ L06A0: CP $AA ; is character the token 'SCREEN$' ? ; continue in runtime. - LD (IX+$0B),$00 ; set descriptor length - LD (IX+$0C),$1B ; to $1b00 to include bitmaps and attributes. + LD (IX+#0B),#00 ; set descriptor length + LD (IX+#0C),#1B ; to #1b00 to include bitmaps and attributes. - LD HL,$4000 ; set start to display file start. - LD (IX+$0D),L ; place start in - LD (IX+$0E),H ; the descriptor. + LD HL,#4000 ; set start to display file start. + LD (IX+#0D),L ; place start in + LD (IX+#0E),H ; the descriptor. JR L0710 ; forward to SA-TYPE-3 ; --- ; the branch was here to consider CODE. ;; SA-CODE -L06C3: CP $AF ; is character the token 'CODE' ? +L06C3: CP #AF ; is character the token 'CODE' ? JR NZ,L0716 ; forward if not to SA-LINE to consider an ; auto-started BASIC program. - LD A,($5C74) ; fetch command from T_ADDR - CP $03 ; is it MERGE ? + LD A,(#5C74) ; fetch command from T_ADDR + CP #03 ; is it MERGE ? JP Z,L1C8A ; jump forward to REPORT-C if so. ; 'Nonsense in BASIC' @@ -2187,7 +2135,7 @@ L06C3: CP $AF ; is character the token 'CODE' ? ; return or ':' follows. JR NZ,L06E1 ; forward to SA-CODE-1 if there are parameters. - LD A,($5C74) ; else fetch the command from T_ADDR. + LD A,(#5C74) ; else fetch the command from T_ADDR. AND A ; test for zero - SAVE without a specification. JP Z,L1C8A ; jump to REPORT-C if so. ; 'Nonsense in BASIC' @@ -2205,12 +2153,12 @@ L06E1: CALL L1C82 ; routine EXPT-1NUM checks for numeric ; expression and stacks it in run-time. RST 18H ; GET-CHAR - CP $2C ; does a comma follow ? + CP #2C ; does a comma follow ? JR Z,L06F5 ; forward if so to SA-CODE-3 ; else allow saved code to be loaded to a specified address. - LD A,($5C74) ; fetch command from T_ADDR. + LD A,(#5C74) ; fetch command from T_ADDR. AND A ; is the command SAVE which requires length ? JP Z,L1C8A ; jump to REPORT-C if so. ; 'Nonsense in BASIC' @@ -2238,16 +2186,16 @@ L06F9: CALL L1BEE ; routine CHECK-END errors with extraneous ; in run-time there are two 16-bit parameters on the calculator stack. CALL L1E99 ; routine FIND-INT2 gets length. - LD (IX+$0B),C ; place length - LD (IX+$0C),B ; in descriptor. + LD (IX+#0B),C ; place length + LD (IX+#0C),B ; in descriptor. CALL L1E99 ; routine FIND-INT2 gets start. - LD (IX+$0D),C ; place start - LD (IX+$0E),B ; in descriptor. + LD (IX+#0D),C ; place start + LD (IX+#0E),B ; in descriptor. LD H,B ; transfer the LD L,C ; start to HL also. ;; SA-TYPE-3 -L0710: LD (IX+$00),$03 ; place type 3 - code in descriptor. +L0710: LD (IX+#00),#03 ; place type 3 - code in descriptor. JR L075A ; forward to SA-ALL. ; --- @@ -2255,7 +2203,7 @@ L0710: LD (IX+$00),$03 ; place type 3 - code in descriptor. ; number. ;; SA-LINE -L0716: CP $CA ; is character the token 'LINE' ? +L0716: CP #CA ; is character the token 'LINE' ? JR Z,L0723 ; forward to SA-LINE-1 if so. ; else all possibilities have been considered and nothing must follow. @@ -2264,7 +2212,7 @@ L0716: CP $CA ; is character the token 'LINE' ? ; continue in run-time to save BASIC without auto-start. - LD (IX+$0E),$80 ; place high line number in descriptor to + LD (IX+#0E),#80 ; place high line number in descriptor to ; disable auto-start. JR L073A ; forward to SA-TYPE-0 to save program. @@ -2272,7 +2220,7 @@ L0716: CP $CA ; is character the token 'LINE' ? ; the branch was here to consider auto-start. ;; SA-LINE-1 -L0723: LD A,($5C74) ; fetch command from T_ADDR +L0723: LD A,(#5C74) ; fetch command from T_ADDR AND A ; test for SAVE. JP NZ,L1C8A ; jump forward to REPORT-C with anything else. ; 'Nonsense in BASIC' @@ -2285,8 +2233,8 @@ L0723: LD A,($5C74) ; fetch command from T_ADDR CALL L1BEE ; routine CHECK-END quits if syntax path. CALL L1E99 ; routine FIND-INT2 fetches the numeric ; expression. - LD (IX+$0D),C ; place the auto-start - LD (IX+$0E),B ; line number in the descriptor. + LD (IX+#0D),C ; place the auto-start + LD (IX+#0E),B ; line number in the descriptor. ; Note. this isn't checked, but is subsequently handled by the system. ; If the user typed 40000 instead of 4000 then it won't auto-start @@ -2295,23 +2243,23 @@ L0723: LD A,($5C74) ; fetch command from T_ADDR ; continue to save program and any variables. ;; SA-TYPE-0 -L073A: LD (IX+$00),$00 ; place type zero - program in descriptor. - LD HL,($5C59) ; fetch E_LINE to HL. - LD DE,($5C53) ; fetch PROG to DE. +L073A: LD (IX+#00),#00 ; place type zero - program in descriptor. + LD HL,(#5C59) ; fetch E_LINE to HL. + LD DE,(#5C53) ; fetch PROG to DE. SCF ; set carry flag to calculate from end of ; variables E_LINE -1. SBC HL,DE ; subtract to give total length. - LD (IX+$0B),L ; place total length - LD (IX+$0C),H ; in descriptor. - LD HL,($5C4B) ; load HL from system variable VARS + LD (IX+#0B),L ; place total length + LD (IX+#0C),H ; in descriptor. + LD HL,(#5C4B) ; load HL from system variable VARS SBC HL,DE ; subtract to give program length. - LD (IX+$0F),L ; place length of program - LD (IX+$10),H ; in the descriptor. + LD (IX+#0F),L ; place length of program + LD (IX+#10),H ; in the descriptor. EX DE,HL ; start to HL, length to DE. ;; SA-ALL -L075A: LD A,($5C74) ; fetch command from T_ADDR +L075A: LD A,(#5C74) ; fetch command from T_ADDR AND A ; test for zero - SAVE. JP Z,L0970 ; jump forward to SA-CONTRL with SAVE -> @@ -2319,12 +2267,12 @@ L075A: LD A,($5C74) ; fetch command from T_ADDR ; continue with LOAD, MERGE and VERIFY. PUSH HL ; save start. - LD BC,$0011 ; prepare to add seventeen + LD BC,#0011 ; prepare to add seventeen ADD IX,BC ; to point IX at second descriptor. ;; LD-LOOK-H L0767: PUSH IX ; save IX - LD DE,$0011 ; seventeen bytes + LD DE,#0011 ; seventeen bytes XOR A ; reset zero flag SCF ; set carry flag CALL L0556 ; routine LD-BYTES loads a header from tape @@ -2332,23 +2280,23 @@ L0767: PUSH IX ; save IX POP IX ; restore IX. JR NC,L0767 ; loop back to LD-LOOK-H until header found. - LD A,$FE ; select system channel 'S' + LD A,#FE ; select system channel 'S' CALL L1601 ; routine CHAN-OPEN opens it. - LD (IY+$52),$03 ; set SCR_CT to 3 lines. + LD (IY+#52),#03 ; set SCR_CT to 3 lines. - LD C,$80 ; C has bit 7 set to indicate type mismatch as + LD C,#80 ; C has bit 7 set to indicate type mismatch as ; a default startpoint. - LD A,(IX+$00) ; fetch loaded header type to A - CP (IX-$11) ; compare with expected type. + LD A,(IX+#00) ; fetch loaded header type to A + CP (IX-#11) ; compare with expected type. JR NZ,L078A ; forward to LD-TYPE with mis-match. - LD C,$F6 ; set C to minus ten - will count characters + LD C,#F6 ; set C to minus ten - will count characters ; up to zero. ;; LD-TYPE -L078A: CP $04 ; check if type in acceptable range 0 - 3. +L078A: CP #04 ; check if type in acceptable range 0 - 3. JR NC,L0767 ; back to LD-LOOK-H with 4 and over. ; else A indicates type 0-3. @@ -2361,9 +2309,9 @@ L078A: CP $04 ; check if type in acceptable range 0 - 3. PUSH IX ; transfer IX, POP DE ; the 2nd descriptor, to DE. - LD HL,$FFF0 ; prepare minus seventeen. + LD HL,#FFF0 ; prepare minus seventeen. ADD HL,DE ; add to point HL to 1st descriptor. - LD B,$0A ; the count will be ten characters for the + LD B,#0A ; the count will be ten characters for the ; filename. LD A,(HL) ; fetch first character and test for @@ -2374,8 +2322,8 @@ L078A: CP $04 ; check if type in acceptable range 0 - 3. ; match or -128 for a type mismatch. Although characters have to be counted ; bit 7 of C will not alter from state set here. - LD A,C ; transfer $F6 or $80 to A - ADD A,B ; add $0A + LD A,C ; transfer #F6 or #80 to A + ADD A,B ; add #0A LD C,A ; place result, zero or -118, in C. ; At this point we have either a type mismatch, a wildcard match or ten @@ -2402,25 +2350,25 @@ L07AD: RST 10H ; PRINT-A prints character ; else print a terminal carriage return. - LD A,$0D ; prepare carriage return. + LD A,#0D ; prepare carriage return. RST 10H ; PRINT-A outputs it. ; The various control routines for LOAD, VERIFY and MERGE are executed ; during the one-second gap following the header on tape. POP HL ; restore xx - LD A,(IX+$00) ; fetch incoming type - CP $03 ; compare with CODE + LD A,(IX+#00) ; fetch incoming type + CP #03 ; compare with CODE JR Z,L07CB ; forward to VR-CONTROL if it is CODE. ; type is a program or an array. - LD A,($5C74) ; fetch command from T_ADDR + LD A,(#5C74) ; fetch command from T_ADDR DEC A ; was it LOAD ? JP Z,L0808 ; JUMP forward to LD-CONTRL if so to ; load BASIC or variables. - CP $02 ; was command MERGE ? + CP #02 ; was command MERGE ? JP Z,L08B6 ; jump forward to ME-CONTRL if so. ; else continue into VERIFY control routine to verify. @@ -2434,10 +2382,10 @@ L07AD: RST 10H ; PRINT-A prints character ;; VR-CONTROL L07CB: PUSH HL ; save pointer to data. - LD L,(IX-$06) ; fetch length of old data - LD H,(IX-$05) ; to HL. - LD E,(IX+$0B) ; fetch length of new data - LD D,(IX+$0C) ; to DE. + LD L,(IX-#06) ; fetch length of old data + LD H,(IX-#05) ; to HL. + LD E,(IX+#0B) ; fetch length of new data + LD D,(IX+#0C) ; to DE. LD A,H ; check length of old OR L ; for zero. JR Z,L07E9 ; forward to VR-CONT-1 if length unspecified @@ -2454,8 +2402,8 @@ L07CB: PUSH HL ; save pointer to data. ; a length on tape shorter than expected is not allowed for CODE - LD A,(IX+$00) ; else fetch type from tape. - CP $03 ; is it CODE ? + LD A,(IX+#00) ; else fetch type from tape. + CP #03 ; is it CODE ? JR NZ,L0806 ; forward to REPORT-R if so ; 'Tape loading error' @@ -2465,14 +2413,14 @@ L07E9: POP HL ; pop pointer to data OR L ; e.g. LOAD 'x' CODE JR NZ,L07F4 ; forward to VR-CONT-2 if destination specified. - LD L,(IX+$0D) ; else use the destination in the header - LD H,(IX+$0E) ; and load code at address saved from. + LD L,(IX+#0D) ; else use the destination in the header + LD H,(IX+#0E) ; and load code at address saved from. ;; VR-CONT-2 L07F4: PUSH HL ; push pointer to start of data block. POP IX ; transfer to IX. - LD A,($5C74) ; fetch reduced command from T_ADDR - CP $02 ; is it VERIFY ? + LD A,(#5C74) ; fetch reduced command from T_ADDR + CP #02 ; is it VERIFY ? SCF ; prepare a set carry flag JR NZ,L0800 ; skip to VR-CONT-3 if not @@ -2480,13 +2428,13 @@ L07F4: PUSH HL ; push pointer to start of data block. ; data is not loaded. ;; VR-CONT-3 -L0800: LD A,$FF ; signal data block to be loaded +L0800: LD A,#FF ; signal data block to be loaded ; ----------------- ; Load a data block ; ----------------- ; This routine is called from 3 places other than above to load a data block. -; In all cases the accumulator is first set to $FF so the routine could be +; In all cases the accumulator is first set to #FF so the routine could be ; called at the previous instruction. ;; LD-BLOCK @@ -2496,7 +2444,7 @@ L0802: CALL L0556 ; routine LD-BYTES ;; REPORT-R L0806: RST 08H ; ERROR-1 - DEFB $1A ; Error Report: Tape loading error + DEFB #1A ; Error Report: Tape loading error ; ------------------- ; Handle LOAD control @@ -2504,8 +2452,8 @@ L0806: RST 08H ; ERROR-1 ; This branch is taken when the command is LOAD with type 0, 1 or 2. ;; LD-CONTRL -L0808: LD E,(IX+$0B) ; fetch length of found data block - LD D,(IX+$0C) ; from 2nd descriptor. +L0808: LD E,(IX+#0B) ; fetch length of found data block + LD D,(IX+#0C) ; from 2nd descriptor. PUSH HL ; save destination LD A,H ; test for zero OR L ; @@ -2520,15 +2468,15 @@ L0808: LD E,(IX+$0B) ; fetch length of found data block ; --- ;; LD-CONT-1 -L0819: LD L,(IX-$06) ; fetch length from - LD H,(IX-$05) ; the first header. +L0819: LD L,(IX-#06) ; fetch length from + LD H,(IX-#05) ; the first header. EX DE,HL ; SCF ; set carry flag SBC HL,DE ; JR C,L082E ; to LD-DATA ;; LD-CONT-2 -L0825: LD DE,$0005 ; allow overhead of five bytes. +L0825: LD DE,#0005 ; allow overhead of five bytes. ADD HL,DE ; add in the difference in data lengths. LD B,H ; transfer to LD C,L ; the BC register pair @@ -2536,7 +2484,7 @@ L0825: LD DE,$0005 ; allow overhead of five bytes. ;; LD-DATA L082E: POP HL ; pop destination - LD A,(IX+$00) ; fetch type 0, 1 or 2. + LD A,(IX+#00) ; fetch type 0, 1 or 2. AND A ; test for program and variables. JR Z,L0873 ; forward if so to LD-PROG @@ -2556,23 +2504,23 @@ L082E: POP HL ; pop destination INC BC ; adjust length to INC BC ; include these INC BC ; three bytes also. - LD ($5C5F),IX ; save header pointer in X_PTR. + LD (#5C5F),IX ; save header pointer in X_PTR. CALL L19E8 ; routine RECLAIM-2 reclaims the old variable ; sliding workspace including the two headers ; downwards. - LD IX,($5C5F) ; reload IX from X_PTR which will have been + LD IX,(#5C5F) ; reload IX from X_PTR which will have been ; adjusted down by POINTERS routine. ;; LD-DATA-1 -L084C: LD HL,($5C59) ; address E_LINE - DEC HL ; now point to the $80 variables end-marker. - LD C,(IX+$0B) ; fetch new data length - LD B,(IX+$0C) ; from 2nd header. +L084C: LD HL,(#5C59) ; address E_LINE + DEC HL ; now point to the #80 variables end-marker. + LD C,(IX+#0B) ; fetch new data length + LD B,(IX+#0C) ; from 2nd header. PUSH BC ; * save it. INC BC ; adjust the INC BC ; length to include INC BC ; letter name and total length. - LD A,(IX-$03) ; fetch letter name from old header. + LD A,(IX-#03) ; fetch letter name from old header. PUSH AF ; preserve accumulator though not corrupted. CALL L1655 ; routine MAKE-ROOM creates space for variable @@ -2591,7 +2539,7 @@ L084C: LD HL,($5C59) ; address E_LINE PUSH HL ; transfer address POP IX ; to IX register pair. SCF ; set carry flag indicating load not verify. - LD A,$FF ; signal data not header. + LD A,#FF ; signal data not header. JP L0802 ; JUMP back to LD-BLOCK ; ----------------- @@ -2599,11 +2547,11 @@ L084C: LD HL,($5C59) ; address E_LINE ;; LD-PROG L0873: EX DE,HL ; transfer dest to DE. - LD HL,($5C59) ; address E_LINE + LD HL,(#5C59) ; address E_LINE DEC HL ; now variables end-marker. - LD ($5C5F),IX ; place the IX header pointer in X_PTR - LD C,(IX+$0B) ; get new length - LD B,(IX+$0C) ; from 2nd header + LD (#5C5F),IX ; place the IX header pointer in X_PTR + LD C,(IX+#0B) ; get new length + LD B,(IX+#0C) ; from 2nd header PUSH BC ; and save it. CALL L19E5 ; routine RECLAIM-1 reclaims program and vars. @@ -2615,27 +2563,27 @@ L0873: EX DE,HL ; transfer dest to DE. CALL L1655 ; routine MAKE-ROOM creates the space. - LD IX,($5C5F) ; reload IX from adjusted X_PTR + LD IX,(#5C5F) ; reload IX from adjusted X_PTR INC HL ; point to start of new area. - LD C,(IX+$0F) ; fetch length of BASIC on tape - LD B,(IX+$10) ; from 2nd descriptor + LD C,(IX+#0F) ; fetch length of BASIC on tape + LD B,(IX+#10) ; from 2nd descriptor ADD HL,BC ; add to address the start of variables. - LD ($5C4B),HL ; set system variable VARS + LD (#5C4B),HL ; set system variable VARS - LD H,(IX+$0E) ; fetch high byte of autostart line number. + LD H,(IX+#0E) ; fetch high byte of autostart line number. LD A,H ; transfer to A - AND $C0 ; test if greater than $3F. + AND #C0 ; test if greater than #3F. JR NZ,L08AD ; forward to LD-PROG-1 if so with no autostart. - LD L,(IX+$0D) ; else fetch the low byte. - LD ($5C42),HL ; set sytem variable to line number NEWPPC - LD (IY+$0A),$00 ; set statement NSPPC to zero. + LD L,(IX+#0D) ; else fetch the low byte. + LD (#5C42),HL ; set sytem variable to line number NEWPPC + LD (IY+#0A),#00 ; set statement NSPPC to zero. ;; LD-PROG-1 L08AD: POP DE ; ** pop the length POP IX ; * and start. SCF ; set carry flag - LD A,$FF ; signal data as opposed to a header. + LD A,#FF ; signal data as opposed to a header. JP L0802 ; jump back to LD-BLOCK ; -------------------- @@ -2645,14 +2593,14 @@ L08AD: POP DE ; ** pop the length ; ;; ME-CONTRL -L08B6: LD C,(IX+$0B) ; fetch length - LD B,(IX+$0C) ; of data block on tape. +L08B6: LD C,(IX+#0B) ; fetch length + LD B,(IX+#0C) ; of data block on tape. PUSH BC ; save it. INC BC ; one for the pot. RST 30H ; BC-SPACES creates room in workspace. ; HL addresses last new location. - LD (HL),$80 ; place end-marker at end. + LD (HL),#80 ; place end-marker at end. EX DE,HL ; transfer first location to HL. POP DE ; restore length to DE. PUSH HL ; save start. @@ -2660,17 +2608,17 @@ L08B6: LD C,(IX+$0B) ; fetch length PUSH HL ; and transfer it POP IX ; to IX register. SCF ; set carry flag to load data on tape. - LD A,$FF ; signal data not a header. + LD A,#FF ; signal data not a header. CALL L0802 ; routine LD-BLOCK loads to workspace. POP HL ; restore first location in workspace to HL. -X08CE LD DE,($5C53) ; set DE from system variable PROG. +X08CE LD DE,(#5C53) ; set DE from system variable PROG. ; now enter a loop to merge the data block in workspace with the program and ; variables. ;; ME-NEW-LP L08D2: LD A,(HL) ; fetch next byte from workspace. - AND $C0 ; compare with $3F. + AND #C0 ; compare with #3F. JR NZ,L08F0 ; forward to ME-VAR-LP if a variable or ; end-marker. @@ -2713,15 +2661,15 @@ L08EB: CALL L092C ; routine ME-ENTER enters the line ;; ME-VAR-LP L08F0: LD A,(HL) ; fetch first byte of workspace variable. LD C,A ; copy to C also. - CP $80 ; is it the end-marker ? + CP #80 ; is it the end-marker ? RET Z ; return if so as complete. >>>>> PUSH HL ; save workspace area pointer. - LD HL,($5C4B) ; load HL with VARS - start of variables area. + LD HL,(#5C4B) ; load HL with VARS - start of variables area. ;; ME-OLD-VP L08F9: LD A,(HL) ; fetch first byte. - CP $80 ; is it the end-marker ? + CP #80 ; is it the end-marker ? JR Z,L0923 ; forward if so to ME-VAR-L2 to add ; variable at end of variables area. @@ -2742,8 +2690,8 @@ L0901: PUSH BC ; save character in C. ; the branch was here when first characters of name matched. ;; ME-OLD-V2 -L0909: AND $E0 ; keep bits 11100000 - CP $A0 ; compare 10100000 - a long-named variable. +L0909: AND #E0 ; keep bits 11100000 + CP #A0 ; compare 10100000 - a long-named variable. JR NZ,L0921 ; forward to ME-VAR-L1 if just one-character. @@ -2779,9 +2727,9 @@ L091E: POP HL ; restore the prog/vars pointer. ; branch here when variable is to replace an existing one ;; ME-VAR-L1 -L0921: LD A,$FF ; indicate a replacement. +L0921: LD A,#FF ; indicate a replacement. -; this entry point is when A holds $80 indicating a new variable. +; this entry point is when A holds #80 indicating a new variable. ;; ME-VAR-L2 L0923: POP DE ; pop workspace pointer. @@ -2804,13 +2752,13 @@ L092C: JR NZ,L093E ; forward to ME-ENT-1 for insertion only. ; but the program line or variable matches so old one is reclaimed. EX AF,AF' ; save flag?? - LD ($5C5F),HL ; preserve workspace pointer in dynamic X_PTR + LD (#5C5F),HL ; preserve workspace pointer in dynamic X_PTR EX DE,HL ; transfer program dest pointer to HL. CALL L19B8 ; routine NEXT-ONE finds following location ; in program or variables area. CALL L19E8 ; routine RECLAIM-2 reclaims the space between. EX DE,HL ; transfer program dest pointer back to DE. - LD HL,($5C5F) ; fetch adjusted workspace pointer from X_PTR + LD HL,(#5C5F) ; fetch adjusted workspace pointer from X_PTR EX AF,AF' ; restore flags. ; now the new line or variable is entered. @@ -2821,8 +2769,8 @@ L093E: EX AF,AF' ; save or re-save flags. CALL L19B8 ; routine NEXT-ONE finds next in workspace. ; gets next in DE, difference in BC. ; prev addr in HL - LD ($5C5F),HL ; store pointer in X_PTR - LD HL,($5C53) ; load HL from system variable PROG + LD (#5C5F),HL ; store pointer in X_PTR + LD HL,(#5C53) ; load HL from system variable PROG EX (SP),HL ; swap with prog/vars pointer on stack. PUSH BC ; ** save length of new program line/variable. EX AF,AF' ; fetch flags back. @@ -2844,8 +2792,8 @@ L0958: INC HL ; address next? POP BC ; ** pop length POP DE ; * pop value for PROG which may have been ; altered by POINTERS if first line. - LD ($5C53),DE ; set PROG to original value. - LD DE,($5C5F) ; fetch adjusted workspace pointer from X_PTR + LD (#5C53),DE ; set PROG to original value. + LD DE,(#5C5F) ; fetch adjusted workspace pointer from X_PTR PUSH BC ; save length PUSH DE ; and workspace pointer EX DE,HL ; make workspace pointer source, prog/vars @@ -2873,7 +2821,7 @@ L0958: INC HL ; address next? ;; SA-CONTRL L0970: PUSH HL ; save start of data - LD A,$FD ; select system channel 'S' + LD A,#FD ; select system channel 'S' CALL L1601 ; routine CHAN-OPEN XOR A ; clear to address table directly @@ -2881,27 +2829,27 @@ L0970: PUSH HL ; save start of data CALL L0C0A ; routine PO-MSG - ; 'Start tape then press any key.' - SET 5,(IY+$02) ; TV_FLAG - Signal lower screen requires + SET 5,(IY+#02) ; TV_FLAG - Signal lower screen requires ; clearing CALL L15D4 ; routine WAIT-KEY PUSH IX ; save pointer to descriptor. - LD DE,$0011 ; there are seventeen bytes. + LD DE,#0011 ; there are seventeen bytes. XOR A ; signal a header. CALL L04C2 ; routine SA-BYTES POP IX ; restore descriptor pointer. - LD B,$32 ; wait for a second - 50 interrupts. + LD B,#32 ; wait for a second - 50 interrupts. ;; SA-1-SEC L0991: HALT ; wait for interrupt DJNZ L0991 ; back to SA-1-SEC until pause complete. - LD E,(IX+$0B) ; fetch length of bytes from the - LD D,(IX+$0C) ; descriptor. + LD E,(IX+#0B) ; fetch length of bytes from the + LD D,(IX+#0C) ; descriptor. - LD A,$FF ; signal data bytes. + LD A,#FF ; signal data bytes. POP IX ; retrieve pointer to start JP L04C2 ; jump back to SA-BYTES @@ -2914,23 +2862,23 @@ L0991: HALT ; wait for interrupt ; OLD NEW PROG DATA DATA CODE ; HEADER HEADER num chr NOTES. ; ------ ------ ---- ---- ---- ---- ----------------------------- -; IX-$11 IX+$00 0 1 2 3 Type. -; IX-$10 IX+$01 x x x x F ($FF if filename is null). -; IX-$0F IX+$02 x x x x i -; IX-$0E IX+$03 x x x x l -; IX-$0D IX+$04 x x x x e -; IX-$0C IX+$05 x x x x n -; IX-$0B IX+$06 x x x x a -; IX-$0A IX+$07 x x x x m -; IX-$09 IX+$08 x x x x e -; IX-$08 IX+$09 x x x x . -; IX-$07 IX+$0A x x x x (terminal spaces). -; IX-$06 IX+$0B lo lo lo lo Total -; IX-$05 IX+$0C hi hi hi hi Length of datablock. -; IX-$04 IX+$0D Auto - - Start Various -; IX-$03 IX+$0E Start a-z a-z addr ($80 if no autostart). -; IX-$02 IX+$0F lo - - - Length of Program -; IX-$01 IX+$10 hi - - - only i.e. without variables. +; IX-#11 IX+#00 0 1 2 3 Type. +; IX-#10 IX+#01 x x x x F (#FF if filename is null). +; IX-#0F IX+#02 x x x x i +; IX-#0E IX+#03 x x x x l +; IX-#0D IX+#04 x x x x e +; IX-#0C IX+#05 x x x x n +; IX-#0B IX+#06 x x x x a +; IX-#0A IX+#07 x x x x m +; IX-#09 IX+#08 x x x x e +; IX-#08 IX+#09 x x x x . +; IX-#07 IX+#0A x x x x (terminal spaces). +; IX-#06 IX+#0B lo lo lo lo Total +; IX-#05 IX+#0C hi hi hi hi Length of datablock. +; IX-#04 IX+#0D Auto - - Start Various +; IX-#03 IX+#0E Start a-z a-z addr (#80 if no autostart). +; IX-#02 IX+#0F lo - - - Length of Program +; IX-#01 IX+#10 hi - - - only i.e. without variables. ; @@ -2941,21 +2889,21 @@ L0991: HALT ; wait for interrupt ; Starts with normal initial step-over byte. ;; tape-msgs -L09A1: DEFB $80 +L09A1: DEFB #80 DEFM "Start tape, then press any key" -L09C0: DEFB '.'+$80 - DEFB $0D +L09C0: DEFB '.'+#80 + DEFB #0D DEFM "Program:" - DEFB ' '+$80 - DEFB $0D + DEFB ' '+#80 + DEFB #0D DEFM "Number array:" - DEFB ' '+$80 - DEFB $0D + DEFB ' '+#80 + DEFB #0D DEFM "Character array:" - DEFB ' '+$80 - DEFB $0D + DEFB ' '+#80 + DEFB #0D DEFM "Bytes:" - DEFB ' '+$80 + DEFB ' '+#80 ;************************************************** @@ -2972,19 +2920,19 @@ L09C0: DEFB '.'+$80 ;; PRINT-OUT L09F4: CALL L0B03 ; routine PO-FETCH fetches print position ; to HL register pair. - CP $20 ; is character a space or higher ? + CP #20 ; is character a space or higher ? JP NC,L0AD9 ; jump forward to PO-ABLE if so. - CP $06 ; is character in range 00-05 ? + CP #06 ; is character in range 00-05 ? JR C,L0A69 ; to PO-QUEST to print '?' if so. - CP $18 ; is character in range 24d - 31d ? + CP #18 ; is character in range 24d - 31d ? JR NC,L0A69 ; to PO-QUEST to also print '?' if so. LD HL,L0A11 - 6 ; address 0A0B - the base address of control ; character table - where zero would be. LD E,A ; control character 06 - 23d - LD D,$00 ; is transferred to DE. + LD D,#00 ; is transferred to DE. ADD HL,DE ; index into table. @@ -3003,24 +2951,24 @@ L09F4: CALL L0B03 ; routine PO-FETCH fetches print position ; follows the table. ;; ctlchrtab -L0A11: DEFB L0A5F - $ ; 06d offset $4E to Address: PO-COMMA - DEFB L0A69 - $ ; 07d offset $57 to Address: PO-QUEST - DEFB L0A23 - $ ; 08d offset $10 to Address: PO-BACK-1 - DEFB L0A3D - $ ; 09d offset $29 to Address: PO-RIGHT - DEFB L0A69 - $ ; 10d offset $54 to Address: PO-QUEST - DEFB L0A69 - $ ; 11d offset $53 to Address: PO-QUEST - DEFB L0A69 - $ ; 12d offset $52 to Address: PO-QUEST - DEFB L0A4F - $ ; 13d offset $37 to Address: PO-ENTER - DEFB L0A69 - $ ; 14d offset $50 to Address: PO-QUEST - DEFB L0A69 - $ ; 15d offset $4F to Address: PO-QUEST - DEFB L0A7A - $ ; 16d offset $5F to Address: PO-1-OPER - DEFB L0A7A - $ ; 17d offset $5E to Address: PO-1-OPER - DEFB L0A7A - $ ; 18d offset $5D to Address: PO-1-OPER - DEFB L0A7A - $ ; 19d offset $5C to Address: PO-1-OPER - DEFB L0A7A - $ ; 20d offset $5B to Address: PO-1-OPER - DEFB L0A7A - $ ; 21d offset $5A to Address: PO-1-OPER - DEFB L0A75 - $ ; 22d offset $54 to Address: PO-2-OPER - DEFB L0A75 - $ ; 23d offset $53 to Address: PO-2-OPER +L0A11: DEFB L0A5F - $ ; 06d offset #4E to Address: PO-COMMA + DEFB L0A69 - $ ; 07d offset #57 to Address: PO-QUEST + DEFB L0A23 - $ ; 08d offset #10 to Address: PO-BACK-1 + DEFB L0A3D - $ ; 09d offset #29 to Address: PO-RIGHT + DEFB L0A69 - $ ; 10d offset #54 to Address: PO-QUEST + DEFB L0A69 - $ ; 11d offset #53 to Address: PO-QUEST + DEFB L0A69 - $ ; 12d offset #52 to Address: PO-QUEST + DEFB L0A4F - $ ; 13d offset #37 to Address: PO-ENTER + DEFB L0A69 - $ ; 14d offset #50 to Address: PO-QUEST + DEFB L0A69 - $ ; 15d offset #4F to Address: PO-QUEST + DEFB L0A7A - $ ; 16d offset #5F to Address: PO-1-OPER + DEFB L0A7A - $ ; 17d offset #5E to Address: PO-1-OPER + DEFB L0A7A - $ ; 18d offset #5D to Address: PO-1-OPER + DEFB L0A7A - $ ; 19d offset #5C to Address: PO-1-OPER + DEFB L0A7A - $ ; 20d offset #5B to Address: PO-1-OPER + DEFB L0A7A - $ ; 21d offset #5A to Address: PO-1-OPER + DEFB L0A75 - $ ; 22d offset #54 to Address: PO-2-OPER + DEFB L0A75 - $ ; 23d offset #53 to Address: PO-2-OPER ; ------------------- @@ -3031,27 +2979,27 @@ L0A11: DEFB L0A5F - $ ; 06d offset $4E to Address: PO-COMMA ;; PO-BACK-1 L0A23: INC C ; move left one column. - LD A,$22 ; value $21 is leftmost column. + LD A,#22 ; value #21 is leftmost column. CP C ; have we passed ? JR NZ,L0A3A ; to PO-BACK-3 if not and store new position. - BIT 1,(IY+$01) ; test FLAGS - is printer in use ? + BIT 1,(IY+#01) ; test FLAGS - is printer in use ? JR NZ,L0A38 ; to PO-BACK-2 if so, as we are unable to ; backspace from the leftmost position. INC B ; move up one screen line - LD C,$02 ; the rightmost column position. - LD A,$18 ; Note. This should be $19 + LD C,#02 ; the rightmost column position. + LD A,#18 ; Note. This should be #19 ; credit. Dr. Frank O'Hara, 1982 CP B ; has position moved past top of screen ? JR NZ,L0A3A ; to PO-BACK-3 if not and store new position. - DEC B ; else back to $18. + DEC B ; else back to #18. ;; PO-BACK-2 -L0A38: LD C,$21 ; the leftmost column position. +L0A38: LD C,#21 ; the leftmost column position. ;; PO-BACK-3 L0A3A: JP L0DD9 ; to CL-SET and PO-STORE to save new @@ -3070,17 +3018,17 @@ L0A3A: JP L0DD9 ; to CL-SET and PO-STORE to save new ; - Dr. Ian Logan, Understanding Your Spectrum, 1982. ;; PO-RIGHT -L0A3D: LD A,($5C91) ; fetch P_FLAG value +L0A3D: LD A,(#5C91) ; fetch P_FLAG value PUSH AF ; and save it on stack. - LD (IY+$57),$01 ; temporarily set P_FLAG 'OVER 1'. - LD A,$20 ; prepare a space. + LD (IY+#57),#01 ; temporarily set P_FLAG 'OVER 1'. + LD A,#20 ; prepare a space. CALL L0B65 ; routine PO-CHAR to print it. ; Note. could be PO-ABLE which would update ; the column position. POP AF ; restore the permanent flag. - LD ($5C91),A ; and restore system variable P_FLAG + LD (#5C91),A ; and restore system variable P_FLAG RET ; return without updating column position @@ -3090,11 +3038,11 @@ L0A3D: LD A,($5C91) ; fetch P_FLAG value ; A carriage return is 'printed' to screen or printer buffer. ;; PO-ENTER -L0A4F: BIT 1,(IY+$01) ; test FLAGS - is printer in use ? +L0A4F: BIT 1,(IY+#01) ; test FLAGS - is printer in use ? JP NZ,L0ECD ; to COPY-BUFF if so, to flush buffer and reset ; the print position. - LD C,$21 ; the leftmost column position. + LD C,#21 ; the leftmost column position. CALL L0C55 ; routine PO-SCR handles any scrolling required. DEC B ; to next screen line. JP L0DD9 ; jump forward to CL-SET to store new position. @@ -3108,10 +3056,10 @@ L0A4F: BIT 1,(IY+$01) ; test FLAGS - is printer in use ? ;; PO-COMMA L0A5F: CALL L0B03 ; routine PO-FETCH - seems unnecessary. - LD A,C ; the column position. $21-$01 - DEC A ; move right. $20-$00 - DEC A ; and again $1F-$00 or $FF if trailing - AND $10 ; will be $00 or $10. + LD A,C ; the column position. #21-#01 + DEC A ; move right. #20-#00 + DEC A ; and again #1F-#00 or #FF if trailing + AND #10 ; will be #00 or #10. JR L0AC3 ; forward to PO-FILL ; ------------------- @@ -3122,7 +3070,7 @@ L0A5F: CALL L0B03 ; routine PO-FETCH - seems unnecessary. ; there are a surprising number yet to be assigned. ;; PO-QUEST -L0A69: LD A,$3F ; prepare the character '?'. +L0A69: LD A,#3F ; prepare the character '?'. JR L0AD9 ; forward to PO-ABLE. ; -------------------------------- @@ -3131,12 +3079,12 @@ L0A69: LD A,$3F ; prepare the character '?'. ; Certain control characters are followed by 1 or 2 operands. ; The entry points from control character table are PO-2-OPER and PO-1-OPER. ; The routines alter the output address of the current channel so that -; subsequent RST $10 instructions take the appropriate action +; subsequent RST #10 instructions take the appropriate action ; before finally resetting the output address back to PRINT-OUT. ;; PO-TV-2 L0A6D: LD DE,L0A87 ; address: PO-CONT will be next output routine - LD ($5C0F),A ; store first operand in TVDATA-hi + LD (#5C0F),A ; store first operand in TVDATA-hi JR L0A80 ; forward to PO-CHANGE >> ; --- @@ -3155,10 +3103,10 @@ L0A75: LD DE,L0A6D ; address: PO-TV-2 will be next output routine L0A7A: LD DE,L0A87 ; address: PO-CONT will be next output routine ;; PO-TV-1 -L0A7D: LD ($5C0E),A ; store control code in TVDATA-lo +L0A7D: LD (#5C0E),A ; store control code in TVDATA-lo ;; PO-CHANGE -L0A80: LD HL,($5C51) ; use CURCHL to find current output channel. +L0A80: LD HL,(#5C51) ; use CURCHL to find current output channel. LD (HL),E ; make it INC HL ; the supplied LD (HL),D ; address from DE. @@ -3169,11 +3117,11 @@ L0A80: LD HL,($5C51) ; use CURCHL to find current output channel. ;; PO-CONT L0A87: LD DE,L09F4 ; Address: PRINT-OUT CALL L0A80 ; routine PO-CHANGE to restore normal channel. - LD HL,($5C0E) ; TVDATA gives control code and possible + LD HL,(#5C0E) ; TVDATA gives control code and possible ; subsequent character LD D,A ; save current character LD A,L ; the stored control code - CP $16 ; was it INK to OVER (1 operand) ? + CP #16 ; was it INK to OVER (1 operand) ? JP C,L2211 ; to CO-TEMP-5 JR NZ,L0AC2 ; to PO-TAB if not 22d i.e. 23d TAB. @@ -3181,17 +3129,17 @@ L0A87: LD DE,L09F4 ; Address: PRINT-OUT ; else must have been 22d AT. LD B,H ; line to H (0-23d) LD C,D ; column to C (0-31d) - LD A,$1F ; the value 31d + LD A,#1F ; the value 31d SUB C ; reverse the column number. JR C,L0AAC ; to PO-AT-ERR if C was greater than 31d. - ADD A,$02 ; transform to system range $02-$21 + ADD A,#02 ; transform to system range #02-#21 LD C,A ; and place in column register. - BIT 1,(IY+$01) ; test FLAGS - is printer in use ? + BIT 1,(IY+#01) ; test FLAGS - is printer in use ? JR NZ,L0ABF ; to PO-AT-SET as line can be ignored. - LD A,$16 ; 22 decimal + LD A,#16 ; 22 decimal SUB B ; subtract line number to reverse ; 0 - 22 becomes 22 - 0. @@ -3199,13 +3147,13 @@ L0A87: LD DE,L09F4 ; Address: PRINT-OUT L0AAC: JP C,L1E9F ; to REPORT-B if higher than 22 decimal ; Integer out of range. - INC A ; adjust for system range $01-$17 + INC A ; adjust for system range #01-#17 LD B,A ; place in line register - INC B ; adjust to system range $02-$18 - BIT 0,(IY+$02) ; TV_FLAG - Lower screen in use ? + INC B ; adjust to system range #02-#18 + BIT 0,(IY+#02) ; TV_FLAG - Lower screen in use ? JP NZ,L0C55 ; exit to PO-SCR to test for scrolling - CP (IY+$31) ; Compare against DF_SZ + CP (IY+#31) ; Compare against DF_SZ JP C,L0C86 ; to REPORT-5 if too low ; Out of screen. @@ -3224,17 +3172,17 @@ L0AC2: LD A,H ; transfer parameter to A ;; PO-FILL L0AC3: CALL L0B03 ; routine PO-FETCH, HL-addr, BC=line/column. - ; column 1 (right), $21 (left) + ; column 1 (right), #21 (left) ADD A,C ; add operand to current column DEC A ; range 0 - 31+ - AND $1F ; make range 0 - 31d + AND #1F ; make range 0 - 31d RET Z ; return if result zero LD D,A ; Counter to D - SET 0,(IY+$01) ; update FLAGS - signal suppress leading space. + SET 0,(IY+#01) ; update FLAGS - signal suppress leading space. ;; PO-SPACE -L0AD0: LD A,$20 ; space character. +L0AD0: LD A,#20 ; space character. CALL L0C3B ; routine PO-SAVE prints the character ; using alternate set (normal output routine) DEC D ; decrement counter. @@ -3259,29 +3207,29 @@ L0AD9: CALL L0B24 ; routine PO-ANY ; The main screen, lower screen/input buffer or ZX printer. ;; PO-STORE -L0ADC: BIT 1,(IY+$01) ; test FLAGS - Is printer in use ? +L0ADC: BIT 1,(IY+#01) ; test FLAGS - Is printer in use ? JR NZ,L0AFC ; to PO-ST-PR if so - BIT 0,(IY+$02) ; TV_FLAG - Lower screen in use ? + BIT 0,(IY+#02) ; TV_FLAG - Lower screen in use ? JR NZ,L0AF0 ; to PO-ST-E if so - LD ($5C88),BC ; S_POSN line/column upper screen - LD ($5C84),HL ; DF_CC display file address + LD (#5C88),BC ; S_POSN line/column upper screen + LD (#5C84),HL ; DF_CC display file address RET ; ; --- ;; PO-ST-E -L0AF0: LD ($5C8A),BC ; SPOSNL line/column lower screen - LD ($5C82),BC ; ECHO_E line/column input buffer - LD ($5C86),HL ; DFCCL lower screen memory address +L0AF0: LD (#5C8A),BC ; SPOSNL line/column lower screen + LD (#5C82),BC ; ECHO_E line/column input buffer + LD (#5C86),HL ; DFCCL lower screen memory address RET ; ; --- ;; PO-ST-PR -L0AFC: LD (IY+$45),C ; P_POSN column position printer - LD ($5C80),HL ; PR_CC full printer buffer memory address +L0AFC: LD (IY+#45),C ; P_POSN column position printer + LD (#5C80),HL ; PR_CC full printer buffer memory address RET ; ; ------------------------- @@ -3296,25 +3244,25 @@ L0AFC: LD (IY+$45),C ; P_POSN column position printer ; to the printer buffer could corrupt a 256-byte section of memory. ;; PO-FETCH -L0B03: BIT 1,(IY+$01) ; test FLAGS - Is printer in use +L0B03: BIT 1,(IY+#01) ; test FLAGS - Is printer in use JR NZ,L0B1D ; to PO-F-PR if so ; assume upper screen - LD BC,($5C88) ; S_POSN - LD HL,($5C84) ; DF_CC display file address - BIT 0,(IY+$02) ; TV_FLAG - Lower screen in use ? + LD BC,(#5C88) ; S_POSN + LD HL,(#5C84) ; DF_CC display file address + BIT 0,(IY+#02) ; TV_FLAG - Lower screen in use ? RET Z ; return if upper screen ; ah well, was lower screen - LD BC,($5C8A) ; SPOSNL - LD HL,($5C86) ; DFCCL + LD BC,(#5C8A) ; SPOSNL + LD HL,(#5C86) ; DFCCL RET ; return ; --- ;; PO-F-PR -L0B1D: LD C,(IY+$45) ; P_POSN column only - LD HL,($5C80) ; PR_CC printer buffer address +L0B1D: LD C,(IY+#45) ; P_POSN column only + LD HL,(#5C80) ; PR_CC printer buffer address RET ; return ; ------------------- @@ -3324,10 +3272,10 @@ L0B1D: LD C,(IY+$45) ; P_POSN column only ; It is only called from PO-ABLE which continues into PO-STORE ;; PO-ANY -L0B24: CP $80 ; ASCII ? +L0B24: CP #80 ; ASCII ? JR C,L0B65 ; to PO-CHAR is so. - CP $90 ; test if a block graphic character. + CP #90 ; test if a block graphic character. JR NC,L0B52 ; to PO-T&UDG to print tokens and udg's ; The 16 2*2 mosaic characters 128-143 decimal are formed from @@ -3337,13 +3285,13 @@ L0B24: CP $80 ; ASCII ? CALL L0B38 ; routine PO-GR-1 to construct top half ; then bottom half. CALL L0B03 ; routine PO-FETCH fetches print position. - LD DE,$5C92 ; MEM-0 is location of 8 bytes of character + LD DE,#5C92 ; MEM-0 is location of 8 bytes of character JR L0B7F ; to PR-ALL to print to screen or printer ; --- ;; PO-GR-1 -L0B38: LD HL,$5C92 ; address MEM-0 - a temporary buffer in +L0B38: LD HL,#5C92 ; address MEM-0 - a temporary buffer in ; systems variables which is normally used ; by the calculator. CALL L0B3E ; routine PO-GR-2 to construct top half @@ -3352,14 +3300,14 @@ L0B38: LD HL,$5C92 ; address MEM-0 - a temporary buffer in ;; PO-GR-2 L0B3E: RR B ; rotate bit 0/2 to carry - SBC A,A ; result $00 or $FF - AND $0F ; mask off right hand side + SBC A,A ; result #00 or #FF + AND #0F ; mask off right hand side LD C,A ; store part in C RR B ; rotate bit 1/3 of original chr to carry - SBC A,A ; result $00 or $FF - AND $F0 ; mask off left hand side + SBC A,A ; result #00 or #FF + AND #F0 ; mask off left hand side OR C ; combine with stored pattern - LD C,$04 ; four bytes for top/bottom half + LD C,#04 ; four bytes for top/bottom half ;; PO-GR-3 L0B4C: LD (HL),A ; store bit patterns in temporary buffer @@ -3377,9 +3325,9 @@ L0B4C: LD (HL),A ; store bit patterns in temporary buffer L0B52: JP L3B9F ;Spectrum 128 patch NOP -L0B56: ADD A,$15 ; add 21d to restore to 0 - 20 +L0B56: ADD A,#15 ; add 21d to restore to 0 - 20 PUSH BC ; save current print position - LD BC,($5C7B) ; fetch UDG to address bit patterns + LD BC,(#5C7B) ; fetch UDG to address bit patterns JR L0B6A ; to PO-CHAR-2 - common code to lay down ; a bit patterned character @@ -3395,21 +3343,21 @@ L0B5F: CALL L0C10 ; routine PO-TOKENS prints tokens ;; PO-CHAR L0B65: PUSH BC ; save print position - LD BC,($5C36) ; address CHARS + LD BC,(#5C36) ; address CHARS ; This common code is used to transfer the character bytes to memory. ;; PO-CHAR-2 L0B6A: EX DE,HL ; transfer destination address to DE - LD HL,$5C3B ; point to FLAGS + LD HL,#5C3B ; point to FLAGS RES 0,(HL) ; allow for leading space - CP $20 ; is it a space ? + CP #20 ; is it a space ? JR NZ,L0B76 ; to PO-CHAR-3 if not SET 0,(HL) ; signal no leading space to FLAGS ;; PO-CHAR-3 -L0B76: LD H,$00 ; set high byte to 0 +L0B76: LD H,#00 ; set high byte to 0 LD L,A ; character to A ; 0-21 UDG or 32-127 ASCII. ADD HL,HL ; multiply @@ -3431,18 +3379,18 @@ L0B76: LD H,$00 ; set high byte to 0 ;; PR-ALL L0B7F: LD A,C ; column to A DEC A ; move right - LD A,$21 ; pre-load with leftmost position + LD A,#21 ; pre-load with leftmost position JR NZ,L0B93 ; but if not zero to PR-ALL-1 DEC B ; down one line - LD C,A ; load C with $21 - BIT 1,(IY+$01) ; test FLAGS - Is printer in use + LD C,A ; load C with #21 + BIT 1,(IY+#01) ; test FLAGS - Is printer in use JR Z,L0B93 ; to PR-ALL-1 if not PUSH DE ; save source address CALL L0ECD ; routine COPY-BUFF outputs line to printer POP DE ; restore character source address - LD A,C ; the new column number ($21) to C + LD A,C ; the new column number (#21) to C ;; PR-ALL-1 L0B93: CP C ; this test is really for screen - new line ? @@ -3453,8 +3401,8 @@ L0B93: CP C ; this test is really for screen - new line ? POP DE ; restore source PUSH BC ; save line/column PUSH HL ; and destination - LD A,($5C91) ; fetch P_FLAG to accumulator - LD B,$FF ; prepare OVER mask in B. + LD A,(#5C91) ; fetch P_FLAG to accumulator + LD B,#FF ; prepare OVER mask in B. RRA ; bit 0 set if OVER 1 JR C,L0BA4 ; to PR-ALL-2 @@ -3465,12 +3413,12 @@ L0BA4: RRA ; skip bit 1 of P_FLAG RRA ; bit 2 is INVERSE SBC A,A ; will be FF for INVERSE 1 else zero LD C,A ; transfer INVERSE mask to C - LD A,$08 ; prepare to count 8 bytes + LD A,#08 ; prepare to count 8 bytes AND A ; clear carry to signal screen - BIT 1,(IY+$01) ; test FLAGS - is printer in use ? + BIT 1,(IY+#01) ; test FLAGS - is printer in use ? JR Z,L0BB6 ; to PR-ALL-3 if screen - SET 1,(IY+$30) ; update FLAGS2 - signal printer buffer has + SET 1,(IY+#30) ; update FLAGS2 - signal printer buffer has ; been used. SCF ; set carry flag to signal printer. @@ -3496,7 +3444,7 @@ L0BC1: INC HL ; address next character byte EX DE,HL ; destination to HL DEC H ; bring back to last updated screen position - BIT 1,(IY+$01) ; test FLAGS - is printer in use ? + BIT 1,(IY+#01) ; test FLAGS - is printer in use ? CALL Z,L0BDB ; if not, call routine PO-ATTR to update ; corresponding colour attribute. POP HL ; restore original screen/printer position @@ -3513,7 +3461,7 @@ L0BC1: INC HL ; address next character byte ;; PR-ALL-6 L0BD3: EX AF,AF' ; save the flag - LD A,$20 ; load A with 32 decimal + LD A,#20 ; load A with 32 decimal ADD A,E ; add this to E LD E,A ; and store result in E EX AF,AF' ; fetch the flag @@ -3529,36 +3477,36 @@ L0BD3: EX AF,AF' ; save the flag ; to manipulate H to form the correct colour attribute address. ;; PO-ATTR -L0BDB: LD A,H ; fetch high byte $40 - $57 +L0BDB: LD A,H ; fetch high byte #40 - #57 RRCA ; shift RRCA ; bits 3 and 4 RRCA ; to right. - AND $03 ; range is now 0 - 2 - OR $58 ; form correct high byte for third of screen + AND #03 ; range is now 0 - 2 + OR #58 ; form correct high byte for third of screen LD H,A ; HL is now correct - LD DE,($5C8F) ; make D hold ATTR_T, E hold MASK-T + LD DE,(#5C8F) ; make D hold ATTR_T, E hold MASK-T LD A,(HL) ; fetch existing attribute XOR E ; apply masks AND D ; XOR E ; - BIT 6,(IY+$57) ; test P_FLAG - is this PAPER 9 ?? + BIT 6,(IY+#57) ; test P_FLAG - is this PAPER 9 ?? JR Z,L0BFA ; skip to PO-ATTR-1 if not. - AND $C7 ; set paper + AND #C7 ; set paper BIT 2,A ; to contrast with ink JR NZ,L0BFA ; skip to PO-ATTR-1 - XOR $38 ; + XOR #38 ; ;; PO-ATTR-1 -L0BFA: BIT 4,(IY+$57) ; test P_FLAG - Is this INK 9 ?? +L0BFA: BIT 4,(IY+#57) ; test P_FLAG - Is this INK 9 ?? JR Z,L0C08 ; skip to PO-ATTR-2 if not - AND $F8 ; make ink + AND #F8 ; make ink BIT 5,A ; contrast with paper. JR NZ,L0C08 ; to PO-ATTR-2 - XOR $07 ; + XOR #07 ; ;; PO-ATTR-2 L0C08: LD (HL),A ; save the new attribute. @@ -3575,7 +3523,7 @@ L0C08: LD (HL),A ; save the new attribute. ;; PO-MSG L0C0A: PUSH HL ; put hi-byte zero on stack to suppress - LD H,$00 ; trailing spaces + LD H,#00 ; trailing spaces EX (SP),HL ; ld h,0; push hl would have done ?. JR L0C14 ; forward to PO-TABLE. @@ -3594,14 +3542,14 @@ L0C14: CALL L0C41 ; routine PO-SEARCH will set carry for L0C17: JR C,L0C22 ; forward to PO-EACH if not a command, ; '<>' etc. - LD A,$20 ; prepare leading space - BIT 0,(IY+$01) ; test FLAGS - leading space if not set + LD A,#20 ; prepare leading space + BIT 0,(IY+#01) ; test FLAGS - leading space if not set CALL Z,L0C3B ; routine PO-SAVE to print a space ; without disturbing registers ;; PO-EACH L0C22: LD A,(DE) ; fetch character - AND $7F ; remove any inverted bit + AND #7F ; remove any inverted bit CALL L0C3B ; routine PO-SAVE to print using alternate ; set of registers. LD A,(DE) ; re-fetch character. @@ -3611,26 +3559,26 @@ L0C22: LD A,(DE) ; fetch character JR NC,L0C22 ; back to PO-EACH if not POP DE ; * re-fetch trailing space flag to D (was A) - CP $48 ; was last character '$' ($24*2) + CP #48 ; was last character '$' (#24*2) JR Z,L0C35 ; forward to PO-TR-SP to consider trailing ; space if so. - CP $82 ; was it < 'A' i.e. '#','>','=' from tokens + CP #82 ; was it < 'A' i.e. '#','>','=' from tokens ; or ' ','.' (from tape) or '?' from scroll RET C ; no trailing space ;; PO-TR-SP L0C35: LD A,D ; the trailing space flag (zero if an error msg) - CP $03 ; test against RND, INKEY$ and PI + CP #03 ; test against RND, INKEY$ and PI ; which have no parameters and RET C ; therefore no trailing space so return. - LD A,$20 ; else continue and print a trailing space. + LD A,#20 ; else continue and print a trailing space. ; ------------------------- ; Handle recursive printing ; ------------------------- -; This routine which is part of PRINT-OUT allows RST $10 to be +; This routine which is part of PRINT-OUT allows RST #10 to be ; used recursively to print tokens and the spaces associated with them. ;; PO-SAVE @@ -3664,11 +3612,11 @@ L0C44: BIT 7,(HL) ; is character inverted ? EX DE,HL ; transfer address to DE POP AF ; restore message/token number - CP $20 ; return with carry set + CP #20 ; return with carry set RET C ; for all messages and function tokens LD A,(DE) ; test first character of token - SUB $41 ; and return with carry set + SUB #41 ; and return with carry set RET ; if it is less that 'A' ; i.e. '<>', '<=', '>=' @@ -3682,34 +3630,34 @@ L0C44: BIT 7,(HL) ; is character inverted ? ; The B register holds the current line. ;; PO-SCR -L0C55: BIT 1,(IY+$01) ; test FLAGS - is printer in use ? +L0C55: BIT 1,(IY+#01) ; test FLAGS - is printer in use ? RET NZ ; return immediately if so. LD DE,L0DD9 ; set DE to address: CL-SET PUSH DE ; and push for return address. LD A,B ; transfer the line to A. - BIT 0,(IY+$02) ; test TV_FLAG - Lower screen in use ? + BIT 0,(IY+#02) ; test TV_FLAG - Lower screen in use ? JP NZ,L0D02 ; jump forward to PO-SCR-4 if so. - CP (IY+$31) ; greater than DF_SZ display file size ? + CP (IY+#31) ; greater than DF_SZ display file size ? JR C,L0C86 ; forward to REPORT-5 if less. ; 'Out of screen' RET NZ ; return (via CL-SET) if greater - BIT 4,(IY+$02) ; test TV_FLAG - Automatic listing ? + BIT 4,(IY+#02) ; test TV_FLAG - Automatic listing ? JR Z,L0C88 ; forward to PO-SCR-2 if not. - LD E,(IY+$2D) ; fetch BREG - the count of scroll lines to E. + LD E,(IY+#2D) ; fetch BREG - the count of scroll lines to E. DEC E ; decrease and jump JR Z,L0CD2 ; to PO-SCR-3 if zero and scrolling required. - LD A,$00 ; explicit - select channel zero. + LD A,#00 ; explicit - select channel zero. CALL L1601 ; routine CHAN-OPEN opens it. - LD SP,($5C3F) ; set stack pointer to LIST_SP + LD SP,(#5C3F) ; set stack pointer to LIST_SP - RES 4,(IY+$02) ; reset TV_FLAG - signal auto listing finished. + RES 4,(IY+#02) ; reset TV_FLAG - signal auto listing finished. RET ; return ignoring pushed value, CL-SET ; to MAIN or EDITOR without updating ; print position -> @@ -3719,33 +3667,33 @@ L0C55: BIT 1,(IY+$01) ; test FLAGS - is printer in use ? ;; REPORT-5 L0C86: RST 08H ; ERROR-1 - DEFB $04 ; Error Report: Out of screen + DEFB #04 ; Error Report: Out of screen ; continue here if not an automatic listing. ;; PO-SCR-2 -L0C88: DEC (IY+$52) ; decrease SCR_CT +L0C88: DEC (IY+#52) ; decrease SCR_CT JR NZ,L0CD2 ; forward to PO-SCR-3 to scroll display if ; result not zero. ; now produce prompt. - LD A,$18 ; reset + LD A,#18 ; reset SUB B ; the - LD ($5C8C),A ; SCR_CT scroll count - LD HL,($5C8F) ; L=ATTR_T, H=MASK_T + LD (#5C8C),A ; SCR_CT scroll count + LD HL,(#5C8F) ; L=ATTR_T, H=MASK_T PUSH HL ; save on stack - LD A,($5C91) ; P_FLAG + LD A,(#5C91) ; P_FLAG PUSH AF ; save on stack to prevent lower screen ; attributes (BORDCR etc.) being applied. - LD A,$FD ; select system channel 'K' + LD A,#FD ; select system channel 'K' CALL L1601 ; routine CHAN-OPEN opens it XOR A ; clear to address message directly LD DE,L0CF8 ; make DE address: scrl-mssg CALL L0C0A ; routine PO-MSG prints to lower screen - SET 5,(IY+$02) ; set TV_FLAG - signal lower screen requires + SET 5,(IY+#02) ; set TV_FLAG - signal lower screen requires ; clearing - LD HL,$5C3B ; make HL address FLAGS + LD HL,#5C3B ; make HL address FLAGS SET 3,(HL) ; signal 'L' mode. RES 5,(HL) ; signal 'no new key'. EXX ; switch to main set. @@ -3756,30 +3704,30 @@ L0C88: DEC (IY+$52) ; decrease SCR_CT ; choices available, it is however the best. EXX ; switch back to alternate set. - CP $20 ; space is considered as BREAK + CP #20 ; space is considered as BREAK JR Z,L0D00 ; forward to REPORT-D if so ; 'BREAK - CONT repeats' - CP $E2 ; is character 'STOP' ? + CP #E2 ; is character 'STOP' ? JR Z,L0D00 ; forward to REPORT-D if so - OR $20 ; convert to lower-case - CP $6E ; is character 'n' ? + OR #20 ; convert to lower-case + CP #6E ; is character 'n' ? JR Z,L0D00 ; forward to REPORT-D if so else scroll. - LD A,$FE ; select system channel 'S' + LD A,#FE ; select system channel 'S' CALL L1601 ; routine CHAN-OPEN POP AF ; restore original P_FLAG - LD ($5C91),A ; and save in P_FLAG. + LD (#5C91),A ; and save in P_FLAG. POP HL ; restore original ATTR_T, MASK_T - LD ($5C8F),HL ; and reset ATTR_T, MASK-T as 'scroll?' has + LD (#5C8F),HL ; and reset ATTR_T, MASK-T as 'scroll?' has ; been printed. ;; PO-SCR-3 L0CD2: CALL L0DFE ; routine CL-SC-ALL to scroll whole display - LD B,(IY+$31) ; fetch DF_SZ to B + LD B,(IY+#31) ; fetch DF_SZ to B INC B ; increase to address last line of display - LD C,$21 ; set C to $21 (was $21 from above routine) + LD C,#21 ; set C to #21 (was #21 from above routine) PUSH BC ; save the line and column in BC. CALL L0E9B ; routine CL-ADDR finds display address. @@ -3788,14 +3736,14 @@ L0CD2: CALL L0DFE ; routine CL-SC-ALL to scroll whole display RRCA ; (this code sequence is used twice RRCA ; elsewhere and is a candidate for RRCA ; a subroutine.) - AND $03 ; - OR $58 ; + AND #03 ; + OR #58 ; LD H,A ; - LD DE,$5AE0 ; start of last 'line' of attribute area + LD DE,#5AE0 ; start of last 'line' of attribute area LD A,(DE) ; get attribute for last line LD C,(HL) ; transfer to base line of upper part - LD B,$20 ; there are thirty two bytes + LD B,#20 ; there are thirty two bytes EX DE,HL ; swap the pointers. ;; PO-SCR-3A @@ -3814,31 +3762,31 @@ L0CF0: LD (DE),A ; transfer ; The message 'scroll?' appears here with last byte inverted. ;; scrl-mssg -L0CF8: DEFB $80 ; initial step-over byte. +L0CF8: DEFB #80 ; initial step-over byte. DEFM "scroll" - DEFB '?'+$80 + DEFB '?'+#80 ;; REPORT-D L0D00: RST 08H ; ERROR-1 - DEFB $0C ; Error Report: BREAK - CONT repeats + DEFB #0C ; Error Report: BREAK - CONT repeats ; continue here if using lower display - A holds line number. ;; PO-SCR-4 -L0D02: CP $02 ; is line number less than 2 ? +L0D02: CP #02 ; is line number less than 2 ? JR C,L0C86 ; to REPORT-5 if so ; 'Out of Screen'. - ADD A,(IY+$31) ; add DF_SZ - SUB $19 ; + ADD A,(IY+#31) ; add DF_SZ + SUB #19 ; RET NC ; return if scrolling unnecessary NEG ; Negate to give number of scrolls required. PUSH BC ; save line/column LD B,A ; count to B - LD HL,($5C8F) ; fetch current ATTR_T, MASK_T to HL. + LD HL,(#5C8F) ; fetch current ATTR_T, MASK_T to HL. PUSH HL ; and save - LD HL,($5C91) ; fetch P_FLAG + LD HL,(#5C91) ; fetch P_FLAG PUSH HL ; and save. ; to prevent corruption by input AT @@ -3847,18 +3795,18 @@ L0D02: CP $02 ; is line number less than 2 ? ;; PO-SCR-4A L0D1C: PUSH AF ; save scroll number. - LD HL,$5C6B ; address DF_SZ + LD HL,#5C6B ; address DF_SZ LD B,(HL) ; fetch old value LD A,B ; transfer to A INC A ; and increment LD (HL),A ; then put back. - LD HL,$5C89 ; address S_POSN_hi - line + LD HL,#5C89 ; address S_POSN_hi - line CP (HL) ; compare JR C,L0D2D ; forward to PO-SCR-4B if scrolling required INC (HL) ; else increment S_POSN_hi - LD B,$18 ; set count to whole display ?? - ; Note. should be $17 and the top line + LD B,#18 ; set count to whole display ?? + ; Note. should be #17 and the top line ; will be scrolled into the ROM which ; is harmless on the standard set up. @@ -3869,16 +3817,16 @@ L0D2D: CALL L0E00 ; routine CL-SCROLL scrolls B lines JR NZ,L0D1C ; back to to PO-SCR-4A until done POP HL ; restore original P_FLAG. - LD (IY+$57),L ; and overwrite system variable P_FLAG. + LD (IY+#57),L ; and overwrite system variable P_FLAG. POP HL ; restore original ATTR_T/MASK_T. - LD ($5C8F),HL ; and update system variables. + LD (#5C8F),HL ; and update system variables. - LD BC,($5C88) ; fetch S_POSN to BC. - RES 0,(IY+$02) ; signal to TV_FLAG - main screen in use. + LD BC,(#5C88) ; fetch S_POSN to BC. + RES 0,(IY+#02) ; signal to TV_FLAG - main screen in use. CALL L0DD9 ; call routine CL-SET for upper display. - SET 0,(IY+$02) ; signal to TV_FLAG - lower screen in use. + SET 0,(IY+#02) ; signal to TV_FLAG - lower screen in use. POP BC ; restore line/column RET ; return via CL-SET for lower display. @@ -3890,20 +3838,20 @@ L0D2D: CALL L0E00 ; routine CL-SCROLL scrolls B lines ;; TEMPS L0D4D: XOR A ; clear the accumulator - LD HL,($5C8D) ; fetch L=ATTR_P and H=MASK_P - BIT 0,(IY+$02) ; test TV_FLAG - is lower screen in use ? + LD HL,(#5C8D) ; fetch L=ATTR_P and H=MASK_P + BIT 0,(IY+#02) ; test TV_FLAG - is lower screen in use ? JR Z,L0D5B ; skip to TEMPS-1 if not LD H,A ; set H, MASK P, to 00000000. - LD L,(IY+$0E) ; fetch BORDCR to L which is used for lower + LD L,(IY+#0E) ; fetch BORDCR to L which is used for lower ; screen. ;; TEMPS-1 -L0D5B: LD ($5C8F),HL ; transfer values to ATTR_T and MASK_T +L0D5B: LD (#5C8F),HL ; transfer values to ATTR_T and MASK_T ; for the print flag the permanent values are odd bits, temporary even bits. - LD HL,$5C91 ; address P_FLAG. + LD HL,#5C91 ; address P_FLAG. JR NZ,L0D65 ; skip to TEMPS-2 if lower screen using A=0. LD A,(HL) ; else pick up flag bits. @@ -3911,7 +3859,7 @@ L0D5B: LD ($5C8F),HL ; transfer values to ATTR_T and MASK_T ;; TEMPS-2 L0D65: XOR (HL) ; - AND $55 ; BIN 01010101 + AND #55 ; BIN 01010101 XOR (HL) ; permanent now as original LD (HL),A ; apply permanent bits to temporary bits. RET ; and return. @@ -3930,24 +3878,24 @@ L0D6B: CALL L0DAF ; routine CL-ALL clears display and ; this routine called from INPUT, ** ;; CLS-LOWER -L0D6E: LD HL,$5C3C ; address System Variable TV_FLAG. +L0D6E: LD HL,#5C3C ; address System Variable TV_FLAG. RES 5,(HL) ; TV_FLAG - signal do not clear lower screen. SET 0,(HL) ; TV_FLAG - signal lower screen in use. CALL L0D4D ; routine TEMPS picks up temporary colours. - LD B,(IY+$31) ; fetch lower screen DF_SZ + LD B,(IY+#31) ; fetch lower screen DF_SZ CALL L0E44 ; routine CL-LINE clears lower part ; and sets permanent attributes. - LD HL,$5AC0 ; fetch attribute address leftmost cell, + LD HL,#5AC0 ; fetch attribute address leftmost cell, ; second line up. - LD A,($5C8D) ; fetch permanent attribute from ATTR_P. + LD A,(#5C8D) ; fetch permanent attribute from ATTR_P. DEC B ; decrement lower screen display file size JR L0D8E ; forward to CLS-3 -> ; --- ;; CLS-1 -L0D87: LD C,$20 ; set counter to 32 characters per line +L0D87: LD C,#20 ; set counter to 32 characters per line ;; CLS-2 L0D89: DEC HL ; decrease attribute address. @@ -3959,15 +3907,15 @@ L0D89: DEC HL ; decrease attribute address. L0D8E: DJNZ L0D87 ; decrease B counter and back to CLS-1 ; if not zero. - LD (IY+$31),$02 ; set DF_SZ lower screen to 2 + LD (IY+#31),#02 ; set DF_SZ lower screen to 2 ; This entry point is called from CL-ALL below to ; reset the system channel input and output addresses to normal. ;; CL-CHAN -L0D94: LD A,$FD ; select system channel 'K' +L0D94: LD A,#FD ; select system channel 'K' CALL L1601 ; routine CHAN-OPEN opens it. - LD HL,($5C51) ; fetch CURCHL to HL to address current channel + LD HL,(#5C51) ; fetch CURCHL to HL to address current channel LD DE,L09F4 ; set address to PRINT-OUT for first pass. AND A ; clear carry for first pass. @@ -3981,7 +3929,7 @@ L0DA0: LD (HL),E ; insert output address first pass. JR C,L0DA0 ; back to CL-CHAN-A if first pass else done. - LD BC,$1721 ; line 23 for lower screen + LD BC,#1721 ; line 23 for lower screen JR L0DD9 ; exit via CL-SET to set column ; for lower display @@ -3993,29 +3941,29 @@ L0DA0: LD (HL),E ; insert output address first pass. ; and system channels. ;; CL-ALL -L0DAF: LD HL,$0000 ; initialize plot coordinates. - LD ($5C7D),HL ; set COORDS to 0,0. - RES 0,(IY+$30) ; update FLAGS2 - signal main screen is clear. +L0DAF: LD HL,#0000 ; initialize plot coordinates. + LD (#5C7D),HL ; set COORDS to 0,0. + RES 0,(IY+#30) ; update FLAGS2 - signal main screen is clear. CALL L0D94 ; routine CL-CHAN makes channel 'K' 'normal'. - LD A,$FE ; select system channel 'S' + LD A,#FE ; select system channel 'S' CALL L1601 ; routine CHAN-OPEN opens it CALL L0D4D ; routine TEMPS picks up permanent values. - LD B,$18 ; There are 24 lines. + LD B,#18 ; There are 24 lines. CALL L0E44 ; routine CL-LINE clears 24 text lines - ; (and sets BC to $1821) + ; (and sets BC to #1821) - LD HL,($5C51) ; fetch CURCHL make HL address current + LD HL,(#5C51) ; fetch CURCHL make HL address current ; channel 'S' LD DE,L09F4 ; address: PRINT-OUT LD (HL),E ; is made INC HL ; the normal LD (HL),D ; output address. - LD (IY+$52),$01 ; set SCR_CT - scroll count is set to default. - ; Note. BC already contains $1821. - LD BC,$1821 ; reset column and line to 0,0 + LD (IY+#52),#01 ; set SCR_CT - scroll count is set to default. + ; Note. BC already contains #1821. + LD BC,#1821 ; reset column and line to 0,0 ; and continue into CL-SET, below, exiting ; via PO-STORE (for upper screen). @@ -4027,16 +3975,16 @@ L0DAF: LD HL,$0000 ; initialize plot coordinates. ; or the column for printer. ;; CL-SET -L0DD9: LD HL,$5B00 ; the base address of printer buffer - BIT 1,(IY+$01) ; test FLAGS - is printer in use ? +L0DD9: LD HL,#5B00 ; the base address of printer buffer + BIT 1,(IY+#01) ; test FLAGS - is printer in use ? JR NZ,L0DF4 ; forward to CL-SET-2 if so. LD A,B ; transfer line to A. - BIT 0,(IY+$02) ; test TV_FLAG - lower screen in use ? + BIT 0,(IY+#02) ; test TV_FLAG - lower screen in use ? JR Z,L0DEE ; skip to CL-SET-1 if handling upper part - ADD A,(IY+$31) ; add DF_SZ for lower screen - SUB $18 ; and adjust. + ADD A,(IY+#31) ; add DF_SZ for lower screen + SUB #18 ; and adjust. ;; CL-SET-1 L0DEE: PUSH BC ; save the line/column. @@ -4048,10 +3996,10 @@ L0DEE: PUSH BC ; save the line/column. POP BC ; restore the line/column. ;; CL-SET-2 -L0DF4: LD A,$21 ; the column $1-$21 is reversed - SUB C ; to range $00 - $20 +L0DF4: LD A,#21 ; the column #1-#21 is reversed + SUB C ; to range #00 - #20 LD E,A ; now transfer to DE - LD D,$00 ; prepare for addition + LD D,#00 ; prepare for addition ADD HL,DE ; and add to base address JP L0ADC ; exit via PO-STORE to update relevant ; system variables. @@ -4062,51 +4010,51 @@ L0DF4: LD A,$21 ; the column $1-$21 is reversed ; and from the routine CL-SCROLL, once, to scroll part of the display. ;; CL-SC-ALL -L0DFE: LD B,$17 ; scroll 23 lines, after 'scroll?'. +L0DFE: LD B,#17 ; scroll 23 lines, after 'scroll?'. ;; CL-SCROLL L0E00: CALL L0E9B ; routine CL-ADDR gets screen address in HL. - LD C,$08 ; there are 8 pixel lines to scroll. + LD C,#08 ; there are 8 pixel lines to scroll. ;; CL-SCR-1 L0E05: PUSH BC ; save counters. PUSH HL ; and initial address. LD A,B ; get line count. - AND $07 ; will set zero if all third to be scrolled. + AND #07 ; will set zero if all third to be scrolled. LD A,B ; re-fetch the line count. JR NZ,L0E19 ; forward to CL-SCR-3 if partial scroll. ; HL points to top line of third and must be copied to bottom of previous 3rd. -; ( so HL = $4800 or $5000 ) ( but also sometimes $4000 ) +; ( so HL = #4800 or #5000 ) ( but also sometimes #4000 ) ;; CL-SCR-2 L0E0D: EX DE,HL ; copy HL to DE. - LD HL,$F8E0 ; subtract $08 from H and add $E0 to L - + LD HL,#F8E0 ; subtract #08 from H and add #E0 to L - ADD HL,DE ; to make destination bottom line of previous ; third. EX DE,HL ; restore the source and destination. - LD BC,$0020 ; thirty-two bytes are to be copied. + LD BC,#0020 ; thirty-two bytes are to be copied. DEC A ; decrement the line count. LDIR ; copy a pixel line to previous third. ;; CL-SCR-3 L0E19: EX DE,HL ; save source in DE. - LD HL,$FFE0 ; load the value -32. + LD HL,#FFE0 ; load the value -32. ADD HL,DE ; add to form destination in HL. EX DE,HL ; switch source and destination LD B,A ; save the count in B. - AND $07 ; mask to find count applicable to current + AND #07 ; mask to find count applicable to current RRCA ; third and RRCA ; multiply by RRCA ; thirty two (same as 5 RLCAs) - LD C,A ; transfer byte count to C ($E0 at most) + LD C,A ; transfer byte count to C (#E0 at most) LD A,B ; store line count to A - LD B,$00 ; make B zero + LD B,#00 ; make B zero LDIR ; copy bytes (BC=0, H incremented, L=0) - LD B,$07 ; set B to 7, C is zero. + LD B,#07 ; set B to 7, C is zero. ADD HL,BC ; add 7 to H to address next third. - AND $F8 ; has last third been done ? + AND #F8 ; has last third been done ? JR NZ,L0E0D ; back to CL-SCR-2 if not POP HL ; restore topmost address. @@ -4117,11 +4065,11 @@ L0E19: EX DE,HL ; save source in DE. CALL L0E88 ; routine CL-ATTR gets address in attributes ; from current 'ninth line', count in BC. - LD HL,$FFE0 ; set HL to the 16-bit value -32. + LD HL,#FFE0 ; set HL to the 16-bit value -32. ADD HL,DE ; and add to form destination address. EX DE,HL ; swap source and destination addresses. LDIR ; copy bytes scrolling the linear attributes. - LD B,$01 ; continue to clear the bottom line. + LD B,#01 ; continue to clear the bottom line. ; --------------------------- ; Clear text lines of display @@ -4133,7 +4081,7 @@ L0E19: EX DE,HL ; save source in DE. ;; CL-LINE L0E44: PUSH BC ; save line count CALL L0E9B ; routine CL-ADDR gets top address - LD C,$08 ; there are eight screen lines to a text line. + LD C,#08 ; there are eight screen lines to a text line. ;; CL-LINE-1 L0E4A: PUSH BC ; save pixel line count @@ -4141,23 +4089,23 @@ L0E4A: PUSH BC ; save pixel line count LD A,B ; transfer the line to A (1-24). ;; CL-LINE-2 -L0E4D: AND $07 ; mask 0-7 to consider thirds at a time +L0E4D: AND #07 ; mask 0-7 to consider thirds at a time RRCA ; multiply RRCA ; by 32 (same as five RLCA instructions) RRCA ; now 32 - 256(0) LD C,A ; store result in C LD A,B ; save line in A (1-24) - LD B,$00 ; set high byte to 0, prepare for ldir. + LD B,#00 ; set high byte to 0, prepare for ldir. DEC C ; decrement count 31-255. LD D,H ; copy HL LD E,L ; to DE. - LD (HL),$00 ; blank the first byte. + LD (HL),#00 ; blank the first byte. INC DE ; make DE point to next byte. LDIR ; ldir will clear lines. - LD DE,$0701 ; now address next third adjusting + LD DE,#0701 ; now address next third adjusting ADD HL,DE ; register E to address left hand side DEC A ; decrease the line count. - AND $F8 ; will be 16, 8 or 0 (AND $18 will do). + AND #F8 ; will be 16, 8 or 0 (AND #18 will do). LD B,A ; transfer count to B. JR NZ,L0E4D ; back to CL-LINE-2 if 16 or 8 to do ; the next third. @@ -4175,18 +4123,18 @@ L0E4D: AND $07 ; mask 0-7 to consider thirds at a time INC DE ; make DE point to next location. - LD A,($5C8D) ; fetch ATTR_P - permanent attributes - BIT 0,(IY+$02) ; test TV_FLAG - lower screen in use ? + LD A,(#5C8D) ; fetch ATTR_P - permanent attributes + BIT 0,(IY+#02) ; test TV_FLAG - lower screen in use ? JR Z,L0E80 ; skip to CL-LINE-3 if not. - LD A,($5C48) ; else lower screen uses BORDCR as attribute. + LD A,(#5C48) ; else lower screen uses BORDCR as attribute. ;; CL-LINE-3 L0E80: LD (HL),A ; put attribute in first byte. DEC BC ; decrement the counter. LDIR ; copy bytes to set all attributes. - POP BC ; restore the line $01-$24. - LD C,$21 ; make column $21. (No use is made of this) + POP BC ; restore the line #01-#24. + LD C,#21 ; make column #21. (No use is made of this) RET ; return to the calling routine. ; ------------------ @@ -4201,12 +4149,12 @@ L0E80: LD (HL),A ; put attribute in first byte. ; to manipulate H to form the correct colour attribute address. ;; CL-ATTR -L0E88: LD A,H ; fetch H to A - $48, $50, or $58. +L0E88: LD A,H ; fetch H to A - #48, #50, or #58. RRCA ; divide by RRCA ; eight. - RRCA ; $09, $0A or $0B. - DEC A ; $08, $09 or $0A. - OR $50 ; $58, $59 or $5A. + RRCA ; #09, #0A or #0B. + DEC A ; #08, #09 or #0A. + OR #50 ; #58, #59 or #5A. LD H,A ; save high byte of attributes. EX DE,HL ; transfer attribute address to DE @@ -4230,21 +4178,21 @@ L0E88: LD A,H ; fetch H to A - $48, $50, or $58. ; of the start of a screen character line which is supplied in B. ;; CL-ADDR -L0E9B: LD A,$18 ; reverse the line number - SUB B ; to range $00 - $17. +L0E9B: LD A,#18 ; reverse the line number + SUB B ; to range #00 - #17. LD D,A ; save line in D for later. RRCA ; multiply RRCA ; by RRCA ; thirty-two. - AND $E0 ; mask off low bits to make + AND #E0 ; mask off low bits to make LD L,A ; L a multiple of 32. LD A,D ; bring back the line to A. - AND $18 ; now $00, $08 or $10. + AND #18 ; now #00, #08 or #10. - OR $40 ; add the base address of screen. + OR #40 ; add the base address of screen. LD H,A ; HL now has the correct address. RET ; return. @@ -4263,8 +4211,8 @@ L0E9B: LD A,$18 ; reverse the line number L0EAC: DI ; disable interrupts as this is time-critical. - LD B,$B0 ; top 176 lines. -L0EAF: LD HL,$4000 ; address start of the display file. + LD B,#B0 ; top 176 lines. +L0EAF: LD HL,#4000 ; address start of the display file. ; now enter a loop to handle each pixel line. @@ -4278,16 +4226,16 @@ L0EB2: PUSH HL ; save the screen address. POP HL ; and display address. INC H ; next line down screen within 'thirds'. LD A,H ; high byte to A. - AND $07 ; result will be zero if we have left third. + AND #07 ; result will be zero if we have left third. JR NZ,L0EC9 ; forward to COPY-2 if not to continue loop. LD A,L ; consider low byte first. - ADD A,$20 ; increase by 32 - sets carry if back to zero. + ADD A,#20 ; increase by 32 - sets carry if back to zero. LD L,A ; will be next group of 8. CCF ; complement - carry set if more lines in ; the previous third. SBC A,A ; will be FF, if more, else 00. - AND $F8 ; will be F8 (-8) or 00. + AND #F8 ; will be F8 (-8) or 00. ADD A,H ; that is subtract 8, if more to do in third. LD H,A ; and reset address. @@ -4307,8 +4255,8 @@ L0EC9: DJNZ L0EB2 ; back to COPY-1 for all lines. ;; COPY-BUFF L0ECD: DI ; disable interrupts - LD HL,$5B00 ; the base address of the Printer Buffer. - LD B,$08 ; set count to 8 lines of 32 bytes. + LD HL,#5B00 ; the base address of the Printer Buffer. + LD B,#08 ; set count to 8 lines of 32 bytes. ;; COPY-3 L0ED3: PUSH BC ; save counter. @@ -4321,8 +4269,8 @@ L0ED3: PUSH BC ; save counter. ; three instructions. ;; COPY-END -L0EDA: LD A,$04 ; output value 4 to port - OUT ($FB),A ; to stop the slowed printer motor. +L0EDA: LD A,#04 ; output value 4 to port + OUT (#FB),A ; to stop the slowed printer motor. EI ; enable interrupts. ; -------------------- @@ -4342,8 +4290,8 @@ L0EDA: LD A,$04 ; output value 4 to port ; of PR_CC_hi. ;; CLEAR-PRB -L0EDF: LD HL,$5B00 ; the location of the buffer. - LD (IY+$46),L ; update PR_CC_lo - set to zero - superfluous. +L0EDF: LD HL,#5B00 ; the location of the buffer. + LD (IY+#46),L ; update PR_CC_lo - set to zero - superfluous. XOR A ; clear the accumulator. LD B,A ; set count to 256 bytes. @@ -4352,8 +4300,8 @@ L0EE7: LD (HL),A ; set addressed location to zero. INC HL ; address next byte - Note. not INC L. DJNZ L0EE7 ; back to PRB-BYTES. repeat for 256 bytes. - RES 1,(IY+$30) ; set FLAGS2 - signal printer buffer is clear. - LD C,$21 ; set the column position . + RES 1,(IY+#30) ; set FLAGS2 - signal printer buffer is clear. + LD C,#21 ; set the column position . JP L0DD9 ; exit via CL-SET and then PO-STORE. ; ----------------- @@ -4361,7 +4309,7 @@ L0EE7: LD (HL),A ; set addressed location to zero. ; ----------------- ; This routine is called from COPY and COPY-BUFF to output a line of ; 32 bytes to the ZX Printer. -; Output to port $FB - +; Output to port #FB - ; bit 7 set - activate stylus. ; bit 7 low - deactivate stylus. ; bit 2 set - stops printer. @@ -4371,11 +4319,11 @@ L0EE7: LD (HL),A ; set addressed location to zero. ;; COPY-LINE L0EF4: LD A,B ; fetch the counter 1-8 or 1-176 - CP $03 ; is it 01 or 02 ?. - SBC A,A ; result is $FF if so else $00. - AND $02 ; result is 02 now else 00. + CP #03 ; is it 01 or 02 ?. + SBC A,A ; result is #FF if so else #00. + AND #02 ; result is 02 now else 00. ; bit 1 set slows the printer. - OUT ($FB),A ; slow the printer for the + OUT (#FB),A ; slow the printer for the ; last two lines. LD D,A ; save the mask to control the printer later. @@ -4383,18 +4331,18 @@ L0EF4: LD A,B ; fetch the counter 1-8 or 1-176 L0EFD: CALL L1F54 ; call BREAK-KEY to read keyboard immediately. JR C,L0F0C ; forward to COPY-L-2 if 'break' not pressed. - LD A,$04 ; else stop the - OUT ($FB),A ; printer motor. + LD A,#04 ; else stop the + OUT (#FB),A ; printer motor. EI ; enable interrupts. CALL L0EDF ; call routine CLEAR-PRB. ; Note. should not be cleared if COPY in use. ;; REPORT-Dc L0F0A: RST 08H ; ERROR-1 - DEFB $0C ; Error Report: BREAK - CONT repeats + DEFB #0C ; Error Report: BREAK - CONT repeats ;; COPY-L-2 -L0F0C: IN A,($FB) ; test now to see if +L0F0C: IN A,(#FB) ; test now to see if ADD A,A ; a printer is attached. RET M ; return if not - but continue with parent ; command. @@ -4402,12 +4350,12 @@ L0F0C: IN A,($FB) ; test now to see if JR NC,L0EFD ; back to COPY-L-1 if stylus of printer not ; in position. - LD C,$20 ; set count to 32 bytes. + LD C,#20 ; set count to 32 bytes. ;; COPY-L-3 L0F14: LD E,(HL) ; fetch a byte from line. INC HL ; address next location. Note. not INC L. - LD B,$08 ; count the bits. + LD B,#08 ; count the bits. ;; COPY-L-4 L0F18: RL D ; prepare mask to receive bit. @@ -4415,12 +4363,12 @@ L0F18: RL D ; prepare mask to receive bit. RR D ; and back to bit 7 of D restoring bit 1 ;; COPY-L-5 -L0F1E: IN A,($FB) ; read the port. +L0F1E: IN A,(#FB) ; read the port. RRA ; bit 0 to carry. JR NC,L0F1E ; back to COPY-L-5 if stylus not in position. LD A,D ; transfer command bits to A. - OUT ($FB),A ; and output to port. + OUT (#FB),A ; and output to port. DJNZ L0F18 ; loop back to COPY-L-4 for all 8 bits. DEC C ; decrease the byte count. @@ -4440,13 +4388,13 @@ L0F1E: IN A,($FB) ; read the port. ; This is a compact and highly versatile routine. ;; EDITOR -L0F2C: LD HL,($5C3D) ; fetch ERR_SP +L0F2C: LD HL,(#5C3D) ; fetch ERR_SP PUSH HL ; save on stack ;; ED-AGAIN L0F30: LD HL,L107F ; address: ED-ERROR PUSH HL ; save address on stack and - LD ($5C3D),SP ; make ERR_SP point to it. + LD (#5C3D),SP ; make ERR_SP point to it. ; Note. While in editing/input mode should an error occur then RST 08 will ; update X_PTR to the location reached by CH_ADD and jump to ED-ERROR @@ -4459,9 +4407,9 @@ L0F30: LD HL,L107F ; address: ED-ERROR L0F38: CALL L15D4 ; routine WAIT-KEY gets key possibly ; changing the mode. PUSH AF ; save key. - LD D,$00 ; and give a short click based - LD E,(IY-$01) ; on PIP value for duration. - LD HL,$00C8 ; and pitch. + LD D,#00 ; and give a short click based + LD E,(IY-#01) ; on PIP value for duration. + LD HL,#00C8 ; and pitch. CALL L03B5 ; routine BEEPER gives click - effective ; with rubber keyboard. POP AF ; get saved key value. @@ -4472,23 +4420,23 @@ L0F38: CALL L15D4 ; routine WAIT-KEY gets key possibly ; handler and an input stream set up to supply characters. ; The character that has been received can now be processed. - CP $18 ; range 24 to 255 ? + CP #18 ; range 24 to 255 ? JR NC,L0F81 ; forward to ADD-CHAR if so. - CP $07 ; lower than 7 ? + CP #07 ; lower than 7 ? JR C,L0F81 ; forward to ADD-CHAR also. ; Note. This is a 'bug' and chr$ 6, the comma ; control character, should have had an ; entry in the ED-KEYS table. ; Steven Vickers, 1984, Pitman. - CP $10 ; less than 16 ? + CP #10 ; less than 16 ? JR C,L0F92 ; forward to ED-KEYS if editing control ; range 7 to 15 dealt with by a table - LD BC,$0002 ; prepare for ink/paper etc. + LD BC,#0002 ; prepare for ink/paper etc. LD D,A ; save character in D - CP $16 ; is it ink/paper/bright etc. ? + CP #16 ; is it ink/paper/bright etc. ? JR C,L0F6C ; forward to ED-CONTR if so ; leaves 22d AT and 23d TAB @@ -4497,7 +4445,7 @@ L0F38: CALL L15D4 ; routine WAIT-KEY gets key possibly ; when the keyboard is used for input. INC BC ; if it was AT/TAB - 3 locations required - BIT 7,(IY+$37) ; test FLAGX - Is this INPUT LINE ? + BIT 7,(IY+#37) ; test FLAGX - Is this INPUT LINE ? JP Z,L101E ; jump to ED-IGNORE if not, else CALL L15D4 ; routine WAIT-KEY - input address is KEY-NEXT @@ -4509,8 +4457,8 @@ L0F6C: CALL L15D4 ; routine WAIT-KEY for control. ; input address will be key-next. PUSH DE ; saved code/parameters - LD HL,($5C5B) ; fetch address of keyboard cursor from K_CUR - RES 0,(IY+$07) ; set MODE to 'L' + LD HL,(#5C5B) ; fetch address of keyboard cursor from K_CUR + RES 0,(IY+#07) ; set MODE to 'L' CALL L1655 ; routine MAKE-ROOM makes 2/3 spaces at cursor @@ -4530,9 +4478,9 @@ L0F6C: CALL L15D4 ; routine WAIT-KEY for control. ; it is also the OUTPUT service routine for system channel 'R'. ;; ADD-CHAR -L0F81: RES 0,(IY+$07) ; set MODE to 'L' +L0F81: RES 0,(IY+#07) ; set MODE to 'L' -X0F85: LD HL,($5C5B) ; fetch address of keyboard cursor from K_CUR +X0F85: LD HL,(#5C5B) ; fetch address of keyboard cursor from K_CUR CALL L1652 ; routine ONE-SPACE creates one space. ; either a continuation of above or from ED-CONTR with ED-LOOP on stack. @@ -4540,7 +4488,7 @@ X0F85: LD HL,($5C5B) ; fetch address of keyboard cursor from K_CUR ;; ADD-CH-1 L0F8B: LD (DE),A ; load current character to last new location. INC DE ; address next - LD ($5C5B),DE ; and update K_CUR system variable. + LD (#5C5B),DE ; and update K_CUR system variable. RET ; return - either a simple return ; from ADD-CHAR or to ED-LOOP on stack. @@ -4551,33 +4499,33 @@ L0F8B: LD (DE),A ; load current character to last new location. ;; ED-KEYS L0F92: LD E,A ; character to E. - LD D,$00 ; prepare to add. - LD HL,L0FA0 - 7 ; base address of editing keys table. $0F99 + LD D,#00 ; prepare to add. + LD HL,L0FA0 - 7 ; base address of editing keys table. #0F99 ADD HL,DE ; add E LD E,(HL) ; fetch offset to E ADD HL,DE ; add offset for address of handling routine. PUSH HL ; push the address on machine stack. - LD HL,($5C5B) ; load address of cursor from K_CUR. + LD HL,(#5C5B) ; load address of cursor from K_CUR. RET ; an make an indirect jump forward to routine. ; ------------------ ; Editing keys table ; ------------------ -; For each code in the range $07 to $0F this table contains a +; For each code in the range #07 to #0F this table contains a ; single offset byte to the routine that services that code. ; Note. for what was intended there should also have been an ; entry for chr$ 6 with offset to ed-symbol. ;; ed-keys-t -L0FA0: DEFB L0FA9 - $ ; 07d offset $09 to Address: ED-EDIT - DEFB L1007 - $ ; 08d offset $66 to Address: ED-LEFT - DEFB L100C - $ ; 09d offset $6A to Address: ED-RIGHT - DEFB L0FF3 - $ ; 10d offset $50 to Address: ED-DOWN - DEFB L1059 - $ ; 11d offset $B5 to Address: ED-UP - DEFB L1015 - $ ; 12d offset $70 to Address: ED-DELETE - DEFB L1024 - $ ; 13d offset $7E to Address: ED-ENTER - DEFB L1076 - $ ; 14d offset $CF to Address: ED-SYMBOL - DEFB L107C - $ ; 15d offset $D4 to Address: ED-GRAPH +L0FA0: DEFB L0FA9 - $ ; 07d offset #09 to Address: ED-EDIT + DEFB L1007 - $ ; 08d offset #66 to Address: ED-LEFT + DEFB L100C - $ ; 09d offset #6A to Address: ED-RIGHT + DEFB L0FF3 - $ ; 10d offset #50 to Address: ED-DOWN + DEFB L1059 - $ ; 11d offset #B5 to Address: ED-UP + DEFB L1015 - $ ; 12d offset #70 to Address: ED-DELETE + DEFB L1024 - $ ; 13d offset #7E to Address: ED-ENTER + DEFB L1076 - $ ; 14d offset #CF to Address: ED-SYMBOL + DEFB L107C - $ ; 15d offset #D4 to Address: ED-GRAPH ; --------------- ; Handle EDIT key @@ -4587,9 +4535,9 @@ L0FA0: DEFB L0FA9 - $ ; 07d offset $09 to Address: ED-EDIT ; Alternatively ... ;; ED-EDIT -L0FA9: LD HL,($5C49) ; fetch E_PPC the last line number entered. +L0FA9: LD HL,(#5C49) ; fetch E_PPC the last line number entered. ; Note. may not exist and may follow program. - BIT 5,(IY+$37) ; test FLAGX - input mode ? + BIT 5,(IY+#37) ; test FLAGX - input mode ? JP NZ,L1097 ; jump forward to CLEAR-SP if not in editor. CALL L196E ; routine LINE-ADDR to find address of line @@ -4610,22 +4558,22 @@ L0FA9: LD HL,($5C49) ; fetch E_PPC the last line number entered. LD C,(HL) ; transfer to C INC HL ; next to high byte LD B,(HL) ; transfer to B. - LD HL,$000A ; an overhead of ten bytes + LD HL,#000A ; an overhead of ten bytes ADD HL,BC ; is added to length. LD B,H ; transfer adjusted value LD C,L ; to BC register. CALL L1F05 ; routine TEST-ROOM checks free memory. CALL L1097 ; routine CLEAR-SP clears editing area. - LD HL,($5C51) ; address CURCHL + LD HL,(#5C51) ; address CURCHL EX (SP),HL ; swap with line address on stack PUSH HL ; save line address underneath - LD A,$FF ; select system channel 'R' + LD A,#FF ; select system channel 'R' CALL L1601 ; routine CHAN-OPEN opens it POP HL ; drop line address DEC HL ; make it point to first byte of line num. - DEC (IY+$0F) ; decrease E_PPC_lo to suppress line cursor. + DEC (IY+#0F) ; decrease E_PPC_lo to suppress line cursor. ; Note. ineffective when E_PPC is one ; greater than last line of program perhaps ; as a result of a delete. @@ -4633,14 +4581,14 @@ L0FA9: LD HL,($5C49) ; fetch E_PPC the last line number entered. CALL L1855 ; routine OUT-LINE outputs the BASIC line ; to the editing area. - INC (IY+$0F) ; restore E_PPC_lo to the previous value. - LD HL,($5C59) ; address E_LINE in editing area. + INC (IY+#0F) ; restore E_PPC_lo to the previous value. + LD HL,(#5C59) ; address E_LINE in editing area. INC HL ; advance INC HL ; past space INC HL ; and digit characters INC HL ; of line number. - LD ($5C5B),HL ; update K_CUR to address start of BASIC. + LD (#5C5B),HL ; update K_CUR to address start of BASIC. POP HL ; restore the address of CURCHL. CALL L1615 ; routine CHAN-FLAG sets flags for it. RET ; RETURN to ED-LOOP. @@ -4653,10 +4601,10 @@ L0FA9: LD HL,($5C49) ; fetch E_PPC the last line number entered. ; In input mode this key can be used as an alternative to entering STOP. ;; ED-DOWN -L0FF3: BIT 5,(IY+$37) ; test FLAGX - Input Mode ? +L0FF3: BIT 5,(IY+#37) ; test FLAGX - Input Mode ? JR NZ,L1001 ; skip to ED-STOP if so - LD HL,$5C49 ; address E_PPC - 'current line' + LD HL,#5C49 ; address E_PPC - 'current line' CALL L190F ; routine LN-FETCH fetches number of next ; line or same if at end of program. JR L106E ; forward to ED-LIST to produce an @@ -4665,7 +4613,7 @@ L0FF3: BIT 5,(IY+$37) ; test FLAGX - Input Mode ? ; --- ;; ED-STOP -L1001: LD (IY+$00),$10 ; set ERR_NR to 'STOP in INPUT' code +L1001: LD (IY+#00),#10 ; set ERR_NR to 'STOP in INPUT' code JR L1024 ; forward to ED-ENTER to produce error. ; ------------------- @@ -4687,13 +4635,13 @@ L1007: CALL L1031 ; routine ED-EDGE moves left if possible ;; ED-RIGHT L100C: LD A,(HL) ; fetch addressed character. - CP $0D ; is it carriage return ? + CP #0D ; is it carriage return ? RET Z ; return if so to ED-LOOP INC HL ; address next character ;; ED-CUR -L1011: LD ($5C5B),HL ; update K_CUR system variable +L1011: LD (#5C5B),HL ; update K_CUR system variable RET ; return to ED-LOOP ; -------------- @@ -4707,7 +4655,7 @@ L1011: LD ($5C5B),HL ; update K_CUR system variable ;; ED-DELETE L1015: CALL L1031 ; routine ED-EDGE moves cursor to left. - LD BC,$0001 ; of character to be deleted. + LD BC,#0001 ; of character to be deleted. JP L19E8 ; to RECLAIM-2 reclaim the character. ; ------------------------------------------ @@ -4735,8 +4683,8 @@ L1024: POP HL ; discard address ED-LOOP ;; ED-END L1026: POP HL ; the previous value of ERR_SP - LD ($5C3D),HL ; is restored to ERR_SP system variable - BIT 7,(IY+$00) ; is ERR_NR $FF (= 'OK') ? + LD (#5C3D),HL ; is restored to ERR_SP system variable + BIT 7,(IY+#00) ; is ERR_NR #FF (= 'OK') ? RET NZ ; return if so LD SP,HL ; else put error routine on stack @@ -4777,8 +4725,8 @@ L103E: LD H,D ; transfer DE - leftmost pointer INC HL ; address next leftmost character to ; advance position each time. LD A,(DE) ; pick up previous in A - AND $F0 ; lose the low bits - CP $10 ; is it INK to TAB $10-$1F ? + AND #F0 ; lose the low bits + CP #10 ; is it INK to TAB #10-#1F ? ; that is, is it followed by a parameter ? JR NZ,L1051 ; to ED-EDGE-2 if not ; HL has been incremented once @@ -4790,8 +4738,8 @@ L103E: LD H,D ; transfer DE - leftmost pointer ; The test will always fail and the jump to ED-EDGE-2 will be taken. LD A,(DE) ; reload leftmost character - SUB $17 ; decimal 23 ('tab') - ADC A,$00 ; will be 0 for 'tab' and 'at'. + SUB #17 ; decimal 23 ('tab') + ADC A,#00 ; will be 0 for 'tab' and 'at'. JR NZ,L1051 ; forward to ED-EDGE-2 if not ; HL has been incremented twice @@ -4819,14 +4767,14 @@ L1051: AND A ; prepare for true subtraction ; This has no alternative use in input mode. ;; ED-UP -L1059: BIT 5,(IY+$37) ; test FLAGX - input mode ? +L1059: BIT 5,(IY+#37) ; test FLAGX - input mode ? RET NZ ; return if not in editor - to ED-LOOP. - LD HL,($5C49) ; get current line from E_PPC + LD HL,(#5C49) ; get current line from E_PPC CALL L196E ; routine LINE-ADDR gets address EX DE,HL ; and previous in DE CALL L1695 ; routine LINE-NO gets prev line number - LD HL,$5C4A ; set HL to E_PPC_hi as next routine stores + LD HL,#5C4A ; set HL to E_PPC_hi as next routine stores ; top first. CALL L191C ; routine LN-STORE loads DE value to HL ; high byte first - E_PPC_lo takes E @@ -4836,7 +4784,7 @@ L1059: BIT 5,(IY+$37) ; test FLAGX - input mode ? ;; ED-LIST L106E: CALL L1795 ; routine AUTO-LIST lists to upper screen ; including adjusted current line. - LD A,$00 ; select lower screen again + LD A,#00 ; select lower screen again JP L1601 ; exit via CHAN-OPEN to ED-LOOP ; -------------------------------- @@ -4854,11 +4802,11 @@ L106E: CALL L1795 ; routine AUTO-LIST lists to upper screen ; You can get round the missing chr$ 6 handler by sending multiple print ; items separated by a newline '. -; chr$14 would have the same functionality. +; chr#14 would have the same functionality. ; This is chr$ 14. ;; ED-SYMBOL -L1076: BIT 7,(IY+$37) ; test FLAGX - is this INPUT LINE ? +L1076: BIT 7,(IY+#37) ; test FLAGX - is this INPUT LINE ? JR Z,L1024 ; back to ED-ENTER if not to treat as if ; enter had been pressed. ; else continue and add code to buffer. @@ -4876,16 +4824,16 @@ L107C: JP L0F81 ; jump back to ADD-CHAR ; points to the stack location holding address ED_ERROR. ;; ED-ERROR -L107F: BIT 4,(IY+$30) ; test FLAGS2 - is K channel in use ? +L107F: BIT 4,(IY+#30) ; test FLAGS2 - is K channel in use ? JR Z,L1026 ; back to ED-END if not. ; but as long as we're editing lines or inputting from the keyboard, then ; we've run out of memory so give a short rasp. - LD (IY+$00),$FF ; reset ERR_NR to 'OK'. - LD D,$00 ; prepare for beeper. - LD E,(IY-$02) ; use RASP value. - LD HL,$1A90 ; set a duration. + LD (IY+#00),#FF ; reset ERR_NR to 'OK'. + LD D,#00 ; prepare for beeper. + LD E,(IY-#02) ; use RASP value. + LD HL,#1A90 ; set a duration. CALL L03B5 ; routine BEEPER emits a warning rasp. JP L0F30 ; to ED-AGAIN to re-stack address of ; this routine and make ERR_SP point to it. @@ -4907,8 +4855,8 @@ L1097: PUSH HL ; preserve HL ; if in input HL = STKBOT, DE = WORKSP DEC HL ; adjust CALL L19E5 ; routine RECLAIM-1 reclaims space - LD ($5C5B),HL ; set K_CUR to start of empty area - LD (IY+$07),$00 ; set MODE to 'KLC' + LD (#5C5B),HL ; set K_CUR to start of empty area + LD (IY+#07),#00 ; set MODE to 'KLC' POP HL ; restore HL. RET ; return. @@ -4919,41 +4867,41 @@ L1097: PUSH HL ; preserve HL ; channel 'K'. ;; KEY-INPUT -L10A8: BIT 3,(IY+$02) ; test TV_FLAG - has a key been pressed in +L10A8: BIT 3,(IY+#02) ; test TV_FLAG - has a key been pressed in ; editor ? CALL NZ,L111D ; routine ED-COPY if so to reprint the lower ; screen at every keystroke. AND A ; clear carry - required exit condition. - BIT 5,(IY+$01) ; test FLAGS - has a new key been pressed ? + BIT 5,(IY+#01) ; test FLAGS - has a new key been pressed ? RET Z ; return if not. - LD A,($5C08) ; system variable LASTK will hold last key - + LD A,(#5C08) ; system variable LASTK will hold last key - ; from the interrupt routine. - RES 5,(IY+$01) ; update FLAGS - reset the new key flag. + RES 5,(IY+#01) ; update FLAGS - reset the new key flag. PUSH AF ; save the input character. - BIT 5,(IY+$02) ; test TV_FLAG - clear lower screen ? + BIT 5,(IY+#02) ; test TV_FLAG - clear lower screen ? CALL NZ,L0D6E ; routine CLS-LOWER if so. POP AF ; restore the character code. - CP $20 ; if space or higher then + CP #20 ; if space or higher then JR NC,L111B ; forward to KEY-DONE2 and return with carry ; set to signal key-found. - CP $10 ; with 16d INK and higher skip + CP #10 ; with 16d INK and higher skip JR NC,L10FA ; forward to KEY-CONTR. - CP $06 ; for 6 - 15d + CP #06 ; for 6 - 15d JR NC,L10DB ; skip forward to KEY-M-CL to handle Modes ; and CapsLock. ; that only leaves 0-5, the flash bright inverse switches. LD B,A ; save character in B - AND $01 ; isolate the embedded parameter (0/1). + AND #01 ; isolate the embedded parameter (0/1). LD C,A ; and store in C LD A,B ; re-fetch copy (0-5) RRA ; halve it 0, 1 or 2. - ADD A,$12 ; add 18d gives 'flash', 'bright' + ADD A,#12 ; add 18d gives 'flash', 'bright' ; and 'inverse'. JR L1105 ; forward to KEY-DATA with the ; parameter (0/1) in C. @@ -4965,8 +4913,8 @@ L10A8: BIT 3,(IY+$02) ; test TV_FLAG - has a key been pressed in ;; KEY-M-CL L10DB: JR NZ,L10E6 ; forward to KEY-MODE if not 06 (capslock) - LD HL,$5C6A ; point to FLAGS2 - LD A,$08 ; value 00000100 + LD HL,#5C6A ; point to FLAGS2 + LD A,#08 ; value 00000100 XOR (HL) ; toggle BIT 2 of FLAGS2 the capslock bit LD (HL),A ; and store result in FLAGS2 again. JR L10F4 ; forward to KEY-FLAG to signal no-key. @@ -4974,25 +4922,25 @@ L10DB: JR NZ,L10E6 ; forward to KEY-MODE if not 06 (capslock) ; --- ;; KEY-MODE -L10E6: CP $0E ; compare with chr 14d +L10E6: CP #0E ; compare with chr 14d RET C ; return with carry set "key found" for ; codes 7 - 13d leaving 14d and 15d ; which are converted to mode codes. - SUB $0D ; subtract 13d leaving 1 and 2 + SUB #0D ; subtract 13d leaving 1 and 2 ; 1 is 'E' mode, 2 is 'G' mode. - LD HL,$5C41 ; address the MODE system variable. + LD HL,#5C41 ; address the MODE system variable. CP (HL) ; compare with existing value before LD (HL),A ; inserting the new value. JR NZ,L10F4 ; forward to KEY-FLAG if it has changed. - LD (HL),$00 ; else make MODE zero - KLC mode + LD (HL),#00 ; else make MODE zero - KLC mode ; Note. while in Extended/Graphics mode, ; the Extended Mode/Graphics key is pressed ; again to get out. ;; KEY-FLAG -L10F4: SET 3,(IY+$02) ; update TV_FLAG - show key state has changed +L10F4: SET 3,(IY+#02) ; update TV_FLAG - show key state has changed CP A ; clear carry and reset zero flags - ; no actual key returned. RET ; make the return. @@ -5003,9 +4951,9 @@ L10F4: SET 3,(IY+$02) ; update TV_FLAG - show key state has changed ;; KEY-CONTR L10FA: LD B,A ; make a copy of character. - AND $07 ; mask to leave bits 0-7 + AND #07 ; mask to leave bits 0-7 LD C,A ; and store in C. - LD A,$10 ; initialize to 16d - INK. + LD A,#10 ; initialize to 16d - INK. BIT 3,B ; was it paper ? JR NZ,L1105 ; forward to KEY-DATA with INK 16d and ; colour in C. @@ -5013,7 +4961,7 @@ L10FA: LD B,A ; make a copy of character. INC A ; else change from INK to PAPER (17d) if so. ;; KEY-DATA -L1105: LD (IY-$2D),C ; put the colour (0-7)/state(0/1) in KDATA +L1105: LD (IY-#2D),C ; put the colour (0-7)/state(0/1) in KDATA LD DE,L110D ; address: KEY-NEXT will be next input stream JR L1113 ; forward to KEY-CHAN to change it ... @@ -5022,13 +4970,13 @@ L1105: LD (IY-$2D),C ; put the colour (0-7)/state(0/1) in KDATA ; ... so that INPUT_AD directs control to here at next call to WAIT-KEY ;; KEY-NEXT -L110D: LD A,($5C0D) ; pick up the parameter stored in KDATA. +L110D: LD A,(#5C0D) ; pick up the parameter stored in KDATA. LD DE,L10A8 ; address: KEY-INPUT will be next input stream ; continue to restore default channel and ; make a return with the control code. ;; KEY-CHAN -L1113: LD HL,($5C4F) ; address start of CHANNELS area using CHANS +L1113: LD HL,(#5C4F) ; address start of CHANNELS area using CHANS ; system variable. ; Note. One might have expected CURCHL to ; have been used. @@ -5054,19 +5002,19 @@ L111B: SCF ; set carry flag to show a key has been found ;; ED-COPY L111D: CALL L0D4D ; routine TEMPS sets temporary attributes. - RES 3,(IY+$02) ; update TV_FLAG - signal no change in mode - RES 5,(IY+$02) ; update TV_FLAG - signal don't clear lower + RES 3,(IY+#02) ; update TV_FLAG - signal no change in mode + RES 5,(IY+#02) ; update TV_FLAG - signal don't clear lower ; screen. - LD HL,($5C8A) ; fetch SPOSNL + LD HL,(#5C8A) ; fetch SPOSNL PUSH HL ; and save on stack. - LD HL,($5C3D) ; fetch ERR_SP + LD HL,(#5C3D) ; fetch ERR_SP PUSH HL ; and save also LD HL,L1167 ; address: ED-FULL PUSH HL ; is pushed as the error routine - LD ($5C3D),SP ; and ERR_SP made to point to it. + LD (#5C3D),SP ; and ERR_SP made to point to it. - LD HL,($5C82) ; fetch ECHO_E + LD HL,(#5C82) ; fetch ECHO_E PUSH HL ; and push also SCF ; set carry flag to control SET-DE @@ -5082,7 +5030,7 @@ L111D: CALL L0D4D ; routine TEMPS sets temporary attributes. CALL L18E1 ; routine OUT-CURS considers a ; terminating cursor. - LD HL,($5C8A) ; fetch updated SPOSNL + LD HL,(#5C8A) ; fetch updated SPOSNL EX (SP),HL ; exchange with ECHO_E on stack EX DE,HL ; transfer ECHO_E to DE CALL L0D4D ; routine TEMPS to re-set attributes @@ -5092,23 +5040,23 @@ L111D: CALL L0D4D ; routine TEMPS sets temporary attributes. ; text from a previous print may follow this line and requires blanking. ;; ED-BLANK -L1150: LD A,($5C8B) ; fetch SPOSNL_hi is current line +L1150: LD A,(#5C8B) ; fetch SPOSNL_hi is current line SUB D ; compare with old JR C,L117C ; forward to ED-C-DONE if no blanking JR NZ,L115E ; forward to ED-SPACES if line has changed LD A,E ; old column to A - SUB (IY+$50) ; subtract new in SPOSNL_lo + SUB (IY+#50) ; subtract new in SPOSNL_lo JR NC,L117C ; forward to ED-C-DONE if no backfilling. ;; ED-SPACES -L115E: LD A,$20 ; prepare a space. +L115E: LD A,#20 ; prepare a space. PUSH DE ; save old line/column. CALL L09F4 ; routine PRINT-OUT prints a space over ; any text from previous print. ; Note. Since the blanking only occurs when - ; using $09F4 to print to the lower screen, + ; using #09F4 to print to the lower screen, ; there is no need to vector via a RST 10 ; and we can use this alternate set. POP DE ; restore the old line column. @@ -5124,12 +5072,12 @@ L115E: LD A,$20 ; prepare a space. ; that this is perhaps not the best idea you've had that day. ;; ED-FULL -L1167: LD D,$00 ; prepare to moan. - LD E,(IY-$02) ; fetch RASP value. - LD HL,$1A90 ; set duration. +L1167: LD D,#00 ; prepare to moan. + LD E,(IY-#02) ; fetch RASP value. + LD HL,#1A90 ; set duration. CALL L03B5 ; routine BEEPER. - LD (IY+$00),$FF ; clear ERR_NR. - LD DE,($5C8A) ; fetch SPOSNL. + LD (IY+#00),#FF ; clear ERR_NR. + LD DE,(#5C8A) ; fetch SPOSNL. JR L117E ; forward to ED-C-END ; ------- @@ -5144,14 +5092,14 @@ L117C: POP DE ; fetch new line/column. ;; ED-C-END L117E: POP HL ; restore the old value of ERR_SP. - LD ($5C3D),HL ; update the system variable ERR_SP + LD (#5C3D),HL ; update the system variable ERR_SP POP BC ; old value of SPOSN_L PUSH DE ; save new value CALL L0DD9 ; routine CL-SET and PO-STORE ; update ECHO_E and SPOSN_L from BC POP HL ; restore new value - LD ($5C82),HL ; and update ECHO_E - LD (IY+$26),$00 ; make error pointer X_PTR_hi out of bounds + LD (#5C82),HL ; and update ECHO_E + LD (IY+#26),#00 ; make error pointer X_PTR_hi out of bounds RET ; return ; ----------------------------------------------- @@ -5163,7 +5111,7 @@ L117E: POP HL ; restore the old value of ERR_SP. ; this routine is called once ;; SET-HL -L1190: LD HL,($5C61) ; fetch WORKSP to HL. +L1190: LD HL,(#5C61) ; fetch WORKSP to HL. DEC HL ; point to last location of editing area. AND A ; clear carry to limit exit points to first ; or last. @@ -5171,14 +5119,14 @@ L1190: LD HL,($5C61) ; fetch WORKSP to HL. ; this routine is called with carry set and exits at a conditional return. ;; SET-DE -L1195: LD DE,($5C59) ; fetch E_LINE to DE - BIT 5,(IY+$37) ; test FLAGX - Input Mode ? +L1195: LD DE,(#5C59) ; fetch E_LINE to DE + BIT 5,(IY+#37) ; test FLAGX - Input Mode ? RET Z ; return now if in editing mode - LD DE,($5C61) ; fetch WORKSP to DE + LD DE,(#5C61) ; fetch WORKSP to DE RET C ; return if carry set ( entry = set-de) - LD HL,($5C63) ; fetch STKBOT to HL as well + LD HL,(#5C63) ; fetch STKBOT to HL as well RET ; and return (entry = set-hl (in input)) ; ------------------------------- @@ -5193,12 +5141,12 @@ L1195: LD DE,($5C59) ; fetch E_LINE to DE ;; REMOVE-FP L11A7: LD A,(HL) ; fetch character - CP $0E ; is it the number marker ? - LD BC,$0006 ; prepare for six bytes - CALL Z,L19E8 ; routine RECLAIM-2 reclaims space if $0E + CP #0E ; is it the number marker ? + LD BC,#0006 ; prepare for six bytes + CALL Z,L19E8 ; routine RECLAIM-2 reclaims space if #0E LD A,(HL) ; reload next (or same) character INC HL ; and advance address - CP $0D ; end of line or input buffer ? + CP #0D ; end of line or input buffer ? JR NZ,L11A7 ; back to REMOVE-FP until entire line done. RET ; return @@ -5216,11 +5164,11 @@ L11A7: LD A,(HL) ; fetch character ; | ROM | File | File | Buffer | Variables | ; +---------+-----------+------------+--------------+-------------+-- ; ^ ^ ^ ^ ^ ^ -; $0000 $4000 $5800 $5B00 $5C00 $5CB6 = CHANS +; #0000 #4000 #5800 #5B00 #5C00 #5CB6 = CHANS ; ; ; --+----------+---+---------+-----------+---+------------+--+---+-- -; | Channel |$80| BASIC | Variables |$80| Edit Line |NL|$80| +; | Channel |#80| BASIC | Variables |#80| Edit Line |NL|#80| ; | Info | | Program | Area | | or Command | | | ; --+----------+---+---------+-----------+---+------------+--+---+-- ; ^ ^ ^ ^ ^ @@ -5229,7 +5177,7 @@ L11A7: LD A,(HL) ; fetch character ; ; ---5--> <---2--- <--3--- ; --+-------+--+------------+-------+-------+---------+-------+-+---+------+ -; | INPUT |NL| Temporary | Calc. | Spare | Machine | GOSUB |?|$3E| UDGs | +; | INPUT |NL| Temporary | Calc. | Spare | Machine | GOSUB |?|#3E| UDGs | ; | data | | Work Space | Stack | | Stack | Stack | | | | ; --+-------+--+------------+-------+-------+---------+-------+-+---+------+ ; ^ ^ ^ ^ ^ ^ ^ @@ -5250,12 +5198,12 @@ L11A7: LD A,(HL) ; fetch character ;; NEW L11B7: DI ; disable interrupts - machine stack will be ; cleared. - LD A,$FF ; flag coming from NEW. - LD DE,($5CB2) ; fetch RAMTOP as top value. + LD A,#FF ; flag coming from NEW. + LD DE,(#5CB2) ; fetch RAMTOP as top value. EXX ; switch in alternate set. - LD BC,($5CB4) ; fetch P-RAMT differs on 16K/48K machines. - LD DE,($5C38) ; fetch RASP/PIP. - LD HL,($5C7B) ; fetch UDG differs on 16K/48K machines. + LD BC,(#5CB4) ; fetch P-RAMT differs on 16K/48K machines. + LD DE,(#5C38) ; fetch RASP/PIP. + LD HL,(#5C7B) ; fetch UDG differs on 16K/48K machines. EXX ; switch back to main set and continue into... ; --------------------------- @@ -5268,12 +5216,12 @@ L11B7: DI ; disable interrupts - machine stack will be ;; START-NEW L11CB: LD B,A ; save the flag for later branching. - LD A,$07 ; select a white border - OUT ($FE),A ; and set it now. + LD A,#07 ; select a white border + OUT (#FE),A ; and set it now. - LD A,$3F ; load accumulator with last page in ROM. + LD A,#3F ; load accumulator with last page in ROM. LD I,A ; set the I register - this remains constant - ; and can't be in range $40 - $7F as 'snow' + ; and can't be in range #40 - #7F as 'snow' ; appears on the screen. NOP ; these seem unnecessary. NOP ; @@ -5287,7 +5235,7 @@ L11CB: LD B,A ; save the flag for later branching. ; ------------ ; Typically a Spectrum will have 16K or 48K of Ram and this code will ; test it all till it finds an unpopulated location or, less likely, a -; faulty location. Usually it stops when it reaches the top $FFFF or +; faulty location. Usually it stops when it reaches the top #FFFF or ; in the case of NEW the supplied top value. The entire screen turns ; black with sometimes red stripes on black paper visible. @@ -5296,9 +5244,9 @@ L11DA: LD H,D ; transfer the top value to LD L,E ; the HL register pair. ;; RAM-FILL -L11DC: LD (HL),$02 ; load with 2 - red ink on black paper +L11DC: LD (HL),#02 ; load with 2 - red ink on black paper DEC HL ; next lower - CP H ; have we reached ROM - $3F ? + CP H ; have we reached ROM - #3F ? JR NZ,L11DC ; back to RAM-FILL if not. ;; RAM-READ @@ -5319,118 +5267,118 @@ L11E2: AND A ; clear carry - prepare to subtract L11EF: DEC HL ; step back to last valid location. EXX ; regardless of state, set up possibly ; stored system variables in case from NEW. - LD ($5CB4),BC ; insert P-RAMT. - LD ($5C38),DE ; insert RASP/PIP. - LD ($5C7B),HL ; insert UDG. + LD (#5CB4),BC ; insert P-RAMT. + LD (#5C38),DE ; insert RASP/PIP. + LD (#5C7B),HL ; insert UDG. EXX ; switch in main set. INC B ; now test if we arrived here from NEW. JR Z,L1219 ; forward to RAM-SET if we did. ; this section applies to START only. - LD ($5CB4),HL ; set P-RAMT to the highest working RAM + LD (#5CB4),HL ; set P-RAMT to the highest working RAM ; address. - LD DE,$3EAF ; address of last byte of 'U' bitmap in ROM. - LD BC,$00A8 ; there are 21 user defined graphics. + LD DE,#3EAF ; address of last byte of 'U' bitmap in ROM. + LD BC,#00A8 ; there are 21 user defined graphics. EX DE,HL ; switch pointers and make the UDGs a LDDR ; copy of the standard characters A - U. EX DE,HL ; switch the pointer to HL. INC HL ; update to start of 'A' in RAM. - LD ($5C7B),HL ; make UDG system variable address the first + LD (#5C7B),HL ; make UDG system variable address the first ; bitmap. DEC HL ; point at RAMTOP again. - LD BC,$0040 ; set the values of - LD ($5C38),BC ; the PIP and RASP system variables. + LD BC,#0040 ; set the values of + LD (#5C38),BC ; the PIP and RASP system variables. ; the NEW command path rejoins here. ;; RAM-SET -L1219: LD ($5CB2),HL ; set system variable RAMTOP to HL. +L1219: LD (#5CB2),HL ; set system variable RAMTOP to HL. - LD HL,$3C00 ; a strange place to set the pointer to the - LD ($5C36),HL ; character set, CHARS - as no printing yet. + LD HL,#3C00 ; a strange place to set the pointer to the + LD (#5C36),HL ; character set, CHARS - as no printing yet. - LD HL,($5CB2) ; fetch RAMTOP to HL again as we've lost it. + LD HL,(#5CB2) ; fetch RAMTOP to HL again as we've lost it. - LD (HL),$3E ; top of user ram holds GOSUB end marker + LD (HL),#3E ; top of user ram holds GOSUB end marker ; an impossible line number - see RETURN. - ; no significance in the number $3E. It has + ; no significance in the number #3E. It has ; been traditional since the ZX80. DEC HL ; followed by empty byte (not important). LD SP,HL ; set up the machine stack pointer. DEC HL ; DEC HL ; - LD ($5C3D),HL ; ERR_SP is where the error pointer is + LD (#5C3D),HL ; ERR_SP is where the error pointer is ; at moment empty - will take address MAIN-4 ; at the call preceding that address, ; although interrupts and calls will make use ; of this location in meantime. IM 1 ; select interrupt mode 1. - LD IY,$5C3A ; set IY to ERR_NR. IY can reach all standard + LD IY,#5C3A ; set IY to ERR_NR. IY can reach all standard ; system variables but shadow ROM system ; variables will be mostly out of range. EI ; enable interrupts now that we have a stack. - LD HL,$5CB6 ; the address of the channels - initially + LD HL,#5CB6 ; the address of the channels - initially ; following system variables. - LD ($5C4F),HL ; set the CHANS system variable. + LD (#5C4F),HL ; set the CHANS system variable. LD DE,L15AF ; address: init-chan in ROM. - LD BC,$0015 ; there are 21 bytes of initial data in ROM. + LD BC,#0015 ; there are 21 bytes of initial data in ROM. EX DE,HL ; swap the pointers. LDIR ; copy the bytes to RAM. EX DE,HL ; swap pointers. HL points to program area. DEC HL ; decrement address. - LD ($5C57),HL ; set DATADD to location before program area. + LD (#5C57),HL ; set DATADD to location before program area. INC HL ; increment again. - LD ($5C53),HL ; set PROG the location where BASIC starts. - LD ($5C4B),HL ; set VARS to same location with a - LD (HL),$80 ; variables end-marker. + LD (#5C53),HL ; set PROG the location where BASIC starts. + LD (#5C4B),HL ; set VARS to same location with a + LD (HL),#80 ; variables end-marker. INC HL ; advance address. - LD ($5C59),HL ; set E_LINE, where the edit line + LD (#5C59),HL ; set E_LINE, where the edit line ; will be created. ; Note. it is not strictly necessary to ; execute the next fifteen bytes of code ; as this will be done by the call to SET-MIN. ; -- - LD (HL),$0D ; initially just has a carriage return + LD (HL),#0D ; initially just has a carriage return INC HL ; followed by - LD (HL),$80 ; an end-marker. + LD (HL),#80 ; an end-marker. INC HL ; address the next location. - LD ($5C61),HL ; set WORKSP - empty workspace. - LD ($5C63),HL ; set STKBOT - bottom of the empty stack. - LD ($5C65),HL ; set STKEND to the end of the empty stack. + LD (#5C61),HL ; set WORKSP - empty workspace. + LD (#5C63),HL ; set STKBOT - bottom of the empty stack. + LD (#5C65),HL ; set STKEND to the end of the empty stack. ; -- - LD A,$38 ; the colour system is set to white paper, + LD A,#38 ; the colour system is set to white paper, ; black ink, no flash or bright. - LD ($5C8D),A ; set ATTR_P permanent colour attributes. - LD ($5C8F),A ; set ATTR_T temporary colour attributes. - LD ($5C48),A ; set BORDCR the border colour/lower screen + LD (#5C8D),A ; set ATTR_P permanent colour attributes. + LD (#5C8F),A ; set ATTR_T temporary colour attributes. + LD (#5C48),A ; set BORDCR the border colour/lower screen ; attributes. - LD HL,$0523 ; The keyboard repeat and delay values - LD ($5C09),HL ; are loaded to REPDEL and REPPER. + LD HL,#0523 ; The keyboard repeat and delay values + LD (#5C09),HL ; are loaded to REPDEL and REPPER. - DEC (IY-$3A) ; set KSTATE-0 to $FF. - DEC (IY-$36) ; set KSTATE-4 to $FF. + DEC (IY-#3A) ; set KSTATE-0 to #FF. + DEC (IY-#36) ; set KSTATE-4 to #FF. ; thereby marking both available. LD HL,L15C6 ; set source to ROM Address: init-strm - LD DE,$5C10 ; set destination to system variable STRMS-FD - LD BC,$000E ; copy the 14 bytes of initial 7 streams data + LD DE,#5C10 ; set destination to system variable STRMS-FD + LD BC,#000E ; copy the 14 bytes of initial 7 streams data LDIR ; from ROM to RAM. - SET 1,(IY+$01) ; update FLAGS - signal printer in use. + SET 1,(IY+#01) ; update FLAGS - signal printer in use. CALL L0EDF ; call routine CLEAR-PRB to initialize system ; variables associated with printer. - LD (IY+$31),$02 ; set DF_SZ the lower screen display size to + LD (IY+#31),#02 ; set DF_SZ the lower screen display size to ; two lines CALL L0D6B ; call routine CLS to set up system ; variables associated with screen and clear @@ -5440,7 +5388,7 @@ L1219: LD ($5CB2),HL ; set system variable RAMTOP to HL. CALL L0C0A ; routine PO-MSG puts ; '(c) 1982 Sinclair Research Ltd' ; at bottom of display. - SET 5,(IY+$02) ; update TV_FLAG - signal lower screen will + SET 5,(IY+#02) ; update TV_FLAG - signal lower screen will ; require clearing. JR L12A9 ; forward to MAIN-1 @@ -5452,7 +5400,7 @@ L1219: LD ($5CB2),HL ; set system variable RAMTOP to HL. ; ;; MAIN-EXEC -L12A2: LD (IY+$31),$02 ; set DF_SZ lower screen display file +L12A2: LD (IY+#31),#02 ; set DF_SZ lower screen display file ; size to 2 lines. CALL L1795 ; routine AUTO-LIST @@ -5460,7 +5408,7 @@ L12A2: LD (IY+$31),$02 ; set DF_SZ lower screen display file L12A9: CALL L16B0 ; routine SET-MIN clears work areas. ;; MAIN-2 -L12AC: LD A,$00 ; select channel 'K' the keyboard +L12AC: LD A,#00 ; select channel 'K' the keyboard CALL L1601 ; routine CHAN-OPEN opens it CALL L0F2C ; routine EDITOR is called. ; Note the above routine is where the Spectrum @@ -5468,21 +5416,21 @@ L12AC: LD A,$00 ; select channel 'K' the keyboard ; most common input at this stage ; is LOAD "". CALL L1B17 ; routine LINE-SCAN scans the input. - BIT 7,(IY+$00) ; test ERR_NR - will be $FF if syntax + BIT 7,(IY+#00) ; test ERR_NR - will be #FF if syntax ; is correct. JR NZ,L12CF ; forward, if correct, to MAIN-3. ; - BIT 4,(IY+$30) ; test FLAGS2 - K channel in use ? + BIT 4,(IY+#30) ; test FLAGS2 - K channel in use ? JR Z,L1303 ; forward to MAIN-4 if not. ; - LD HL,($5C59) ; an editing error so address E_LINE. + LD HL,(#5C59) ; an editing error so address E_LINE. CALL L11A7 ; routine REMOVE-FP removes the hidden ; floating-point forms. - LD (IY+$00),$FF ; system variable ERR_NR is reset to 'OK'. + LD (IY+#00),#FF ; system variable ERR_NR is reset to 'OK'. JR L12AC ; back to MAIN-2 to allow user to correct. ; --- @@ -5490,8 +5438,8 @@ L12AC: LD A,$00 ; select channel 'K' the keyboard ; the branch was here if syntax has passed test. ;; MAIN-3 -L12CF: LD HL,($5C59) ; fetch the edit line address from E_LINE. - LD ($5C5D),HL ; system variable CH_ADD is set to first +L12CF: LD HL,(#5C59) ; fetch the edit line address from E_LINE. + LD (#5C5D),HL ; system variable CH_ADD is set to first ; character of edit line. ; Note. the above two instructions are a little ; inadequate. @@ -5510,21 +5458,21 @@ L12CF: LD HL,($5C59) ; fetch the edit line address from E_LINE. ; Has the user just pressed the ENTER key ? RST 18H ; GET-CHAR gets character addressed by CH_ADD. - CP $0D ; is it a carriage return ? + CP #0D ; is it a carriage return ? JR Z,L12A2 ; back to MAIN-EXEC if so for an automatic ; listing. ; this must be a direct command. - BIT 0,(IY+$30) ; test FLAGS2 - clear the main screen ? + BIT 0,(IY+#30) ; test FLAGS2 - clear the main screen ? CALL NZ,L0DAF ; routine CL-ALL, if so, e.g. after listing. CALL L0D6E ; routine CLS-LOWER anyway. - LD A,$19 ; compute scroll count to 25 minus - SUB (IY+$4F) ; value of S_POSN_hi. - LD ($5C8C),A ; update SCR_CT system variable. - SET 7,(IY+$01) ; update FLAGS - signal running program. - LD (IY+$00),$FF ; set ERR_NR to 'OK'. - LD (IY+$0A),$01 ; set NSPPC to one for first statement. + LD A,#19 ; compute scroll count to 25 minus + SUB (IY+#4F) ; value of S_POSN_hi. + LD (#5C8C),A ; update SCR_CT system variable. + SET 7,(IY+#01) ; update FLAGS - signal running program. + LD (IY+#00),#FF ; set ERR_NR to 'OK'. + LD (IY+#0A),#01 ; set NSPPC to one for first statement. CALL L1B8A ; call routine LINE-RUN to run the line. ; sysvar ERR_SP therefore addresses MAIN-4 @@ -5537,13 +5485,13 @@ L12CF: LD HL,($5C59) ; fetch the edit line address from E_LINE. ;; MAIN-4 L1303: HALT ; wait for interrupt. - RES 5,(IY+$01) ; update FLAGS - signal no new key. - BIT 1,(IY+$30) ; test FLAGS2 - is printer buffer clear ? + RES 5,(IY+#01) ; update FLAGS - signal no new key. + BIT 1,(IY+#30) ; test FLAGS2 - is printer buffer clear ? CALL NZ,L0ECD ; call routine COPY-BUFF if not. ; Note. the programmer has neglected ; to set bit 1 of FLAGS first. - LD A,($5C3A) ; fetch ERR_NR + LD A,(#5C3A) ; fetch ERR_NR INC A ; increment to give true code. ; Now deal with a runtime error as opposed to an editing error. @@ -5552,34 +5500,34 @@ L1303: HALT ; wait for interrupt. ;; MAIN-G L1313: PUSH AF ; save the error number. - LD HL,$0000 ; prepare to clear some system variables. - LD (IY+$37),H ; clear all the bits of FLAGX. - LD (IY+$26),H ; blank X_PTR_hi to suppress error marker. - LD ($5C0B),HL ; blank DEFADD to signal that no defined + LD HL,#0000 ; prepare to clear some system variables. + LD (IY+#37),H ; clear all the bits of FLAGX. + LD (IY+#26),H ; blank X_PTR_hi to suppress error marker. + LD (#5C0B),HL ; blank DEFADD to signal that no defined ; function is currently being evaluated. - LD HL,$0001 ; explicit - inc hl would do. - LD ($5C16),HL ; ensure STRMS-00 is keyboard. + LD HL,#0001 ; explicit - inc hl would do. + LD (#5C16),HL ; ensure STRMS-00 is keyboard. CALL L16B0 ; routine SET-MIN clears workspace etc. - RES 5,(IY+$37) ; update FLAGX - signal in EDIT not INPUT mode. + RES 5,(IY+#37) ; update FLAGX - signal in EDIT not INPUT mode. ; Note. all the bits were reset earlier. CALL L0D6E ; call routine CLS-LOWER. - SET 5,(IY+$02) ; update TV_FLAG - signal lower screen + SET 5,(IY+#02) ; update TV_FLAG - signal lower screen ; requires clearing. POP AF ; bring back the error number LD B,A ; and make a copy in B. - CP $0A ; is it a print-ready digit ? + CP #0A ; is it a print-ready digit ? JR C,L133C ; forward to MAIN-5 if so. - ADD A,$07 ; add ASCII offset to letters. + ADD A,#07 ; add ASCII offset to letters. ;; MAIN-5 L133C: CALL L15EF ; call routine OUT-CODE to print the code. - LD A,$20 ; followed by a space. + LD A,#20 ; followed by a space. RST 10H ; PRINT-A LD A,B ; fetch stored report code. @@ -5590,40 +5538,40 @@ X1349: CALL L3B3B ; Spectrum 128 patch NOP L134D: CALL L0C0A ; routine PO-MSG prints them although it would - ; be more succinct to use RST $10. + ; be more succinct to use RST #10. - LD BC,($5C45) ; fetch PPC the current line number. + LD BC,(#5C45) ; fetch PPC the current line number. CALL L1A1B ; routine OUT-NUM-1 will print that - LD A,$3A ; then a ':'. + LD A,#3A ; then a ':'. RST 10H ; PRINT-A - LD C,(IY+$0D) ; then SUBPPC for statement - LD B,$00 ; limited to 127 + LD C,(IY+#0D) ; then SUBPPC for statement + LD B,#00 ; limited to 127 CALL L1A1B ; routine OUT-NUM-1 CALL L1097 ; routine CLEAR-SP clears editing area. ; which probably contained 'RUN'. - LD A,($5C3A) ; fetch ERR_NR again - INC A ; test for no error originally $FF. + LD A,(#5C3A) ; fetch ERR_NR again + INC A ; test for no error originally #FF. JR Z,L1386 ; forward to MAIN-9 if no error. - CP $09 ; is code Report 9 STOP ? + CP #09 ; is code Report 9 STOP ? JR Z,L1373 ; forward to MAIN-6 if so - CP $15 ; is code Report L Break ? + CP #15 ; is code Report L Break ? JR NZ,L1376 ; forward to MAIN-7 if not ; Stop or Break was encountered so consider CONTINUE. ;; MAIN-6 -L1373: INC (IY+$0D) ; increment SUBPPC to next statement. +L1373: INC (IY+#0D) ; increment SUBPPC to next statement. ;; MAIN-7 -L1376: LD BC,$0003 ; prepare to copy 3 system variables to - LD DE,$5C70 ; address OSPPC - statement for CONTINUE. +L1376: LD BC,#0003 ; prepare to copy 3 system variables to + LD DE,#5C70 ; address OSPPC - statement for CONTINUE. ; also updating OLDPPC line number below. - LD HL,$5C44 ; set source top to NSPPC next statement. + LD HL,#5C44 ; set source top to NSPPC next statement. BIT 7,(HL) ; did BREAK occur before the jump ? ; e.g. between GO TO and next statement. JR Z,L1384 ; skip forward to MAIN-8, if not, as setup @@ -5637,8 +5585,8 @@ L1384: LDDR ; copy PPC to OLDPPC and SUBPPC to OSPCC ; or NSPPC to OLDPPC and NEWPPC to OSPCC ;; MAIN-9 -L1386: LD (IY+$0A),$FF ; update NSPPC - signal 'no jump'. - RES 3,(IY+$01) ; update FLAGS - signal use 'K' mode for +L1386: LD (IY+#0A),#FF ; update NSPPC - signal 'no jump'. + RES 3,(IY+#01) ; update FLAGS - signal use 'K' mode for ; the first character in the editor and JP L12AC ; jump back to MAIN-2. @@ -5647,7 +5595,7 @@ L1386: LD (IY+$0A),$FF ; update NSPPC - signal 'no jump'. ; Canned report messages ; ---------------------- ; The Error reports with the last byte inverted. The first entry -; is a dummy entry. The last, which begins with $7F, the Spectrum +; is a dummy entry. The last, which begins with #7F, the Spectrum ; character for copyright symbol, is placed here for convenience ; as is the preceding comma and space. ; The report line must accommodate a 4-digit line number and a 3-digit @@ -5656,68 +5604,68 @@ L1386: LD (IY+$0A),$FF ; update NSPPC - signal 'no jump'. ; e.g. "B Integer out of range, 1000:127" ;; rpt-mesgs -L1391: DEFB $80 - DEFB 'O','K'+$80 ; 0 +L1391: DEFB #80 + DEFB 'O','K'+#80 ; 0 DEFM "NEXT without FO" - DEFB 'R'+$80 ; 1 + DEFB 'R'+#80 ; 1 DEFM "Variable not foun" - DEFB 'd'+$80 ; 2 + DEFB 'd'+#80 ; 2 DEFM "Subscript wron" - DEFB 'g'+$80 ; 3 + DEFB 'g'+#80 ; 3 DEFM "Out of memor" - DEFB 'y'+$80 ; 4 + DEFB 'y'+#80 ; 4 DEFM "Out of scree" - DEFB 'n'+$80 ; 5 + DEFB 'n'+#80 ; 5 DEFM "Number too bi" - DEFB 'g'+$80 ; 6 + DEFB 'g'+#80 ; 6 DEFM "RETURN without GOSU" - DEFB 'B'+$80 ; 7 + DEFB 'B'+#80 ; 7 DEFM "End of fil" - DEFB 'e'+$80 ; 8 + DEFB 'e'+#80 ; 8 DEFM "STOP statemen" - DEFB 't'+$80 ; 9 + DEFB 't'+#80 ; 9 DEFM "Invalid argumen" - DEFB 't'+$80 ; A + DEFB 't'+#80 ; A DEFM "Integer out of rang" - DEFB 'e'+$80 ; B + DEFB 'e'+#80 ; B DEFM "Nonsense in BASI" - DEFB 'C'+$80 ; C + DEFB 'C'+#80 ; C DEFM "BREAK - CONT repeat" - DEFB 's'+$80 ; D + DEFB 's'+#80 ; D DEFM "Out of DAT" - DEFB 'A'+$80 ; E + DEFB 'A'+#80 ; E DEFM "Invalid file nam" - DEFB 'e'+$80 ; F + DEFB 'e'+#80 ; F DEFM "No room for lin" - DEFB 'e'+$80 ; G + DEFB 'e'+#80 ; G DEFM "STOP in INPU" - DEFB 'T'+$80 ; H + DEFB 'T'+#80 ; H DEFM "FOR without NEX" - DEFB 'T'+$80 ; I + DEFB 'T'+#80 ; I DEFM "Invalid I/O devic" - DEFB 'e'+$80 ; J + DEFB 'e'+#80 ; J DEFM "Invalid colou" - DEFB 'r'+$80 ; K + DEFB 'r'+#80 ; K DEFM "BREAK into progra" - DEFB 'm'+$80 ; L + DEFB 'm'+#80 ; L DEFM "RAMTOP no goo" - DEFB 'd'+$80 ; M + DEFB 'd'+#80 ; M DEFM "Statement los" - DEFB 't'+$80 ; N + DEFB 't'+#80 ; N DEFM "Invalid strea" - DEFB 'm'+$80 ; O + DEFB 'm'+#80 ; O DEFM "FN without DE" - DEFB 'F'+$80 ; P + DEFB 'F'+#80 ; P DEFM "Parameter erro" - DEFB 'r'+$80 ; Q + DEFB 'r'+#80 ; Q DEFM "Tape loading erro" - DEFB 'r'+$80 ; R + DEFB 'r'+#80 ; R ;; comma-sp -L1537: DEFB ',',' '+$80 ; used in report line. +L1537: DEFB ',',' '+#80 ; used in report line. ;; copyright -L1539: DEFB $7F ; copyright +L1539: DEFB #7F ; copyright DEFM " 1982 Sinclair Research Lt" - DEFB 'd'+$80 + DEFB 'd'+#80 ; ------------- @@ -5729,8 +5677,8 @@ L1539: DEFB $7F ; copyright ;; REPORT-G ; No Room for line -L1555: LD A,$10 ; i.e. 'G' -$30 -$07 - LD BC,$0000 ; this seems unnecessary. +L1555: LD A,#10 ; i.e. 'G' -#30 -#07 + LD BC,#0000 ; this seems unnecessary. JP L1313 ; jump back to MAIN-G ; ----------------------------- @@ -5744,8 +5692,8 @@ L1555: LD A,$10 ; i.e. 'G' -$30 -$07 ; Entering a non-existent line allows the subsequent line to be edited next. ;; MAIN-ADD -L155D: LD ($5C49),BC ; set E_PPC to extracted line number. - LD HL,($5C5D) ; fetch CH_ADD - points to location after the +L155D: LD (#5C49),BC ; set E_PPC to extracted line number. + LD HL,(#5C5D) ; fetch CH_ADD - points to location after the ; initial digits (set in E_LINE_NO). EX DE,HL ; save start of BASIC in DE. @@ -5754,7 +5702,7 @@ L155D: LD ($5C49),BC ; set E_PPC to extracted line number. ; the only error that can occur is ; 'Out of memory'. - LD HL,($5C61) ; fetch WORKSP - end of line. + LD HL,(#5C61) ; fetch WORKSP - end of line. SCF ; prepare for true subtraction. SBC HL,DE ; find length of BASIC and PUSH HL ; save it on stack. @@ -5781,24 +5729,24 @@ L157D: POP BC ; retrieve the length of the new line. INC BC ; (two bytes). DEC HL ; HL points to location before the destination - LD DE,($5C53) ; fetch the address of PROG + LD DE,(#5C53) ; fetch the address of PROG PUSH DE ; and save it on the stack CALL L1655 ; routine MAKE-ROOM creates BC spaces in ; program area and updates pointers. POP HL ; restore old program pointer. - LD ($5C53),HL ; and put back in PROG as it may have been + LD (#5C53),HL ; and put back in PROG as it may have been ; altered by the POINTERS routine. POP BC ; retrieve BASIC length PUSH BC ; and save again. INC DE ; points to end of new area. - LD HL,($5C61) ; set HL to WORKSP - location after edit line. + LD HL,(#5C61) ; set HL to WORKSP - location after edit line. DEC HL ; decrement to address end marker. DEC HL ; decrement to address carriage return. LDDR ; copy the BASIC line back to initial command. - LD HL,($5C49) ; fetch E_PPC - line number. + LD HL,(#5C49) ; fetch E_PPC - line number. EX DE,HL ; swap it to DE, HL points to last of ; four locations. POP BC ; retrieve length of line. @@ -5808,7 +5756,7 @@ L157D: POP BC ; retrieve the length of the new line. DEC HL ; LD (HL),E ; then low byte of line number. DEC HL ; - LD (HL),D ; then high byte range $0 - $27 (1-9999). + LD (HL),D ; then high byte range #0 - #27 (1-9999). ;; MAIN-ADD2 L15AB: POP AF ; drop the address of Report G @@ -5829,28 +5777,28 @@ L15AB: POP AF ; drop the address of Report G ;; init-chan L15AF: DEFW L09F4 ; PRINT-OUT DEFW L10A8 ; KEY-INPUT - DEFB $4B ; 'K' + DEFB #4B ; 'K' DEFW L09F4 ; PRINT-OUT DEFW L15C4 ; REPORT-J - DEFB $53 ; 'S' + DEFB #53 ; 'S' DEFW L0F81 ; ADD-CHAR DEFW L15C4 ; REPORT-J - DEFB $52 ; 'R' + DEFB #52 ; 'R' DEFW L09F4 ; PRINT-OUT DEFW L15C4 ; REPORT-J - DEFB $50 ; 'P' + DEFB #50 ; 'P' - DEFB $80 ; End Marker + DEFB #80 ; End Marker ;; REPORT-J L15C4: RST 08H ; ERROR-1 - DEFB $12 ; Error Report: Invalid I/O device + DEFB #12 ; Error Report: Invalid I/O device ; ------------------- ; Initial stream data ; ------------------- -; This is the initial stream data for the seven streams $FD - $03 that is +; This is the initial stream data for the seven streams #FD - #03 that is ; copied from ROM to the STRMS system variables area during initialization. ; There are reserved locations there for another 12 streams. ; Each location contains an offset to the second byte of a channel. @@ -5858,14 +5806,14 @@ L15C4: RST 08H ; ERROR-1 ; offset of zero for some and zero is used to denote that a stream is closed. ;; init-strm -L15C6: DEFB $01, $00 ; stream $FD offset to channel 'K' - DEFB $06, $00 ; stream $FE offset to channel 'S' - DEFB $0B, $00 ; stream $FF offset to channel 'R' +L15C6: DEFB #01, #00 ; stream #FD offset to channel 'K' + DEFB #06, #00 ; stream #FE offset to channel 'S' + DEFB #0B, #00 ; stream #FF offset to channel 'R' - DEFB $01, $00 ; stream $00 offset to channel 'K' - DEFB $01, $00 ; stream $01 offset to channel 'K' - DEFB $06, $00 ; stream $02 offset to channel 'S' - DEFB $10, $00 ; stream $03 offset to channel 'P' + DEFB #01, #00 ; stream #00 offset to channel 'K' + DEFB #01, #00 ; stream #01 offset to channel 'K' + DEFB #06, #00 ; stream #02 offset to channel 'S' + DEFB #10, #00 ; stream #03 offset to channel 'P' ; ---------------------------- ; Control for input subroutine @@ -5873,10 +5821,10 @@ L15C6: DEFB $01, $00 ; stream $FD offset to channel 'K' ; ;; WAIT-KEY -L15D4: BIT 5,(IY+$02) ; test TV_FLAG - clear lower screen ? +L15D4: BIT 5,(IY+#02) ; test TV_FLAG - clear lower screen ? JR NZ,L15DE ; forward to WAIT-KEY1 if so. - SET 3,(IY+$02) ; update TV_FLAG - signal reprint the edit + SET 3,(IY+#02) ; update TV_FLAG - signal reprint the edit ; line to the lower screen. ;; WAIT-KEY1 @@ -5891,7 +5839,7 @@ L15DE: CALL L15E6 ; routine INPUT-AD is called. ;; REPORT-8 L15E4: RST 08H ; ERROR-1 - DEFB $07 ; Error Report: End of file + DEFB #07 ; Error Report: End of file ; ------------------------------ ; Make HL point to input address @@ -5902,7 +5850,7 @@ L15E4: RST 08H ; ERROR-1 ;; INPUT-AD L15E6: EXX ; switch in alternate set. PUSH HL ; save HL register - LD HL,($5C51) ; fetch address of CURCHL - current channel. + LD HL,(#5C51) ; fetch address of CURCHL - current channel. INC HL ; step over output routine INC HL ; to point to low byte of input routine. JR L15F7 ; forward to CALL-SUB. @@ -5916,16 +5864,16 @@ L15E6: EXX ; switch in alternate set. ; PRINT-A-2 is a continuation of the RST 10 to print any character. ; Both print to the current channel and the printing of control codes ; may alter that channel to divert subsequent RST 10 instructions -; to temporary routines. The normal channel is $09F4. +; to temporary routines. The normal channel is #09F4. ;; OUT-CODE -L15EF: LD E,$30 ; add 48 decimal to give ASCII +L15EF: LD E,#30 ; add 48 decimal to give ASCII ADD A,E ; character '0' to '9'. ;; PRINT-A-2 L15F2: EXX ; switch in alternate set PUSH HL ; save HL register - LD HL,($5C51) ; fetch CURCHL the current channel. + LD HL,(#5C51) ; fetch CURCHL the current channel. ; input-ad rejoins here also. @@ -5948,14 +5896,14 @@ L15F7: LD E,(HL) ; put the low byte in E. ; This is either for its own use or in response to a user's request, for ; example, when '#' is encountered with output - PRINT, LIST etc. ; or with input - INPUT, INKEY$ etc. -; it is entered with a system stream $FD - $FF, or a user stream $00 - $0F +; it is entered with a system stream #FD - #FF, or a user stream #00 - #0F ; in the accumulator. ;; CHAN-OPEN -L1601: ADD A,A ; double the stream ($FF will become $FE etc.) - ADD A,$16 ; add the offset to stream 0 from $5C00 +L1601: ADD A,A ; double the stream (#FF will become #FE etc.) + ADD A,#16 ; add the offset to stream 0 from #5C00 LD L,A ; result to L - LD H,$5C ; now form the address in STRMS area. + LD H,#5C ; now form the address in STRMS area. LD E,(HL) ; fetch low byte of CHANS offset INC HL ; address next LD D,(HL) ; fetch high byte of offset @@ -5965,14 +5913,14 @@ L1601: ADD A,A ; double the stream ($FF will become $FE etc.) ;; REPORT-Oa L160E: RST 08H ; ERROR-1 - DEFB $17 ; Error Report: Invalid stream + DEFB #17 ; Error Report: Invalid stream ; continue here if stream was open. Note that the offset is from CHANS ; to the second byte of the channel. ;; CHAN-OP-1 L1610: DEC DE ; reduce offset so it points to the channel. - LD HL,($5C4F) ; fetch CHANS the location of the base of + LD HL,(#5C4F) ; fetch CHANS the location of the base of ; the channel information area ADD HL,DE ; and add the offset to address the channel. ; and continue to set flags. @@ -5984,9 +5932,9 @@ L1610: DEC DE ; reduce offset so it points to the channel. ; current channel when it has been temporarily altered. ;; CHAN-FLAG -L1615: LD ($5C51),HL ; set CURCHL system variable to the +L1615: LD (#5C51),HL ; set CURCHL system variable to the ; address in HL - RES 4,(IY+$30) ; update FLAGS2 - signal K channel not in use. + RES 4,(IY+#30) ; update FLAGS2 - signal K channel not in use. ; Note. provide a default for channel 'R'. INC HL ; advance past INC HL ; output routine. @@ -6000,7 +5948,7 @@ L1615: LD ($5C51),HL ; set CURCHL system variable to the RET NC ; but if the letter wasn't found in the ; table just return now. - channel 'R'. - LD D,$00 ; prepare to add + LD D,#00 ; prepare to add LD E,(HL) ; offset to E ADD HL,DE ; add offset to location of offset to form ; address of routine @@ -6019,11 +5967,11 @@ L162C: JP (HL) ; jump to the routine ; A zero end-marker is required as channel 'R' is not present. ;; chn-cd-lu -L162D: DEFB 'K', L1634-$-1 ; offset $06 to CHAN-K - DEFB 'S', L1642-$-1 ; offset $12 to CHAN-S - DEFB 'P', L164D-$-1 ; offset $1B to CHAN-P +L162D: DEFB 'K', L1634-$-1 ; offset #06 to CHAN-K + DEFB 'S', L1642-$-1 ; offset #12 to CHAN-S + DEFB 'P', L164D-$-1 ; offset #1B to CHAN-P - DEFB $00 ; end marker. + DEFB #00 ; end marker. ; -------------- ; Channel K flag @@ -6031,9 +5979,9 @@ L162D: DEFB 'K', L1634-$-1 ; offset $06 to CHAN-K ; routine to set flags for lower screen/keyboard channel. ;; CHAN-K -L1634: SET 0,(IY+$02) ; update TV_FLAG - signal lower screen in use - RES 5,(IY+$01) ; update FLAGS - signal no new key - SET 4,(IY+$30) ; update FLAGS2 - signal K channel in use +L1634: SET 0,(IY+#02) ; update TV_FLAG - signal lower screen in use + RES 5,(IY+#01) ; update FLAGS - signal no new key + SET 4,(IY+#30) ; update FLAGS2 - signal K channel in use JR L1646 ; forward to CHAN-S-1 for indirect exit ; -------------- @@ -6042,10 +5990,10 @@ L1634: SET 0,(IY+$02) ; update TV_FLAG - signal lower screen in use ; routine to set flags for upper screen channel. ;; CHAN-S -L1642: RES 0,(IY+$02) ; TV_FLAG - signal main screen in use +L1642: RES 0,(IY+#02) ; TV_FLAG - signal main screen in use ;; CHAN-S-1 -L1646: RES 1,(IY+$01) ; update FLAGS - signal printer not in use +L1646: RES 1,(IY+#01) ; update FLAGS - signal printer not in use JP L0D4D ; jump back to TEMPS and exit via that ; routine after setting temporary attributes. ; -------------- @@ -6056,20 +6004,20 @@ L1646: RES 1,(IY+$01) ; update FLAGS - signal printer not in use ; This status remains in force until reset by the routine above. ;; CHAN-P -L164D: SET 1,(IY+$01) ; update FLAGS - signal printer in use +L164D: SET 1,(IY+#01) ; update FLAGS - signal printer in use RET ; return ; ----------------------- ; Just one space required ; ----------------------- ; This routine is called once only to create a single space -; in workspace by ADD-CHAR. It is slightly quicker than using a RST $30. +; in workspace by ADD-CHAR. It is slightly quicker than using a RST #30. ; There are several instances in the calculator where the sequence -; ld bc, 1; rst $30 could be replaced by a call to this routine but it +; ld bc, 1; rst #30 could be replaced by a call to this routine but it ; only gives a saving of one byte each time. ;; ONE-SPACE -L1652: LD BC,$0001 ; create space for a single character. +L1652: LD BC,#0001 ; create space for a single character. ; --------- ; Make Room @@ -6088,7 +6036,7 @@ L1655: PUSH HL ; save the address pointer. CALL L1664 ; routine POINTERS updates the ; dynamic memory location pointers. ; DE now holds the old value of STKEND. - LD HL,($5C65) ; fetch new STKEND the top destination. + LD HL,(#5C65) ; fetch new STKEND the top destination. EX DE,HL ; HL now addresses the top of the area to ; be moved up - old STKEND. @@ -6111,8 +6059,8 @@ L1655: PUSH HL ; save the address pointer. ;; POINTERS L1664: PUSH AF ; preserve accumulator. PUSH HL ; put pos pointer on stack. - LD HL,$5C4B ; address VARS the first of the - LD A,$0E ; fourteen variables to consider. + LD HL,#5C4B ; address VARS the first of the + LD A,#0E ; fourteen variables to consider. ;; PTR-NEXT L166B: LD E,(HL) ; fetch the low byte of the system variable. @@ -6164,22 +6112,22 @@ L167F: INC HL ; address next system variable. ; been found using LINE-ADDR, and it is entered at LINE-NO. If it encounters ; the program 'end-marker' then the previous line is used and if that ; should also be unacceptable then zero is used as it must be a direct -; command. The program end-marker is the variables end-marker $80, or +; command. The program end-marker is the variables end-marker #80, or ; if variables exist, then the first character of any variable name. ;; LINE-ZERO -L168F: DEFB $00, $00 ; dummy line number used for direct commands +L168F: DEFB #00, #00 ; dummy line number used for direct commands ;; LINE-NO-A L1691: EX DE,HL ; fetch the previous line to HL and set - LD DE,$168F ; DE to LINE-ZERO should HL also fail. + LD DE,#168F ; DE to LINE-ZERO should HL also fail. ; -> The Entry Point. ;; LINE-NO -L1695: LD A,(HL) ; fetch the high byte - max $2F - AND $C0 ; mask off the invalid bits. +L1695: LD A,(HL) ; fetch the high byte - max #2F + AND #C0 ; mask off the invalid bits. JR NZ,L1691 ; to LINE-NO-A if an end-marker. LD D,(HL) ; reload the high byte. @@ -6193,13 +6141,13 @@ L1695: LD A,(HL) ; fetch the high byte - max $2F ; This is a continuation of the restart BC-SPACES ;; RESERVE -L169E: LD HL,($5C63) ; STKBOT first location of calculator stack +L169E: LD HL,(#5C63) ; STKBOT first location of calculator stack DEC HL ; make one less than new location CALL L1655 ; routine MAKE-ROOM creates the room. INC HL ; address the first new location INC HL ; advance to second POP BC ; restore old WORKSP - LD ($5C61),BC ; system variable WORKSP was perhaps + LD (#5C61),BC ; system variable WORKSP was perhaps ; changed by POINTERS routine. POP BC ; restore count for return value. EX DE,HL ; switch. DE = location after first new space @@ -6220,31 +6168,31 @@ L169E: LD HL,($5C63) ; STKBOT first location of calculator stack ; displaying an error. ;; SET-MIN -L16B0: LD HL,($5C59) ; fetch E_LINE - LD (HL),$0D ; insert carriage return - LD ($5C5B),HL ; make K_CUR keyboard cursor point there. +L16B0: LD HL,(#5C59) ; fetch E_LINE + LD (HL),#0D ; insert carriage return + LD (#5C5B),HL ; make K_CUR keyboard cursor point there. INC HL ; next location - LD (HL),$80 ; holds end-marker $80 + LD (HL),#80 ; holds end-marker #80 INC HL ; next location becomes - LD ($5C61),HL ; start of WORKSP + LD (#5C61),HL ; start of WORKSP ; This entry point is used prior to input and prior to the execution, ; or parsing, of each statement. ;; SET-WORK -L16BF: LD HL,($5C61) ; fetch WORKSP value - LD ($5C63),HL ; and place in STKBOT +L16BF: LD HL,(#5C61) ; fetch WORKSP value + LD (#5C63),HL ; and place in STKBOT ; This entry point is used to move the stack back to its normal place ; after temporary relocation during line entry and also from ERROR-3 ;; SET-STK -L16C5: LD HL,($5C63) ; fetch STKBOT value - LD ($5C65),HL ; and place in STKEND. +L16C5: LD HL,(#5C63) ; fetch STKBOT value + LD (#5C65),HL ; and place in STKEND. PUSH HL ; perhaps an obsolete entry point. - LD HL,$5C92 ; normal location of MEM-0 - LD ($5C68),HL ; is restored to system variable MEM. + LD HL,#5C92 ; normal location of MEM-0 + LD (#5C68),HL ; is restored to system variable MEM. POP HL ; saved value not required. RET ; return. @@ -6259,7 +6207,7 @@ L16C5: LD HL,($5C63) ; fetch STKBOT value ; On entry, HL must point to the end of the something to be deleted. ;; REC-EDIT -L16D4: LD DE,($5C59) ; fetch start of edit line from E_LINE. +L16D4: LD DE,(#5C59) ; fetch start of edit line from E_LINE. JP L19E5 ; jump forward to RECLAIM-1. ; -------------------------- @@ -6338,9 +6286,9 @@ L16E5: CALL L171E ; routine STR-DATA fetches parameter ; peculiar to that stream without disturbing ; data pointer to STRMS entry in HL. - LD BC,$0000 ; the stream is to be blanked. - LD DE,$A3E2 ; the number of bytes from stream 4, $5C1E, - ; to $10000 + LD BC,#0000 ; the stream is to be blanked. + LD DE,#A3E2 ; the number of bytes from stream 4, #5C1E, + ; to #10000 EX DE,HL ; transfer offset to HL, STRMS data pointer ; to DE. ADD HL,DE ; add the offset to the data pointer. @@ -6350,7 +6298,7 @@ L16E5: CALL L171E ; routine STR-DATA fetches parameter ; proceed with a negative result. LD BC,L15C6 + 14 ; prepare the address of the byte after - ; the initial stream data in ROM. ($15D4) + ; the initial stream data in ROM. (#15D4) ADD HL,BC ; index into the data table with negative value. LD C,(HL) ; low byte to C INC HL ; address next. @@ -6379,7 +6327,7 @@ L16FC: EX DE,HL ; address of stream to HL. ;; CLOSE-2 L1701: PUSH HL ; * save address of stream data pointer ; in STRMS on the machine stack. - LD HL,($5C4F) ; fetch CHANS address to HL + LD HL,(#5C4F) ; fetch CHANS address to HL ADD HL,BC ; add the offset to address the second ; byte of the output routine hopefully. INC HL ; step past @@ -6387,15 +6335,15 @@ L1701: PUSH HL ; * save address of stream data pointer INC HL ; to address channel's letter LD C,(HL) ; pick it up in C. ; Note. but if stream is already closed we - ; get the value $10 (the byte preceding 'K'). + ; get the value #10 (the byte preceding 'K'). EX DE,HL ; save the pointer to the letter in DE. LD HL,L1716 ; address: cl-str-lu in ROM. CALL L16DC ; routine INDEXER uses the code to get ; the 8-bit offset from the current point to ; the address of the closing routine in ROM. - ; Note. it won't find $10 there! + ; Note. it won't find #10 there! LD C,(HL) ; transfer the offset to C. - LD B,$00 ; prepare to add. + LD B,#00 ; prepare to add. ADD HL,BC ; add offset to point to the address of the ; routine that closes the stream. ; (and presumably removes any buffers that @@ -6439,22 +6387,22 @@ L171C: POP HL ; * now just restore the stream data pointer ;; STR-DATA L171E: CALL L1E94 ; routine FIND-INT1 fetches parameter to A - CP $10 ; is it less than 16d ? + CP #10 ; is it less than 16d ? JR C,L1727 ; skip forward to STR-DATA1 if so. ;; REPORT-Ob L1725: RST 08H ; ERROR-1 - DEFB $17 ; Error Report: Invalid stream + DEFB #17 ; Error Report: Invalid stream ;; STR-DATA1 -L1727: ADD A,$03 ; add the offset for 3 system streams. +L1727: ADD A,#03 ; add the offset for 3 system streams. ; range 00 - 15d becomes 3 - 18d. RLCA ; double as there are two bytes per ; stream - now 06 - 36d - LD HL,$5C10 ; address STRMS - the start of the streams + LD HL,#5C10 ; address STRMS - the start of the streams ; data area in system variables. LD C,A ; transfer the low byte to A. - LD B,$00 ; prepare to add offset. + LD B,#00 ; prepare to add offset. ADD HL,BC ; add to address the data entry in STRMS. ; the data entry itself contains an offset from CHANS to the address of the @@ -6477,8 +6425,8 @@ L1727: ADD A,$03 ; add the offset for 3 system streams. ;; OPEN L1736: RST 28H ;; FP-CALC ;s,c. - DEFB $01 ;;exchange ;c,s. - DEFB $38 ;;end-calc + DEFB #01 ;;exchange ;c,s. + DEFB #38 ;;end-calc CALL L171E ; routine STR-DATA fetches the stream off ; the stack and returns with the CHANS @@ -6491,7 +6439,7 @@ L1736: RST 28H ;; FP-CALC ;s,c. ; if it is a system channel then it can re-attached. EX DE,HL ; save STRMS address in DE. - LD HL,($5C4F) ; fetch CHANS. + LD HL,(#5C4F) ; fetch CHANS. ADD HL,BC ; add the offset to address the second ; byte of the channel. INC HL ; skip over the @@ -6501,13 +6449,13 @@ L1736: RST 28H ;; FP-CALC ;s,c. EX DE,HL ; save letter pointer and bring back ; the STRMS pointer. - CP $4B ; is it 'K' ? + CP #4B ; is it 'K' ? JR Z,L1756 ; forward to OPEN-1 if so - CP $53 ; is it 'S' ? + CP #53 ; is it 'S' ? JR Z,L1756 ; forward to OPEN-1 if so - CP $50 ; is it 'P' ? + CP #50 ; is it 'P' ? JR NZ,L1725 ; back to REPORT-Ob if not. ; to report 'Invalid stream'. @@ -6543,7 +6491,7 @@ L175D: PUSH HL ; * save the STRMS data entry pointer. ;; REPORT-Fb L1765: RST 08H ; ERROR-1 - DEFB $0E ; Error Report: Invalid file name + DEFB #0E ; Error Report: Invalid file name ;; OPEN-3 L1767: PUSH BC ; save the length of the string. @@ -6552,7 +6500,7 @@ L1767: PUSH BC ; save the length of the string. ; distinguish between a binary or text ; channel then it will be simply a matter ; of setting bit 7 of FLAGX. - AND $DF ; make it upper-case. + AND #DF ; make it upper-case. LD C,A ; place it in C. LD HL,L177A ; address: op-str-lu is loaded. CALL L16DC ; routine INDEXER will search for letter. @@ -6560,7 +6508,7 @@ L1767: PUSH BC ; save the length of the string. ; 'Invalid filename' LD C,(HL) ; fetch the displacement to opening routine. - LD B,$00 ; prepare to add. + LD B,#00 ; prepare to add. ADD HL,BC ; now form address of opening routine. POP BC ; restore the length of string. JP (HL) ; now jump forward to the relevant routine. @@ -6575,11 +6523,11 @@ L1767: PUSH BC ; save the length of the string. ; provided by the user and not the operating system. ;; op-str-lu -L177A: DEFB 'K', L1781-$-1 ; $06 offset to OPEN-K - DEFB 'S', L1785-$-1 ; $08 offset to OPEN-S - DEFB 'P', L1789-$-1 ; $0A offset to OPEN-P +L177A: DEFB 'K', L1781-$-1 ; #06 offset to OPEN-K + DEFB 'S', L1785-$-1 ; #08 offset to OPEN-S + DEFB 'P', L1789-$-1 ; #0A offset to OPEN-P - DEFB $00 ; end-marker. + DEFB #00 ; end-marker. ; ---------------------------- ; The Stream Opening Routines. @@ -6603,7 +6551,7 @@ L177A: DEFB 'K', L1781-$-1 ; $06 offset to OPEN-K ; Something of significance is being passed to these ghost routines in the ; second character. Strings 'RB', 'RT' perhaps or a drive/station number. ; The routine would have to deal with that and exit to OPEN_END with BC -; containing $0001 or more likely there would be an exit within the routine. +; containing #0001 or more likely there would be an exit within the routine. ; Anyway doesn't matter, these routines are long gone. ; ----------------- @@ -6612,7 +6560,7 @@ L177A: DEFB 'K', L1781-$-1 ; $06 offset to OPEN-K ; Open Keyboard stream. ;; OPEN-K -L1781: LD E,$01 ; 01 is offset to second byte of channel 'K'. +L1781: LD E,#01 ; 01 is offset to second byte of channel 'K'. JR L178B ; forward to OPEN-END ; ----------------- @@ -6621,7 +6569,7 @@ L1781: LD E,$01 ; 01 is offset to second byte of channel 'K'. ; Open Screen stream. ;; OPEN-S -L1785: LD E,$06 ; 06 is offset to 2nd byte of channel 'S' +L1785: LD E,#06 ; 06 is offset to 2nd byte of channel 'S' JR L178B ; to OPEN-END ; ----------------- @@ -6630,7 +6578,7 @@ L1785: LD E,$06 ; 06 is offset to 2nd byte of channel 'S' ; Open Printer stream. ;; OPEN-P -L1789: LD E,$10 ; 16d is offset to 2nd byte of channel 'P' +L1789: LD E,#10 ; 16d is offset to 2nd byte of channel 'P' ;; OPEN-END L178B: DEC BC ; the stored length of 'K','S','P' or @@ -6652,7 +6600,7 @@ L178B: DEC BC ; the stored length of 'K','S','P' or ; ; Luckily this provides a mechanism for extending these in a shadow ROM ; but without the powerful mechanisms set up in this ROM. -; An instruction fetch on $0008 may page in a peripheral ROM, +; An instruction fetch on #0008 may page in a peripheral ROM, ; e.g. the Sinclair Interface 1 ROM, to handle these commands. ; However that wasn't the plan. ; Development of this ROM continued for another three months until the cost @@ -6668,19 +6616,19 @@ L1793: JR L1725 ; to REPORT-Ob ; This produces an automatic listing in the upper screen. ;; AUTO-LIST -L1795: LD ($5C3F),SP ; save stack pointer in LIST_SP - LD (IY+$02),$10 ; update TV_FLAG set bit 3 +L1795: LD (#5C3F),SP ; save stack pointer in LIST_SP + LD (IY+#02),#10 ; update TV_FLAG set bit 3 CALL L0DAF ; routine CL-ALL. - SET 0,(IY+$02) ; update TV_FLAG - signal lower screen in use + SET 0,(IY+#02) ; update TV_FLAG - signal lower screen in use - LD B,(IY+$31) ; fetch DF_SZ to B. + LD B,(IY+#31) ; fetch DF_SZ to B. CALL L0E44 ; routine CL-LINE clears lower display ; preserving B. - RES 0,(IY+$02) ; update TV_FLAG - signal main screen in use - SET 0,(IY+$30) ; update FLAGS2 - signal unnecessary to + RES 0,(IY+#02) ; update TV_FLAG - signal main screen in use + SET 0,(IY+#30) ; update FLAGS2 - signal unnecessary to ; clear main screen. - LD HL,($5C49) ; fetch E_PPC current edit line to HL. - LD DE,($5C6C) ; fetch S_TOP to DE, the current top line + LD HL,(#5C49) ; fetch E_PPC current edit line to HL. + LD DE,(#5C6C) ; fetch S_TOP to DE, the current top line ; (initially zero) AND A ; prepare for true subtraction. SBC HL,DE ; subtract and @@ -6690,7 +6638,7 @@ L1795: LD ($5C3F),SP ; save stack pointer in LIST_SP PUSH DE ; save the top line number. CALL L196E ; routine LINE-ADDR gets address of E_PPC. - LD DE,$02C0 ; prepare known number of characters in + LD DE,#02C0 ; prepare known number of characters in ; the default upper screen. EX DE,HL ; offset to HL, program address to DE. SBC HL,DE ; subtract high value from low to obtain @@ -6713,7 +6661,7 @@ L17CE: PUSH BC ; save the result. INC HL ; number LD E,(HL) ; in DE. DEC HL ; adjust back to start. - LD ($5C6C),DE ; update S_TOP. + LD (#5C6C),DE ; update S_TOP. JR L17CE ; to AUTO-L-1 until estimate reached. ; --- @@ -6721,13 +6669,13 @@ L17CE: PUSH BC ; save the result. ; the jump was to here if S_TOP was greater than E_PPC ;; AUTO-L-2 -L17E1: LD ($5C6C),HL ; make S_TOP the same as E_PPC. +L17E1: LD (#5C6C),HL ; make S_TOP the same as E_PPC. ; continue here with valid starting point from above or good estimate ; from computation ;; AUTO-L-3 -L17E4: LD HL,($5C6C) ; fetch S_TOP line number to HL. +L17E4: LD HL,(#5C6C) ; fetch S_TOP line number to HL. CALL L196E ; routine LINE-ADDR gets address in HL. ; address of next in DE. JR Z,L17ED ; to AUTO-L-4 if line exists. @@ -6739,7 +6687,7 @@ L17ED: CALL L1833 ; routine LIST-ALL >>> ; The return will be to here if no scrolling occurred - RES 4,(IY+$02) ; update TV_FLAG - signal no auto listing. + RES 4,(IY+#02) ; update TV_FLAG - signal no auto listing. RET ; return. ; ------------ @@ -6748,7 +6696,7 @@ L17ED: CALL L1833 ; routine LIST-ALL >>> ; A short form of LIST #3. The listing goes to stream 3 - default printer. ;; LLIST -L17F5: LD A,$03 ; the usual stream for ZX Printer +L17F5: LD A,#03 ; the usual stream for ZX Printer JR L17FB ; forward to LIST-1 ; ----------- @@ -6760,10 +6708,10 @@ L17F5: LD A,$03 ; the usual stream for ZX Printer ; Just listing a line makes it the current edit line. ;; LIST -L17F9: LD A,$02 ; default is stream 2 - the upper screen. +L17F9: LD A,#02 ; default is stream 2 - the upper screen. ;; LIST-1 -L17FB: LD (IY+$02),$00 ; the TV_FLAG is initialized with bit 0 reset +L17FB: LD (IY+#02),#00 ; the TV_FLAG is initialized with bit 0 reset ; indicating upper screen in use. CALL L2530 ; routine SYNTAX-Z - checking syntax ? CALL NZ,L1601 ; routine CHAN-OPEN if in run-time. @@ -6774,10 +6722,10 @@ L17FB: LD (IY+$02),$00 ; the TV_FLAG is initialized with bit 0 reset RST 18H ; GET-CHAR - CP $3B ; is it ';' ? + CP #3B ; is it ';' ? JR Z,L1814 ; skip to LIST-2 if so. - CP $2C ; is it ',' ? + CP #2C ; is it ',' ? JR NZ,L181A ; forward to LIST-3 if neither separator. ; we have, say, LIST #15, and a number must follow the separator. @@ -6809,7 +6757,7 @@ L1822: CALL L1BEE ; routine CHECK-END quits if syntax OK >>> CALL L1E99 ; routine FIND-INT2 fetches the number ; from the calculator stack in run-time. LD A,B ; fetch high byte of line number and - AND $3F ; make less than $40 so that NEXT-ONE + AND #3F ; make less than #40 so that NEXT-ONE ; (from LINE-ADDR) doesn't lose context. ; Note. this is not satisfactory and the typo ; LIST 20000 will list an entirely different @@ -6819,14 +6767,14 @@ L1822: CALL L1BEE ; routine CHECK-END quits if syntax OK >>> LD H,A ; transfer the modified LD L,C ; line number to HL. - LD ($5C49),HL ; update E_PPC to new line number. + LD (#5C49),HL ; update E_PPC to new line number. CALL L196E ; routine LINE-ADDR gets the address of the ; line. ; This routine is called from AUTO-LIST ;; LIST-ALL -L1833: LD E,$01 ; signal current line not yet printed +L1833: LD E,#01 ; signal current line not yet printed ;; LIST-ALL-2 L1835: CALL L1855 ; routine OUT-LINE outputs a BASIC line @@ -6835,14 +6783,14 @@ L1835: CALL L1855 ; routine OUT-LINE outputs a BASIC line RST 10H ; PRINT-A prints the carriage return (in A) - BIT 4,(IY+$02) ; test TV_FLAG - automatic listing ? + BIT 4,(IY+#02) ; test TV_FLAG - automatic listing ? JR Z,L1835 ; back to LIST-ALL-2 if not ; (loop exit is via OUT-LINE) ; continue here if an automatic listing required. - LD A,($5C6B) ; fetch DF_SZ lower display file size. - SUB (IY+$4F) ; subtract S_POSN_hi ithe current line number. + LD A,(#5C6B) ; fetch DF_SZ lower display file size. + SUB (IY+#4F) ; subtract S_POSN_hi ithe current line number. JR NZ,L1835 ; back to LIST-ALL-2 if upper screen not full. XOR E ; A contains zero, E contains one if the @@ -6856,7 +6804,7 @@ L1835: CALL L1855 ; routine OUT-LINE outputs a BASIC line PUSH HL ; save the pointer address. PUSH DE ; save the E flag. - LD HL,$5C6C ; fetch S_TOP the rough estimate. + LD HL,#5C6C ; fetch S_TOP the rough estimate. CALL L190F ; routine LN-FETCH updates S_TOP with ; the number of the next line. POP DE ; restore the E flag. @@ -6871,20 +6819,20 @@ L1835: CALL L1855 ; routine OUT-LINE outputs a BASIC line ; and from ED-EDIT to 'sprint' the line to the edit buffer. ;; OUT-LINE -L1855: LD BC,($5C49) ; fetch E_PPC the current line which may be +L1855: LD BC,(#5C49) ; fetch E_PPC the current line which may be ; unchecked and not exist. CALL L1980 ; routine CP-LINES finds match or line after. - LD D,$3E ; prepare cursor '>' in D. + LD D,#3E ; prepare cursor '>' in D. JR Z,L1865 ; to OUT-LINE1 if matched or line after. - LD DE,$0000 ; put zero in D, to suppress line cursor. + LD DE,#0000 ; put zero in D, to suppress line cursor. RL E ; pick up carry in E if line before current ; leave E zero if same or after. ;; OUT-LINE1 -L1865: LD (IY+$2D),E ; save flag in BREG which is spare. +L1865: LD (IY+#2D),E ; save flag in BREG which is spare. LD A,(HL) ; get high byte of line number. - CP $40 ; is it too high ($2F is maximum possible) ? + CP #40 ; is it too high (#2F is maximum possible) ? POP BC ; drop the return address and RET NC ; make an early return if so >>> @@ -6894,7 +6842,7 @@ L1865: LD (IY+$2D),E ; save flag in BREG which is spare. INC HL ; skip low number byte. INC HL ; and the two INC HL ; length bytes. - RES 0,(IY+$01) ; update FLAGS - signal leading space required. + RES 0,(IY+#01) ; update FLAGS - signal leading space required. LD A,D ; fetch the cursor. AND A ; test for zero. JR Z,L1881 ; to OUT-LINE3 if zero. @@ -6905,28 +6853,28 @@ L1865: LD (IY+$2D),E ; save flag in BREG which is spare. ; this entry point is called from ED-COPY ;; OUT-LINE2 -L187D: SET 0,(IY+$01) ; update FLAGS - suppress leading space. +L187D: SET 0,(IY+#01) ; update FLAGS - suppress leading space. ;; OUT-LINE3 L1881: PUSH DE ; save flag E for a return value. EX DE,HL ; save HL address in DE. - RES 2,(IY+$30) ; update FLAGS2 - signal NOT in QUOTES. + RES 2,(IY+#30) ; update FLAGS2 - signal NOT in QUOTES. - LD HL,$5C3B ; point to FLAGS. + LD HL,#5C3B ; point to FLAGS. RES 2,(HL) ; signal 'K' mode. (starts before keyword) - BIT 5,(IY+$37) ; test FLAGX - input mode ? + BIT 5,(IY+#37) ; test FLAGX - input mode ? JR Z,L1894 ; forward to OUT-LINE4 if not. SET 2,(HL) ; signal 'L' mode. (used for input) ;; OUT-LINE4 -L1894: LD HL,($5C5F) ; fetch X_PTR - possibly the error pointer +L1894: LD HL,(#5C5F) ; fetch X_PTR - possibly the error pointer ; address. AND A ; clear the carry flag. SBC HL,DE ; test if an error address has been reached. JR NZ,L18A1 ; forward to OUT-LINE5 if not. - LD A,$3F ; load A with '?' the error marker. + LD A,#3F ; load A with '?' the error marker. CALL L18C1 ; routine OUT-FLASH to print flashing marker. ;; OUT-LINE5 @@ -6937,7 +6885,7 @@ L18A1: CALL L18E1 ; routine OUT-CURS will print the cursor if CALL L18B6 ; routine NUMBER skips a hidden floating ; point number if present. INC HL ; now increment the pointer. - CP $0D ; is character end-of-line ? + CP #0D ; is character end-of-line ? JR Z,L18B4 ; to OUT-LINE6, if so, as line is finished. EX DE,HL ; save the pointer in DE. @@ -6950,7 +6898,7 @@ L18A1: CALL L18E1 ; routine OUT-CURS will print the cursor if ;; OUT-LINE6 L18B4: POP DE ; bring back the flag E, zero if current ; line printed else 1 if still to print. - RET ; return with A holding $0D + RET ; return with A holding #0D ; ------------------------- ; Check for a number marker @@ -6965,7 +6913,7 @@ L18B4: POP DE ; bring back the flag E, zero if current ; and may mask old 5-byte string parameters. ;; NUMBER -L18B6: CP $0E ; character fourteen ? +L18B6: CP #0E ; character fourteen ? RET NZ ; return if not. INC HL ; skip the character @@ -6983,31 +6931,31 @@ L18B6: CP $0E ; character fourteen ? ; This subroutine is called from OUT-LINE to print a flashing error ; marker '?' or from the next routine to print a flashing cursor e.g. 'L'. ; However, this only gets called from OUT-LINE when printing the edit line -; or the input buffer to the lower screen so a direct call to $09F4 can +; or the input buffer to the lower screen so a direct call to #09F4 can ; be used, even though out-line outputs to other streams. ; In fact the alternate set is used for the whole routine. ;; OUT-FLASH L18C1: EXX ; switch in alternate set - LD HL,($5C8F) ; fetch L = ATTR_T, H = MASK-T + LD HL,(#5C8F) ; fetch L = ATTR_T, H = MASK-T PUSH HL ; save masks. RES 7,H ; reset flash mask bit so active. SET 7,L ; make attribute FLASH. - LD ($5C8F),HL ; resave ATTR_T and MASK-T + LD (#5C8F),HL ; resave ATTR_T and MASK-T - LD HL,$5C91 ; address P_FLAG + LD HL,#5C91 ; address P_FLAG LD D,(HL) ; fetch to D PUSH DE ; and save. - LD (HL),$00 ; clear inverse, over, ink/paper 9 + LD (HL),#00 ; clear inverse, over, ink/paper 9 CALL L09F4 ; routine PRINT-OUT outputs character ; without the need to vector via RST 10. POP HL ; pop P_FLAG to H. - LD (IY+$57),H ; and restore system variable P_FLAG. + LD (IY+#57),H ; and restore system variable P_FLAG. POP HL ; restore temporary masks - LD ($5C8F),HL ; and restore system variables ATTR_T/MASK_T + LD (#5C8F),HL ; and restore system variables ATTR_T/MASK_T EXX ; switch back to main set RET ; return @@ -7023,7 +6971,7 @@ L18C1: EXX ; switch in alternate set ; performs another very important function also. ;; OUT-CURS -L18E1: LD HL,($5C5B) ; fetch K_CUR the current cursor address +L18E1: LD HL,(#5C5B) ; fetch K_CUR the current cursor address AND A ; prepare for true subtraction. SBC HL,DE ; test against pointer address in DE and RET NZ ; return if not at exact position. @@ -7031,11 +6979,11 @@ L18E1: LD HL,($5C5B) ; fetch K_CUR the current cursor address ; the value of MODE, maintained by KEY-INPUT, is tested and if non-zero ; then this value 'E' or 'G' will take precedence. - LD A,($5C41) ; fetch MODE 0='KLC', 1='E', 2='G'. + LD A,(#5C41) ; fetch MODE 0='KLC', 1='E', 2='G'. RLC A ; double the value and set flags. JR Z,L18F3 ; to OUT-C-1 if still zero ('KLC'). - ADD A,$43 ; add 'C' - will become 'E' if originally 1 + ADD A,#43 ; add 'C' - will become 'E' if originally 1 ; or 'G' if originally 2. JR L1909 ; forward to OUT-C-2 to print. @@ -7048,9 +6996,9 @@ L18E1: LD HL,($5C5B) ; fetch K_CUR the current cursor address ; to let the interrupt routine know how to decode the next key. ;; OUT-C-1 -L18F3: LD HL,$5C3B ; Address FLAGS +L18F3: LD HL,#5C3B ; Address FLAGS RES 3,(HL) ; signal 'K' mode initially. - LD A,$4B ; prepare letter 'K'. + LD A,#4B ; prepare letter 'K'. BIT 2,(HL) ; test FLAGS - was the ; previous main character ':' or 'THEN' ? JR Z,L1909 ; forward to OUT-C-2 if so to print. @@ -7059,11 +7007,11 @@ L18F3: LD HL,$5C3B ; Address FLAGS ; Note. transient bit has been made permanent. INC A ; augment from 'K' to 'L'. - BIT 3,(IY+$30) ; test FLAGS2 - consider caps lock ? + BIT 3,(IY+#30) ; test FLAGS2 - consider caps lock ? ; which is maintained by KEY-INPUT. JR Z,L1909 ; forward to OUT-C-2 if not set to print. - LD A,$43 ; alter 'L' to 'C'. + LD A,#43 ; alter 'L' to 'C'. ;; OUT-C-2 L1909: PUSH DE ; save address pointer but OK as OUT-FLASH @@ -7098,7 +7046,7 @@ L190F: LD E,(HL) ; fetch low byte ; This entry point is from the ED-UP with HL addressing E_PPC_hi ;; LN-STORE -L191C: BIT 5,(IY+$37) ; test FLAGX - input mode ? +L191C: BIT 5,(IY+#37) ; test FLAGX - input mode ? RET NZ ; return if so. ; Note. above already checked by ED-UP/ED-DOWN. @@ -7119,12 +7067,12 @@ L191C: BIT 5,(IY+$37) ; test FLAGX - input mode ? ;; OUT-SP-2 L1925: LD A,E ; will be space if OUT-CODE not yet called. - ; or $FF if spaces are suppressed. - ; else $30 ('0'). + ; or #FF if spaces are suppressed. + ; else #30 ('0'). ; (from the first instruction at OUT-CODE) ; this guy is just too clever. AND A ; test bit 7 of A. - RET M ; return if $FF, as leading spaces not + RET M ; return if #FF, as leading spaces not ; required. This is set when printing line ; number and statement in MAIN-5. @@ -7161,21 +7109,21 @@ L1937: CALL L2D1B ; routine NUMERIC tests if it is a digit ? ; changing mode. Will be 'K' mode if digits ; are at beginning of edit line. - CP $21 ; less than quote character ? + CP #21 ; less than quote character ? JR C,L196C ; to OUT-CH-3 to output controls and space. - RES 2,(IY+$01) ; initialize FLAGS to 'K' mode and leave + RES 2,(IY+#01) ; initialize FLAGS to 'K' mode and leave ; unchanged if this character would precede ; a keyword. - CP $CB ; is character 'THEN' token ? + CP #CB ; is character 'THEN' token ? JR Z,L196C ; to OUT-CH-3 to output if so. - CP $3A ; is it ':' ? + CP #3A ; is it ':' ? JR NZ,L195A ; to OUT-CH-1 if not statement separator ; to change mode back to 'L'. - BIT 5,(IY+$37) ; FLAGX - Input Mode ?? + BIT 5,(IY+#37) ; FLAGX - Input Mode ?? JR NZ,L1968 ; to OUT-CH-2 if in input as no statements. ; Note. this check should seemingly be at ; the start. Commands seem inappropriate in @@ -7183,7 +7131,7 @@ L1937: CALL L2D1B ; routine NUMERIC tests if it is a digit ? ; checker anyway. ; unless INPUT LINE is being used. - BIT 2,(IY+$30) ; test FLAGS2 - is the ':' within quotes ? + BIT 2,(IY+#30) ; test FLAGS2 - is the ':' within quotes ? JR Z,L196C ; to OUT-CH-3 if ':' is outside quoted text. JR L1968 ; to OUT-CH-2 as ':' is within quotes @@ -7191,17 +7139,17 @@ L1937: CALL L2D1B ; routine NUMERIC tests if it is a digit ? ; --- ;; OUT-CH-1 -L195A: CP $22 ; is it quote character '"' ? +L195A: CP #22 ; is it quote character '"' ? JR NZ,L1968 ; to OUT-CH-2 with others to set 'L' mode. PUSH AF ; save character. - LD A,($5C6A) ; fetch FLAGS2. - XOR $04 ; toggle the quotes flag. - LD ($5C6A),A ; update FLAGS2 + LD A,(#5C6A) ; fetch FLAGS2. + XOR #04 ; toggle the quotes flag. + LD (#5C6A),A ; update FLAGS2 POP AF ; and restore character. ;; OUT-CH-2 -L1968: SET 2,(IY+$01) ; update FLAGS - signal L mode if the cursor +L1968: SET 2,(IY+#01) ; update FLAGS - signal L mode if the cursor ; is next. ;; OUT-CH-3 @@ -7218,7 +7166,7 @@ L196C: RST 10H ; PRINT-A vectors the character to ;; LINE-ADDR L196E: PUSH HL ; save line number in HL register - LD HL,($5C53) ; fetch start of program from PROG + LD HL,(#5C53) ; fetch start of program from PROG LD D,H ; transfer address to LD E,L ; the DE register pair. @@ -7271,8 +7219,8 @@ L1988: INC HL ; ; -> entry point. ;; EACH-STMT -L198B: LD ($5C5D),HL ; save HL in CH_ADD - LD C,$00 ; initialize quotes flag +L198B: LD (#5C5D),HL ; save HL in CH_ADD + LD C,#00 ; initialize quotes flag ;; EACH-S-1 L1990: DEC D ; decrease statement count @@ -7294,17 +7242,17 @@ L1998: INC HL ; next address ;; EACH-S-3 L199A: CALL L18B6 ; routine NUMBER skips if number marker - LD ($5C5D),HL ; save in CH_ADD - CP $22 ; is it quotes '"' ? + LD (#5C5D),HL ; save in CH_ADD + CP #22 ; is it quotes '"' ? JR NZ,L19A5 ; to EACH-S-4 if not DEC C ; toggle bit 0 of C ;; EACH-S-4 -L19A5: CP $3A ; is it ':' +L19A5: CP #3A ; is it ':' JR Z,L19AD ; to EACH-S-5 - CP $CB ; 'THEN' + CP #CB ; 'THEN' JR NZ,L19B1 ; to EACH-S-6 ;; EACH-S-5 @@ -7312,7 +7260,7 @@ L19AD: BIT 0,C ; is it in quotes JR Z,L1990 ; to EACH-S-1 if not ;; EACH-S-6 -L19B1: CP $0D ; end of line ? +L19B1: CP #0D ; end of line ? JR NZ,L1998 ; to EACH-S-2 DEC D ; decrease the statement counter @@ -7326,8 +7274,8 @@ L19B1: CP $0D ; end of line ? ; ZX Spectrum BASIC Programming by Steven Vickers 1982. ; It is bits 7-5 of the first character of a variable that allow ; the six types to be distinguished. Bits 4-0 are the reduced letter. -; So any variable name is higher that $3F and can be distinguished -; also from the variables area end-marker $80. +; So any variable name is higher that #3F and can be distinguished +; also from the variables area end-marker #80. ; ; 76543210 meaning brief outline of format. ; -------- ------------------------ ----------------------- @@ -7355,7 +7303,7 @@ L19B1: CP $0D ; end of line ? ;; NEXT-ONE L19B8: PUSH HL ; save the pointer address. LD A,(HL) ; get first byte. - CP $40 ; compare with upper limit for line numbers. + CP #40 ; compare with upper limit for line numbers. JR C,L19D5 ; forward to NEXT-O-3 if within BASIC area. ; the continuation here is for the next variable unless the supplied @@ -7371,11 +7319,11 @@ L19B8: PUSH HL ; save the pointer address. ; it remains set for for-next loop variables. ;; NEXT-O-1 -L19C7: LD BC,$0005 ; set BC to 5 for floating point number +L19C7: LD BC,#0005 ; set BC to 5 for floating point number JR NC,L19CE ; forward to NEXT-O-2 if not a for/next ; variable. - LD C,$12 ; set BC to eighteen locations. + LD C,#12 ; set BC to eighteen locations. ; value, limit, step, line and statement. ; now deal with long-named variables @@ -7479,19 +7427,19 @@ L19E8: PUSH BC ; ; arises whereby the Spectrum becomes locked with no means of reclaiming space. ;; E-LINE-NO -L19FB: LD HL,($5C59) ; load HL from system variable E_LINE. +L19FB: LD HL,(#5C59) ; load HL from system variable E_LINE. DEC HL ; decrease so that NEXT_CHAR can be used ; without skipping the first digit. - LD ($5C5D),HL ; store in the system variable CH_ADD. + LD (#5C5D),HL ; store in the system variable CH_ADD. RST 20H ; NEXT-CHAR skips any noise and white-space ; to point exactly at the first digit. - LD HL,$5C92 ; use MEM-0 as a temporary calculator stack + LD HL,#5C92 ; use MEM-0 as a temporary calculator stack ; an overhead of three locations are needed. - LD ($5C65),HL ; set new STKEND. + LD (#5C65),HL ; set new STKEND. CALL L2D3B ; routine INT-TO-FP will read digits till ; a non-digit found. @@ -7500,14 +7448,14 @@ L19FB: LD HL,($5C59) ; load HL from system variable E_LINE. JR C,L1A15 ; forward to E-L-1 if overflow i.e. > 65535. ; 'Nonsense in BASIC' - LD HL,$D8F0 ; load HL with value -9999 + LD HL,#D8F0 ; load HL with value -9999 ADD HL,BC ; add to line number in BC ;; E-L-1 L1A15: JP C,L1C8A ; to REPORT-C 'Nonsense in BASIC' if over. ; Note. As ERR_SP points to ED_ERROR ; the report is never produced although - ; the RST $08 will update X_PTR leading to + ; the RST #08 will update X_PTR leading to ; the error marker being displayed when ; the ED_LOOP is reiterated. ; in fact, since it is immediately @@ -7541,7 +7489,7 @@ L1A1B: PUSH DE ; save the LD H,B ; transfer the LD L,C ; number to HL. - LD E,$FF ; signal 'no leading zeros'. + LD E,#FF ; signal 'no leading zeros'. JR L1A30 ; forward to continue at OUT-NUM-3 ; --- @@ -7555,14 +7503,14 @@ L1A28: PUSH DE ; save flags LD E,(HL) ; low byte to E PUSH HL ; save pointer EX DE,HL ; transfer number to HL - LD E,$20 ; signal 'output leading spaces' + LD E,#20 ; signal 'output leading spaces' ;; OUT-NUM-3 -L1A30: LD BC,$FC18 ; value -1000 +L1A30: LD BC,#FC18 ; value -1000 CALL L192A ; routine OUT-SP-NO outputs space or number - LD BC,$FF9C ; value -100 + LD BC,#FF9C ; value -100 CALL L192A ; routine OUT-SP-NO - LD C,$F6 ; value -10 ( B is still $FF ) + LD C,#F6 ; value -10 ( B is still #FF ) CALL L192A ; routine OUT-SP-NO LD A,L ; remainder to A. @@ -7582,8 +7530,8 @@ L1A42: CALL L15EF ; routine OUT-CODE for final digit. ; ---------------- ; The offset table ; ---------------- -; The BASIC interpreter has found a command code $CE - $FF -; which is then reduced to range $00 - $31 and added to the base address +; The BASIC interpreter has found a command code #CE - #FF +; which is then reduced to range #00 - #31 and added to the base address ; of this table to give the address of an offset which, when added to ; the offset therein, gives the location in the following parameter table ; where a list of class codes, separators and addresses relevant to the @@ -7661,262 +7609,262 @@ L1A48: DEFB L1AF9 - $ ; B1 offset to Address: P-DEF-FN ; is rather simple e.g. MOVE "M1","M2" ;; P-LET -L1A7A: DEFB $01 ; Class-01 - A variable is required. - DEFB $3D ; Separator: '=' - DEFB $02 ; Class-02 - An expression, numeric or string, +L1A7A: DEFB #01 ; Class-01 - A variable is required. + DEFB #3D ; Separator: '=' + DEFB #02 ; Class-02 - An expression, numeric or string, ; must follow. ;; P-GO-TO -L1A7D: DEFB $06 ; Class-06 - A numeric expression must follow. - DEFB $00 ; Class-00 - No further operands. - DEFW L1E67 ; Address: $1E67; Address: GO-TO +L1A7D: DEFB #06 ; Class-06 - A numeric expression must follow. + DEFB #00 ; Class-00 - No further operands. + DEFW L1E67 ; Address: #1E67; Address: GO-TO ;; P-IF -L1A81: DEFB $06 ; Class-06 - A numeric expression must follow. - DEFB $CB ; Separator: 'THEN' - DEFB $05 ; Class-05 - Variable syntax checked +L1A81: DEFB #06 ; Class-06 - A numeric expression must follow. + DEFB #CB ; Separator: 'THEN' + DEFB #05 ; Class-05 - Variable syntax checked ; by routine. - DEFW L1CF0 ; Address: $1CF0; Address: IF + DEFW L1CF0 ; Address: #1CF0; Address: IF ;; P-GO-SUB -L1A86: DEFB $06 ; Class-06 - A numeric expression must follow. - DEFB $00 ; Class-00 - No further operands. - DEFW L1EED ; Address: $1EED; Address: GO-SUB +L1A86: DEFB #06 ; Class-06 - A numeric expression must follow. + DEFB #00 ; Class-00 - No further operands. + DEFW L1EED ; Address: #1EED; Address: GO-SUB ;; P-STOP -L1A8A: DEFB $00 ; Class-00 - No further operands. - DEFW L1CEE ; Address: $1CEE; Address: STOP +L1A8A: DEFB #00 ; Class-00 - No further operands. + DEFW L1CEE ; Address: #1CEE; Address: STOP ;; P-RETURN -L1A8D: DEFB $00 ; Class-00 - No further operands. - DEFW L1F23 ; Address: $1F23; Address: RETURN +L1A8D: DEFB #00 ; Class-00 - No further operands. + DEFW L1F23 ; Address: #1F23; Address: RETURN ;; P-FOR -L1A90: DEFB $04 ; Class-04 - A single character variable must +L1A90: DEFB #04 ; Class-04 - A single character variable must ; follow. - DEFB $3D ; Separator: '=' - DEFB $06 ; Class-06 - A numeric expression must follow. - DEFB $CC ; Separator: 'TO' - DEFB $06 ; Class-06 - A numeric expression must follow. - DEFB $05 ; Class-05 - Variable syntax checked + DEFB #3D ; Separator: '=' + DEFB #06 ; Class-06 - A numeric expression must follow. + DEFB #CC ; Separator: 'TO' + DEFB #06 ; Class-06 - A numeric expression must follow. + DEFB #05 ; Class-05 - Variable syntax checked ; by routine. - DEFW L1D03 ; Address: $1D03; Address: FOR + DEFW L1D03 ; Address: #1D03; Address: FOR ;; P-NEXT -L1A98: DEFB $04 ; Class-04 - A single character variable must +L1A98: DEFB #04 ; Class-04 - A single character variable must ; follow. - DEFB $00 ; Class-00 - No further operands. - DEFW L1DAB ; Address: $1DAB; Address: NEXT + DEFB #00 ; Class-00 - No further operands. + DEFW L1DAB ; Address: #1DAB; Address: NEXT ;; P-PRINT -L1A9C: DEFB $05 ; Class-05 - Variable syntax checked entirely +L1A9C: DEFB #05 ; Class-05 - Variable syntax checked entirely ; by routine. - DEFW L1FCD ; Address: $1FCD; Address: PRINT + DEFW L1FCD ; Address: #1FCD; Address: PRINT ;; P-INPUT -L1A9F: DEFB $05 ; Class-05 - Variable syntax checked entirely +L1A9F: DEFB #05 ; Class-05 - Variable syntax checked entirely ; by routine. - DEFW L2089 ; Address: $2089; Address: INPUT + DEFW L2089 ; Address: #2089; Address: INPUT ;; P-DIM -L1AA2: DEFB $05 ; Class-05 - Variable syntax checked entirely +L1AA2: DEFB #05 ; Class-05 - Variable syntax checked entirely ; by routine. - DEFW L2C02 ; Address: $2C02; Address: DIM + DEFW L2C02 ; Address: #2C02; Address: DIM ;; P-REM -L1AA5: DEFB $05 ; Class-05 - Variable syntax checked entirely +L1AA5: DEFB #05 ; Class-05 - Variable syntax checked entirely ; by routine. - DEFW L1BB2 ; Address: $1BB2; Address: REM + DEFW L1BB2 ; Address: #1BB2; Address: REM ;; P-NEW -L1AA8: DEFB $00 ; Class-00 - No further operands. - DEFW L11B7 ; Address: $11B7; Address: NEW +L1AA8: DEFB #00 ; Class-00 - No further operands. + DEFW L11B7 ; Address: #11B7; Address: NEW ;; P-RUN -L1AAB: DEFB $03 ; Class-03 - A numeric expression may follow +L1AAB: DEFB #03 ; Class-03 - A numeric expression may follow ; else default to zero. - DEFW L1EA1 ; Address: $1EA1; Address: RUN + DEFW L1EA1 ; Address: #1EA1; Address: RUN ;; P-LIST -L1AAE: DEFB $05 ; Class-05 - Variable syntax checked entirely +L1AAE: DEFB #05 ; Class-05 - Variable syntax checked entirely ; by routine. - DEFW L17F9 ; Address: $17F9; Address: LIST + DEFW L17F9 ; Address: #17F9; Address: LIST ;; P-POKE -L1AB1: DEFB $08 ; Class-08 - Two comma-separated numeric +L1AB1: DEFB #08 ; Class-08 - Two comma-separated numeric ; expressions required. - DEFB $00 ; Class-00 - No further operands. - DEFW L1E80 ; Address: $1E80; Address: POKE + DEFB #00 ; Class-00 - No further operands. + DEFW L1E80 ; Address: #1E80; Address: POKE ;; P-RANDOM -L1AB5: DEFB $03 ; Class-03 - A numeric expression may follow +L1AB5: DEFB #03 ; Class-03 - A numeric expression may follow ; else default to zero. - DEFW L1E4F ; Address: $1E4F; Address: RANDOMIZE + DEFW L1E4F ; Address: #1E4F; Address: RANDOMIZE ;; P-CONT -L1AB8: DEFB $00 ; Class-00 - No further operands. - DEFW L1E5F ; Address: $1E5F; Address: CONTINUE +L1AB8: DEFB #00 ; Class-00 - No further operands. + DEFW L1E5F ; Address: #1E5F; Address: CONTINUE ;; P-CLEAR -L1ABB: DEFB $03 ; Class-03 - A numeric expression may follow +L1ABB: DEFB #03 ; Class-03 - A numeric expression may follow ; else default to zero. - DEFW L1EAC ; Address: $1EAC; Address: CLEAR + DEFW L1EAC ; Address: #1EAC; Address: CLEAR ;; P-CLS -L1ABE: DEFB $00 ; Class-00 - No further operands. - DEFW L0D6B ; Address: $0D6B; Address: CLS +L1ABE: DEFB #00 ; Class-00 - No further operands. + DEFW L0D6B ; Address: #0D6B; Address: CLS ;; P-PLOT -L1AC1: DEFB $09 ; Class-09 - Two comma-separated numeric +L1AC1: DEFB #09 ; Class-09 - Two comma-separated numeric ; expressions required with optional colour ; items. - DEFB $00 ; Class-00 - No further operands. - DEFW L22DC ; Address: $22DC; Address: PLOT + DEFB #00 ; Class-00 - No further operands. + DEFW L22DC ; Address: #22DC; Address: PLOT ;; P-PAUSE -L1AC5: DEFB $06 ; Class-06 - A numeric expression must follow. - DEFB $00 ; Class-00 - No further operands. - DEFW L1F3A ; Address: $1F3A; Address: PAUSE +L1AC5: DEFB #06 ; Class-06 - A numeric expression must follow. + DEFB #00 ; Class-00 - No further operands. + DEFW L1F3A ; Address: #1F3A; Address: PAUSE ;; P-READ -L1AC9: DEFB $05 ; Class-05 - Variable syntax checked entirely +L1AC9: DEFB #05 ; Class-05 - Variable syntax checked entirely ; by routine. - DEFW L1DED ; Address: $1DED; Address: READ + DEFW L1DED ; Address: #1DED; Address: READ ;; P-DATA -L1ACC: DEFB $05 ; Class-05 - Variable syntax checked entirely +L1ACC: DEFB #05 ; Class-05 - Variable syntax checked entirely ; by routine. - DEFW L1E27 ; Address: $1E27; Address: DATA + DEFW L1E27 ; Address: #1E27; Address: DATA ;; P-RESTORE -L1ACF: DEFB $03 ; Class-03 - A numeric expression may follow +L1ACF: DEFB #03 ; Class-03 - A numeric expression may follow ; else default to zero. - DEFW L1E42 ; Address: $1E42; Address: RESTORE + DEFW L1E42 ; Address: #1E42; Address: RESTORE ;; P-DRAW -L1AD2: DEFB $09 ; Class-09 - Two comma-separated numeric +L1AD2: DEFB #09 ; Class-09 - Two comma-separated numeric ; expressions required with optional colour ; items. - DEFB $05 ; Class-05 - Variable syntax checked + DEFB #05 ; Class-05 - Variable syntax checked ; by routine. - DEFW L2382 ; Address: $2382; Address: DRAW + DEFW L2382 ; Address: #2382; Address: DRAW ;; P-COPY -L1AD6: DEFB $00 ; Class-00 - No further operands. - DEFW L0EAC ; Address: $0EAC; Address: COPY +L1AD6: DEFB #00 ; Class-00 - No further operands. + DEFW L0EAC ; Address: #0EAC; Address: COPY ;; P-LPRINT -L1AD9: DEFB $05 ; Class-05 - Variable syntax checked entirely +L1AD9: DEFB #05 ; Class-05 - Variable syntax checked entirely ; by routine. - DEFW L1FC9 ; Address: $1FC9; Address: LPRINT + DEFW L1FC9 ; Address: #1FC9; Address: LPRINT ;; P-LLIST -L1ADC: DEFB $05 ; Class-05 - Variable syntax checked entirely +L1ADC: DEFB #05 ; Class-05 - Variable syntax checked entirely ; by routine. - DEFW L17F5 ; Address: $17F5; Address: LLIST + DEFW L17F5 ; Address: #17F5; Address: LLIST ;; P-SAVE -L1ADF: DEFB $0B ; Class-0B - Offset address converted to tape +L1ADF: DEFB #0B ; Class-0B - Offset address converted to tape ; command. ;; P-LOAD -L1AE0: DEFB $0B ; Class-0B - Offset address converted to tape +L1AE0: DEFB #0B ; Class-0B - Offset address converted to tape ; command. ;; P-VERIFY -L1AE1: DEFB $0B ; Class-0B - Offset address converted to tape +L1AE1: DEFB #0B ; Class-0B - Offset address converted to tape ; command. ;; P-MERGE -L1AE2: DEFB $0B ; Class-0B - Offset address converted to tape +L1AE2: DEFB #0B ; Class-0B - Offset address converted to tape ; command. ;; P-BEEP -L1AE3: DEFB $08 ; Class-08 - Two comma-separated numeric +L1AE3: DEFB #08 ; Class-08 - Two comma-separated numeric ; expressions required. - DEFB $00 ; Class-00 - No further operands. - DEFW L03F8 ; Address: $03F8; Address: BEEP + DEFB #00 ; Class-00 - No further operands. + DEFW L03F8 ; Address: #03F8; Address: BEEP ;; P-CIRCLE -L1AE7: DEFB $09 ; Class-09 - Two comma-separated numeric +L1AE7: DEFB #09 ; Class-09 - Two comma-separated numeric ; expressions required with optional colour ; items. - DEFB $05 ; Class-05 - Variable syntax checked + DEFB #05 ; Class-05 - Variable syntax checked ; by routine. - DEFW L2320 ; Address: $2320; Address: CIRCLE + DEFW L2320 ; Address: #2320; Address: CIRCLE ;; P-INK -L1AEB: DEFB $07 ; Class-07 - Offset address is converted to +L1AEB: DEFB #07 ; Class-07 - Offset address is converted to ; colour code. ;; P-PAPER -L1AEC: DEFB $07 ; Class-07 - Offset address is converted to +L1AEC: DEFB #07 ; Class-07 - Offset address is converted to ; colour code. ;; P-FLASH -L1AED: DEFB $07 ; Class-07 - Offset address is converted to +L1AED: DEFB #07 ; Class-07 - Offset address is converted to ; colour code. ;; P-BRIGHT -L1AEE: DEFB $07 ; Class-07 - Offset address is converted to +L1AEE: DEFB #07 ; Class-07 - Offset address is converted to ; colour code. ;; P-INVERSE -L1AEF: DEFB $07 ; Class-07 - Offset address is converted to +L1AEF: DEFB #07 ; Class-07 - Offset address is converted to ; colour code. ;; P-OVER -L1AF0: DEFB $07 ; Class-07 - Offset address is converted to +L1AF0: DEFB #07 ; Class-07 - Offset address is converted to ; colour code. ;; P-OUT -L1AF1: DEFB $08 ; Class-08 - Two comma-separated numeric +L1AF1: DEFB #08 ; Class-08 - Two comma-separated numeric ; expressions required. - DEFB $00 ; Class-00 - No further operands. - DEFW L1E7A ; Address: $1E7A; Address: OUT + DEFB #00 ; Class-00 - No further operands. + DEFW L1E7A ; Address: #1E7A; Address: OUT ;; P-BORDER -L1AF5: DEFB $06 ; Class-06 - A numeric expression must follow. - DEFB $00 ; Class-00 - No further operands. - DEFW L2294 ; Address: $2294; Address: BORDER +L1AF5: DEFB #06 ; Class-06 - A numeric expression must follow. + DEFB #00 ; Class-00 - No further operands. + DEFW L2294 ; Address: #2294; Address: BORDER ;; P-DEF-FN -L1AF9: DEFB $05 ; Class-05 - Variable syntax checked entirely +L1AF9: DEFB #05 ; Class-05 - Variable syntax checked entirely ; by routine. - DEFW L1F60 ; Address: $1F60; Address: DEF-FN + DEFW L1F60 ; Address: #1F60; Address: DEF-FN ;; P-OPEN -L1AFC: DEFB $06 ; Class-06 - A numeric expression must follow. - DEFB $2C ; Separator: ',' see Footnote * - DEFB $0A ; Class-0A - A string expression must follow. - DEFB $00 ; Class-00 - No further operands. - DEFW L1736 ; Address: $1736; Address: OPEN +L1AFC: DEFB #06 ; Class-06 - A numeric expression must follow. + DEFB #2C ; Separator: ',' see Footnote * + DEFB #0A ; Class-0A - A string expression must follow. + DEFB #00 ; Class-00 - No further operands. + DEFW L1736 ; Address: #1736; Address: OPEN ;; P-CLOSE -L1B02: DEFB $06 ; Class-06 - A numeric expression must follow. - DEFB $00 ; Class-00 - No further operands. - DEFW L16E5 ; Address: $16E5; Address: CLOSE +L1B02: DEFB #06 ; Class-06 - A numeric expression must follow. + DEFB #00 ; Class-00 - No further operands. + DEFW L16E5 ; Address: #16E5; Address: CLOSE ;; P-FORMAT -L1B06: DEFB $0A ; Class-0A - A string expression must follow. - DEFB $00 ; Class-00 - No further operands. - DEFW L1793 ; Address: $1793; Address: CAT-ETC +L1B06: DEFB #0A ; Class-0A - A string expression must follow. + DEFB #00 ; Class-00 - No further operands. + DEFW L1793 ; Address: #1793; Address: CAT-ETC ;; P-MOVE -L1B0A: DEFB $0A ; Class-0A - A string expression must follow. - DEFB $2C ; Separator: ',' - DEFB $0A ; Class-0A - A string expression must follow. - DEFB $00 ; Class-00 - No further operands. - DEFW L1793 ; Address: $1793; Address: CAT-ETC +L1B0A: DEFB #0A ; Class-0A - A string expression must follow. + DEFB #2C ; Separator: ',' + DEFB #0A ; Class-0A - A string expression must follow. + DEFB #00 ; Class-00 - No further operands. + DEFW L1793 ; Address: #1793; Address: CAT-ETC ;; P-ERASE -L1B10: DEFB $0A ; Class-0A - A string expression must follow. - DEFB $00 ; Class-00 - No further operands. - DEFW L1793 ; Address: $1793; Address: CAT-ETC +L1B10: DEFB #0A ; Class-0A - A string expression must follow. + DEFB #00 ; Class-00 - No further operands. + DEFW L1793 ; Address: #1793; Address: CAT-ETC ;; P-CAT -L1B14: DEFB $00 ; Class-00 - No further operands. - DEFW L1793 ; Address: $1793; Address: CAT-ETC +L1B14: DEFB #00 ; Class-00 - No further operands. + DEFW L1793 ; Address: #1793; Address: CAT-ETC ; * Note that a comma is required as a separator with the OPEN command ; but the Interface 1 programmers relaxed this allowing ';' as an @@ -7932,14 +7880,14 @@ L1B14: DEFB $00 ; Class-00 - No further operands. ; requires checking. ;; LINE-SCAN -L1B17: RES 7,(IY+$01) ; update FLAGS - signal checking syntax +L1B17: RES 7,(IY+#01) ; update FLAGS - signal checking syntax CALL L19FB ; routine E-LINE-NO >> ; fetches the line number if in range. XOR A ; clear the accumulator. - LD ($5C47),A ; set statement number SUBPPC to zero. - DEC A ; set accumulator to $FF. - LD ($5C3A),A ; set ERR_NR to 'OK' - 1. + LD (#5C47),A ; set statement number SUBPPC to zero. + DEC A ; set accumulator to #FF. + LD (#5C3A),A ; set ERR_NR to 'OK' - 1. JR L1B29 ; forward to continue at STMT-L-1. ; -------------- @@ -7955,20 +7903,20 @@ L1B28: RST 20H ; NEXT-CHAR ;; STMT-L-1 L1B29: CALL L16BF ; routine SET-WORK clears workspace etc. - INC (IY+$0D) ; increment statement number SUBPPC + INC (IY+#0D) ; increment statement number SUBPPC JP M,L1C8A ; to REPORT-C to raise ; 'Nonsense in BASIC' if over 127. RST 18H ; GET-CHAR - LD B,$00 ; set B to zero for later indexing. + LD B,#00 ; set B to zero for later indexing. ; early so any other reason ??? - CP $0D ; is character carriage return ? + CP #0D ; is character carriage return ? ; i.e. an empty statement. JR Z,L1BB3 ; forward to LINE-END if so. - CP $3A ; is it statement end marker ':' ? + CP #3A ; is it statement end marker ':' ? ; i.e. another type of empty statement. JR Z,L1B28 ; back to STMT-LOOP if so. @@ -7980,7 +7928,7 @@ L1B29: CALL L16BF ; routine SET-WORK clears workspace etc. RST 20H ; NEXT-CHAR to advance pointer LD A,C ; restore current character - SUB $CE ; subtract 'DEF FN' - first command + SUB #CE ; subtract 'DEF FN' - first command JP C,L1C8A ; jump to REPORT-C if less than a command ; raising ; 'Nonsense in BASIC' @@ -8000,7 +7948,7 @@ L1B29: CALL L16BF ; routine SET-WORK clears workspace etc. ; ;; SCAN-LOOP -L1B52: LD HL,($5C74) ; fetch temporary address from T_ADDR +L1B52: LD HL,(#5C74) ; fetch temporary address from T_ADDR ; during subsequent loops. ; -> the initial entry point with HL addressing start of syntax table entry. @@ -8008,17 +7956,17 @@ L1B52: LD HL,($5C74) ; fetch temporary address from T_ADDR ;; GET-PARAM L1B55: LD A,(HL) ; pick up the parameter. INC HL ; address next one. - LD ($5C74),HL ; save pointer in system variable T_ADDR + LD (#5C74),HL ; save pointer in system variable T_ADDR LD BC,L1B52 ; address: SCAN-LOOP PUSH BC ; is now pushed on stack as looping address. LD C,A ; store parameter in C. - CP $20 ; is it greater than ' ' ? + CP #20 ; is it greater than ' ' ? JR NC,L1B6F ; forward to SEPARATOR to check that correct ; separator appears in statement if so. LD HL,L1C01 ; address: class-tbl. - LD B,$00 ; prepare to index into the class table. + LD B,#00 ; prepare to index into the class table. ADD HL,BC ; index to find displacement to routine. LD C,(HL) ; displacement to BC ADD HL,BC ; add to address the CLASS routine. @@ -8065,7 +8013,7 @@ L1B76: CALL L1F54 ; routine BREAK-KEY is tested after every ;; REPORT-L L1B7B: RST 08H ; ERROR-1 - DEFB $14 ; Error Report: BREAK into program + DEFB #14 ; Error Report: BREAK into program ;; STMT-R-1 L1B7D: CALL L3B4D ; Spectrum 128 patch @@ -8073,7 +8021,7 @@ L1B7D: CALL L3B4D ; Spectrum 128 patch L1B81: JR NZ,L1BF4 ; forward to STMT-NEXT if a program line. - LD HL,($5C42) ; fetch line number from NEWPPC + LD HL,(#5C42) ; fetch line number from NEWPPC BIT 7,H ; will be set if minus two - direct command(s) JR Z,L1B9E ; forward to LINE-NEW if a jump is to be ; made to a new program line/statement. @@ -8085,13 +8033,13 @@ L1B81: JR NZ,L1BF4 ; forward to STMT-NEXT if a program line. ; the next statement of a direct command is to be considered. ;; LINE-RUN -L1B8A: LD HL,$FFFE ; The dummy value minus two - LD ($5C45),HL ; is set/reset as line number in PPC. - LD HL,($5C61) ; point to end of line + 1 - WORKSP. - DEC HL ; now point to $80 end-marker. - LD DE,($5C59) ; address the start of line E_LINE. +L1B8A: LD HL,#FFFE ; The dummy value minus two + LD (#5C45),HL ; is set/reset as line number in PPC. + LD HL,(#5C61) ; point to end of line + 1 - WORKSP. + DEC HL ; now point to #80 end-marker. + LD DE,(#5C59) ; address the start of line E_LINE. DEC DE ; now location before - for GET-CHAR. - LD A,($5C44) ; load statement to A from NSPPC. + LD A,(#5C44) ; load statement to A from NSPPC. JR L1BD1 ; forward to NEXT-LINE. ; ------------------------------ @@ -8104,7 +8052,7 @@ L1B8A: LD HL,$FFFE ; The dummy value minus two ;; LINE-NEW L1B9E: CALL L196E ; routine LINE-ADDR gets address of line ; returning zero flag set if line found. - LD A,($5C44) ; fetch new statement from NSPPC + LD A,(#5C44) ; fetch new statement from NSPPC JR Z,L1BBF ; forward to LINE-USE if line matched. ; continue as must be a direct command. @@ -8117,8 +8065,8 @@ L1B9E: CALL L196E ; routine LINE-ADDR gets address of line LD B,A ; save statement in B. ? LD A,(HL) ; fetch high byte of line number. - AND $C0 ; test if using direct command - ; a program line is less than $3F + AND #C0 ; test if using direct command + ; a program line is less than #3F LD A,B ; retrieve statement. ; (we can assume it is zero). JR Z,L1BBF ; forward to LINE-USE if was a program line @@ -8127,7 +8075,7 @@ L1B9E: CALL L196E ; routine LINE-ADDR gets address of line ;; REPORT-0 L1BB0: RST 08H ; ERROR-1 - DEFB $FF ; Error Report: OK + DEFB #FF ; Error Report: OK ; ------------------ ; Handle REM command @@ -8149,9 +8097,9 @@ L1BB2: POP BC ; drop return address STMT-RET and L1BB3: CALL L2530 ; routine SYNTAX-Z (UNSTACK-Z?) RET Z ; return if checking syntax. - LD HL,($5C55) ; fetch NXTLIN to HL. - LD A,$C0 ; test against the - AND (HL) ; system limit $3F. + LD HL,(#5C55) ; fetch NXTLIN to HL. + LD A,#C0 ; test against the + AND (HL) ; system limit #3F. RET NZ ; return if more as must be ; end of program. ; (or direct command) @@ -8168,13 +8116,13 @@ L1BB3: CALL L2530 ; routine SYNTAX-Z (UNSTACK-Z?) ; First make statement zero number one leaving others unaffected. ;; LINE-USE -L1BBF: CP $01 ; will set carry if zero. - ADC A,$00 ; add in any carry. +L1BBF: CP #01 ; will set carry if zero. + ADC A,#00 ; add in any carry. LD D,(HL) ; high byte of line number to D. INC HL ; advance pointer. LD E,(HL) ; low byte of line number to E. - LD ($5C45),DE ; set system variable PPC. + LD (#5C45),DE ; set system variable PPC. INC HL ; advance pointer. LD E,(HL) ; low byte of line length to E. @@ -8190,21 +8138,21 @@ L1BBF: CP $01 ; will set carry if zero. ; previous line or edit line. ; ----------------------------- ; The pointer will be the next line if continuing from above or to -; edit line end-marker ($80) if from LINE-RUN. +; edit line end-marker (#80) if from LINE-RUN. ;; NEXT-LINE -L1BD1: LD ($5C55),HL ; store pointer in system variable NXTLIN +L1BD1: LD (#5C55),HL ; store pointer in system variable NXTLIN EX DE,HL ; bring back pointer to previous or edit line - LD ($5C5D),HL ; and update CH_ADD with character address. + LD (#5C5D),HL ; and update CH_ADD with character address. LD D,A ; store statement in D. - LD E,$00 ; set E to zero to suppress token searching + LD E,#00 ; set E to zero to suppress token searching ; if EACH-STMT is to be called. - LD (IY+$0A),$FF ; set statement NSPPC to $FF signalling + LD (IY+#0A),#FF ; set statement NSPPC to #FF signalling ; no jump to be made. DEC D ; decrement and test statement - LD (IY+$0D),D ; set SUBPPC to decremented statement number. + LD (IY+#0D),D ; set SUBPPC to decremented statement number. JP Z,L1B28 ; to STMT-LOOP if result zero as statement is ; at start of line and address is known. @@ -8215,7 +8163,7 @@ L1BD1: LD ($5C55),HL ; store pointer in system variable NXTLIN ;; REPORT-N L1BEC: RST 08H ; ERROR-1 - DEFB $16 ; Error Report: Statement lost + DEFB #16 ; Error Report: Statement lost ; ----------------- ; End of statement? @@ -8243,14 +8191,14 @@ L1BF4: CALL L3B5D ; Spectrum 128 patch L1BF7: JR Z,L1BB3 ; back to LINE-END if so. - CP $3A ; is it ':' ? + CP #3A ; is it ':' ? JP Z,L1B28 ; jump back to STMT-LOOP to consider ; further statements JP L1C8A ; jump to REPORT-C with any other character ; 'Nonsense in BASIC'. -; Note. the two-byte sequence 'rst 08; defb $0b' could replace the above jp. +; Note. the two-byte sequence 'rst 08; defb #0b' could replace the above jp. ; ------------------- ; Command class table @@ -8294,7 +8242,7 @@ L1C11: POP BC ; drop address SCAN-LOOP. ; as should be no further characters. EX DE,HL ; save HL to DE. - LD HL,($5C74) ; fetch T_ADDR + LD HL,(#5C74) ; fetch T_ADDR LD C,(HL) ; fetch low byte of routine INC HL ; address next. LD B,(HL) ; fetch high byte of routine. @@ -8321,35 +8269,35 @@ L1C1F: CALL L28B2 ; routine LOOK-VARS returns carry set if not ; ;; VAR-A-1 -L1C22: LD (IY+$37),$00 ; set FLAGX to zero +L1C22: LD (IY+#37),#00 ; set FLAGX to zero JR NC,L1C30 ; forward to VAR-A-2 if found or checking ; syntax. - SET 1,(IY+$37) ; FLAGX - Signal a new variable + SET 1,(IY+#37) ; FLAGX - Signal a new variable JR NZ,L1C46 ; to VAR-A-3 if not assigning to an array ; e.g. LET a$(3,3) = "X" ;; REPORT-2 L1C2E: RST 08H ; ERROR-1 - DEFB $01 ; Error Report: Variable not found + DEFB #01 ; Error Report: Variable not found ;; VAR-A-2 L1C30: CALL Z,L2996 ; routine STK-VAR considers a subscript/slice - BIT 6,(IY+$01) ; test FLAGS - Numeric or string result ? + BIT 6,(IY+#01) ; test FLAGS - Numeric or string result ? JR NZ,L1C46 ; to VAR-A-3 if numeric XOR A ; default to array/slice - to be retained. CALL L2530 ; routine SYNTAX-Z CALL NZ,L2BF1 ; routine STK-FETCH is called in runtime ; may overwrite A with 1. - LD HL,$5C71 ; address system variable FLAGX + LD HL,#5C71 ; address system variable FLAGX OR (HL) ; set bit 0 if simple variable to be reclaimed LD (HL),A ; update FLAGX EX DE,HL ; start of string/subscript to DE ;; VAR-A-3 -L1C46: LD ($5C72),BC ; update STRLEN - LD ($5C4D),HL ; and DEST of assigned string. +L1C46: LD (#5C72),BC ; update STRLEN + LD (#5C4D),HL ; and DEST of assigned string. RET ; return. ; ------------------------------------------------- @@ -8370,15 +8318,15 @@ L1C4E: POP BC ; drop return address SCAN-LOOP ; ;; VAL-FET-1 -L1C56: LD A,($5C3B) ; initial FLAGS to A +L1C56: LD A,(#5C3B) ; initial FLAGS to A ;; VAL-FET-2 L1C59: PUSH AF ; save A briefly CALL L24FB ; routine SCANNING evaluates expression. POP AF ; restore A - LD D,(IY+$01) ; post-SCANNING FLAGS to D + LD D,(IY+#01) ; post-SCANNING FLAGS to D XOR D ; xor the two sets of flags - AND $40 ; pick up bit 6 of xored FLAGS should be zero + AND #40 ; pick up bit 6 of xored FLAGS should be zero JR NZ,L1C8A ; forward to REPORT-C if not zero ; 'Nonsense in BASIC' - results don't agree. @@ -8397,8 +8345,8 @@ L1C59: PUSH AF ; save A briefly L1C6C: CALL L28B2 ; routine LOOK-VARS PUSH AF ; preserve flags. LD A,C ; fetch type - should be 011xxxxx - OR $9F ; combine with 10011111. - INC A ; test if now $FF by incrementing. + OR #9F ; combine with 10011111. + INC A ; test if now #FF by incrementing. JR NZ,L1C8A ; forward to REPORT-C if result not zero. POP AF ; else restore flags. @@ -8421,7 +8369,7 @@ L1C79: RST 20H ; NEXT-CHAR advance past 'AT' or '('. ;; EXPT-2NUM L1C7A: CALL L1C82 ; routine EXPT-1NUM is called for first ; numeric expression - CP $2C ; is character ',' ? + CP #2C ; is character ',' ? JR NZ,L1C8A ; to REPORT-C if not required separator. ; 'Nonsense in BASIC'. @@ -8432,12 +8380,12 @@ L1C7A: CALL L1C82 ; routine EXPT-1NUM is called for first ;; CLASS-06 ;; EXPT-1NUM L1C82: CALL L24FB ; routine SCANNING - BIT 6,(IY+$01) ; test FLAGS - Numeric or string result ? + BIT 6,(IY+#01) ; test FLAGS - Numeric or string result ? RET NZ ; return if result is numeric. ;; REPORT-C L1C8A: RST 08H ; ERROR-1 - DEFB $0B ; Error Report: Nonsense in BASIC + DEFB #0B ; Error Report: Nonsense in BASIC ; --------------------------------------------------------------- ; class-0A e.g. ERASE "????" ; a string expression must follow. @@ -8448,7 +8396,7 @@ L1C8A: RST 08H ; ERROR-1 ;; CLASS-0A ;; EXPT-EXP L1C8C: CALL L24FB ; routine SCANNING - BIT 6,(IY+$01) ; test FLAGS - Numeric or string result ? + BIT 6,(IY+#01) ; test FLAGS - Numeric or string result ? RET Z ; return if string result. JR L1C8A ; back to REPORT-C if numeric. @@ -8463,20 +8411,20 @@ L1C8C: CALL L24FB ; routine SCANNING ; Note. these commands should ensure that current channel is 'S' ;; CLASS-07 -L1C96: BIT 7,(IY+$01) ; test FLAGS - checking syntax only ? - RES 0,(IY+$02) ; update TV_FLAG - signal main screen in use +L1C96: BIT 7,(IY+#01) ; test FLAGS - checking syntax only ? + RES 0,(IY+#02) ; update TV_FLAG - signal main screen in use CALL NZ,L0D4D ; routine TEMPS is called in runtime. POP AF ; drop return address SCAN-LOOP - LD A,($5C74) ; T_ADDR_lo to accumulator. - ; points to '$07' entry + 1 - ; e.g. for INK points to $EC now + LD A,(#5C74) ; T_ADDR_lo to accumulator. + ; points to '#07' entry + 1 + ; e.g. for INK points to #EC now ; Note if you move alter the syntax table next line may have to be altered. -; Note. For ZASM assembler replace following expression with SUB $13. +; Note. For ZASM assembler replace following expression with SUB #13. -L1CA5: SUB low (L1AEB-$D8) ; convert $EB to $D8 ('INK') etc. - ; ( is SUB $13 in standard ROM ) +L1CA5: SUB low (L1AEB-#D8) ; convert #EB to #D8 ('INK') etc. + ; ( is SUB #13 in standard ROM ) CALL L21FC ; routine CO-TEMP-4 CALL L1BEE ; routine CHECK-END check that nothing else @@ -8484,13 +8432,13 @@ L1CA5: SUB low (L1AEB-$D8) ; convert $EB to $D8 ('INK') etc. ; return here in runtime. - LD HL,($5C8F) ; pick up ATTR_T and MASK_T - LD ($5C8D),HL ; and store in ATTR_P and MASK_P - LD HL,$5C91 ; point to P_FLAG. + LD HL,(#5C8F) ; pick up ATTR_T and MASK_T + LD (#5C8D),HL ; and store in ATTR_P and MASK_P + LD HL,#5C91 ; point to P_FLAG. LD A,(HL) ; pick up in A RLCA ; rotate to left XOR (HL) ; combine with HL - AND $AA ; 10101010 + AND #AA ; 10101010 XOR (HL) ; only permanent bits affected LD (HL),A ; reload into P_FLAG. RET ; return. @@ -8507,13 +8455,13 @@ L1CA5: SUB low (L1AEB-$D8) ; convert $EB to $D8 ('INK') etc. L1CBE: CALL L2530 ; routine SYNTAX-Z JR Z,L1CD6 ; forward to CL-09-1 if checking syntax. - RES 0,(IY+$02) ; update TV_FLAG - signal main screen in use + RES 0,(IY+#02) ; update TV_FLAG - signal main screen in use CALL L0D4D ; routine TEMPS is called. - LD HL,$5C90 ; point to MASK_T + LD HL,#5C90 ; point to MASK_T LD A,(HL) ; fetch mask to accumulator. - OR $F8 ; or with 11111000 paper/bright/flash 8 + OR #F8 ; or with 11111000 paper/bright/flash 8 LD (HL),A ; mask back to MASK_T system variable. - RES 6,(IY+$57) ; reset P_FLAG - signal NOT PAPER 9 ? + RES 6,(IY+#57) ; reset P_FLAG - signal NOT PAPER 9 ? RST 18H ; GET-CHAR @@ -8550,10 +8498,10 @@ L1CDB: JP L0605 ; jump way back to SAVE-ETC ; Also called from LIST-4. ;; FETCH-NUM -L1CDE: CP $0D ; is character a carriage return ? +L1CDE: CP #0D ; is character a carriage return ? JR Z,L1CE6 ; forward to USE-ZERO if so - CP $3A ; is it ':' ? + CP #3A ; is it ':' ? JR NZ,L1C82 ; forward to EXPT-1NUM if not. ; else continue and use zero. @@ -8568,8 +8516,8 @@ L1CE6: CALL L2530 ; routine SYNTAX-Z (UNSTACK-Z?) RET Z ; RST 28H ;; FP-CALC - DEFB $A0 ;;stk-zero ;0. - DEFB $38 ;;end-calc + DEFB #A0 ;;stk-zero ;0. + DEFB #38 ;;end-calc RET ; return. @@ -8582,7 +8530,7 @@ L1CE6: CALL L2530 ; routine SYNTAX-Z (UNSTACK-Z?) ;; REPORT-9 ;; STOP L1CEE: RST 08H ; ERROR-1 - DEFB $08 ; Error Report: STOP statement + DEFB #08 ; Error Report: STOP statement ; ----------------- ; Handle IF command @@ -8601,8 +8549,8 @@ L1CF0: POP BC ; drop return address - STMT-RET RST 28H ;; FP-CALC score>100 (1=TRUE 0=FALSE) - DEFB $02 ;;delete . - DEFB $38 ;;end-calc + DEFB #02 ;;delete . + DEFB #38 ;;end-calc EX DE,HL ; make HL point to deleted value CALL L34E9 ; routine TEST-ZERO @@ -8623,7 +8571,7 @@ L1D00: JP L1B29 ; to STMT-L-1, if true (1) to execute command ; The routine begins by checking for an optional STEP. ;; FOR -L1D03: CP $CD ; is there a 'STEP' ? +L1D03: CP #CD ; is there a 'STEP' ? JR NZ,L1D10 ; to F-USE-1 if not to use 1 as default. RST 20H ; NEXT-CHAR @@ -8637,34 +8585,34 @@ L1D03: CP $CD ; is there a 'STEP' ? L1D10: CALL L1BEE ; routine CHECK-END RST 28H ;; FP-CALC v,l. - DEFB $A1 ;;stk-one v,l,1=s. - DEFB $38 ;;end-calc + DEFB #A1 ;;stk-one v,l,1=s. + DEFB #38 ;;end-calc ;; F-REORDER L1D16: RST 28H ;; FP-CALC v,l,s. - DEFB $C0 ;;st-mem-0 v,l,s. - DEFB $02 ;;delete v,l. - DEFB $01 ;;exchange l,v. - DEFB $E0 ;;get-mem-0 l,v,s. - DEFB $01 ;;exchange l,s,v. - DEFB $38 ;;end-calc + DEFB #C0 ;;st-mem-0 v,l,s. + DEFB #02 ;;delete v,l. + DEFB #01 ;;exchange l,v. + DEFB #E0 ;;get-mem-0 l,v,s. + DEFB #01 ;;exchange l,s,v. + DEFB #38 ;;end-calc CALL L2AFF ; routine LET assigns the initial value v to ; the variable altering type if necessary. - LD ($5C68),HL ; The system variable MEM is made to point to + LD (#5C68),HL ; The system variable MEM is made to point to ; the variable instead of its normal ; location MEMBOT DEC HL ; point to single-character name LD A,(HL) ; fetch name SET 7,(HL) ; set bit 7 at location - LD BC,$0006 ; add six to HL + LD BC,#0006 ; add six to HL ADD HL,BC ; to address where limit should be. RLCA ; test bit 7 of original name. JR C,L1D34 ; forward to F-L-S if already a FOR/NEXT ; variable - LD C,$0D ; otherwise an additional 13 bytes are needed. + LD C,#0D ; otherwise an additional 13 bytes are needed. ; 5 for each value, two for line number and ; 1 byte for looping statement. CALL L1655 ; routine MAKE-ROOM creates them. @@ -8674,21 +8622,21 @@ L1D16: RST 28H ;; FP-CALC v,l,s. L1D34: PUSH HL ; save position. RST 28H ;; FP-CALC l,s. - DEFB $02 ;;delete l. - DEFB $02 ;;delete . - DEFB $38 ;;end-calc + DEFB #02 ;;delete l. + DEFB #02 ;;delete . + DEFB #38 ;;end-calc ; DE points to STKEND, l. POP HL ; restore variable position EX DE,HL ; swap pointers - LD C,$0A ; ten bytes to move + LD C,#0A ; ten bytes to move LDIR ; Copy 'deleted' values to variable. - LD HL,($5C45) ; Load with current line number from PPC + LD HL,(#5C45) ; Load with current line number from PPC EX DE,HL ; exchange pointers. LD (HL),E ; save the looping line INC HL ; in the next LD (HL),D ; two locations. - LD D,(IY+$0D) ; fetch statement from SUBPPC system variable. + LD D,(IY+#0D) ; fetch statement from SUBPPC system variable. INC D ; increment statement. INC HL ; and pointer LD (HL),D ; and store the looping statement. @@ -8699,29 +8647,29 @@ L1D34: PUSH HL ; save position. ; no loop is possible so execution continues after the matching 'NEXT' - LD B,(IY+$38) ; get single-character name from STRLEN_lo - LD HL,($5C45) ; get the current line from PPC - LD ($5C42),HL ; and store it in NEWPPC - LD A,($5C47) ; fetch current statement from SUBPPC + LD B,(IY+#38) ; get single-character name from STRLEN_lo + LD HL,(#5C45) ; get the current line from PPC + LD (#5C42),HL ; and store it in NEWPPC + LD A,(#5C47) ; fetch current statement from SUBPPC NEG ; Negate as counter decrements from zero ; initially and we are in the middle of a ; line. LD D,A ; Store result in D. - LD HL,($5C5D) ; get current address from CH_ADD - LD E,$F3 ; search will be for token 'NEXT' + LD HL,(#5C5D) ; get current address from CH_ADD + LD E,#F3 ; search will be for token 'NEXT' ;; F-LOOP L1D64: PUSH BC ; save variable name. - LD BC,($5C55) ; fetch NXTLIN + LD BC,(#5C55) ; fetch NXTLIN CALL L1D86 ; routine LOOK-PROG searches for 'NEXT' token. - LD ($5C55),BC ; update NXTLIN + LD (#5C55),BC ; update NXTLIN POP BC ; and fetch the letter JR C,L1D84 ; forward to REPORT-I if the end of program ; was reached by LOOK-PROG. ; 'FOR without NEXT' RST 20H ; NEXT-CHAR fetches character after NEXT - OR $20 ; ensure it is upper-case. + OR #20 ; ensure it is upper-case. CP B ; compare with FOR variable name JR Z,L1D7C ; forward to F-FOUND if it matches. @@ -8735,16 +8683,16 @@ L1D64: PUSH BC ; save variable name. ;; F-FOUND L1D7C: RST 20H ; NEXT-CHAR - LD A,$01 ; subtract the negated counter from 1 + LD A,#01 ; subtract the negated counter from 1 SUB D ; to give the statement after the NEXT - LD ($5C44),A ; set system variable NSPPC + LD (#5C44),A ; set system variable NSPPC RET ; return to STMT-RET to branch to new ; line and statement. -> ; --- ;; REPORT-I L1D84: RST 08H ; ERROR-1 - DEFB $11 ; Error Report: FOR without NEXT + DEFB #11 ; Error Report: FOR without NEXT ; --------- ; LOOK-PROG @@ -8756,7 +8704,7 @@ L1D84: RST 08H ; ERROR-1 ;; LOOK-PROG L1D86: LD A,(HL) ; fetch current character - CP $3A ; is it ':' a statement separator ? + CP #3A ; is it ':' a statement separator ? JR Z,L1DA3 ; forward to LOOK-P-2 if so. ; The starting point was PROG - 1 or the end of a line. @@ -8764,7 +8712,7 @@ L1D86: LD A,(HL) ; fetch current character ;; LOOK-P-1 L1D8B: INC HL ; increment pointer to address LD A,(HL) ; the high byte of line number - AND $C0 ; test for program end marker $80 or a + AND #C0 ; test for program end marker #80 or a ; variable SCF ; Set Carry Flag RET NZ ; return with carry set if at end @@ -8773,7 +8721,7 @@ L1D8B: INC HL ; increment pointer to address LD B,(HL) ; high byte of line number to B INC HL ; LD C,(HL) ; low byte to C. - LD ($5C42),BC ; set system variable NEWPPC. + LD (#5C42),BC ; set system variable NEWPPC. INC HL ; LD C,(HL) ; low byte of line length to C. INC HL ; @@ -8783,7 +8731,7 @@ L1D8B: INC HL ; increment pointer to address LD B,H ; and save result LD C,L ; in BC. POP HL ; restore address. - LD D,$00 ; initialize statement counter to zero. + LD D,#00 ; initialize statement counter to zero. ;; LOOK-P-2 L1DA3: PUSH BC ; save address of next line @@ -8800,34 +8748,34 @@ L1DA3: PUSH BC ; save address of next line ; The parameter tables have already evaluated the presence of a variable ;; NEXT -L1DAB: BIT 1,(IY+$37) ; test FLAGX - handling a new variable ? +L1DAB: BIT 1,(IY+#37) ; test FLAGX - handling a new variable ? JP NZ,L1C2E ; jump back to REPORT-2 if so ; 'Variable not found' ; now test if found variable is a simple variable uninitialized by a FOR. - LD HL,($5C4D) ; load address of variable from DEST + LD HL,(#5C4D) ; load address of variable from DEST BIT 7,(HL) ; is it correct type ? JR Z,L1DD8 ; forward to REPORT-1 if not ; 'NEXT without FOR' INC HL ; step past variable name - LD ($5C68),HL ; and set MEM to point to three 5-byte values + LD (#5C68),HL ; and set MEM to point to three 5-byte values ; value, limit, step. RST 28H ;; FP-CALC add step and re-store - DEFB $E0 ;;get-mem-0 v. - DEFB $E2 ;;get-mem-2 v,s. - DEFB $0F ;;addition v+s. - DEFB $C0 ;;st-mem-0 v+s. - DEFB $02 ;;delete . - DEFB $38 ;;end-calc + DEFB #E0 ;;get-mem-0 v. + DEFB #E2 ;;get-mem-2 v,s. + DEFB #0F ;;addition v+s. + DEFB #C0 ;;st-mem-0 v+s. + DEFB #02 ;;delete . + DEFB #38 ;;end-calc CALL L1DDA ; routine NEXT-LOOP tests against limit. RET C ; return if no more iterations possible. - LD HL,($5C68) ; find start of variable contents from MEM. - LD DE,$000F ; add 3*5 to + LD HL,(#5C68) ; find start of variable contents from MEM. + LD DE,#000F ; add 3*5 to ADD HL,DE ; address the looping line number LD E,(HL) ; low byte to E INC HL ; @@ -8841,7 +8789,7 @@ L1DAB: BIT 1,(IY+$37) ; test FLAGX - handling a new variable ? ;; REPORT-1 L1DD8: RST 08H ; ERROR-1 - DEFB $00 ; Error Report: NEXT without FOR + DEFB #00 ; Error Report: NEXT without FOR ; ----------------- @@ -8854,24 +8802,24 @@ L1DD8: RST 08H ; ERROR-1 ;; NEXT-LOOP L1DDA: RST 28H ;; FP-CALC - DEFB $E1 ;;get-mem-1 l. - DEFB $E0 ;;get-mem-0 l,v. - DEFB $E2 ;;get-mem-2 l,v,s. - DEFB $36 ;;less-0 l,v,(1/0) negative step ? - DEFB $00 ;;jump-true l,v.(1/0) + DEFB #E1 ;;get-mem-1 l. + DEFB #E0 ;;get-mem-0 l,v. + DEFB #E2 ;;get-mem-2 l,v,s. + DEFB #36 ;;less-0 l,v,(1/0) negative step ? + DEFB #00 ;;jump-true l,v.(1/0) - DEFB $02 ;;to L1DE2, NEXT-1 if step negative + DEFB #02 ;;to L1DE2, NEXT-1 if step negative - DEFB $01 ;;exchange v,l. + DEFB #01 ;;exchange v,l. ;; NEXT-1 -L1DE2: DEFB $03 ;;subtract l-v OR v-l. - DEFB $37 ;;greater-0 (1/0) - DEFB $00 ;;jump-true . +L1DE2: DEFB #03 ;;subtract l-v OR v-l. + DEFB #37 ;;greater-0 (1/0) + DEFB #00 ;;jump-true . - DEFB $04 ;;to L1DE9, NEXT-2 if no more iterations. + DEFB #04 ;;to L1DE9, NEXT-2 if no more iterations. - DEFB $38 ;;end-calc . + DEFB #38 ;;end-calc . AND A ; clear carry flag signalling another loop. RET ; return @@ -8879,7 +8827,7 @@ L1DE2: DEFB $03 ;;subtract l-v OR v-l. ; --- ;; NEXT-2 -L1DE9: DEFB $38 ;;end-calc . +L1DE9: DEFB #38 ;;end-calc . SCF ; set carry flag signalling looping exhausted. RET ; return @@ -8905,19 +8853,19 @@ L1DED: CALL L1C1F ; routine CLASS-01 checks variable. RST 18H ; GET-CHAR - LD ($5C5F),HL ; save character position in X_PTR. - LD HL,($5C57) ; load HL with Data Address DATADD, which is + LD (#5C5F),HL ; save character position in X_PTR. + LD HL,(#5C57) ; load HL with Data Address DATADD, which is ; the start of the program or the address ; after the last expression that was read or ; the address of the line number of the ; last RESTORE command. LD A,(HL) ; fetch character - CP $2C ; is it a comma ? + CP #2C ; is it a comma ? JR Z,L1E0A ; forward to READ-1 if so. ; else all data in this statement has been read so look for next DATA token - LD E,$E4 ; token 'DATA' + LD E,#E4 ; token 'DATA' CALL L1D86 ; routine LOOK-PROG JR NC,L1E0A ; forward to READ-1 if DATA found @@ -8925,7 +8873,7 @@ L1DED: CALL L1C1F ; routine CLASS-01 checks variable. ;; REPORT-E L1E08: RST 08H ; ERROR-1 - DEFB $0D ; Error Report: Out of DATA + DEFB #0D ; Error Report: Out of DATA ;; READ-1 L1E0A: CALL L0077 ; routine TEMP-PTR1 advances updating CH_ADD @@ -8934,14 +8882,14 @@ L1E0A: CALL L0077 ; routine TEMP-PTR1 advances updating CH_ADD ; checking type match and adjusting CH_ADD. RST 18H ; GET-CHAR fetches adjusted character position - LD ($5C57),HL ; store back in DATADD - LD HL,($5C5F) ; fetch X_PTR the original READ CH_ADD - LD (IY+$26),$00 ; now nullify X_PTR_hi + LD (#5C57),HL ; store back in DATADD + LD HL,(#5C5F) ; fetch X_PTR the original READ CH_ADD + LD (IY+#26),#00 ; now nullify X_PTR_hi CALL L0078 ; routine TEMP-PTR2 restores READ CH_ADD ;; READ-2 L1E1E: RST 18H ; GET-CHAR - CP $2C ; is it ',' indicating more variables to read ? + CP #2C ; is it ',' indicating more variables to read ? JR Z,L1DEC ; back to READ-3 if so CALL L1BEE ; routine CHECK-END @@ -8962,7 +8910,7 @@ L1E27: CALL L2530 ; routine SYNTAX-Z to check status ;; DATA-1 L1E2C: CALL L24FB ; routine SCANNING to check syntax of ; expression - CP $2C ; is it a comma ? + CP #2C ; is it a comma ? CALL NZ,L1BEE ; routine CHECK-END checks that statement ; is complete. Will make an early exit if ; so. >>> @@ -8972,7 +8920,7 @@ L1E2C: CALL L24FB ; routine SCANNING to check syntax of ; --- ;; DATA-2 -L1E37: LD A,$E4 ; set token to 'DATA' and continue into +L1E37: LD A,#E4 ; set token to 'DATA' and continue into ; the the PASS-BY routine. @@ -8988,7 +8936,7 @@ L1E39: LD B,A ; Give BC enough space to find token. ; Work backwards till keyword is found which ; is start of statement before any quotes. ; HL points to location before keyword. - LD DE,$0200 ; count 1+1 statements, dummy value in E to + LD DE,#0200 ; count 1+1 statements, dummy value in E to ; inhibit searching for a token. JP L198B ; to EACH-STMT to find next statement @@ -9026,7 +8974,7 @@ L1E39: LD B,A ; Give BC enough space to find token. ;; RESTORE L1E42: CALL L1E99 ; routine FIND-INT2 puts integer in BC. - ; Note. B should be checked against limit $3F + ; Note. B should be checked against limit #3F ; and an error generated if higher. ; this entry point is used from RUN command with BC holding zero @@ -9036,7 +8984,7 @@ L1E45: LD H,B ; transfer the line LD L,C ; number to the HL register. CALL L196E ; routine LINE-ADDR to fetch the address. DEC HL ; point to the location before the line. - LD ($5C57),HL ; update system variable DATADD. + LD (#5C57),HL ; update system variable DATADD. RET ; return to STMT-RET (or RUN) ; ------------------------ @@ -9052,10 +9000,10 @@ L1E4F: CALL L1E99 ; routine FIND-INT2 puts parameter in BC. OR C ; for zero. JR NZ,L1E5A ; forward to RAND-1 if not zero. - LD BC,($5C78) ; use the lower two bytes at FRAMES1. + LD BC,(#5C78) ; use the lower two bytes at FRAMES1. ;; RAND-1 -L1E5A: LD ($5C76),BC ; place in SEED system variable. +L1E5A: LD (#5C76),BC ; place in SEED system variable. RET ; return to STMT-RET ; ----------------------- @@ -9066,8 +9014,8 @@ L1E5A: LD ($5C76),BC ; place in SEED system variable. ; by using the last part of GO TO and exits indirectly to STMT-RET. ;; CONTINUE -L1E5F: LD HL,($5C6E) ; fetch OLDPPC line number. - LD D,(IY+$36) ; fetch OSPPC statement. +L1E5F: LD HL,(#5C6E) ; fetch OLDPPC line number. + LD D,(IY+#36) ; fetch OSPPC statement. JR L1E73 ; forward to GO-TO-2 ; -------------------- @@ -9078,8 +9026,8 @@ L1E5F: LD HL,($5C6E) ; fetch OLDPPC line number. ; It updates the system variables used to fetch the next line/statement. ; It is at STMT-RET that the actual change in control takes place. ; Unlike some BASICs the line number need not exist. -; Note. the high byte of the line number is incorrectly compared with $F0 -; instead of $3F. This leads to commands with operands greater than 32767 +; Note. the high byte of the line number is incorrectly compared with #F0 +; instead of #3F. This leads to commands with operands greater than 32767 ; being considered as having been run from the editing area and the ; error report 'Statement Lost' is given instead of 'OK'. ; - Steven Vickers, 1984. @@ -9088,16 +9036,16 @@ L1E5F: LD HL,($5C6E) ; fetch OLDPPC line number. L1E67: CALL L1E99 ; routine FIND-INT2 puts operand in BC LD H,B ; transfer line LD L,C ; number to HL. - LD D,$00 ; set statement to 0 - first. + LD D,#00 ; set statement to 0 - first. LD A,H ; compare high byte only - CP $F0 ; to $F0 i.e. 61439 in full. + CP #F0 ; to #F0 i.e. 61439 in full. JR NC,L1E9F ; forward to REPORT-B if above. ; This call entry point is used to update the system variables e.g. by RETURN. ;; GO-TO-2 -L1E73: LD ($5C42),HL ; save line number in NEWPPC - LD (IY+$0A),D ; and statement in NSPPC +L1E73: LD (#5C42),HL ; save line number in NEWPPC + LD (IY+#0A),D ; and statement in NSPPC RET ; to STMT-RET (or GO-SUB command) ; ------------------ @@ -9175,7 +9123,7 @@ L1E9C: JR C,L1E9F ; to REPORT-Bb with overflow. ;; REPORT-Bb L1E9F: RST 08H ; ERROR-1 - DEFB $0A ; Error Report: Integer out of range + DEFB #0A ; Error Report: Integer out of range ; ------------------ ; Handle RUN command @@ -9186,7 +9134,7 @@ L1E9F: RST 08H ; ERROR-1 ;; RUN L1EA1: CALL L1E67 ; routine GO-TO puts line number in ; system variables. - LD BC,$0000 ; prepare to set DATADD to first line. + LD BC,#0000 ; prepare to set DATADD to first line. CALL L1E45 ; routine REST-RUN does the 'restore'. ; Note BC still holds zero. JR L1EAF ; forward to CLEAR-RUN to clear variables @@ -9211,19 +9159,19 @@ L1EAF: LD A,B ; test for OR C ; zero. JR NZ,L1EB7 ; skip to CLEAR-1 if not zero. - LD BC,($5CB2) ; use the existing value of RAMTOP if zero. + LD BC,(#5CB2) ; use the existing value of RAMTOP if zero. ;; CLEAR-1 L1EB7: PUSH BC ; save ramtop value. - LD DE,($5C4B) ; fetch VARS - LD HL,($5C59) ; fetch E_LINE + LD DE,(#5C4B) ; fetch VARS + LD HL,(#5C59) ; fetch E_LINE DEC HL ; adjust to point at variables end-marker. CALL L19E5 ; routine RECLAIM-1 reclaims the space used by ; the variables. CALL L0D6B ; routine CLS to clear screen. - LD HL,($5C65) ; fetch STKEND the start of free memory. - LD DE,$0032 ; allow for another 50 bytes. + LD HL,(#5C65) ; fetch STKEND the start of free memory. + LD DE,#0032 ; allow for another 50 bytes. ADD HL,DE ; add the overhead to HL. POP DE ; restore the ramtop value. @@ -9231,25 +9179,25 @@ L1EB7: PUSH BC ; save ramtop value. JR NC,L1EDA ; forward to REPORT-M ; 'RAMTOP no good' - LD HL,($5CB4) ; now P-RAMT ($7FFF on 16K RAM machine) + LD HL,(#5CB4) ; now P-RAMT (#7FFF on 16K RAM machine) AND A ; exact this time. SBC HL,DE ; new ramtop must be lower or the same. JR NC,L1EDC ; skip to CLEAR-2 if in actual RAM. ;; REPORT-M L1EDA: RST 08H ; ERROR-1 - DEFB $15 ; Error Report: RAMTOP no good + DEFB #15 ; Error Report: RAMTOP no good ;; CLEAR-2 L1EDC: EX DE,HL ; transfer ramtop value to HL. - LD ($5CB2),HL ; update system variable RAMTOP. + LD (#5CB2),HL ; update system variable RAMTOP. POP DE ; pop the return address STMT-RET. POP BC ; pop the Error Address. - LD (HL),$3E ; now put the GO SUB end-marker at RAMTOP. + LD (HL),#3E ; now put the GO SUB end-marker at RAMTOP. DEC HL ; leave a location beneath it. LD SP,HL ; initialize the machine stack pointer. PUSH BC ; push the error address. - LD ($5C3D),SP ; make ERR_SP point to location. + LD (#5C3D),SP ; make ERR_SP point to location. EX DE,HL ; put STMT-RET in HL. JP (HL) ; and go there directly. @@ -9263,22 +9211,22 @@ L1EDC: EX DE,HL ; transfer ramtop value to HL. ;; GO-SUB L1EED: POP DE ; drop the address STMT-RET - LD H,(IY+$0D) ; fetch statement from SUBPPC and + LD H,(IY+#0D) ; fetch statement from SUBPPC and INC H ; increment it EX (SP),HL ; swap - error address to HL, ; H (statement) at top of stack, ; L (unimportant) beneath. INC SP ; adjust to overwrite unimportant byte - LD BC,($5C45) ; fetch the current line number from PPC + LD BC,(#5C45) ; fetch the current line number from PPC PUSH BC ; and PUSH onto GO SUB stack. ; the empty machine-stack can be rebuilt PUSH HL ; push the error address. - LD ($5C3D),SP ; make system variable ERR_SP point to it. + LD (#5C3D),SP ; make system variable ERR_SP point to it. PUSH DE ; push the address STMT-RET. CALL L1E67 ; call routine GO-TO to update the system ; variables NEWPPC and NSPPC. ; then make an indirect exit to STMT-RET via - LD BC,$0014 ; a 20-byte overhead memory check. + LD BC,#0014 ; a 20-byte overhead memory check. ; ---------------------- ; Check available memory @@ -9287,22 +9235,22 @@ L1EED: POP DE ; drop the address STMT-RET ; upwards or the GO SUB stack downwards. ;; TEST-ROOM -L1F05: LD HL,($5C65) ; fetch STKEND +L1F05: LD HL,(#5C65) ; fetch STKEND ADD HL,BC ; add the supplied test value - JR C,L1F15 ; forward to REPORT-4 if over $FFFF + JR C,L1F15 ; forward to REPORT-4 if over #FFFF EX DE,HL ; was less so transfer to DE - LD HL,$0050 ; test against another 80 bytes + LD HL,#0050 ; test against another 80 bytes ADD HL,DE ; anyway - JR C,L1F15 ; forward to REPORT-4 if this passes $FFFF + JR C,L1F15 ; forward to REPORT-4 if this passes #FFFF SBC HL,SP ; if less than the machine stack pointer RET C ; then return - OK. ;; REPORT-4 -L1F15: LD L,$03 ; prepare 'Out of Memory' - JP L0055 ; jump back to ERROR-3 at $0055 - ; Note. this error can't be trapped at $0008 +L1F15: LD L,#03 ; prepare 'Out of Memory' + JP L0055 ; jump back to ERROR-3 at #0055 + ; Note. this error can't be trapped at #0008 ; ------------------------------ ; THE 'FREE MEMORY' USER ROUTINE @@ -9311,7 +9259,7 @@ L1F15: LD L,$03 ; prepare 'Out of Memory' ; approximate free memory with PRINT 65536 - USR 7962. ;; free-mem -L1F1A: LD BC,$0000 ; allow no overhead. +L1F1A: LD BC,#0000 ; allow no overhead. CALL L1F05 ; routine TEST-ROOM. @@ -9331,8 +9279,8 @@ L1F1A: LD BC,$0000 ; allow no overhead. L1F23: POP BC ; drop the address STMT-RET. POP HL ; now the error address. POP DE ; now a possible BASIC return line. - LD A,D ; the high byte $00 - $27 is - CP $3E ; compared with the traditional end-marker $3E. + LD A,D ; the high byte #00 - #27 is + CP #3E ; compared with the traditional end-marker #3E. JR Z,L1F36 ; forward to REPORT-7 with a match. ; 'RETURN without GOSUB' @@ -9344,7 +9292,7 @@ L1F23: POP BC ; drop the address STMT-RET. EX (SP),HL ; statement to H, error address to base of ; new machine stack. EX DE,HL ; statement to D, BASIC line number to HL. - LD ($5C3D),SP ; adjust ERR_SP to point to new stack pointer + LD (#5C3D),SP ; adjust ERR_SP to point to new stack pointer PUSH BC ; now re-stack the address STMT-RET JP L1E73 ; to GO-TO-2 to update statement and line ; system variables and exit indirectly to the @@ -9358,7 +9306,7 @@ L1F36: PUSH DE ; replace the end-marker. ; as will be required in a few clock cycles. RST 08H ; ERROR-1 - DEFB $06 ; Error Report: RETURN without GOSUB + DEFB #06 ; Error Report: RETURN without GOSUB ; -------------------- ; Handle PAUSE command @@ -9379,18 +9327,18 @@ L1F3D: HALT ; wait for interrupt. JR Z,L1F4F ; forward to PAUSE-END if so. LD A,B ; test if - AND C ; now $FFFF + AND C ; now #FFFF INC A ; that is, initially zero. JR NZ,L1F49 ; skip forward to PAUSE-2 if not. INC BC ; restore counter to zero. ;; PAUSE-2 -L1F49: BIT 5,(IY+$01) ; test FLAGS - has a new key been pressed ? +L1F49: BIT 5,(IY+#01) ; test FLAGS - has a new key been pressed ? JR Z,L1F3D ; back to PAUSE-1 if not. ;; PAUSE-END -L1F4F: RES 5,(IY+$01) ; update FLAGS - signal no new key +L1F4F: RES 5,(IY+#01) ; update FLAGS - signal no new key RET ; and return. ; ------------------- @@ -9401,13 +9349,13 @@ L1F4F: RES 5,(IY+$01) ; update FLAGS - signal no new key ; It is also called at STMT-RET after every statement. ;; BREAK-KEY -L1F54: LD A,$7F ; Input address: $7FFE - IN A,($FE) ; read lower right keys +L1F54: LD A,#7F ; Input address: #7FFE + IN A,(#FE) ; read lower right keys RRA ; rotate bit 0 - SPACE RET C ; return if not reset - LD A,$FE ; Input address: $FEFE - IN A,($FE) ; read lower left keys + LD A,#FE ; Input address: #FEFE + IN A,(#FE) ; read lower left keys RRA ; rotate bit 0 - SHIFT RET ; carry will be set if not pressed. ; return with no carry if both keys @@ -9424,7 +9372,7 @@ L1F54: LD A,$7F ; Input address: $7FFE L1F60: CALL L2530 ; routine SYNTAX-Z JR Z,L1F6A ; forward to DEF-FN-1 if parsing - LD A,$CE ; else load A with 'DEF FN' and + LD A,#CE ; else load A with 'DEF FN' and JP L1E39 ; jump back to PASS-BY ; --- @@ -9432,27 +9380,27 @@ L1F60: CALL L2530 ; routine SYNTAX-Z ; continue here if checking syntax. ;; DEF-FN-1 -L1F6A: SET 6,(IY+$01) ; set FLAGS - Assume numeric result +L1F6A: SET 6,(IY+#01) ; set FLAGS - Assume numeric result CALL L2C8D ; call routine ALPHA JR NC,L1F89 ; if not then to DEF-FN-4 to jump to ; 'Nonsense in BASIC' RST 20H ; NEXT-CHAR - CP $24 ; is it '$' ? + CP #24 ; is it '$' ? JR NZ,L1F7D ; to DEF-FN-2 if not as numeric. - RES 6,(IY+$01) ; set FLAGS - Signal string result + RES 6,(IY+#01) ; set FLAGS - Signal string result RST 20H ; get NEXT-CHAR ;; DEF-FN-2 -L1F7D: CP $28 ; is it '(' ? +L1F7D: CP #28 ; is it '(' ? JR NZ,L1FBD ; to DEF-FN-7 'Nonsense in BASIC' RST 20H ; NEXT-CHAR - CP $29 ; is it ')' ? + CP #29 ; is it ')' ? JR Z,L1FA6 ; to DEF-FN-6 if null argument ;; DEF-FN-3 @@ -9467,7 +9415,7 @@ L1F89: JP NC,L1C8A ; to REPORT-C if not RST 20H ; NEXT-CHAR re-initializes HL from CH_ADD ; and advances. - CP $24 ; '$' ? is it a string argument. + CP #24 ; '$' ? is it a string argument. JR NZ,L1F94 ; forward to DEF-FN-5 if not. EX DE,HL ; save pointer to '$' in DE @@ -9476,9 +9424,9 @@ L1F89: JP NC,L1C8A ; to REPORT-C if not ;; DEF-FN-5 L1F94: EX DE,HL ; bring back pointer. - LD BC,$0006 ; the function requires six hidden bytes for + LD BC,#0006 ; the function requires six hidden bytes for ; each parameter passed. - ; The first byte will be $0E + ; The first byte will be #0E ; then 5-byte numeric value ; or 5-byte string pointer. @@ -9487,14 +9435,14 @@ L1F94: EX DE,HL ; bring back pointer. INC HL ; adjust HL (set by LDDR) INC HL ; to point to first location. - LD (HL),$0E ; insert the 'hidden' marker. + LD (HL),#0E ; insert the 'hidden' marker. ; Note. these invisible storage locations hold nothing meaningful for the ; moment. They will be used every time the corresponding function is ; evaluated in runtime. ; Now consider the following character fetched earlier. - CP $2C ; is it ',' ? (more than one parameter) + CP #2C ; is it ',' ? (more than one parameter) JR NZ,L1FA6 ; to DEF-FN-6 if not @@ -9504,27 +9452,27 @@ L1F94: EX DE,HL ; bring back pointer. ; --- ;; DEF-FN-6 -L1FA6: CP $29 ; should close with a ')' +L1FA6: CP #29 ; should close with a ')' JR NZ,L1FBD ; to DEF-FN-7 if not ; 'Nonsense in BASIC' RST 20H ; get NEXT-CHAR - CP $3D ; is it '=' ? + CP #3D ; is it '=' ? JR NZ,L1FBD ; to DEF-FN-7 if not 'Nonsense...' RST 20H ; address NEXT-CHAR - LD A,($5C3B) ; get FLAGS which has been set above + LD A,(#5C3B) ; get FLAGS which has been set above PUSH AF ; and preserve CALL L24FB ; routine SCANNING checks syntax of expression ; and also sets flags. POP AF ; restore previous flags - XOR (IY+$01) ; xor with FLAGS - bit 6 should be same + XOR (IY+#01) ; xor with FLAGS - bit 6 should be same ; therefore will be reset. - AND $40 ; isolate bit 6. + AND #40 ; isolate bit 6. ;; DEF-FN-7 L1FBD: JP NZ,L1C8A ; jump back to REPORT-C if the expected result @@ -9563,7 +9511,7 @@ L1FC3: CALL L2530 ; routine SYNTAX-Z sets zero flag if syntax ; An extra UDG might have been better. ;; LPRINT -L1FC9: LD A,$03 ; the printer channel +L1FC9: LD A,#03 ; the printer channel JR L1FCF ; forward to PRINT-1 ; --------------------- @@ -9574,7 +9522,7 @@ L1FC9: LD A,$03 ; the printer channel ; of the computer. However the stream can be altered in range 0 - 15. ;; PRINT -L1FCD: LD A,$02 ; the stream for the upper screen. +L1FCD: LD A,#02 ; the stream for the upper screen. ; The LPRINT command joins here. @@ -9612,7 +9560,7 @@ L1FE5: CALL L204E ; routine PR-POSN-1 returns zero if more JR Z,L1FE5 ; loop back to PRINT-3 if so ;; PRINT-4 -L1FF2: CP $29 ; return now if this is ')' from input-item. +L1FF2: CP #29 ; return now if this is ')' from input-item. ; (see INPUT.) RET Z ; or continue and print carriage return in ; runtime @@ -9626,7 +9574,7 @@ L1FF2: CP $29 ; return now if this is ')' from input-item. ;; PRINT-CR L1FF5: CALL L1FC3 ; routine UNSTACK-Z - LD A,$0D ; prepare a carriage return + LD A,#0D ; prepare a carriage return RST 10H ; PRINT-A RET ; return @@ -9642,7 +9590,7 @@ L1FF5: CALL L1FC3 ; routine UNSTACK-Z ;; PR-ITEM-1 L1FFC: RST 18H ; GET-CHAR - CP $AC ; is character 'AT' ? + CP #AC ; is character 'AT' ? JR NZ,L200E ; forward to PR-ITEM-2 if not. CALL L1C79 ; routine NEXT-2NUM check for two comma @@ -9651,13 +9599,13 @@ L1FFC: RST 18H ; GET-CHAR CALL L1FC3 ; routine UNSTACK-Z quits if checking syntax. CALL L2307 ; routine STK-TO-BC get the numbers in B and C. - LD A,$16 ; prepare the 'at' control. + LD A,#16 ; prepare the 'at' control. JR L201E ; forward to PR-AT-TAB to print the sequence. ; --- ;; PR-ITEM-2 -L200E: CP $AD ; is character 'TAB' ? +L200E: CP #AD ; is character 'TAB' ? JR NZ,L2024 ; to PR-ITEM-3 if not @@ -9666,7 +9614,7 @@ L200E: CP $AD ; is character 'TAB' ? CALL L1FC3 ; routine UNSTACK-Z quits if checking syntax. CALL L1E99 ; routine FIND-INT2 puts integer in BC. - LD A,$17 ; prepare the 'tab' control. + LD A,#17 ; prepare the 'tab' control. ;; PR-AT-TAB L201E: RST 10H ; PRINT-A outputs the control @@ -9693,7 +9641,7 @@ L2024: CALL L21F2 ; routine CO-TEMP-3 will print any colour CALL L24FB ; routine SCANNING now to evaluate expression CALL L1FC3 ; routine UNSTACK-Z if not runtime. - BIT 6,(IY+$01) ; test FLAGS - Numeric or string result ? + BIT 6,(IY+#01) ; test FLAGS - Numeric or string result ? CALL Z,L2BF1 ; routine STK-FETCH if string. ; note no flags affected. JP NZ,L2DE3 ; to PRINT-FP to print if numeric >>> @@ -9723,14 +9671,14 @@ L203C: LD A,B ; this tests if the ; the others in print_items. ;; PR-END-Z -L2045: CP $29 ; is character a ')' ? +L2045: CP #29 ; is character a ')' ? RET Z ; return if so - e.g. INPUT (p$); a$ ;; PR-ST-END -L2048: CP $0D ; is it a carriage return ? +L2048: CP #0D ; is it a carriage return ? RET Z ; return also - e.g. PRINT a - CP $3A ; is character a ':' ? + CP #3A ; is character a ':' ? RET ; return - zero flag will be set if so. ; e.g. PRINT a : @@ -9741,19 +9689,19 @@ L2048: CP $0D ; is it a carriage return ? ;; PR-POSN-1 L204E: RST 18H ; GET-CHAR - CP $3B ; is it ';' ? + CP #3B ; is it ';' ? ; i.e. print from last position. JR Z,L2067 ; forward to PR-POSN-3 if so. ; i.e. do nothing. - CP $2C ; is it ',' ? + CP #2C ; is it ',' ? ; i.e. print at next tabstop. JR NZ,L2061 ; forward to PR-POSN-2 if anything else. CALL L2530 ; routine SYNTAX-Z JR Z,L2067 ; forward to PR-POSN-3 if checking syntax. - LD A,$06 ; prepare the 'comma' control character. + LD A,#06 ; prepare the 'comma' control character. RST 10H ; PRINT-A outputs to current channel in ; run-time. @@ -9765,7 +9713,7 @@ L204E: RST 18H ; GET-CHAR ; check for newline. ;; PR-POSN-2 -L2061: CP $27 ; is character a "'" ? (newline) +L2061: CP #27 ; is character a "'" ? (newline) RET NZ ; return if no match >>> CALL L1FF5 ; routine PRINT-CR outputs a carriage return @@ -9789,7 +9737,7 @@ L206E: CP A ; reset the zero flag. ; LIST #15 ;; STR-ALTER -L2070: CP $23 ; is character '#' ? +L2070: CP #23 ; is character '#' ? SCF ; set carry flag. RET NZ ; return if no match. @@ -9799,7 +9747,7 @@ L2070: CP $23 ; is character '#' ? AND A ; prepare to exit early with carry reset CALL L1FC3 ; routine UNSTACK-Z exits early if parsing CALL L1E94 ; routine FIND-INT1 gets number off stack - CP $10 ; must be range 0 - 15 decimal. + CP #10 ; must be range 0 - 15 decimal. JP NC,L160E ; jump back to REPORT-Oa if not ; 'Invalid stream'. @@ -9817,13 +9765,13 @@ L2070: CP $23 ; is character '#' ? L2089: CALL L2530 ; routine SYNTAX-Z to check if in runtime. JR Z,L2096 ; forward to INPUT-1 if checking syntax. - LD A,$01 ; select channel 'K' the keyboard for input. + LD A,#01 ; select channel 'K' the keyboard for input. CALL L1601 ; routine CHAN-OPEN opens it. CALL L0D6E ; routine CLS-LOWER clears the lower screen ; and sets DF_SZ to two. ;; INPUT-1 -L2096: LD (IY+$02),$01 ; update TV_FLAG - signal lower screen in use +L2096: LD (IY+#02),#01 ; update TV_FLAG - signal lower screen in use ; ensuring that the correct set of system ; variables are updated and that the border ; colour is used. @@ -9836,26 +9784,26 @@ L2096: LD (IY+$02),$01 ; update TV_FLAG - signal lower screen in use ; keyboard input has been made and it remains to adjust the upper ; screen in case the lower two lines have been extended upwards. - LD BC,($5C88) ; fetch S_POSN current line/column of + LD BC,(#5C88) ; fetch S_POSN current line/column of ; the upper screen. - LD A,($5C6B) ; fetch DF_SZ the display file size of + LD A,(#5C6B) ; fetch DF_SZ the display file size of ; the lower screen. CP B ; test that lower screen does not overlap JR C,L20AD ; forward to INPUT-2 if not. ; the two screens overlap so adjust upper screen. - LD C,$21 ; set column of upper screen to leftmost. + LD C,#21 ; set column of upper screen to leftmost. LD B,A ; and line to one above lower screen. ; continue forward to update upper screen ; print position. ;; INPUT-2 -L20AD: LD ($5C88),BC ; set S_POSN update upper screen line/column. - LD A,$19 ; subtract from twenty five +L20AD: LD (#5C88),BC ; set S_POSN update upper screen line/column. + LD A,#19 ; subtract from twenty five SUB B ; the new line number. - LD ($5C8C),A ; and place result in SCR_CT - scroll count. - RES 0,(IY+$02) ; update TV_FLAG - signal main screen in use. + LD (#5C8C),A ; and place result in SCR_CT - scroll count. + RES 0,(IY+#02) ; update TV_FLAG - signal main screen in use. CALL L0DD9 ; routine CL-SET sets the print position ; system variables for the upper screen. JP L0D6E ; jump back to CLS-LOWER and make @@ -9875,7 +9823,7 @@ L20C1: CALL L204E ; routine PR-POSN-1 deals with a single JR Z,L20C1 ; back to IN-ITEM-1 until no more in a ; sequence. - CP $28 ; is character '(' ? + CP #28 ; is character '(' ? JR NZ,L20D8 ; forward to IN-ITEM-2 if not. ; any variables within braces will be treated as part, or all, of the prompt @@ -9886,7 +9834,7 @@ L20C1: CALL L204E ; routine PR-POSN-1 deals with a single ; prompt. RST 18H ; GET-CHAR - CP $29 ; is character a matching ')' ? + CP #29 ; is character a matching ')' ? JP NZ,L1C8A ; jump back to REPORT-C if not. ; 'Nonsense in BASIC'. @@ -9896,7 +9844,7 @@ L20C1: CALL L204E ; routine PR-POSN-1 deals with a single ; --- ;; IN-ITEM-2 -L20D8: CP $CA ; is the character the token 'LINE' ? +L20D8: CP #CA ; is the character the token 'LINE' ? JR NZ,L20ED ; forward to IN-ITEM-3 if not. RST 20H ; NEXT-CHAR - variable must come next. @@ -9905,8 +9853,8 @@ L20D8: CP $CA ; is the character the token 'LINE' ? ; or generates an error if no variable ; at this position. - SET 7,(IY+$37) ; update FLAGX - signal handling INPUT LINE - BIT 6,(IY+$01) ; test FLAGS - numeric or string result ? + SET 7,(IY+#37) ; update FLAGX - signal handling INPUT LINE + BIT 6,(IY+#01) ; test FLAGS - numeric or string result ? JP NZ,L1C8A ; jump back to REPORT-C if not string ; 'Nonsense in BASIC'. @@ -9923,29 +9871,29 @@ L20ED: CALL L2C8D ; routine ALPHA checks if character is CALL L1C1F ; routine CLASS-01 returns destination ; address of variable to be assigned. - RES 7,(IY+$37) ; update FLAGX - signal not INPUT LINE. + RES 7,(IY+#37) ; update FLAGX - signal not INPUT LINE. ;; IN-PROMPT L20FA: CALL L2530 ; routine SYNTAX-Z JP Z,L21B2 ; forward to IN-NEXT-2 if checking syntax. CALL L16BF ; routine SET-WORK clears workspace. - LD HL,$5C71 ; point to system variable FLAGX + LD HL,#5C71 ; point to system variable FLAGX RES 6,(HL) ; signal string result. SET 5,(HL) ; signal in Input Mode for editor. - LD BC,$0001 ; initialize space required to one for + LD BC,#0001 ; initialize space required to one for ; the carriage return. BIT 7,(HL) ; test FLAGX - INPUT LINE in use ? JR NZ,L211C ; forward to IN-PR-2 if so as that is ; all the space that is required. - LD A,($5C3B) ; load accumulator from FLAGS - AND $40 ; mask to test BIT 6 of FLAGS and clear + LD A,(#5C3B) ; load accumulator from FLAGS + AND #40 ; mask to test BIT 6 of FLAGS and clear ; the other bits in A. ; numeric result expected ? JR NZ,L211A ; forward to IN-PR-1 if so - LD C,$03 ; increase space to three bytes for the + LD C,#03 ; increase space to three bytes for the ; pair of surrounding quotes. ;; IN-PR-1 @@ -9954,42 +9902,42 @@ L211A: OR (HL) ; if numeric result, set bit 6 of FLAGX. ;; IN-PR-2 L211C: RST 30H ; BC-SPACES opens 1 or 3 bytes in workspace - LD (HL),$0D ; insert carriage return at last new location. + LD (HL),#0D ; insert carriage return at last new location. LD A,C ; fetch the length, one or three. RRCA ; lose bit 0. RRCA ; test if quotes required. JR NC,L2129 ; forward to IN-PR-3 if not. - LD A,$22 ; load the '"' character + LD A,#22 ; load the '"' character LD (DE),A ; place quote in first new location at DE. DEC HL ; decrease HL - from carriage return. LD (HL),A ; and place a quote in second location. ;; IN-PR-3 -L2129: LD ($5C5B),HL ; set keyboard cursor K_CUR to HL - BIT 7,(IY+$37) ; test FLAGX - is this INPUT LINE ?? +L2129: LD (#5C5B),HL ; set keyboard cursor K_CUR to HL + BIT 7,(IY+#37) ; test FLAGX - is this INPUT LINE ?? JR NZ,L215E ; forward to IN-VAR-3 if so as input will ; be accepted without checking its syntax. - LD HL,($5C5D) ; fetch CH_ADD + LD HL,(#5C5D) ; fetch CH_ADD PUSH HL ; and save on stack. - LD HL,($5C3D) ; fetch ERR_SP + LD HL,(#5C3D) ; fetch ERR_SP PUSH HL ; and save on stack ;; IN-VAR-1 L213A: LD HL,L213A ; address: IN-VAR-1 - this address PUSH HL ; is saved on stack to handle errors. - BIT 4,(IY+$30) ; test FLAGS2 - is K channel in use ? + BIT 4,(IY+#30) ; test FLAGS2 - is K channel in use ? JR Z,L2148 ; forward to IN-VAR-2 if not using the ; keyboard for input. (??) - LD ($5C3D),SP ; set ERR_SP to point to IN-VAR-1 on stack. + LD (#5C3D),SP ; set ERR_SP to point to IN-VAR-1 on stack. ;; IN-VAR-2 -L2148: LD HL,($5C61) ; set HL to WORKSP - start of workspace. +L2148: LD HL,(#5C61) ; set HL to WORKSP - start of workspace. CALL L11A7 ; routine REMOVE-FP removes floating point ; forms when looping in error condition. - LD (IY+$00),$FF ; set ERR_NR to 'OK' cancelling the error. + LD (IY+#00),#FF ; set ERR_NR to 'OK' cancelling the error. ; but X_PTR causes flashing error marker ; to be displayed at each call to the editor. CALL L0F2C ; routine EDITOR allows input to be entered @@ -9997,7 +9945,7 @@ L2148: LD HL,($5C61) ; set HL to WORKSP - start of workspace. ; if we pass to next then there are no system errors - RES 7,(IY+$01) ; update FLAGS - signal checking syntax + RES 7,(IY+#01) ; update FLAGS - signal checking syntax CALL L21B9 ; routine IN-ASSIGN checks syntax using ; the VAL-FET-2 and powerful SCANNING routines. ; any syntax error and its back to IN-VAR-1. @@ -10023,7 +9971,7 @@ L215E: CALL L0F2C ; routine EDITOR is called for input ; INPUT and INPUT LINE converge here. ;; IN-VAR-4 -L2161: LD (IY+$22),$00 ; set K_CUR_hi to a low value so that the cursor +L2161: LD (IY+#22),#00 ; set K_CUR_hi to a low value so that the cursor ; no longer appears in the input line. CALL L21D6 ; routine IN-CHAN-K tests if the keyboard @@ -10039,14 +9987,14 @@ L2161: LD (IY+$22),$00 ; set K_CUR_hi to a low value so that the cursor ; if you're inputting more than one item in ; a statement then that becomes apparent. - LD BC,($5C82) ; fetch line and column from ECHO_E + LD BC,(#5C82) ; fetch line and column from ECHO_E CALL L0DD9 ; routine CL-SET sets S-POSNL to those ; values. ; if using another input channel rejoin here. ;; IN-VAR-5 -L2174: LD HL,$5C71 ; point HL to FLAGX +L2174: LD HL,#5C71 ; point HL to FLAGX RES 5,(HL) ; signal not in input mode BIT 7,(HL) ; is this INPUT LINE ? RES 7,(HL) ; cancel the bit anyway. @@ -10055,20 +10003,20 @@ L2174: LD HL,$5C71 ; point HL to FLAGX POP HL ; drop the looping address POP HL ; drop the the address of previous ; error handler. - LD ($5C3D),HL ; set ERR_SP to point to it. + LD (#5C3D),HL ; set ERR_SP to point to it. POP HL ; drop original CH_ADD which points to ; INPUT command in BASIC line. - LD ($5C5F),HL ; save in X_PTR while input is assigned. - SET 7,(IY+$01) ; update FLAGS - Signal running program + LD (#5C5F),HL ; save in X_PTR while input is assigned. + SET 7,(IY+#01) ; update FLAGS - Signal running program CALL L21B9 ; routine IN-ASSIGN is called again ; this time the variable will be assigned ; the input value without error. ; Note. the previous example now ; becomes "hatstand" - LD HL,($5C5F) ; fetch stored CH_ADD value from X_PTR. - LD (IY+$26),$00 ; set X_PTR_hi so that iy is no longer relevant. - LD ($5C5D),HL ; put restored value back in CH_ADD + LD HL,(#5C5F) ; fetch stored CH_ADD value from X_PTR. + LD (IY+#26),#00 ; set X_PTR_hi so that iy is no longer relevant. + LD (#5C5D),HL ; put restored value back in CH_ADD JR L21B2 ; forward to IN-NEXT-2 to see if anything ; more in the INPUT list. @@ -10077,8 +10025,8 @@ L2174: LD HL,$5C71 ; point HL to FLAGX ; the jump was to here with INPUT LINE only ;; IN-VAR-6 -L219B: LD HL,($5C63) ; STKBOT points to the end of the input. - LD DE,($5C61) ; WORKSP points to the beginning. +L219B: LD HL,(#5C63) ; STKBOT points to the end of the input. + LD DE,(#5C61) ; WORKSP points to the beginning. SCF ; prepare for true subtraction. SBC HL,DE ; subtract to get length LD B,H ; transfer it to @@ -10116,20 +10064,20 @@ L21B2: CALL L204E ; routine PR-POSN-1 handles a position item. ; the assignment. ;; IN-ASSIGN -L21B9: LD HL,($5C61) ; fetch WORKSP start of input - LD ($5C5D),HL ; set CH_ADD to first character +L21B9: LD HL,(#5C61) ; fetch WORKSP start of input + LD (#5C5D),HL ; set CH_ADD to first character RST 18H ; GET-CHAR ignoring leading white-space. - CP $E2 ; is it 'STOP' + CP #E2 ; is it 'STOP' JR Z,L21D0 ; forward to IN-STOP if so. - LD A,($5C71) ; load accumulator from FLAGX + LD A,(#5C71) ; load accumulator from FLAGX CALL L1C59 ; routine VAL-FET-2 makes assignment ; or goes through the motions if checking ; syntax. SCANNING is used. RST 18H ; GET-CHAR - CP $0D ; is it carriage return ? + CP #0D ; is it carriage return ? RET Z ; return if so ; either syntax is OK ; or assignment has been made. @@ -10140,7 +10088,7 @@ L21B9: LD HL,($5C61) ; fetch WORKSP start of input ;; REPORT-Cb L21CE: RST 08H ; ERROR-1 - DEFB $0B ; Error Report: Nonsense in BASIC + DEFB #0B ; Error Report: Nonsense in BASIC ;; IN-STOP L21D0: CALL L2530 ; routine SYNTAX-Z (UNSTACK-Z?) @@ -10151,7 +10099,7 @@ L21D0: CALL L2530 ; routine SYNTAX-Z (UNSTACK-Z?) ;; REPORT-H L21D4: RST 08H ; ERROR-1 - DEFB $10 ; Error Report: STOP in INPUT + DEFB #10 ; Error Report: STOP in INPUT ; ------------------ ; Test for channel K @@ -10161,13 +10109,13 @@ L21D4: RST 08H ; ERROR-1 ; use is the one for the keyboard. ;; IN-CHAN-K -L21D6: LD HL,($5C51) ; fetch address of current channel CURCHL +L21D6: LD HL,(#5C51) ; fetch address of current channel CURCHL INC HL ; INC HL ; advance past INC HL ; input and INC HL ; output streams LD A,(HL) ; fetch the channel identifier. - CP $4B ; test for 'K' + CP #4B ; test for 'K' RET ; return with zero set if keyboard is use. ; -------------------- @@ -10208,10 +10156,10 @@ L21E2: CALL L21F2 ; routine CO-TEMP-3 to output colour control. RST 18H ; GET-CHAR - CP $2C ; is it ',' separator ? + CP #2C ; is it ',' separator ? JR Z,L21E1 ; back if so to CO-TEMP-1 - CP $3B ; is it ';' separator ? + CP #3B ; is it ';' separator ? JR Z,L21E1 ; back to CO-TEMP-1 for more. JP L1C8A ; to REPORT-C (REPORT-Cb is within range) @@ -10227,12 +10175,12 @@ L21E2: CALL L21F2 ; routine CO-TEMP-3 to output colour control. ; It is quite permissible to send these to any stream. ;; CO-TEMP-3 -L21F2: CP $D9 ; is it 'INK' ? +L21F2: CP #D9 ; is it 'INK' ? RET C ; return if less. - CP $DF ; compare with 'OUT' + CP #DF ; compare with 'OUT' CCF ; Complement Carry Flag - RET C ; return if greater than 'OVER', $DE. + RET C ; return if greater than 'OVER', #DE. PUSH AF ; save the colour token. @@ -10242,8 +10190,8 @@ L21F2: CP $D9 ; is it 'INK' ? ; -> this entry point used by CLASS-07. e.g. the command PAPER 6. ;; CO-TEMP-4 -L21FC: SUB $C9 ; reduce to control character $10 (INK) - ; thru $15 (OVER). +L21FC: SUB #C9 ; reduce to control character #10 (INK) + ; thru #15 (OVER). PUSH AF ; save control. CALL L1C82 ; routine EXPT-1NUM stacks addressed ; parameter on calculator stack. @@ -10295,37 +10243,37 @@ L21FC: SUB $C9 ; reduce to control character $10 (INK) ; The colour system variable handler. ; ------------------------------------ ; This is an exit branch from PO-1-OPER, PO-2-OPER -; A holds control $10 (INK) to $15 (OVER) +; A holds control #10 (INK) to #15 (OVER) ; D holds parameter 0-9 for ink/paper 0,1 or 8 for bright/flash, ; 0 or 1 for over/inverse. ;; CO-TEMP-5 -L2211: SUB $11 ; reduce range $FF-$04 - ADC A,$00 ; add in carry if INK +L2211: SUB #11 ; reduce range #FF-#04 + ADC A,#00 ; add in carry if INK JR Z,L2234 ; forward to CO-TEMP-7 with INK and PAPER. - SUB $02 ; reduce range $FF-$02 - ADC A,$00 ; add carry if FLASH + SUB #02 ; reduce range #FF-#02 + ADC A,#00 ; add carry if FLASH JR Z,L2273 ; forward to CO-TEMP-C with FLASH and BRIGHT. - CP $01 ; is it 'INVERSE' ? + CP #01 ; is it 'INVERSE' ? LD A,D ; fetch parameter for INVERSE/OVER - LD B,$01 ; prepare OVER mask setting bit 0. + LD B,#01 ; prepare OVER mask setting bit 0. JR NZ,L2228 ; forward to CO-TEMP-6 if OVER RLCA ; shift bit 0 RLCA ; to bit 2 - LD B,$04 ; set bit 2 of mask for inverse. + LD B,#04 ; set bit 2 of mask for inverse. ;; CO-TEMP-6 L2228: LD C,A ; save the A LD A,D ; re-fetch parameter - CP $02 ; is it less than 2 + CP #02 ; is it less than 2 JR NC,L2244 ; to REPORT-K if not 0 or 1. ; 'Invalid colour'. LD A,C ; restore A - LD HL,$5C91 ; address system variable P_FLAG + LD HL,#5C91 ; address system variable P_FLAG JR L226C ; forward to exit via routine CO-CHANGE ; --- @@ -10334,31 +10282,31 @@ L2228: LD C,A ; save the A ;; CO-TEMP-7 L2234: LD A,D ; fetch parameter - LD B,$07 ; set ink mask 00000111 + LD B,#07 ; set ink mask 00000111 JR C,L223E ; forward to CO-TEMP-8 with INK RLCA ; shift bits 0-2 RLCA ; to RLCA ; bits 3-5 - LD B,$38 ; set paper mask 00111000 + LD B,#38 ; set paper mask 00111000 ; both paper and ink rejoin here ;; CO-TEMP-8 L223E: LD C,A ; value to C LD A,D ; fetch parameter - CP $0A ; is it less than 10d ? + CP #0A ; is it less than 10d ? JR C,L2246 ; forward to CO-TEMP-9 if so. ; ink 10 etc. is not allowed. ;; REPORT-K L2244: RST 08H ; ERROR-1 - DEFB $13 ; Error Report: Invalid colour + DEFB #13 ; Error Report: Invalid colour ;; CO-TEMP-9 -L2246: LD HL,$5C8F ; address system variable ATTR_T initially. - CP $08 ; compare with 8 +L2246: LD HL,#5C8F ; address system variable ATTR_T initially. + CP #08 ; compare with 8 JR C,L2258 ; forward to CO-TEMP-B with 0-7. LD A,(HL) ; fetch temporary attribute as no change. @@ -10368,7 +10316,7 @@ L2246: LD HL,$5C8F ; address system variable ATTR_T initially. OR B ; or with mask to make white CPL ; make black and change other to dark - AND $24 ; 00100100 + AND #24 ; 00100100 JR Z,L2257 ; forward to CO-TEMP-A if black and ; originally light. @@ -10381,9 +10329,9 @@ L2257: LD C,A ; save A in C L2258: LD A,C ; load colour to A CALL L226C ; routine CO-CHANGE addressing ATTR-T - LD A,$07 ; put 7 in accumulator + LD A,#07 ; put 7 in accumulator CP D ; compare with parameter - SBC A,A ; $00 if 0-7, $FF if 8 + SBC A,A ; #00 if 0-7, #FF if 8 CALL L226C ; routine CO-CHANGE addressing MASK-T ; mask returned in A. @@ -10391,11 +10339,11 @@ L2258: LD A,C ; load colour to A RLCA ; 01110000 or 00001110 RLCA ; 11100000 or 00011100 - AND $50 ; 01000000 or 00010000 (AND 01010000) + AND #50 ; 01000000 or 00010000 (AND 01010000) LD B,A ; transfer to mask - LD A,$08 ; load A with 8 + LD A,#08 ; load A with 8 CP D ; compare with parameter - SBC A,A ; $FF if was 9, $00 if 0-8 + SBC A,A ; #FF if was 9, #00 if 0-8 ; continue while addressing P-FLAG ; setting bit 4 if ink 9 ; setting bit 6 if paper 9 @@ -10423,25 +10371,25 @@ L226C: XOR (HL) ; impress bits specified L2273: SBC A,A ; set zero flag for bright. LD A,D ; fetch original parameter 0,1 or 8 RRCA ; rotate bit 0 to bit 7 - LD B,$80 ; mask for flash 10000000 + LD B,#80 ; mask for flash 10000000 JR NZ,L227D ; forward to CO-TEMP-D if flash RRCA ; rotate bit 7 to bit 6 - LD B,$40 ; mask for bright 01000000 + LD B,#40 ; mask for bright 01000000 ;; CO-TEMP-D L227D: LD C,A ; store value in C LD A,D ; fetch parameter - CP $08 ; compare with 8 + CP #08 ; compare with 8 JR Z,L2287 ; forward to CO-TEMP-E if 8 - CP $02 ; test if 0 or 1 + CP #02 ; test if 0 or 1 JR NC,L2244 ; back to REPORT-K if not ; 'Invalid colour' ;; CO-TEMP-E L2287: LD A,C ; value to A - LD HL,$5C8F ; address ATTR_T + LD HL,#5C8F ; address ATTR_T CALL L226C ; routine CO-CHANGE addressing ATTR_T LD A,C ; fetch value RRCA ; for flash8/bright8 complete @@ -10459,11 +10407,11 @@ L2287: LD A,C ; value to A ;; BORDER L2294: CALL L1E94 ; routine FIND-INT1 - CP $08 ; must be in range 0 (black) to 7 (white) + CP #08 ; must be in range 0 (black) to 7 (white) JR NC,L2244 ; back to REPORT-K if not ; 'Invalid colour'. - OUT ($FE),A ; outputting to port effects an immediate + OUT (#FE),A ; outputting to port effects an immediate ; change. RLCA ; shift the colour to RLCA ; the paper bits setting the @@ -10472,10 +10420,10 @@ L2294: CALL L1E94 ; routine FIND-INT1 ; i.e. in the range green to white. JR NZ,L22A6 ; skip to BORDER-1 if so - XOR $07 ; make the ink white. + XOR #07 ; make the ink white. ;; BORDER-1 -L22A6: LD ($5C48),A ; update BORDCR with new paper/ink +L22A6: LD (#5C48),A ; update BORDCR with new paper/ink RET ; return. ; ----------------- @@ -10485,7 +10433,7 @@ L22A6: LD ($5C48),A ; update BORDCR with new paper/ink ; ;; PIXEL-ADD -L22AA: LD A,$AF ; load with 175 decimal. +L22AA: LD A,#AF ; load with 175 decimal. SUB B ; subtract the y value. JP C,L24F9 ; jump forward to REPORT-Bc if greater. ; 'Integer out of range' @@ -10506,7 +10454,7 @@ L22AA: LD A,$AF ; load with 175 decimal. RRA ; 010xxxxx XOR B ; - AND $F8 ; keep the top 5 bits 11111000 + AND #F8 ; keep the top 5 bits 11111000 XOR B ; 010xxbbb LD H,A ; transfer high byte to H. @@ -10517,7 +10465,7 @@ L22AA: LD A,$AF ; load with 175 decimal. RLCA ; RLCA ; XOR B ; the y value - AND $C7 ; apply mask 11000111 + AND #C7 ; apply mask 11000111 XOR B ; restore unmasked bits xxyyyxxx RLCA ; rotate to xyyyxxxx RLCA ; required position. yyyxxxxx @@ -10526,7 +10474,7 @@ L22AA: LD A,$AF ; load with 175 decimal. ; finally form the pixel position in A. LD A,C ; x value to A - AND $07 ; mod 8 + AND #07 ; mod 8 RET ; return ; ---------------- @@ -10546,7 +10494,7 @@ L22CB: CALL L2307 ; routine STK-TO-BC L22D4: RLCA ; rotate and loop back DJNZ L22D4 ; to POINT-LP until pixel at right. - AND $01 ; test to give zero or one. + AND #01 ; test to give zero or one. JP L2D28 ; jump forward to STACK-A to save result. ; ------------------- @@ -10572,12 +10520,12 @@ L22DC: CALL L2307 ; routine STK-TO-BC ; back on the screen though the colours may change. ;; PLOT-SUB -L22E5: LD ($5C7D),BC ; store new x/y values in COORDS +L22E5: LD (#5C7D),BC ; store new x/y values in COORDS CALL L22AA ; routine PIXEL-ADD gets address in HL, ; count from left 0-7 in B. LD B,A ; transfer count to B. INC B ; increase 1-8. - LD A,$FE ; 11111110 in A. + LD A,#FE ; 11111110 in A. ;; PLOT-LOOP L22F0: RRCA ; rotate mask. @@ -10586,7 +10534,7 @@ L22F0: RRCA ; rotate mask. LD B,A ; load mask to B LD A,(HL) ; fetch screen byte to A - LD C,(IY+$57) ; P_FLAG to C + LD C,(IY+#57) ; P_FLAG to C BIT 0,C ; is it to be OVER 1 ? JR NZ,L22FD ; forward to PL-TST-IN if so. @@ -10634,10 +10582,10 @@ L2314: CALL L2DD5 ; routine FP-TO-A compresses last value into ; zero flag set if positive. JP C,L24F9 ; jump forward to REPORT-Bc if >= 255.5. - LD C,$01 ; prepare a positive sign byte. + LD C,#01 ; prepare a positive sign byte. RET Z ; return if FP-TO-BC indicated positive. - LD C,$FF ; prepare negative sign byte and + LD C,#FF ; prepare negative sign byte and RET ; return. @@ -10649,7 +10597,7 @@ L2314: CALL L2DD5 ; routine FP-TO-A compresses last value into ;; CIRCLE L2320: RST 18H ; GET-CHAR - CP $2C ; is it required comma ? + CP #2C ; is it required comma ? JP NZ,L1C8A ; jump to REPORT-C if not @@ -10659,19 +10607,19 @@ L2320: RST 18H ; GET-CHAR ; nothing follows command. RST 28H ;; FP-CALC - DEFB $2A ;;abs ; make radius positive - DEFB $3D ;;re-stack ; in full floating point form - DEFB $38 ;;end-calc + DEFB #2A ;;abs ; make radius positive + DEFB #3D ;;re-stack ; in full floating point form + DEFB #38 ;;end-calc LD A,(HL) ; fetch first floating point byte - CP $81 ; compare to one + CP #81 ; compare to one JR NC,L233B ; forward to C-R-GRE-1 if circle radius ; is greater than one. RST 28H ;; FP-CALC - DEFB $02 ;;delete ; delete the radius from stack. - DEFB $38 ;;end-calc + DEFB #02 ;;delete ; delete the radius from stack. + DEFB #38 ;;end-calc JR L22DC ; to PLOT to just plot x,y. @@ -10680,34 +10628,34 @@ L2320: RST 18H ; GET-CHAR ;; C-R-GRE-1 L233B: RST 28H ;; FP-CALC ; x, y, r - DEFB $A3 ;;stk-pi/2 ; x, y, r, pi/2. - DEFB $38 ;;end-calc + DEFB #A3 ;;stk-pi/2 ; x, y, r, pi/2. + DEFB #38 ;;end-calc - LD (HL),$83 ; ; x, y, r, 2*PI + LD (HL),#83 ; ; x, y, r, 2*PI RST 28H ;; FP-CALC - DEFB $C5 ;;st-mem-5 ; store 2*PI in mem-5 - DEFB $02 ;;delete ; x, y, z. - DEFB $38 ;;end-calc + DEFB #C5 ;;st-mem-5 ; store 2*PI in mem-5 + DEFB #02 ;;delete ; x, y, z. + DEFB #38 ;;end-calc CALL L247D ; routine CD-PRMS1 PUSH BC ; RST 28H ;; FP-CALC - DEFB $31 ;;duplicate - DEFB $E1 ;;get-mem-1 - DEFB $04 ;;multiply - DEFB $38 ;;end-calc + DEFB #31 ;;duplicate + DEFB #E1 ;;get-mem-1 + DEFB #04 ;;multiply + DEFB #38 ;;end-calc LD A,(HL) ; - CP $80 ; + CP #80 ; JR NC,L235A ; to C-ARC-GE1 RST 28H ;; FP-CALC - DEFB $02 ;;delete - DEFB $02 ;;delete - DEFB $38 ;;end-calc + DEFB #02 ;;delete + DEFB #02 ;;delete + DEFB #38 ;;end-calc POP BC ; JP L22DC ; JUMP to PLOT @@ -10717,34 +10665,34 @@ L233B: RST 28H ;; FP-CALC ; x, y, r ;; C-ARC-GE1 L235A: RST 28H ;; FP-CALC - DEFB $C2 ;;st-mem-2 - DEFB $01 ;;exchange - DEFB $C0 ;;st-mem-0 - DEFB $02 ;;delete - DEFB $03 ;;subtract - DEFB $01 ;;exchange - DEFB $E0 ;;get-mem-0 - DEFB $0F ;;addition - DEFB $C0 ;;st-mem-0 - DEFB $01 ;;exchange - DEFB $31 ;;duplicate - DEFB $E0 ;;get-mem-0 - DEFB $01 ;;exchange - DEFB $31 ;;duplicate - DEFB $E0 ;;get-mem-0 - DEFB $A0 ;;stk-zero - DEFB $C1 ;;st-mem-1 - DEFB $02 ;;delete - DEFB $38 ;;end-calc + DEFB #C2 ;;st-mem-2 + DEFB #01 ;;exchange + DEFB #C0 ;;st-mem-0 + DEFB #02 ;;delete + DEFB #03 ;;subtract + DEFB #01 ;;exchange + DEFB #E0 ;;get-mem-0 + DEFB #0F ;;addition + DEFB #C0 ;;st-mem-0 + DEFB #01 ;;exchange + DEFB #31 ;;duplicate + DEFB #E0 ;;get-mem-0 + DEFB #01 ;;exchange + DEFB #31 ;;duplicate + DEFB #E0 ;;get-mem-0 + DEFB #A0 ;;stk-zero + DEFB #C1 ;;st-mem-1 + DEFB #02 ;;delete + DEFB #38 ;;end-calc - INC (IY+$62) ; MEM-2-1st + INC (IY+#62) ; MEM-2-1st CALL L1E94 ; routine FIND-INT1 LD L,A ; PUSH HL ; CALL L1E94 ; routine FIND-INT1 POP HL ; LD H,A ; - LD ($5C7D),HL ; COORDS + LD (#5C7D),HL ; COORDS POP BC ; JP L2420 ; to DRW-STEPS @@ -10757,7 +10705,7 @@ L235A: RST 28H ;; FP-CALC ;; DRAW L2382: RST 18H ; GET-CHAR - CP $2C ; + CP #2C ; JR Z,L238D ; to DR-3-PRMS CALL L1BEE ; routine CHECK-END @@ -10771,53 +10719,53 @@ L238D: RST 20H ; NEXT-CHAR CALL L1BEE ; routine CHECK-END RST 28H ;; FP-CALC - DEFB $C5 ;;st-mem-5 - DEFB $A2 ;;stk-half - DEFB $04 ;;multiply - DEFB $1F ;;sin - DEFB $31 ;;duplicate - DEFB $30 ;;not - DEFB $30 ;;not - DEFB $00 ;;jump-true + DEFB #C5 ;;st-mem-5 + DEFB #A2 ;;stk-half + DEFB #04 ;;multiply + DEFB #1F ;;sin + DEFB #31 ;;duplicate + DEFB #30 ;;not + DEFB #30 ;;not + DEFB #00 ;;jump-true - DEFB $06 ;;to L23A3, DR-SIN-NZ + DEFB #06 ;;to L23A3, DR-SIN-NZ - DEFB $02 ;;delete - DEFB $38 ;;end-calc + DEFB #02 ;;delete + DEFB #38 ;;end-calc JP L2477 ; to LINE-DRAW ; --- ;; DR-SIN-NZ -L23A3: DEFB $C0 ;;st-mem-0 - DEFB $02 ;;delete - DEFB $C1 ;;st-mem-1 - DEFB $02 ;;delete - DEFB $31 ;;duplicate - DEFB $2A ;;abs - DEFB $E1 ;;get-mem-1 - DEFB $01 ;;exchange - DEFB $E1 ;;get-mem-1 - DEFB $2A ;;abs - DEFB $0F ;;addition - DEFB $E0 ;;get-mem-0 - DEFB $05 ;;division - DEFB $2A ;;abs - DEFB $E0 ;;get-mem-0 - DEFB $01 ;;exchange - DEFB $3D ;;re-stack - DEFB $38 ;;end-calc +L23A3: DEFB #C0 ;;st-mem-0 + DEFB #02 ;;delete + DEFB #C1 ;;st-mem-1 + DEFB #02 ;;delete + DEFB #31 ;;duplicate + DEFB #2A ;;abs + DEFB #E1 ;;get-mem-1 + DEFB #01 ;;exchange + DEFB #E1 ;;get-mem-1 + DEFB #2A ;;abs + DEFB #0F ;;addition + DEFB #E0 ;;get-mem-0 + DEFB #05 ;;division + DEFB #2A ;;abs + DEFB #E0 ;;get-mem-0 + DEFB #01 ;;exchange + DEFB #3D ;;re-stack + DEFB #38 ;;end-calc LD A,(HL) ; - CP $81 ; + CP #81 ; JR NC,L23C1 ; to DR-PRMS RST 28H ;; FP-CALC - DEFB $02 ;;delete - DEFB $02 ;;delete - DEFB $38 ;;end-calc + DEFB #02 ;;delete + DEFB #02 ;;delete + DEFB #38 ;;end-calc JP L2477 ; to LINE-DRAW @@ -10828,91 +10776,91 @@ L23C1: CALL L247D ; routine CD-PRMS1 PUSH BC ; RST 28H ;; FP-CALC - DEFB $02 ;;delete - DEFB $E1 ;;get-mem-1 - DEFB $01 ;;exchange - DEFB $05 ;;division - DEFB $C1 ;;st-mem-1 - DEFB $02 ;;delete - DEFB $01 ;;exchange - DEFB $31 ;;duplicate - DEFB $E1 ;;get-mem-1 - DEFB $04 ;;multiply - DEFB $C2 ;;st-mem-2 - DEFB $02 ;;delete - DEFB $01 ;;exchange - DEFB $31 ;;duplicate - DEFB $E1 ;;get-mem-1 - DEFB $04 ;;multiply - DEFB $E2 ;;get-mem-2 - DEFB $E5 ;;get-mem-5 - DEFB $E0 ;;get-mem-0 - DEFB $03 ;;subtract - DEFB $A2 ;;stk-half - DEFB $04 ;;multiply - DEFB $31 ;;duplicate - DEFB $1F ;;sin - DEFB $C5 ;;st-mem-5 - DEFB $02 ;;delete - DEFB $20 ;;cos - DEFB $C0 ;;st-mem-0 - DEFB $02 ;;delete - DEFB $C2 ;;st-mem-2 - DEFB $02 ;;delete - DEFB $C1 ;;st-mem-1 - DEFB $E5 ;;get-mem-5 - DEFB $04 ;;multiply - DEFB $E0 ;;get-mem-0 - DEFB $E2 ;;get-mem-2 - DEFB $04 ;;multiply - DEFB $0F ;;addition - DEFB $E1 ;;get-mem-1 - DEFB $01 ;;exchange - DEFB $C1 ;;st-mem-1 - DEFB $02 ;;delete - DEFB $E0 ;;get-mem-0 - DEFB $04 ;;multiply - DEFB $E2 ;;get-mem-2 - DEFB $E5 ;;get-mem-5 - DEFB $04 ;;multiply - DEFB $03 ;;subtract - DEFB $C2 ;;st-mem-2 - DEFB $2A ;;abs - DEFB $E1 ;;get-mem-1 - DEFB $2A ;;abs - DEFB $0F ;;addition - DEFB $02 ;;delete - DEFB $38 ;;end-calc + DEFB #02 ;;delete + DEFB #E1 ;;get-mem-1 + DEFB #01 ;;exchange + DEFB #05 ;;division + DEFB #C1 ;;st-mem-1 + DEFB #02 ;;delete + DEFB #01 ;;exchange + DEFB #31 ;;duplicate + DEFB #E1 ;;get-mem-1 + DEFB #04 ;;multiply + DEFB #C2 ;;st-mem-2 + DEFB #02 ;;delete + DEFB #01 ;;exchange + DEFB #31 ;;duplicate + DEFB #E1 ;;get-mem-1 + DEFB #04 ;;multiply + DEFB #E2 ;;get-mem-2 + DEFB #E5 ;;get-mem-5 + DEFB #E0 ;;get-mem-0 + DEFB #03 ;;subtract + DEFB #A2 ;;stk-half + DEFB #04 ;;multiply + DEFB #31 ;;duplicate + DEFB #1F ;;sin + DEFB #C5 ;;st-mem-5 + DEFB #02 ;;delete + DEFB #20 ;;cos + DEFB #C0 ;;st-mem-0 + DEFB #02 ;;delete + DEFB #C2 ;;st-mem-2 + DEFB #02 ;;delete + DEFB #C1 ;;st-mem-1 + DEFB #E5 ;;get-mem-5 + DEFB #04 ;;multiply + DEFB #E0 ;;get-mem-0 + DEFB #E2 ;;get-mem-2 + DEFB #04 ;;multiply + DEFB #0F ;;addition + DEFB #E1 ;;get-mem-1 + DEFB #01 ;;exchange + DEFB #C1 ;;st-mem-1 + DEFB #02 ;;delete + DEFB #E0 ;;get-mem-0 + DEFB #04 ;;multiply + DEFB #E2 ;;get-mem-2 + DEFB #E5 ;;get-mem-5 + DEFB #04 ;;multiply + DEFB #03 ;;subtract + DEFB #C2 ;;st-mem-2 + DEFB #2A ;;abs + DEFB #E1 ;;get-mem-1 + DEFB #2A ;;abs + DEFB #0F ;;addition + DEFB #02 ;;delete + DEFB #38 ;;end-calc LD A,(DE) ; - CP $81 ; + CP #81 ; POP BC ; JP C,L2477 ; to LINE-DRAW PUSH BC ; RST 28H ;; FP-CALC - DEFB $01 ;;exchange - DEFB $38 ;;end-calc + DEFB #01 ;;exchange + DEFB #38 ;;end-calc - LD A,($5C7D) ; COORDS-x + LD A,(#5C7D) ; COORDS-x CALL L2D28 ; routine STACK-A RST 28H ;; FP-CALC - DEFB $C0 ;;st-mem-0 - DEFB $0F ;;addition - DEFB $01 ;;exchange - DEFB $38 ;;end-calc + DEFB #C0 ;;st-mem-0 + DEFB #0F ;;addition + DEFB #01 ;;exchange + DEFB #38 ;;end-calc - LD A,($5C7E) ; COORDS-y + LD A,(#5C7E) ; COORDS-y CALL L2D28 ; routine STACK-A RST 28H ;; FP-CALC - DEFB $C5 ;;st-mem-5 - DEFB $0F ;;addition - DEFB $E0 ;;get-mem-0 - DEFB $E5 ;;get-mem-5 - DEFB $38 ;;end-calc + DEFB #C5 ;;st-mem-5 + DEFB #0F ;;addition + DEFB #E0 ;;get-mem-0 + DEFB #E5 ;;get-mem-5 + DEFB #38 ;;end-calc POP BC ; @@ -10927,56 +10875,56 @@ L2420: DEC B ; ;; ARC-LOOP L2425: RST 28H ;; FP-CALC - DEFB $E1 ;;get-mem-1 - DEFB $31 ;;duplicate - DEFB $E3 ;;get-mem-3 - DEFB $04 ;;multiply - DEFB $E2 ;;get-mem-2 - DEFB $E4 ;;get-mem-4 - DEFB $04 ;;multiply - DEFB $03 ;;subtract - DEFB $C1 ;;st-mem-1 - DEFB $02 ;;delete - DEFB $E4 ;;get-mem-4 - DEFB $04 ;;multiply - DEFB $E2 ;;get-mem-2 - DEFB $E3 ;;get-mem-3 - DEFB $04 ;;multiply - DEFB $0F ;;addition - DEFB $C2 ;;st-mem-2 - DEFB $02 ;;delete - DEFB $38 ;;end-calc + DEFB #E1 ;;get-mem-1 + DEFB #31 ;;duplicate + DEFB #E3 ;;get-mem-3 + DEFB #04 ;;multiply + DEFB #E2 ;;get-mem-2 + DEFB #E4 ;;get-mem-4 + DEFB #04 ;;multiply + DEFB #03 ;;subtract + DEFB #C1 ;;st-mem-1 + DEFB #02 ;;delete + DEFB #E4 ;;get-mem-4 + DEFB #04 ;;multiply + DEFB #E2 ;;get-mem-2 + DEFB #E3 ;;get-mem-3 + DEFB #04 ;;multiply + DEFB #0F ;;addition + DEFB #C2 ;;st-mem-2 + DEFB #02 ;;delete + DEFB #38 ;;end-calc ;; ARC-START L2439: PUSH BC ; RST 28H ;; FP-CALC - DEFB $C0 ;;st-mem-0 - DEFB $02 ;;delete - DEFB $E1 ;;get-mem-1 - DEFB $0F ;;addition - DEFB $31 ;;duplicate - DEFB $38 ;;end-calc + DEFB #C0 ;;st-mem-0 + DEFB #02 ;;delete + DEFB #E1 ;;get-mem-1 + DEFB #0F ;;addition + DEFB #31 ;;duplicate + DEFB #38 ;;end-calc - LD A,($5C7D) ; COORDS-x + LD A,(#5C7D) ; COORDS-x CALL L2D28 ; routine STACK-A RST 28H ;; FP-CALC - DEFB $03 ;;subtract - DEFB $E0 ;;get-mem-0 - DEFB $E2 ;;get-mem-2 - DEFB $0F ;;addition - DEFB $C0 ;;st-mem-0 - DEFB $01 ;;exchange - DEFB $E0 ;;get-mem-0 - DEFB $38 ;;end-calc + DEFB #03 ;;subtract + DEFB #E0 ;;get-mem-0 + DEFB #E2 ;;get-mem-2 + DEFB #0F ;;addition + DEFB #C0 ;;st-mem-0 + DEFB #01 ;;exchange + DEFB #E0 ;;get-mem-0 + DEFB #38 ;;end-calc - LD A,($5C7E) ; COORDS-y + LD A,(#5C7E) ; COORDS-y CALL L2D28 ; routine STACK-A RST 28H ;; FP-CALC - DEFB $03 ;;subtract - DEFB $38 ;;end-calc + DEFB #03 ;;subtract + DEFB #38 ;;end-calc CALL L24B7 ; routine DRAW-LINE POP BC ; @@ -10985,25 +10933,25 @@ L2439: PUSH BC ; ;; ARC-END L245F: RST 28H ;; FP-CALC - DEFB $02 ;;delete - DEFB $02 ;;delete - DEFB $01 ;;exchange - DEFB $38 ;;end-calc + DEFB #02 ;;delete + DEFB #02 ;;delete + DEFB #01 ;;exchange + DEFB #38 ;;end-calc - LD A,($5C7D) ; COORDS-x + LD A,(#5C7D) ; COORDS-x CALL L2D28 ; routine STACK-A RST 28H ;; FP-CALC - DEFB $03 ;;subtract - DEFB $01 ;;exchange - DEFB $38 ;;end-calc + DEFB #03 ;;subtract + DEFB #01 ;;exchange + DEFB #38 ;;end-calc - LD A,($5C7E) ; COORDS-y + LD A,(#5C7E) ; COORDS-y CALL L2D28 ; routine STACK-A RST 28H ;; FP-CALC - DEFB $03 ;;subtract - DEFB $38 ;;end-calc + DEFB #03 ;;subtract + DEFB #38 ;;end-calc ;; LINE-DRAW L2477: CALL L24B7 ; routine DRAW-LINE @@ -11018,59 +10966,59 @@ L2477: CALL L24B7 ; routine DRAW-LINE ;; CD-PRMS1 L247D: RST 28H ;; FP-CALC - DEFB $31 ;;duplicate - DEFB $28 ;;sqr - DEFB $34 ;;stk-data - DEFB $32 ;;Exponent: $82, Bytes: 1 - DEFB $00 ;;(+00,+00,+00) - DEFB $01 ;;exchange - DEFB $05 ;;division - DEFB $E5 ;;get-mem-5 - DEFB $01 ;;exchange - DEFB $05 ;;division - DEFB $2A ;;abs - DEFB $38 ;;end-calc + DEFB #31 ;;duplicate + DEFB #28 ;;sqr + DEFB #34 ;;stk-data + DEFB #32 ;;Exponent: #82, Bytes: 1 + DEFB #00 ;;(+00,+00,+00) + DEFB #01 ;;exchange + DEFB #05 ;;division + DEFB #E5 ;;get-mem-5 + DEFB #01 ;;exchange + DEFB #05 ;;division + DEFB #2A ;;abs + DEFB #38 ;;end-calc CALL L2DD5 ; routine FP-TO-A JR C,L2495 ; to USE-252 - AND $FC ; - ADD A,$04 ; + AND #FC ; + ADD A,#04 ; JR NC,L2497 ; to DRAW-SAVE ;; USE-252 -L2495: LD A,$FC ; +L2495: LD A,#FC ; ;; DRAW-SAVE L2497: PUSH AF ; CALL L2D28 ; routine STACK-A RST 28H ;; FP-CALC - DEFB $E5 ;;get-mem-5 - DEFB $01 ;;exchange - DEFB $05 ;;division - DEFB $31 ;;duplicate - DEFB $1F ;;sin - DEFB $C4 ;;st-mem-4 - DEFB $02 ;;delete - DEFB $31 ;;duplicate - DEFB $A2 ;;stk-half - DEFB $04 ;;multiply - DEFB $1F ;;sin - DEFB $C1 ;;st-mem-1 - DEFB $01 ;;exchange - DEFB $C0 ;;st-mem-0 - DEFB $02 ;;delete - DEFB $31 ;;duplicate - DEFB $04 ;;multiply - DEFB $31 ;;duplicate - DEFB $0F ;;addition - DEFB $A1 ;;stk-one - DEFB $03 ;;subtract - DEFB $1B ;;negate - DEFB $C3 ;;st-mem-3 - DEFB $02 ;;delete - DEFB $38 ;;end-calc + DEFB #E5 ;;get-mem-5 + DEFB #01 ;;exchange + DEFB #05 ;;division + DEFB #31 ;;duplicate + DEFB #1F ;;sin + DEFB #C4 ;;st-mem-4 + DEFB #02 ;;delete + DEFB #31 ;;duplicate + DEFB #A2 ;;stk-half + DEFB #04 ;;multiply + DEFB #1F ;;sin + DEFB #C1 ;;st-mem-1 + DEFB #01 ;;exchange + DEFB #C0 ;;st-mem-0 + DEFB #02 ;;delete + DEFB #31 ;;duplicate + DEFB #04 ;;multiply + DEFB #31 ;;duplicate + DEFB #0F ;;addition + DEFB #A1 ;;stk-one + DEFB #03 ;;subtract + DEFB #1B ;;negate + DEFB #C3 ;;st-mem-3 + DEFB #02 ;;delete + DEFB #38 ;;end-calc POP BC ; RET ; @@ -11102,7 +11050,7 @@ L24C4: OR C ; LD L,B ; LD B,C ; PUSH DE ; - LD D,$00 ; + LD D,#00 ; ;; DL-LARGER L24CB: LD H,B ; @@ -11133,7 +11081,7 @@ L24DB: LD C,A ; POP BC ; ;; D-L-STEP -L24DF: LD HL,($5C7D) ; COORDS +L24DF: LD HL,(#5C7D) ; COORDS LD A,B ; ADD A,H ; LD B,A ; @@ -11163,7 +11111,7 @@ L24F7: JR Z,L24EC ; to D-L-PLOT ;; REPORT-Bc L24F9: RST 08H ; ERROR-1 - DEFB $0A ; Error Report: Integer out of range + DEFB #0A ; Error Report: Integer out of range @@ -11194,7 +11142,7 @@ L24F9: RST 08H ; ERROR-1 ;; SCANNING L24FB: RST 18H ; GET-CHAR - LD B,$00 ; priority marker zero is pushed on stack + LD B,#00 ; priority marker zero is pushed on stack ; to signify end of expression when it is ; popped off again. PUSH BC ; put in on stack. @@ -11213,7 +11161,7 @@ L24FF: LD C,A ; store the character while a look up is done. ; first instance a digit or a variable and ; then anything else. >>> - LD B,$00 ; but here if it was found in table so + LD B,#00 ; but here if it was found in table so LD C,(HL) ; fetch offset from table and make B zero. ADD HL,BC ; add the offset to position found JP (HL) ; and jump to the routine e.g. S-BIN @@ -11229,16 +11177,16 @@ L24FF: LD C,A ; store the character while a look up is done. L250F: CALL L0074 ; routine CH-ADD+1 points to next character ; and fetches that character. INC BC ; increase length counter. - CP $0D ; is it carriage return ? + CP #0D ; is it carriage return ? ; inside a quote. JP Z,L1C8A ; jump back to REPORT-C if so. ; 'Nonsense in BASIC'. - CP $22 ; is it a quote '"' ? + CP #22 ; is it a quote '"' ? JR NZ,L250F ; back to S-QUOTE-S if not for more. CALL L0074 ; routine CH-ADD+1 - CP $22 ; compare with possible adjacent quote + CP #22 ; compare with possible adjacent quote RET ; return. with zero set if two together. ; --- @@ -11249,7 +11197,7 @@ L250F: CALL L0074 ; routine CH-ADD+1 points to next character ;; S-2-COORD L2522: RST 20H ; NEXT-CHAR - CP $28 ; is it the opening '(' ? + CP #28 ; is it the opening '(' ? JR NZ,L252D ; forward to S-RPORT-C if not ; 'Nonsense in BASIC'. @@ -11260,7 +11208,7 @@ L2522: RST 20H ; NEXT-CHAR ; before rejoining the main juggling act. RST 18H ; GET-CHAR - CP $29 ; is it the closing ')' ? + CP #29 ; is it the closing ')' ? ;; S-RPORT-C L252D: JP NZ,L1C8A ; jump back to REPORT-C if not. @@ -11274,7 +11222,7 @@ L252D: JP NZ,L1C8A ; jump back to REPORT-C if not. ; four bytes of code, but a call instruction only uses 3 bytes of code. ;; SYNTAX-Z -L2530: BIT 7,(IY+$01) ; test FLAGS - checking syntax only ? +L2530: BIT 7,(IY+#01) ; test FLAGS - checking syntax only ? RET ; return. ; ---------------- @@ -11294,22 +11242,22 @@ L2530: BIT 7,(IY+$01) ; test FLAGS - checking syntax only ? ;; S-SCRN$-S L2535: CALL L2307 ; routine STK-TO-BC. - LD HL,($5C36) ; fetch address of CHARS. - LD DE,$0100 ; fetch offset to chr$ 32 + LD HL,(#5C36) ; fetch address of CHARS. + LD DE,#0100 ; fetch offset to chr$ 32 ADD HL,DE ; and find start of bitmaps. ; Note. not inc h. ?? LD A,C ; transfer line to A. RRCA ; multiply RRCA ; by RRCA ; thirty-two. - AND $E0 ; and with 11100000 - XOR B ; combine with column $00 - $1F + AND #E0 ; and with 11100000 + XOR B ; combine with column #00 - #1F LD E,A ; to give the low byte of top line LD A,C ; column to A range 00000000 to 00011111 - AND $18 ; and with 00011000 - XOR $40 ; xor with 01000000 (high byte screen start) + AND #18 ; and with 00011000 + XOR #40 ; xor with 01000000 (high byte screen start) LD D,A ; register DE now holds start address of cell. - LD B,$60 ; there are 96 characters in ASCII set. + LD B,#60 ; there are 96 characters in ASCII set. ;; S-SCRN-LP L254F: PUSH BC ; save count @@ -11318,25 +11266,25 @@ L254F: PUSH BC ; save count LD A,(DE) ; first byte of screen to A XOR (HL) ; xor with corresponding character byte JR Z,L255A ; forward to S-SC-MTCH if they match - ; if inverse result would be $FF + ; if inverse result would be #FF ; if any other then mismatch - INC A ; set to $00 if inverse + INC A ; set to #00 if inverse JR NZ,L2573 ; forward to S-SCR-NXT if a mismatch - DEC A ; restore $FF + DEC A ; restore #FF ; a match has been found so seven more to test. ;; S-SC-MTCH -L255A: LD C,A ; load C with inverse mask $00 or $FF - LD B,$07 ; count seven more bytes +L255A: LD C,A ; load C with inverse mask #00 or #FF + LD B,#07 ; count seven more bytes ;; S-SC-ROWS L255D: INC D ; increment screen address. INC HL ; increment bitmap address. LD A,(DE) ; byte to A - XOR (HL) ; will give $00 or $FF (inverse) + XOR (HL) ; will give #00 or #FF (inverse) XOR C ; xor with inverse mask JR NZ,L2573 ; forward to S-SCR-NXT if no match. @@ -11347,10 +11295,10 @@ L255D: INC D ; increment screen address. POP BC ; discard the POP BC ; saved POP BC ; pointers - LD A,$80 ; the endpoint of character set + LD A,#80 ; the endpoint of character set SUB B ; subtract the counter ; to give the code 32-127 - LD BC,$0001 ; make one space in workspace. + LD BC,#0001 ; make one space in workspace. RST 30H ; BC-SPACES creates the space sliding ; the calculator stack upwards. @@ -11363,7 +11311,7 @@ L255D: INC D ; increment screen address. ;; S-SCR-NXT L2573: POP HL ; restore the last bitmap start - LD DE,$0008 ; and prepare to add 8. + LD DE,#0008 ; and prepare to add 8. ADD HL,DE ; now addresses next character bitmap. POP DE ; restore screen address POP BC ; and character counter in B @@ -11392,20 +11340,20 @@ L257D: JP L2AB2 ; to STK-STO-$ to store the string in ;; S-ATTR-S L2580: CALL L2307 ; routine STK-TO-BC fetches line to C, ; and column to B. - LD A,C ; line to A $00 - $17 (max 00010111) + LD A,C ; line to A #00 - #17 (max 00010111) RRCA ; rotate RRCA ; bits RRCA ; left. LD C,A ; store in C as an intermediate value. - AND $E0 ; pick up bits 11100000 ( was 00011100 ) - XOR B ; combine with column $00 - $1F + AND #E0 ; pick up bits 11100000 ( was 00011100 ) + XOR B ; combine with column #00 - #1F LD L,A ; low byte now correct. LD A,C ; bring back intermediate result from C - AND $03 ; mask to give correct third of - ; screen $00 - $02 - XOR $58 ; combine with base address. + AND #03 ; mask to give correct third of + ; screen #00 - #02 + XOR #58 ; combine with base address. LD H,A ; high byte correct. LD A,(HL) ; pick up the colour attribute. JP L2D28 ; forward to STACK-A to store result @@ -11415,7 +11363,7 @@ L2580: CALL L2307 ; routine STK-TO-BC fetches line to C, ; Scanning function table ; ----------------------- ; This table is used by INDEXER routine to find the offsets to -; four operators and eight functions. e.g. $A8 is the token 'FN'. +; four operators and eight functions. e.g. #A8 is the token 'FN'. ; This table is used in the first instance for the first character of an ; expression or by a recursive call to SCANNING for the first character of ; any sub-expression. It eliminates functions that have no argument or @@ -11438,21 +11386,21 @@ L2580: CALL L2307 ; routine STK-TO-BC fetches line to C, ; An expression that begins with a quote requires special treatment. ;; scan-func -L2596: DEFB $22, L25B3-$-1 ; $1C offset to S-QUOTE - DEFB '(', L25E8-$-1 ; $4F offset to S-BRACKET - DEFB '.', L268D-$-1 ; $F2 offset to S-DECIMAL - DEFB '+', L25AF-$-1 ; $12 offset to S-U-PLUS +L2596: DEFB #22, L25B3-$-1 ; #1C offset to S-QUOTE + DEFB '(', L25E8-$-1 ; #4F offset to S-BRACKET + DEFB '.', L268D-$-1 ; #F2 offset to S-DECIMAL + DEFB '+', L25AF-$-1 ; #12 offset to S-U-PLUS - DEFB $A8, L25F5-$-1 ; $56 offset to S-FN - DEFB $A5, L25F8-$-1 ; $57 offset to S-RND - DEFB $A7, L2627-$-1 ; $84 offset to S-PI - DEFB $A6, L2634-$-1 ; $8F offset to S-INKEY$ - DEFB $C4, L268D-$-1 ; $E6 offset to S-BIN - DEFB $AA, L2668-$-1 ; $BF offset to S-SCREEN$ - DEFB $AB, L2672-$-1 ; $C7 offset to S-ATTR - DEFB $A9, L267B-$-1 ; $CE offset to S-POINT + DEFB #A8, L25F5-$-1 ; #56 offset to S-FN + DEFB #A5, L25F8-$-1 ; #57 offset to S-RND + DEFB #A7, L2627-$-1 ; #84 offset to S-PI + DEFB #A6, L2634-$-1 ; #8F offset to S-INKEY$ + DEFB #C4, L268D-$-1 ; #E6 offset to S-BIN + DEFB #AA, L2668-$-1 ; #BF offset to S-SCREEN$ + DEFB #AB, L2672-$-1 ; #C7 offset to S-ATTR + DEFB #A9, L267B-$-1 ; #CE offset to S-POINT - DEFB $00 ; zero end marker + DEFB #00 ; zero end marker ; -------------------------- ; Scanning function routines @@ -11474,7 +11422,7 @@ L25AF: RST 20H ; NEXT-CHAR just ignore L25B3: RST 18H ; GET-CHAR INC HL ; address next character (first in quotes) PUSH HL ; save start of quoted text. - LD BC,$0000 ; initialize length of string to zero. + LD BC,#0000 ; initialize length of string to zero. CALL L250F ; routine S-QUOTE-S JR NZ,L25D9 ; forward to S-Q-PRMS if @@ -11500,12 +11448,12 @@ L25CB: LD A,(HL) ; fetch a character from source. INC HL ; advance source address. LD (DE),A ; place in destination. INC DE ; advance destination address. - CP $22 ; was it a '"' just copied ? + CP #22 ; was it a '"' just copied ? JR NZ,L25CB ; back to S-Q-COPY to copy more if not LD A,(HL) ; fetch adjacent character from source. INC HL ; advance source address. - CP $22 ; is this '"' ? - i.e. two quotes together ? + CP #22 ; is this '"' ? - i.e. two quotes together ? JR Z,L25CB ; to S-Q-COPY if so including just one of the ; pair of quotes. @@ -11516,7 +11464,7 @@ L25D9: DEC BC ; decrease count by 1. POP DE ; restore start of string in workspace. ;; S-STRING -L25DB: LD HL,$5C3B ; Address FLAGS system variable. +L25DB: LD HL,#5C3B ; Address FLAGS system variable. RES 6,(HL) ; signal string result. BIT 7,(HL) ; is syntax being checked. CALL NZ,L2AB2 ; routine STK-STO-$ is called in runtime. @@ -11528,7 +11476,7 @@ L25DB: LD HL,$5C3B ; Address FLAGS system variable. ;; S-BRACKET L25E8: RST 20H ; NEXT-CHAR CALL L24FB ; routine SCANNING is called recursively. - CP $29 ; is it the closing ')' ? + CP #29 ; is it the closing ')' ? JP NZ,L1C8A ; jump back to REPORT-C if not ; 'Nonsense in BASIC' @@ -11548,35 +11496,35 @@ L25F5: JP L27BD ; jump forward to S-FN-SBRN. L25F8: CALL L2530 ; routine SYNTAX-Z JR Z,L2625 ; forward to S-RND-END if checking syntax. - LD BC,($5C76) ; fetch system variable SEED + LD BC,(#5C76) ; fetch system variable SEED CALL L2D2B ; routine STACK-BC places on calculator stack RST 28H ;; FP-CALC ;s. - DEFB $A1 ;;stk-one ;s,1. - DEFB $0F ;;addition ;s+1. - DEFB $34 ;;stk-data ; - DEFB $37 ;;Exponent: $87, + DEFB #A1 ;;stk-one ;s,1. + DEFB #0F ;;addition ;s+1. + DEFB #34 ;;stk-data ; + DEFB #37 ;;Exponent: #87, ;;Bytes: 1 - DEFB $16 ;;(+00,+00,+00) ;s+1,75. - DEFB $04 ;;multiply ;(s+1)*75 = v - DEFB $34 ;;stk-data ;v. - DEFB $80 ;;Bytes: 3 - DEFB $41 ;;Exponent $91 - DEFB $00,$00,$80 ;;(+00) ;v,65537. - DEFB $32 ;;n-mod-m ;remainder, result. - DEFB $02 ;;delete ;remainder. - DEFB $A1 ;;stk-one ;remainder, 1. - DEFB $03 ;;subtract ;remainder - 1. = rnd - DEFB $31 ;;duplicate ;rnd,rnd. - DEFB $38 ;;end-calc + DEFB #16 ;;(+00,+00,+00) ;s+1,75. + DEFB #04 ;;multiply ;(s+1)*75 = v + DEFB #34 ;;stk-data ;v. + DEFB #80 ;;Bytes: 3 + DEFB #41 ;;Exponent #91 + DEFB #00,#00,#80 ;;(+00) ;v,65537. + DEFB #32 ;;n-mod-m ;remainder, result. + DEFB #02 ;;delete ;remainder. + DEFB #A1 ;;stk-one ;remainder, 1. + DEFB #03 ;;subtract ;remainder - 1. = rnd + DEFB #31 ;;duplicate ;rnd,rnd. + DEFB #38 ;;end-calc CALL L2DA2 ; routine FP-TO-BC - LD ($5C76),BC ; store in SEED for next starting point. + LD (#5C76),BC ; store in SEED for next starting point. LD A,(HL) ; fetch exponent AND A ; is it zero ? JR Z,L2625 ; forward if so to S-RND-END - SUB $10 ; reduce exponent by 2^16 + SUB #10 ; reduce exponent by 2^16 LD (HL),A ; place back ;; S-RND-END @@ -11592,8 +11540,8 @@ L2627: CALL L2530 ; routine SYNTAX-Z JR Z,L2630 ; to S-PI-END if checking syntax. RST 28H ;; FP-CALC - DEFB $A3 ;;stk-pi/2 pi/2. - DEFB $38 ;;end-calc + DEFB #A3 ;;stk-pi/2 pi/2. + DEFB #38 ;;end-calc INC (HL) ; increment the exponent leaving pi ; on the calculator stack. @@ -11606,26 +11554,26 @@ L2630: RST 20H ; NEXT-CHAR ; -> ;; S-INKEY$ -L2634: LD BC,$105A ; priority $10, operation code $1A ('read-in') - ; +$40 for string result, numeric operand. +L2634: LD BC,#105A ; priority #10, operation code #1A ('read-in') + ; +#40 for string result, numeric operand. ; set this up now in case we need to use the ; calculator. RST 20H ; NEXT-CHAR - CP $23 ; '#' ? + CP #23 ; '#' ? JP Z,L270D ; to S-PUSH-PO if so to use the calculator ; single operation ; to read from network/RS232 etc. . ; else read a key from the keyboard. - LD HL,$5C3B ; fetch FLAGS + LD HL,#5C3B ; fetch FLAGS RES 6,(HL) ; signal string result. BIT 7,(HL) ; checking syntax ? JR Z,L2665 ; forward to S-INK$-EN if so JP L3B6C ; Spectrum 128 patch -L2649: LD C,$00 ; the length of an empty string +L2649: LD C,#00 ; the length of an empty string JR NZ,L2660 ; to S-IK$-STK to store empty string if ; no key returned. @@ -11633,21 +11581,21 @@ L2649: LD C,$00 ; the length of an empty string JR NC,L2660 ; to S-IK$-STK to stack null string if ; invalid - DEC D ; D is expected to be FLAGS so set bit 3 $FF + DEC D ; D is expected to be FLAGS so set bit 3 #FF ; 'L' Mode so no keywords. LD E,A ; main key to A ; C is MODE 0 'KLC' from above still. CALL L0333 ; routine K-DECODE L2657: PUSH AF ; save the code - LD BC,$0001 ; make room for one character + LD BC,#0001 ; make room for one character RST 30H ; BC-SPACES POP AF ; bring the code back LD (DE),A ; put the key in workspace - LD C,$01 ; set C length to one + LD C,#01 ; set C length to one ;; S-IK$-STK -L2660: LD B,$00 ; set high byte of length to zero +L2660: LD B,#00 ; set high byte of length to zero CALL L2AB2 ; routine STK-STO-$ ;; S-INK$-EN @@ -11693,7 +11641,7 @@ L2684: CALL L2C88 ; routine ALPHANUM checks if variable or JR NC,L26DF ; forward to S-NEGATE if not to consider ; a '-' character then functions. - CP $41 ; compare 'A' + CP #41 ; compare 'A' JR NC,L26C9 ; forward to S-LETTER if alpha -> ; else must have been numeric so continue ; into that routine. @@ -11715,17 +11663,17 @@ L268D: CALL L2530 ; routine SYNTAX-Z CALL L2C9B ; routine DEC-TO-FP to evaluate number RST 18H ; GET-CHAR to fetch HL - LD BC,$0006 ; six locations required + LD BC,#0006 ; six locations required CALL L1655 ; routine MAKE-ROOM INC HL ; to first new location - LD (HL),$0E ; insert number marker + LD (HL),#0E ; insert number marker INC HL ; address next EX DE,HL ; make DE destination. - LD HL,($5C65) ; STKEND points to end of stack. - LD C,$05 ; result is five locations lower + LD HL,(#5C65) ; STKEND points to end of stack. + LD C,#05 ; result is five locations lower AND A ; prepare for true subtraction SBC HL,BC ; point to start of value. - LD ($5C65),HL ; update STKEND as we are taking number. + LD (#5C65),HL ; update STKEND as we are taking number. LDIR ; Copy five bytes to program location EX DE,HL ; transfer pointer to HL DEC HL ; adjust @@ -11742,16 +11690,16 @@ L26B5: RST 18H ; GET-CHAR positions HL at digit. ;; S-SD-SKIP L26B6: INC HL ; advance pointer LD A,(HL) ; until we find - CP $0E ; chr 14d - the number indicator + CP #0E ; chr 14d - the number indicator JR NZ,L26B6 ; to S-SD-SKIP until a match ; it has to be here. INC HL ; point to first byte of number CALL L33B4 ; routine STACK-NUM stacks it - LD ($5C5D),HL ; update system variable CH_ADD + LD (#5C5D),HL ; update system variable CH_ADD ;; S-NUMERIC -L26C3: SET 6,(IY+$01) ; update FLAGS - Signal numeric result +L26C3: SET 6,(IY+#01) ; update FLAGS - Signal numeric result JR L26DD ; forward to S-CONT-1 ===> ; actually S-CONT-2 is destination but why ; waste a byte on a jump when a JR will do. @@ -11773,8 +11721,8 @@ L26C9: CALL L28B2 ; routine LOOK-VARS ; is being checked. CALL Z,L2996 ; routine STK-VAR considers a subscript/slice - LD A,($5C3B) ; fetch FLAGS value - CP $C0 ; compare 11000000 + LD A,(#5C3B) ; fetch FLAGS value + CP #C0 ; compare 11000000 JR C,L26DD ; step forward to S-CONT-1 if string ===> INC HL ; advance pointer @@ -11790,49 +11738,49 @@ L26DD: JR L2712 ; forward to S-CONT-2 ===> ; the B register and the operation code, calculator literal in the C register. ; the operation code has bit 7 set if result is numeric and bit 6 is ; set if operand is numeric. so -; $C0 = numeric result, numeric operand. e.g. 'sin' -; $80 = numeric result, string operand. e.g. 'code' -; $40 = string result, numeric operand. e.g. 'str$' -; $00 = string result, string operand. e.g. 'val$' +; #C0 = numeric result, numeric operand. e.g. 'sin' +; #80 = numeric result, string operand. e.g. 'code' +; #40 = string result, numeric operand. e.g. 'str$' +; #00 = string result, string operand. e.g. 'val$' ;; S-NEGATE -L26DF: LD BC,$09DB ; prepare priority 09, operation code $C0 + - ; 'negate' ($1B) - bits 6 and 7 set for numeric +L26DF: LD BC,#09DB ; prepare priority 09, operation code #C0 + + ; 'negate' (#1B) - bits 6 and 7 set for numeric ; result and numeric operand. - CP $2D ; is it '-' ? + CP #2D ; is it '-' ? JR Z,L270D ; forward if so to S-PUSH-PO - LD BC,$1018 ; prepare priority $10, operation code 'val$' - + LD BC,#1018 ; prepare priority #10, operation code 'val$' - ; bits 6 and 7 reset for string result and ; string operand. - CP $AE ; is it 'VAL$' ? + CP #AE ; is it 'VAL$' ? JR Z,L270D ; forward if so to S-PUSH-PO - SUB $AF ; subtract token 'CODE' value to reduce + SUB #AF ; subtract token 'CODE' value to reduce ; functions 'CODE' to 'NOT' although the ; upper range is, as yet, unchecked. - ; valid range would be $00 - $14. + ; valid range would be #00 - #14. JP C,L1C8A ; jump back to REPORT-C with anything else ; 'Nonsense in BASIC' - LD BC,$04F0 ; prepare priority $04, operation $C0 + - ; 'not' ($30) + LD BC,#04F0 ; prepare priority #04, operation #C0 + + ; 'not' (#30) - CP $14 ; is it 'NOT' + CP #14 ; is it 'NOT' JR Z,L270D ; forward to S-PUSH-PO if so JP NC,L1C8A ; to REPORT-C if higher ; 'Nonsense in BASIC' - LD B,$10 ; priority $10 for all the rest - ADD A,$DC ; make range $DC - $EF - ; $C0 + 'code'($1C) thru 'chr$' ($2F) + LD B,#10 ; priority #10 for all the rest + ADD A,#DC ; make range #DC - #EF + ; #C0 + 'code'(#1C) thru 'chr$' (#2F) LD C,A ; transfer 'function' to C - CP $DF ; is it 'sin' ? + CP #DF ; is it 'sin' ? JR NC,L2707 ; forward to S-NO-TO-$ with 'sin' through ; 'chr$' as operand is numeric. @@ -11843,7 +11791,7 @@ L26DF: LD BC,$09DB ; prepare priority 09, operation code $C0 + ; 'len'. ;; S-NO-TO-$ -L2707: CP $EE ; compare 'str$' +L2707: CP #EE ; compare 'str$' JR C,L270D ; forward to S-PUSH-PO if lower as result ; is numeric. @@ -11868,10 +11816,10 @@ L270D: PUSH BC ; push the priority and calculator operation L2712: RST 18H ; GET-CHAR ;; S-CONT-3 -L2713: CP $28 ; is it '(' ? +L2713: CP #28 ; is it '(' ? JR NZ,L2723 ; forward to S-OPERTR if not > - BIT 6,(IY+$01) ; test FLAGS - numeric or string result ? + BIT 6,(IY+#01) ; test FLAGS - numeric or string result ? JR NZ,L2734 ; forward to S-LOOP if numeric to evaluate > ; if a string preceded '(' then slice it. @@ -11886,16 +11834,16 @@ L2713: CP $28 ; is it '(' ? ; the branch was here when possibility of an operator '(' has been excluded. ;; S-OPERTR -L2723: LD B,$00 ; prepare to add +L2723: LD B,#00 ; prepare to add LD C,A ; possible operator to C - LD HL,L2795 ; Address: $2795 - tbl-of-ops + LD HL,L2795 ; Address: #2795 - tbl-of-ops CALL L16DC ; routine INDEXER JR NC,L2734 ; forward to S-LOOP if not in table ; but if found in table the priority has to be looked up. LD C,(HL) ; operation code to C ( B is still zero ) - LD HL,L27B0 - $C3 ; $26ED is base of table + LD HL,L27B0 - #C3 ; #26ED is base of table ADD HL,BC ; index into table. LD B,(HL) ; priority to B. @@ -11929,9 +11877,9 @@ L2734: POP DE ; fetch last priority and operation ; the 'USR' function is special in that it is overloaded to give two types ; of result. - LD HL,$5C3B ; address FLAGS + LD HL,#5C3B ; address FLAGS LD A,E ; new operation to A register - CP $ED ; is it $C0 + 'usr-no' ($2D) ? + CP #ED ; is it #C0 + 'usr-no' (#2D) ? JR NZ,L274C ; forward to S-STK-LST if not BIT 6,(HL) ; string result expected ? @@ -11940,7 +11888,7 @@ L2734: POP DE ; fetch last priority and operation JR NZ,L274C ; forward to S-STK-LST if numeric ; as operand bits match. - LD E,$99 ; reset bit 6 and substitute $19 'usr-$' + LD E,#99 ; reset bit 6 and substitute #19 'usr-$' ; for string operand. ;; S-STK-LST @@ -11949,7 +11897,7 @@ L274C: PUSH DE ; now stack this priority/operation JR Z,L275B ; forward to S-SYNTEST if checking syntax. LD A,E ; fetch the operation code - AND $3F ; mask off the result/operand bits to leave + AND #3F ; mask off the result/operand bits to leave ; a calculator literal. LD B,A ; transfer to B register @@ -11962,8 +11910,8 @@ L274C: PUSH DE ; now stack this priority/operation ; as the calculator too is calling itself. RST 28H ;; FP-CALC - DEFB $3B ;;fp-calc-2 -L2758: DEFB $38 ;;end-calc + DEFB #3B ;;fp-calc-2 +L2758: DEFB #38 ;;end-calc JR L2764 ; forward to S-RUNTEST @@ -11973,8 +11921,8 @@ L2758: DEFB $38 ;;end-calc ;; S-SYNTEST L275B: LD A,E ; fetch the operation code to accumulator - XOR (IY+$01) ; compare with bits of FLAGS - AND $40 ; bit 6 will be zero now if operand + XOR (IY+#01) ; compare with bits of FLAGS + AND #40 ; bit 6 will be zero now if operand ; matched expected result. ;; S-RPORT-C2 @@ -11986,7 +11934,7 @@ L2761: JP NZ,L1C8A ; to REPORT-C if mismatch ;; S-RUNTEST L2764: POP DE ; fetch the last operation from stack - LD HL,$5C3B ; address FLAGS + LD HL,#5C3B ; address FLAGS SET 6,(HL) ; set default to numeric result in FLAGS BIT 7,E ; test the operational result JR NZ,L2770 ; forward to S-LOOPEND if numeric @@ -12005,15 +11953,15 @@ L2770: POP BC ; fetch the previous priority/operation ;; S-TIGHTER L2773: PUSH DE ; save high priority op on stack again LD A,C ; fetch lower priority operation code - BIT 6,(IY+$01) ; test FLAGS - Numeric or string result ? + BIT 6,(IY+#01) ; test FLAGS - Numeric or string result ? JR NZ,L2790 ; forward to S-NEXT if numeric result ; if this is lower priority yet has string then must be a comparison. ; Since these can only be evaluated in context and were defaulted to ; numeric in operator look up they must be changed to string equivalents. - AND $3F ; mask to give true calculator literal - ADD A,$08 ; augment numeric literals to string + AND #3F ; mask to give true calculator literal + ADD A,#08 ; augment numeric literals to string ; equivalents. ; 'no-&-no' => 'str-&-no' ; 'no-l-eql' => 'str-l-eql' @@ -12024,7 +11972,7 @@ L2773: PUSH DE ; save high priority op on stack again ; 'nos-eql' => 'strs-eql' ; 'addition' => 'strs-add' LD C,A ; put modified comparison operator back - CP $10 ; is it now 'str-&-no' ? + CP #10 ; is it now 'str-&-no' ? JR NZ,L2788 ; forward to S-NOT-AND if not. SET 6,C ; set numeric operand bit @@ -12037,7 +11985,7 @@ L2788: JR C,L2761 ; back to S-RPORT-C2 if less ; 'Nonsense in BASIC'. ; e.g. a$ * b$ - CP $17 ; is it 'strs-add' ? + CP #17 ; is it 'strs-add' ? JR Z,L2790 ; forward to to S-NEXT if so ; (bit 6 and 7 are reset) @@ -12053,51 +12001,51 @@ L2790: PUSH BC ; now save this priority/operation on stack ; Table of operators ; ------------------ ; This table is used to look up the calculator literals associated with -; the operator character. The thirteen calculator operations $03 - $0F +; the operator character. The thirteen calculator operations #03 - #0F ; have bits 6 and 7 set to signify a numeric result. ; Some of these codes and bits may be altered later if the context suggests ; a string comparison or operation. ; that is '+', '=', '>', '<', '<=', '>=' or '<>'. ;; tbl-of-ops -L2795: DEFB '+', $CF ; $C0 + 'addition' - DEFB '-', $C3 ; $C0 + 'subtract' - DEFB '*', $C4 ; $C0 + 'multiply' - DEFB '/', $C5 ; $C0 + 'division' - DEFB '^', $C6 ; $C0 + 'to-power' - DEFB '=', $CE ; $C0 + 'nos-eql' - DEFB '>', $CC ; $C0 + 'no-grtr' - DEFB '<', $CD ; $C0 + 'no-less' +L2795: DEFB '+', #CF ; #C0 + 'addition' + DEFB '-', #C3 ; #C0 + 'subtract' + DEFB '*', #C4 ; #C0 + 'multiply' + DEFB '/', #C5 ; #C0 + 'division' + DEFB '^', #C6 ; #C0 + 'to-power' + DEFB '=', #CE ; #C0 + 'nos-eql' + DEFB '>', #CC ; #C0 + 'no-grtr' + DEFB '<', #CD ; #C0 + 'no-less' - DEFB $C7, $C9 ; '<=' $C0 + 'no-l-eql' - DEFB $C8, $CA ; '>=' $C0 + 'no-gr-eql' - DEFB $C9, $CB ; '<>' $C0 + 'nos-neql' - DEFB $C5, $C7 ; 'OR' $C0 + 'or' - DEFB $C6, $C8 ; 'AND' $C0 + 'no-&-no' + DEFB #C7, #C9 ; '<=' #C0 + 'no-l-eql' + DEFB #C8, #CA ; '>=' #C0 + 'no-gr-eql' + DEFB #C9, #CB ; '<>' #C0 + 'nos-neql' + DEFB #C5, #C7 ; 'OR' #C0 + 'or' + DEFB #C6, #C8 ; 'AND' #C0 + 'no-&-no' - DEFB $00 ; zero end-marker. + DEFB #00 ; zero end-marker. ; ------------------- ; Table of priorities ; ------------------- ; This table is indexed with the operation code obtained from the above -; table $C3 - $CF to obtain the priority for the respective operation. +; table #C3 - #CF to obtain the priority for the respective operation. ;; tbl-priors -L27B0: DEFB $06 ; '-' opcode $C3 - DEFB $08 ; '*' opcode $C4 - DEFB $08 ; '/' opcode $C5 - DEFB $0A ; '^' opcode $C6 - DEFB $02 ; 'OR' opcode $C7 - DEFB $03 ; 'AND' opcode $C8 - DEFB $05 ; '<=' opcode $C9 - DEFB $05 ; '>=' opcode $CA - DEFB $05 ; '<>' opcode $CB - DEFB $05 ; '>' opcode $CC - DEFB $05 ; '<' opcode $CD - DEFB $05 ; '=' opcode $CE - DEFB $06 ; '+' opcode $CF +L27B0: DEFB #06 ; '-' opcode #C3 + DEFB #08 ; '*' opcode #C4 + DEFB #08 ; '/' opcode #C5 + DEFB #0A ; '^' opcode #C6 + DEFB #02 ; 'OR' opcode #C7 + DEFB #03 ; 'AND' opcode #C8 + DEFB #05 ; '<=' opcode #C9 + DEFB #05 ; '>=' opcode #CA + DEFB #05 ; '<>' opcode #CB + DEFB #05 ; '>' opcode #CC + DEFB #05 ; '<' opcode #CD + DEFB #05 ; '=' opcode #CE + DEFB #06 ; '+' opcode #CF ; ---------------------- ; Scanning function (FN) @@ -12143,7 +12091,7 @@ L27BD: CALL L2530 ; routine SYNTAX-Z RST 20H ; NEXT-CHAR - CP $24 ; is it '$' ? + CP #24 ; is it '$' ? PUSH AF ; save character and flags JR NZ,L27D0 ; forward to SF-BRKT-1 with numeric function @@ -12151,13 +12099,13 @@ L27BD: CALL L2530 ; routine SYNTAX-Z RST 20H ; NEXT-CHAR ;; SF-BRKT-1 -L27D0: CP $28 ; is '(' ? +L27D0: CP #28 ; is '(' ? JR NZ,L27E6 ; forward to SF-RPRT-C if not ; 'Nonsense in BASIC' RST 20H ; NEXT-CHAR - CP $29 ; is it ')' ? + CP #29 ; is it ')' ? JR Z,L27E9 ; forward to SF-FLAG-6 if no arguments. ;; SF-ARGMTS @@ -12165,7 +12113,7 @@ L27D9: CALL L24FB ; routine SCANNING checks each argument ; which may be an expression. RST 18H ; GET-CHAR - CP $2C ; is it a ',' ? + CP #2C ; is it a ',' ? JR NZ,L27E4 ; forward if not to SF-BRKT-2 to test bracket @@ -12175,7 +12123,7 @@ L27D9: CALL L24FB ; routine SCANNING checks each argument ; --- ;; SF-BRKT-2 -L27E4: CP $29 ; is character the closing ')' ? +L27E4: CP #29 ; is character the closing ')' ? ;; SF-RPRT-C L27E6: JP NZ,L1C8A ; jump to REPORT-C @@ -12185,7 +12133,7 @@ L27E6: JP NZ,L1C8A ; jump to REPORT-C ;; SF-FLAG-6 L27E9: RST 20H ; NEXT-CHAR - LD HL,$5C3B ; address system variable FLAGS + LD HL,#5C3B ; address system variable FLAGS RES 6,(HL) ; signal string result POP AF ; restore test against '$'. JR Z,L27F4 ; forward to SF-SYN-EN if string function. @@ -12201,11 +12149,11 @@ L27F4: JP L2712 ; jump back to S-CONT-2 to continue scanning. ;; SF-RUN L27F7: RST 20H ; NEXT-CHAR fetches name - AND $DF ; AND 11101111 - reset bit 5 - upper-case. + AND #DF ; AND 11101111 - reset bit 5 - upper-case. LD B,A ; save in B RST 20H ; NEXT-CHAR - SUB $24 ; subtract '$' + SUB #24 ; subtract '$' LD C,A ; save result in C JR NZ,L2802 ; forward if not '$' to SF-ARGMT1 @@ -12214,12 +12162,12 @@ L27F7: RST 20H ; NEXT-CHAR fetches name ;; SF-ARGMT1 L2802: RST 20H ; NEXT-CHAR advances to start of argument PUSH HL ; save address - LD HL,($5C53) ; fetch start of program area from PROG + LD HL,(#5C53) ; fetch start of program area from PROG DEC HL ; the search starting point is the previous ; location. ;; SF-FND-DF -L2808: LD DE,$00CE ; search is for token 'DEF FN' in E, +L2808: LD DE,#00CE ; search is for token 'DEF FN' in E, ; statement count in D. PUSH BC ; save C the string test, and B the letter. CALL L1D86 ; routine LOOK-PROG will search for token. @@ -12229,20 +12177,20 @@ L2808: LD DE,$00CE ; search is for token 'DEF FN' in E, ;; REPORT-P L2812: RST 08H ; ERROR-1 - DEFB $18 ; Error Report: FN without DEF + DEFB #18 ; Error Report: FN without DEF ;; SF-CP-DEF L2814: PUSH HL ; save address of DEF FN CALL L28AB ; routine FN-SKPOVR skips over white-space etc. ; without disturbing CH-ADD. - AND $DF ; make fetched character upper-case. + AND #DF ; make fetched character upper-case. CP B ; compare with FN name JR NZ,L2825 ; forward to SF-NOT-FD if no match. ; the letters match so test the type. CALL L28AB ; routine FN-SKPOVR skips white-space - SUB $24 ; subtract '$' from fetched character + SUB #24 ; subtract '$' from fetched character CP C ; compare with saved result of same operation ; on FN name. JR Z,L2831 ; forward to SF-VALUES with a match. @@ -12252,7 +12200,7 @@ L2814: PUSH HL ; save address of DEF FN ;; SF-NOT-FD L2825: POP HL ; restore search point. DEC HL ; make location before - LD DE,$0200 ; the search is to be for the end of the + LD DE,#0200 ; the search is to be for the end of the ; current definition - 2 statements forward. PUSH BC ; save the letter/type CALL L198B ; routine EACH-STMT steps past rejected @@ -12272,25 +12220,25 @@ L2831: AND A ; test A ( will be zero if string '$' - '$' ) POP DE ; discard pointer to 'DEF FN'. POP DE ; restore pointer to first FN argument. - LD ($5C5D),DE ; save in CH_ADD + LD (#5C5D),DE ; save in CH_ADD CALL L28AB ; routine FN-SKPOVR advances HL past '(' PUSH HL ; save start address in DEF FN *** - CP $29 ; is character a ')' ? + CP #29 ; is character a ')' ? JR Z,L2885 ; forward to SF-R-BR-2 if no arguments. ;; SF-ARG-LP L2843: INC HL ; point to next character. LD A,(HL) ; fetch it. - CP $0E ; is it the number marker - LD D,$40 ; signal numeric in D. + CP #0E ; is it the number marker + LD D,#40 ; signal numeric in D. JR Z,L2852 ; forward to SF-ARG-VL if numeric. DEC HL ; back to letter CALL L28AB ; routine FN-SKPOVR skips any white-space INC HL ; advance past the expected '$' to ; the 'hidden' marker. - LD D,$00 ; signal string. + LD D,#00 ; signal string. ;; SF-ARG-VL L2852: INC HL ; now address first of 5-byte location. @@ -12303,24 +12251,24 @@ L2852: INC HL ; now address first of 5-byte location. POP AF ; restore saved result type to A - XOR (IY+$01) ; xor with FLAGS - AND $40 ; and with 01000000 to test bit 6 + XOR (IY+#01) ; xor with FLAGS + AND #40 ; and with 01000000 to test bit 6 JR NZ,L288B ; forward to REPORT-Q if type mismatch. ; 'Parameter error' POP HL ; pop the start address in DEF FN statement EX DE,HL ; transfer to DE ?? pop straight into de ? - LD HL,($5C65) ; set HL to STKEND location after value - LD BC,$0005 ; five bytes to move + LD HL,(#5C65) ; set HL to STKEND location after value + LD BC,#0005 ; five bytes to move SBC HL,BC ; decrease HL by 5 to point to start. - LD ($5C65),HL ; set STKEND 'removing' value from stack. + LD (#5C65),HL ; set STKEND 'removing' value from stack. LDIR ; copy value into DEF FN statement EX DE,HL ; set HL to location after value in DEF FN DEC HL ; step back one CALL L28AB ; routine FN-SKPOVR gets next valid character - CP $29 ; is it ')' end of arguments ? + CP #29 ; is it ')' end of arguments ? JR Z,L2885 ; forward to SF-R-BR-2 if so. ; a comma separator has been encountered in the DEF FN argument list. @@ -12328,7 +12276,7 @@ L2852: INC HL ; now address first of 5-byte location. PUSH HL ; save position in DEF FN statement RST 18H ; GET-CHAR from FN statement - CP $2C ; is it ',' ? + CP #2C ; is it ',' ? JR NZ,L288B ; forward to REPORT-Q if not ; 'Parameter error' @@ -12351,18 +12299,18 @@ L2852: INC HL ; now address first of 5-byte location. L2885: PUSH HL ; save location of ')' in DEF FN RST 18H ; GET-CHAR gets next character in FN - CP $29 ; is it a ')' also ? + CP #29 ; is it a ')' also ? JR Z,L288D ; forward to SF-VALUE if so. ;; REPORT-Q L288B: RST 08H ; ERROR-1 - DEFB $19 ; Error Report: Parameter error + DEFB #19 ; Error Report: Parameter error ;; SF-VALUE L288D: POP DE ; location of ')' in DEF FN to DE. EX DE,HL ; now to HL, FN ')' pointer to DE. - LD ($5C5D),HL ; initialize CH_ADD to this value. + LD (#5C5D),HL ; initialize CH_ADD to this value. ; At this point the start of the DEF FN argument list is on the machine stack. ; We also have to consider that this defined function may form part of the @@ -12371,9 +12319,9 @@ L288D: POP DE ; location of ')' in DEF FN to DE. ; currently being evaluated by recursive calls to SCANNING, then we have to ; preserve the original value of DEFADD and not assume that it is zero. - LD HL,($5C0B) ; get original DEFADD address + LD HL,(#5C0B) ; get original DEFADD address EX (SP),HL ; swap with DEF FN address on stack *** - LD ($5C0B),HL ; set DEFADD to point to this argument list + LD (#5C0B),HL ; set DEFADD to point to this argument list ; during scanning. PUSH DE ; save FN ')' pointer. @@ -12386,9 +12334,9 @@ L288D: POP DE ; location of ')' in DEF FN to DE. ; initially for variables at DEFADD POP HL ; pop the FN ')' pointer - LD ($5C5D),HL ; set CH_ADD to this + LD (#5C5D),HL ; set CH_ADD to this POP HL ; pop the original DEFADD value - LD ($5C0B),HL ; and re-insert into DEFADD system variable. + LD (#5C0B),HL ; and re-insert into DEFADD system variable. RST 20H ; NEXT-CHAR advances to character after ')' JP L2712 ; to S-CONT-2 - to continue current @@ -12409,7 +12357,7 @@ L288D: POP DE ; location of ')' in DEF FN to DE. ;; FN-SKPOVR L28AB: INC HL ; increase pointer LD A,(HL) ; fetch addressed character - CP $21 ; compare with space + 1 + CP #21 ; compare with space + 1 JR C,L28AB ; back to FN-SKPOVR if less RET ; return pointing to a valid character. @@ -12421,7 +12369,7 @@ L28AB: INC HL ; increase pointer ; ;; LOOK-VARS -L28B2: SET 6,(IY+$01) ; update FLAGS - presume numeric result +L28B2: SET 6,(IY+#01) ; update FLAGS - presume numeric result RST 18H ; GET-CHAR CALL L2C8D ; routine ALPHA tests for A-Za-z @@ -12429,16 +12377,16 @@ L28B2: SET 6,(IY+$01) ; update FLAGS - presume numeric result ; 'Nonsense in BASIC' PUSH HL ; save pointer to first letter ^1 - AND $1F ; mask lower bits, 1 - 26 decimal 000xxxxx + AND #1F ; mask lower bits, 1 - 26 decimal 000xxxxx LD C,A ; store in C. RST 20H ; NEXT-CHAR PUSH HL ; save pointer to second character ^2 - CP $28 ; is it '(' - an array ? + CP #28 ; is it '(' - an array ? JR Z,L28EF ; forward to V-RUN/SYN if so. SET 6,C ; set 6 signaling string if solitary 010 - CP $24 ; is character a '$' ? + CP #24 ; is character a '$' ? JR Z,L28DE ; forward to V-STR-VAR SET 5,C ; signal numeric 011 @@ -12465,10 +12413,10 @@ L28D4: CALL L2C88 ; routine ALPHANUM ;; V-STR-VAR L28DE: RST 20H ; NEXT-CHAR advances past '$' - RES 6,(IY+$01) ; update FLAGS - signal string result. + RES 6,(IY+#01) ; update FLAGS - signal string result. ;; V-TEST-FN -L28E3: LD A,($5C0C) ; load A with DEFADD_hi +L28E3: LD A,(#5C0C) ; load A with DEFADD_hi AND A ; and test for zero. JR Z,L28EF ; forward to V-RUN/SYN if a defined function ; is not being evaluated. @@ -12487,7 +12435,7 @@ L28EF: LD B,C ; save flags in B ; if checking syntax the letter is not returned LD A,C ; copy letter/flags to A - AND $E0 ; and with 11100000 to get rid of the letter + AND #E0 ; and with 11100000 to get rid of the letter SET 7,A ; use spare bit to signal checking syntax. LD C,A ; and transfer to C. JR L2934 ; forward to V-SYNTAX @@ -12497,11 +12445,11 @@ L28EF: LD B,C ; save flags in B ; but in runtime search for the variable. ;; V-RUN -L28FD: LD HL,($5C4B) ; set HL to start of variables from VARS +L28FD: LD HL,(#5C4B) ; set HL to start of variables from VARS ;; V-EACH L2900: LD A,(HL) ; get first character - AND $7F ; and with 01111111 + AND #7F ; and with 01111111 ; ignoring bit 7 which distinguishes ; arrays or for/next variables. @@ -12531,15 +12479,15 @@ L2912: INC HL ; address next character in vars area ;; V-SPACES L2913: LD A,(DE) ; pick up letter from prog area INC DE ; and advance address - CP $20 ; is it a space + CP #20 ; is it a space JR Z,L2913 ; back to V-SPACES until non-space - OR $20 ; convert to range 1 - 26. + OR #20 ; convert to range 1 - 26. CP (HL) ; compare with addressed variables character JR Z,L2912 ; loop back to V-MATCHES if a match on an ; intermediate letter. - OR $80 ; now set bit 7 as last character of long + OR #80 ; now set bit 7 as last character of long ; names are inverted. CP (HL) ; compare again JR NZ,L2929 ; forward to V-GET-PTR if no match @@ -12573,7 +12521,7 @@ L2934: POP DE ; discard the pointer to 2nd. character v2 ; in BASIC line/workspace. RST 18H ; GET-CHAR gets character after variable name. - CP $28 ; is it '(' ? + CP #28 ; is it '(' ? JR Z,L2943 ; forward to V-PASS ; Note. could go straight to V-END ? @@ -12627,9 +12575,9 @@ L294B: POP HL ; pop the pointer to first character in ; The variable name to be matched is in C. ;; STK-F-ARG -L2951: LD HL,($5C0B) ; set HL to DEFADD +L2951: LD HL,(#5C0B) ; set HL to DEFADD LD A,(HL) ; load the first character - CP $29 ; is it ')' ? + CP #29 ; is it ')' ? JP Z,L28EF ; JUMP back to V-RUN/SYN, if so, as there are ; no arguments. @@ -12637,11 +12585,11 @@ L2951: LD HL,($5C0B) ; set HL to DEFADD ;; SFA-LOOP L295A: LD A,(HL) ; fetch character again. - OR $60 ; or with 01100000 presume a simple variable. + OR #60 ; or with 01100000 presume a simple variable. LD B,A ; save result in B. INC HL ; address next location. LD A,(HL) ; pick up byte. - CP $0E ; is it the number marker ? + CP #0E ; is it the number marker ? JR Z,L296B ; forward to SFA-CP-VR if so. ; it was a string. White-space may be present but syntax has been checked. @@ -12663,7 +12611,7 @@ L296B: LD A,B ; transfer found variable letter to A. INC HL ; bytes. CALL L28AB ; routine FN-SKPOVR skips to next character - CP $29 ; is it ')' ? + CP #29 ; is it ')' ? JP Z,L28EF ; jump back if so to V-RUN/SYN to look in ; normal variables area. @@ -12681,10 +12629,10 @@ L2981: BIT 5,C ; test if numeric ; by scanning INC HL ; point to start of string descriptor - LD DE,($5C65) ; set DE to STKEND + LD DE,(#5C65) ; set DE to STKEND CALL L33C0 ; routine MOVE-FP puts parameters on stack. EX DE,HL ; new free location to HL. - LD ($5C65),HL ; use it to set STKEND system variable. + LD (#5C65),HL ; use it to set STKEND system variable. ;; SFA-END L2991: POP DE ; discard @@ -12778,7 +12726,7 @@ L29AE: INC HL ; step past EX DE,HL ; save pointer to dimensions in DE RST 18H ; GET-CHAR looks at the BASIC line - CP $28 ; is character '(' ? + CP #28 ; is character '(' ? JR NZ,L2A20 ; to REPORT-3 if not ; 'Subscript wrong' @@ -12802,7 +12750,7 @@ L29C3: PUSH HL ; save counter RST 18H ; GET-CHAR POP HL ; pop counter - CP $2C ; is character ',' ? + CP #2C ; is character ',' ? JR Z,L29EA ; forward to SV-LOOP if so ; in runtime the variable definition indicates a comma should appear here @@ -12818,7 +12766,7 @@ L29C3: PUSH HL ; save counter ; an array of numbers. - CP $29 ; is character ')' ? + CP #29 ; is character ')' ? JR NZ,L2A12 ; forward to SV-RPT-C if not ; 'Nonsense in BASIC' @@ -12830,10 +12778,10 @@ L29C3: PUSH HL ; save counter ; the branch was here with an array of strings. ;; SV-CLOSE -L29D8: CP $29 ; as above ')' could follow the expression +L29D8: CP #29 ; as above ')' could follow the expression JR Z,L2A48 ; forward to SV-DIM if so - CP $CC ; is it 'TO' ? + CP #CC ; is it 'TO' ? JR NZ,L2A12 ; to SV-RPT-C with anything else ; 'Nonsense in BASIC' @@ -12843,7 +12791,7 @@ L29D8: CP $29 ; as above ')' could follow the expression ;; SV-CH-ADD L29E0: RST 18H ; GET-CHAR DEC HL ; backtrack HL - LD ($5C5D),HL ; to set CH_ADD up for slicing routine + LD (#5C5D),HL ; to set CH_ADD up for slicing routine JR L2A45 ; forward to SV-SLICE and make a return ; when all slicing complete. @@ -12851,7 +12799,7 @@ L29E0: RST 18H ; GET-CHAR ; -> the mid-point entry point of the loop ;; SV-COUNT -L29E7: LD HL,$0000 ; initialize data pointer to zero. +L29E7: LD HL,#0000 ; initialize data pointer to zero. ;; SV-LOOP L29EA: PUSH HL ; save the data pointer. @@ -12861,7 +12809,7 @@ L29EA: PUSH HL ; save the data pointer. POP HL ; restore the data pointer. LD A,C ; transfer name/type to A. - CP $C0 ; is it 11000000 ? + CP #C0 ; is it 11000000 ? ; Note. the letter component is absent if ; syntax checking. JR NZ,L29FB ; forward to SV-MULT if not an array of @@ -12870,10 +12818,10 @@ L29EA: PUSH HL ; save the data pointer. ; proceed to check string arrays during syntax. RST 18H ; GET-CHAR - CP $29 ; ')' end of subscripts ? + CP #29 ; ')' end of subscripts ? JR Z,L2A48 ; forward to SV-DIM to consider further slice - CP $CC ; is it 'TO' ? + CP #CC ; is it 'TO' ? JR Z,L29E0 ; back to SV-CH-ADD to consider a slice. ; (no need to repeat get-char at L29E0) @@ -12927,14 +12875,14 @@ L2A12: JR NZ,L2A7A ; forward to SL-RPT-C if so ; transfer it to BC. RST 18H ; GET-CHAR checks BASIC line - CP $29 ; must be a ')' ? + CP #29 ; must be a ')' ? JR Z,L2A22 ; skip to SV-NUMBER if so ; else more subscripts in BASIC line than the variable definition. ;; REPORT-3 L2A20: RST 08H ; ERROR-1 - DEFB $02 ; Error Report: Subscript wrong + DEFB #02 ; Error Report: Subscript wrong ; continue if subscripts matched the numeric array. @@ -12943,7 +12891,7 @@ L2A22: RST 20H ; NEXT-CHAR moves CH_ADD to next statement ; - finished parsing. POP HL ; pop the data pointer. - LD DE,$0005 ; each numeric element is 5 bytes. + LD DE,#0005 ; each numeric element is 5 bytes. CALL L2AF4 ; routine GET-HL*DE multiplies. ADD HL,BC ; now add to start of data in the variable. @@ -12973,11 +12921,11 @@ L2A2C: CALL L2AEE ; routine DE,(DE+1) gets final dimension ; now check that there were no more subscripts in the BASIC line. RST 18H ; GET-CHAR - CP $29 ; is it ')' ? + CP #29 ; is it ')' ? JR Z,L2A48 ; forward to SV-DIM to consider a separate ; subscript or/and a slice. - CP $2C ; a comma is allowed if the final subscript + CP #2C ; a comma is allowed if the final subscript ; is to be sliced e.g a$(2,3,4 TO 6). JR NZ,L2A20 ; to REPORT-3 with anything else ; 'Subscript error' @@ -12991,10 +12939,10 @@ L2A45: CALL L2A52 ; routine SLICING slices the string. L2A48: RST 20H ; NEXT-CHAR ;; SV-SLICE? -L2A49: CP $28 ; is character '(' ? +L2A49: CP #28 ; is character '(' ? JR Z,L2A45 ; loop back if so to SV-SLICE - RES 6,(IY+$01) ; update FLAGS - Signal string result + RES 6,(IY+#01) ; update FLAGS - Signal string result RET ; and return. ; --- @@ -13035,7 +12983,7 @@ L2A52: CALL L2530 ; routine SYNTAX-Z ; in BC. This could be an array subscript. RST 20H ; NEXT-CHAR - CP $29 ; is it ')' ? e.g. a$() + CP #29 ; is it ')' ? e.g. a$() JR Z,L2AAD ; forward to SL-STORE to store entire string. PUSH DE ; else save start address of string @@ -13044,21 +12992,21 @@ L2A52: CALL L2530 ; routine SYNTAX-Z PUSH AF ; and save on stack before any branching. PUSH BC ; save length of string to be sliced. - LD DE,$0001 ; default the start point to position 1. + LD DE,#0001 ; default the start point to position 1. RST 18H ; GET-CHAR POP HL ; pop length to HL as default end point ; and limit. - CP $CC ; is it 'TO' ? e.g. a$( TO 10000) + CP #CC ; is it 'TO' ? e.g. a$( TO 10000) JR Z,L2A81 ; to SL-SECOND to evaluate second parameter. POP AF ; pop the running flag. CALL L2ACD ; routine INT-EXP2 fetches first parameter. - PUSH AF ; save flag (will be $FF if parameter>limit) + PUSH AF ; save flag (will be #FF if parameter>limit) LD D,B ; transfer the start LD E,C ; to DE overwriting 0001. @@ -13066,10 +13014,10 @@ L2A52: CALL L2530 ; routine SYNTAX-Z RST 18H ; GET-CHAR POP HL ; pop the limit length. - CP $CC ; is it 'TO' after a start ? + CP #CC ; is it 'TO' after a start ? JR Z,L2A81 ; to SL-SECOND to evaluate second parameter - CP $29 ; is it ')' ? e.g. a$(365) + CP #29 ; is it ')' ? e.g. a$(365) ;; SL-RPT-C L2A7A: JP NZ,L1C8A ; jump to REPORT-C with anything else @@ -13088,7 +13036,7 @@ L2A81: PUSH HL ; save limit length. POP HL ; pop the length. - CP $29 ; is character ')' ? e.g a$(7 TO ) + CP #29 ; is character ')' ? e.g a$(7 TO ) JR Z,L2A94 ; to SL-DEFINE using length as end point. POP AF ; else restore flag. @@ -13100,7 +13048,7 @@ L2A81: PUSH HL ; save limit length. LD H,B ; transfer second parameter LD L,C ; to HL. e.g. a$(42 to 99) - CP $29 ; is character a ')' ? + CP #29 ; is character a ')' ? JR NZ,L2A7A ; to SL-RPT-C if not ; 'Nonsense in BASIC' @@ -13114,13 +13062,13 @@ L2A94: POP AF ; pop the running flag. EX (SP),HL ; start address to stack, end point to HL (*) AND A ; prepare to subtract. SBC HL,DE ; subtract start point from end point. - LD BC,$0000 ; default the length result to zero. + LD BC,#0000 ; default the length result to zero. JR C,L2AA8 ; forward to SL-OVER if start > end. INC HL ; increment the length for inclusive byte. AND A ; now test the running flag. - JP M,L2A20 ; jump back to REPORT-3 if $FF. + JP M,L2A20 ; jump back to REPORT-3 if #FF. ; 'Subscript out of range' LD B,H ; transfer the length @@ -13128,7 +13076,7 @@ L2A94: POP AF ; pop the running flag. ;; SL-OVER L2AA8: POP DE ; restore start address from machine stack *** - RES 6,(IY+$01) ; update FLAGS - signal string result for + RES 6,(IY+#01) ; update FLAGS - signal string result for ; syntax. ;; SL-STORE @@ -13149,7 +13097,7 @@ L2AB1: XOR A ; clear to signal a sliced string or element. ; -------------------------- ;; STK-STO-$ -L2AB2: RES 6,(IY+$01) ; update FLAGS - signal string result. +L2AB2: RES 6,(IY+#01) ; update FLAGS - signal string result. ; and continue to store parameters of string. ; --------------------------------------- @@ -13162,7 +13110,7 @@ L2AB6: PUSH BC ; save two registers CALL L33A9 ; routine TEST-5-SP checks room and puts 5 ; in BC. POP BC ; fetch the saved registers. - LD HL,($5C65) ; make HL point to first empty location STKEND + LD HL,(#5C65) ; make HL point to first empty location STKEND LD (HL),A ; place the 5 registers. INC HL ; LD (HL),E ; @@ -13173,19 +13121,19 @@ L2AB6: PUSH BC ; save two registers INC HL ; LD (HL),B ; INC HL ; - LD ($5C65),HL ; update system variable STKEND. + LD (#5C65),HL ; update system variable STKEND. RET ; and return. ; ------------------------------------------- ; Return result of evaluating next expression ; ------------------------------------------- ; This clever routine is used to check and evaluate an integer expression -; which is returned in BC, setting A to $FF, if greater than a limit supplied +; which is returned in BC, setting A to #FF, if greater than a limit supplied ; in HL. It is used to check array subscripts, parameters of a string slice ; and the arguments of the DIM command. In the latter case, the limit check -; is not required and H is set to $FF. When checking optional string slice +; is not required and H is set to #FF. When checking optional string slice ; parameters, it is entered at the second entry point so as not to disturb -; the running flag A, which may be $00 or $FF from a previous invocation. +; the running flag A, which may be #00 or #FF from a previous invocation. ;; INT-EXP1 L2ACC: XOR A ; set result flag to zero. @@ -13224,8 +13172,8 @@ L2ACD: PUSH DE ; preserve DE register throughout. SBC HL,BC ; subtract value from limit. ;; I-CARRY -L2AE8: LD A,D ; move flag to accumulator $00 or $FF. - SBC A,$00 ; will set to $FF if carry set. +L2AE8: LD A,D ; move flag to accumulator #00 or #FF. + SBC A,#00 ; will set to #FF if carry set. ;; I-RESTORE L2AEB: POP HL ; restore the limit. @@ -13288,14 +13236,14 @@ L2AF4: CALL L2530 ; routine SYNTAX-Z. ; I digress. ;; LET -L2AFF: LD HL,($5C4D) ; fetch system variable DEST to HL. - BIT 1,(IY+$37) ; test FLAGX - handling a new variable ? +L2AFF: LD HL,(#5C4D) ; fetch system variable DEST to HL. + BIT 1,(IY+#37) ; test FLAGX - handling a new variable ? JR Z,L2B66 ; forward to L-EXISTS if not. ; continue for a new variable. DEST points to start in BASIC line. ; from the CLASS routines. - LD BC,$0005 ; assume numeric and assign an initial 5 bytes + LD BC,#0005 ; assume numeric and assign an initial 5 bytes ;; L-EACH-CH L2B0B: INC BC ; increase byte count for each relevant @@ -13304,18 +13252,18 @@ L2B0B: INC BC ; increase byte count for each relevant ;; L-NO-SP L2B0C: INC HL ; increase pointer. LD A,(HL) ; fetch character. - CP $20 ; is it a space ? + CP #20 ; is it a space ? JR Z,L2B0C ; back to L-NO-SP is so. JR NC,L2B1F ; forward to L-TEST-CH if higher. - CP $10 ; is it $00 - $0F ? + CP #10 ; is it #00 - #0F ? JR C,L2B29 ; forward to L-SPACES if so. - CP $16 ; is it $16 - $1F ? + CP #16 ; is it #16 - #1F ? JR NC,L2B29 ; forward to L-SPACES if so. -; it was $10 - $15 so step over a colour code. +; it was #10 - #15 so step over a colour code. INC HL ; increase pointer. JR L2B0C ; loop back to L-NO-SP. @@ -13328,13 +13276,13 @@ L2B0C: INC HL ; increase pointer. L2B1F: CALL L2C88 ; routine ALPHANUM sets carry if alphanumeric JR C,L2B0B ; loop back to L-EACH-CH for more if so. - CP $24 ; is it '$' ? + CP #24 ; is it '$' ? JP Z,L2BC0 ; jump forward if so, to L-NEW$ ; with a new string. ;; L-SPACES L2B29: LD A,C ; save length lo in A. - LD HL,($5C59) ; fetch E_LINE to HL. + LD HL,(#5C59) ; fetch E_LINE to HL. DEC HL ; point to location before, the variables ; end-marker. CALL L1655 ; routine MAKE-ROOM creates BC spaces @@ -13343,9 +13291,9 @@ L2B29: LD A,C ; save length lo in A. INC HL ; then to second. EX DE,HL ; set DE to second location. PUSH DE ; save this pointer. - LD HL,($5C4D) ; reload HL with DEST. + LD HL,(#5C4D) ; reload HL with DEST. DEC DE ; point to first. - SUB $06 ; subtract six from length_lo. + SUB #06 ; subtract six from length_lo. LD B,A ; save count in B. JR Z,L2B4F ; forward to L-SINGLE if it was just ; one character. @@ -13355,33 +13303,33 @@ L2B29: LD A,C ; save length lo in A. ;; L-CHAR L2B3E: INC HL ; increase pointer. LD A,(HL) ; pick up character. - CP $21 ; is it space or higher ? + CP #21 ; is it space or higher ? JR C,L2B3E ; back to L-CHAR with space and less. - OR $20 ; make variable lower-case. + OR #20 ; make variable lower-case. INC DE ; increase destination pointer. LD (DE),A ; and load to edit line. DJNZ L2B3E ; loop back to L-CHAR until B is zero. - OR $80 ; invert the last character. + OR #80 ; invert the last character. LD (DE),A ; and overwrite that in edit line. ; now consider first character which has bit 6 set - LD A,$C0 ; set A 11000000 is xor mask for a long name. + LD A,#C0 ; set A 11000000 is xor mask for a long name. ; %101 is xor/or result ; single character numerics rejoin here with %00000000 in mask. ; %011 will be xor/or result ;; L-SINGLE -L2B4F: LD HL,($5C4D) ; fetch DEST - HL addresses first character. +L2B4F: LD HL,(#5C4D) ; fetch DEST - HL addresses first character. XOR (HL) ; apply variable type indicator mask (above). - OR $20 ; make lowercase - set bit 5. + OR #20 ; make lowercase - set bit 5. POP HL ; restore pointer to 2nd character. CALL L2BEA ; routine L-FIRST puts A in first character. ; and returns with HL holding - ; new E_LINE-1 the $80 vars end-marker. + ; new E_LINE-1 the #80 vars end-marker. ;; L-NUMERIC L2B59: PUSH HL ; save the pointer. @@ -13389,13 +13337,13 @@ L2B59: PUSH HL ; save the pointer. ; the value of variable is deleted but remains after calculator stack. RST 28H ;; FP-CALC - DEFB $02 ;;delete ; delete variable value - DEFB $38 ;;end-calc + DEFB #02 ;;delete ; delete variable value + DEFB #38 ;;end-calc ; DE (STKEND) points to start of value. POP HL ; restore the pointer. - LD BC,$0005 ; start of number is five bytes before. + LD BC,#0005 ; start of number is five bytes before. AND A ; prepare for true subtraction. SBC HL,BC ; HL points to start of value. JR L2BA6 ; forward to L-ENTER ==> @@ -13406,14 +13354,14 @@ L2B59: PUSH HL ; save the pointer. ; the jump was to here if the variable already existed. ;; L-EXISTS -L2B66: BIT 6,(IY+$01) ; test FLAGS - numeric or string result ? +L2B66: BIT 6,(IY+#01) ; test FLAGS - numeric or string result ? JR Z,L2B72 ; skip forward to L-DELETE$ -*-> ; if string result. ; A numeric variable could be simple or an array element. ; They are treated the same and the old value is overwritten. - LD DE,$0006 ; six bytes forward points to loc past value. + LD DE,#0006 ; six bytes forward points to loc past value. ADD HL,DE ; add to start of number. JR L2B59 ; back to L-NUMERIC to overwrite value. @@ -13422,10 +13370,10 @@ L2B66: BIT 6,(IY+$01) ; test FLAGS - numeric or string result ? ; -*-> the branch was here if a string existed. ;; L-DELETE$ -L2B72: LD HL,($5C4D) ; fetch DEST to HL. +L2B72: LD HL,(#5C4D) ; fetch DEST to HL. ; (still set from first instruction) - LD BC,($5C72) ; fetch STRLEN to BC. - BIT 0,(IY+$37) ; test FLAGX - handling a complete simple + LD BC,(#5C72) ; fetch STRLEN to BC. + BIT 0,(IY+#37) ; test FLAGX - handling a complete simple ; string ? JR NZ,L2BAF ; forward to L-ADD$ if so. @@ -13450,7 +13398,7 @@ L2B72: LD HL,($5C4D) ; fetch DEST to HL. LD D,H ; set DE to point to last location. LD E,L ; INC HL ; set HL to next location. - LD (HL),$20 ; place a space there. + LD (HL),#20 ; place a space there. LDDR ; copy bytes filling with spaces. PUSH HL ; save pointer to start. @@ -13525,9 +13473,9 @@ L2BAF: DEC HL ; point to high byte of length. ; the jump was here with a new string variable. ;; L-NEW$ -L2BC0: LD A,$DF ; indicator mask %11011111 for +L2BC0: LD A,#DF ; indicator mask %11011111 for ; %010xxxxx will be result - LD HL,($5C4D) ; address DEST first character. + LD HL,(#5C4D) ; address DEST first character. AND (HL) ; combine mask with character. ;; L-STRING @@ -13538,16 +13486,16 @@ L2BC6: PUSH AF ; save first character and mask. ADD HL,BC ; add to length. PUSH BC ; save the length. DEC HL ; point to end of string. - LD ($5C4D),HL ; save pointer in DEST. + LD (#5C4D),HL ; save pointer in DEST. ; (updated by POINTERS if in workspace) INC BC ; extra byte for letter. INC BC ; two bytes INC BC ; for the length of string. - LD HL,($5C59) ; address E_LINE. + LD HL,(#5C59) ; address E_LINE. DEC HL ; now end of VARS area. CALL L1655 ; routine MAKE-ROOM makes room for string. ; updating pointers including DEST. - LD HL,($5C4D) ; pick up pointer to end of string from DEST. + LD HL,(#5C4D) ; pick up pointer to end of string from DEST. POP BC ; restore length from stack. PUSH BC ; and save again on stack. INC BC ; add a byte. @@ -13563,7 +13511,7 @@ L2BC6: PUSH AF ; save first character and mask. ;; L-FIRST L2BEA: DEC HL ; address variable name LD (HL),A ; and insert character. - LD HL,($5C59) ; load HL with E_LINE. + LD HL,(#5C59) ; load HL with E_LINE. DEC HL ; now end of VARS area. RET ; return @@ -13574,7 +13522,7 @@ L2BEA: DEC HL ; address variable name ; ;; STK-FETCH -L2BF1: LD HL,($5C65) ; STKEND +L2BF1: LD HL,(#5C65) ; STKEND DEC HL ; LD B,(HL) ; DEC HL ; @@ -13585,7 +13533,7 @@ L2BF1: LD HL,($5C65) ; STKEND LD E,(HL) ; DEC HL ; LD A,(HL) ; - LD ($5C65),HL ; STKEND + LD (#5C65),HL ; STKEND RET ; ; ------------------ @@ -13622,20 +13570,20 @@ L2C15: JR C,L2C1F ; skip to D-LETTER if variable did not exist. PUSH BC ; save type in C. CALL L19B8 ; routine NEXT-ONE find following variable - ; or position of $80 end-marker. + ; or position of #80 end-marker. CALL L19E8 ; routine RECLAIM-2 reclaims the ; space between. POP BC ; pop the type. ;; D-LETTER L2C1F: SET 7,C ; signal array. - LD B,$00 ; initialize dimensions to zero and + LD B,#00 ; initialize dimensions to zero and PUSH BC ; save with the type. - LD HL,$0001 ; make elements one character presuming string + LD HL,#0001 ; make elements one character presuming string BIT 6,C ; is it a string ? JR NZ,L2C2D ; forward to D-SIZE if so. - LD L,$05 ; make elements 5 bytes as is numeric. + LD L,#05 ; make elements 5 bytes as is numeric. ;; D-SIZE L2C2D: EX DE,HL ; save the element size in DE. @@ -13644,7 +13592,7 @@ L2C2D: EX DE,HL ; save the element size in DE. ;; D-NO-LOOP L2C2E: RST 20H ; NEXT-CHAR - LD H,$FF ; disable limit check by setting HL high + LD H,#FF ; disable limit check by setting HL high CALL L2ACC ; routine INT-EXP1 JP C,L2A20 ; to REPORT-3 if > 65280 and then some ; 'Subscript out of range' @@ -13661,13 +13609,13 @@ L2C2E: RST 20H ; NEXT-CHAR EX DE,HL ; save running total in DE RST 18H ; GET-CHAR - CP $2C ; is it ',' ? + CP #2C ; is it ',' ? JR Z,L2C2E ; loop back to D-NO-LOOP until all dimensions ; have been considered ; when loop complete continue. - CP $29 ; is it ')' ? + CP #29 ; is it ')' ? JR NZ,L2C05 ; to D-RPORT-C with anything else ; 'Nonsense in BASIC' @@ -13681,7 +13629,7 @@ L2C2E: RST 20H ; NEXT-CHAR LD L,B ; dimensions to L since these require 16 bits ; then this value will be doubled - LD H,$00 ; set high byte to zero + LD H,#00 ; set high byte to zero ; another four bytes are required for letter(1), total length(2), number of ; dimensions(1) but since we have yet to double allow for two @@ -13701,9 +13649,9 @@ L2C2E: RST 20H ; NEXT-CHAR PUSH HL ; save total space LD B,H ; total space LD C,L ; to BC - LD HL,($5C59) ; address E_LINE - first location after + LD HL,(#5C59) ; address E_LINE - first location after ; variables area - DEC HL ; point to location before - the $80 end-marker + DEC HL ; point to location before - the #80 end-marker CALL L1655 ; routine MAKE-ROOM creates the space if ; memory is available. @@ -13727,11 +13675,11 @@ L2C2E: RST 20H ; NEXT-CHAR LD H,D ; transfer DE space + 1 from make-room LD L,E ; to HL DEC DE ; set DE to next location down. - LD (HL),$00 ; presume numeric and insert a zero + LD (HL),#00 ; presume numeric and insert a zero BIT 6,C ; test bit 6 of C. numeric or string ? JR Z,L2C7C ; skip to DIM-CLEAR if numeric - LD (HL),$20 ; place a space character in HL + LD (HL),#20 ; place a space character in HL ;; DIM-CLEAR L2C7C: POP BC ; pop the data length @@ -13768,18 +13716,18 @@ L2C88: CALL L2D1B ; routine NUMERIC will reset carry if so. ; This routine checks that the character in A is alphabetic ;; ALPHA -L2C8D: CP $41 ; less than 'A' ? +L2C8D: CP #41 ; less than 'A' ? CCF ; Complement Carry Flag RET NC ; return if so - CP $5B ; less than 'Z'+1 ? + CP #5B ; less than 'Z'+1 ? RET C ; is within first range - CP $61 ; less than 'a' ? + CP #61 ; less than 'a' ? CCF ; Complement Carry Flag RET NC ; return if so. - CP $7B ; less than 'z'+1 ? + CP #7B ; less than 'z'+1 ? RET ; carry set if within a-z. ; ------------------------- @@ -13791,15 +13739,15 @@ L2C8D: CP $41 ; less than 'A' ? ; BIN is really just a notational symbol and not a function. ;; DEC-TO-FP -L2C9B: CP $C4 ; 'BIN' token ? +L2C9B: CP #C4 ; 'BIN' token ? JR NZ,L2CB8 ; to NOT-BIN if not - LD DE,$0000 ; initialize 16 bit buffer register. + LD DE,#0000 ; initialize 16 bit buffer register. ;; BIN-DIGIT L2CA2: RST 20H ; NEXT-CHAR - SUB $31 ; '1' - ADC A,$00 ; will be zero if '1' or '0' + SUB #31 ; '1' + ADC A,#00 ; will be zero if '1' or '0' ; carry will be set if was '0' JR NZ,L2CB3 ; forward to BIN-END if result not zero @@ -13826,12 +13774,12 @@ L2CB3: LD B,D ; transfer 16 bit buffer ; continue here with .1, 42, 3.14, 5., 2.3 E -4 ;; NOT-BIN -L2CB8: CP $2E ; '.' - leading decimal point ? +L2CB8: CP #2E ; '.' - leading decimal point ? JR Z,L2CCB ; skip to DECIMAL if so. CALL L2D3B ; routine INT-TO-FP to evaluate all digits ; This number 'x' is placed on stack. - CP $2E ; '.' - mid decimal point ? + CP #2E ; '.' - mid decimal point ? JR NZ,L2CEB ; to E-FORMAT if not to consider that format @@ -13857,8 +13805,8 @@ L2CCF: JP C,L1C8A ; to REPORT-C if just a '.' ; since there is no leading zero put one on the calculator stack. RST 28H ;; FP-CALC - DEFB $A0 ;;stk-zero ; 0. - DEFB $38 ;;end-calc + DEFB #A0 ;;stk-zero ; 0. + DEFB #38 ;;end-calc ; If rejoining from earlier there will be a value 'x' on stack. ; If continuing from above the value zero. @@ -13867,10 +13815,10 @@ L2CCF: JP C,L1C8A ; to REPORT-C if just a '.' ;; DEC-STO-1 L2CD5: RST 28H ;; FP-CALC - DEFB $A1 ;;stk-one ;x or 0,1. - DEFB $C0 ;;st-mem-0 ;x or 0,1. - DEFB $02 ;;delete ;x or 0. - DEFB $38 ;;end-calc + DEFB #A1 ;;stk-one ;x or 0,1. + DEFB #C0 ;;st-mem-0 ;x or 0,1. + DEFB #02 ;;delete ;x or 0. + DEFB #38 ;;end-calc ;; NXT-DGT-1 @@ -13880,13 +13828,13 @@ L2CDA: RST 18H ; GET-CHAR RST 28H ;; FP-CALC ;x or 0,d. first pass. - DEFB $E0 ;;get-mem-0 ;x or 0,d,1. - DEFB $A4 ;;stk-ten ;x or 0,d,1,10. - DEFB $05 ;;division ;x or 0,d,1/10. - DEFB $C0 ;;st-mem-0 ;x or 0,d,1/10. - DEFB $04 ;;multiply ;x or 0,d/10. - DEFB $0F ;;addition ;x or 0 + d/10. - DEFB $38 ;;end-calc last value. + DEFB #E0 ;;get-mem-0 ;x or 0,d,1. + DEFB #A4 ;;stk-ten ;x or 0,d,1,10. + DEFB #05 ;;division ;x or 0,d,1/10. + DEFB #C0 ;;st-mem-0 ;x or 0,d,1/10. + DEFB #04 ;;multiply ;x or 0,d/10. + DEFB #0F ;;addition ;x or 0 + d/10. + DEFB #38 ;;end-calc last value. RST 20H ; NEXT-CHAR moves to next character JR L2CDA ; back to NXT-DGT-1 @@ -13901,20 +13849,20 @@ L2CDA: RST 18H ; GET-CHAR ; Finally see if an exponent has been input. ;; E-FORMAT -L2CEB: CP $45 ; is character 'E' ? +L2CEB: CP #45 ; is character 'E' ? JR Z,L2CF2 ; to SIGN-FLAG if so - CP $65 ; 'e' is acceptable as well. + CP #65 ; 'e' is acceptable as well. RET NZ ; return as no exponent. ;; SIGN-FLAG -L2CF2: LD B,$FF ; initialize temporary sign byte to $FF +L2CF2: LD B,#FF ; initialize temporary sign byte to #FF RST 20H ; NEXT-CHAR - CP $2B ; is character '+' ? + CP #2B ; is character '+' ? JR Z,L2CFE ; to SIGN-DONE - CP $2D ; is character '-' ? + CP #2D ; is character '-' ? JR NZ,L2CFF ; to ST-E-PART as no sign INC B ; set sign to zero @@ -13947,7 +13895,7 @@ L2CFF: CALL L2D1B ; routine NUMERIC ; raised later in E-TO-FP so two different ; error messages depending how high A is. - INC B ; $FF to $00 or $00 to $01 - expendable now. + INC B ; #FF to #00 or #00 to #01 - expendable now. JR Z,L2D18 ; forward to E-FP-JUMP if exponent positive NEG ; Negate the exponent. @@ -13964,10 +13912,10 @@ L2D18: JP L2D4F ; JUMP forward to E-TO-FP to assign to ; returning with carry reset if so. ;; NUMERIC -L2D1B: CP $30 ; '0' +L2D1B: CP #30 ; '0' RET C ; return if less than zero character. - CP $3A ; The upper test is '9' + CP #3A ; The upper test is '9' CCF ; Complement Carry Flag RET ; Return - carry clear if character '0' - '9' @@ -13981,7 +13929,7 @@ L2D1B: CP $30 ; '0' L2D22: CALL L2D1B ; routine NUMERIC RET C ; return if not numeric character - SUB $30 ; convert from ASCII to digit + SUB #30 ; convert from ASCII to digit ; ----------------- ; Stack accumulator @@ -13991,7 +13939,7 @@ L2D22: CALL L2D1B ; routine NUMERIC ;; STACK-A L2D28: LD C,A ; transfer to C - LD B,$00 ; and make B zero + LD B,#00 ; and make B zero ; ---------------------- ; Stack BC register pair @@ -13999,7 +13947,7 @@ L2D28: LD C,A ; transfer to C ; ;; STACK-BC -L2D2B: LD IY,$5C3A ; re-initialize ERR_NR +L2D2B: LD IY,#5C3A ; re-initialize ERR_NR XOR A ; clear to signal small integer LD E,A ; place in E for sign @@ -14009,7 +13957,7 @@ L2D2B: LD IY,$5C3A ; re-initialize ERR_NR CALL L2AB6 ; routine STK-STORE RST 28H ;; FP-CALC - DEFB $38 ;;end-calc make HL = STKEND-5 + DEFB #38 ;;end-calc make HL = STKEND-5 AND A ; clear carry RET ; before returning @@ -14025,8 +13973,8 @@ L2D2B: LD IY,$5C3A ; re-initialize ERR_NR L2D3B: PUSH AF ; save first character RST 28H ;; FP-CALC - DEFB $A0 ;;stk-zero ; v=0. initial value - DEFB $38 ;;end-calc + DEFB #A0 ;;stk-zero ; v=0. initial value + DEFB #38 ;;end-calc POP AF ; fetch first character back. @@ -14035,11 +13983,11 @@ L2D40: CALL L2D22 ; routine STK-DIGIT puts 0-9 on stack RET C ; will return when character is not numeric > RST 28H ;; FP-CALC ; v, d. - DEFB $01 ;;exchange ; d, v. - DEFB $A4 ;;stk-ten ; d, v, 10. - DEFB $04 ;;multiply ; d, v*10. - DEFB $0F ;;addition ; d + v*10 = newvalue - DEFB $38 ;;end-calc ; v. + DEFB #01 ;;exchange ; d, v. + DEFB #A4 ;;stk-ten ; d, v, 10. + DEFB #04 ;;multiply ; d, v*10. + DEFB #0F ;;addition ; d + v*10 = newvalue + DEFB #38 ;;end-calc ; v. CALL L0074 ; routine CH-ADD+1 get next character JR L2D40 ; back to NXT-DGT-2 to process as a digit @@ -14074,15 +14022,15 @@ L2D4F: RLCA ; this will set the x. ;; E-SAVE L2D55: PUSH AF ; save positive exp and sign in carry - LD HL,$5C92 ; address MEM-0 + LD HL,#5C92 ; address MEM-0 CALL L350B ; routine FP-0/1 ; places an integer zero, if no carry, ; else a one in mem-0 as a sign flag RST 28H ;; FP-CALC - DEFB $A4 ;;stk-ten x, 10. - DEFB $38 ;;end-calc + DEFB #A4 ;;stk-ten x, 10. + DEFB #38 ;;end-calc POP AF ; pop the exponent. @@ -14096,23 +14044,23 @@ L2D60: SRL A ; 0>76543210>C PUSH AF ; save shifted exponent. RST 28H ;; FP-CALC - DEFB $C1 ;;st-mem-1 x, 10. - DEFB $E0 ;;get-mem-0 x, 10, (0/1). - DEFB $00 ;;jump-true + DEFB #C1 ;;st-mem-1 x, 10. + DEFB #E0 ;;get-mem-0 x, 10, (0/1). + DEFB #00 ;;jump-true - DEFB $04 ;;to L2D6D, E-DIVSN + DEFB #04 ;;to L2D6D, E-DIVSN - DEFB $04 ;;multiply x*10. - DEFB $33 ;;jump + DEFB #04 ;;multiply x*10. + DEFB #33 ;;jump - DEFB $02 ;;to L2D6E, E-FETCH + DEFB #02 ;;to L2D6E, E-FETCH ;; E-DIVSN -L2D6D: DEFB $05 ;;division x/10. +L2D6D: DEFB #05 ;;division x/10. ;; E-FETCH -L2D6E: DEFB $E1 ;;get-mem-1 x/10 or x*10, 10. - DEFB $38 ;;end-calc new x, 10. +L2D6E: DEFB #E1 ;;get-mem-1 x/10 or x*10, 10. + DEFB #38 ;;end-calc new x, 10. POP AF ; restore shifted exponent @@ -14124,9 +14072,9 @@ L2D71: JR Z,L2D7B ; forward to E-END if A emptied of bits PUSH AF ; re-save shifted exponent RST 28H ;; FP-CALC - DEFB $31 ;;duplicate new x, 10, 10. - DEFB $04 ;;multiply new x, 100. - DEFB $38 ;;end-calc + DEFB #31 ;;duplicate new x, 10, 10. + DEFB #04 ;;multiply new x, 100. + DEFB #38 ;;end-calc POP AF ; restore shifted exponent JR L2D60 ; back to E-LOOP until all bits done. @@ -14139,8 +14087,8 @@ L2D71: JR Z,L2D7B ; forward to E-END if A emptied of bits ;; E-END L2D7B: RST 28H ;; FP-CALC final x, factor. - DEFB $02 ;;delete final x. - DEFB $38 ;;end-calc x. + DEFB #02 ;;delete final x. + DEFB #38 ;;end-calc x. RET ; return @@ -14179,21 +14127,21 @@ L2D7F: INC HL ; skip zero indicator. ; store any integer as positive. ;; p-int-sto -L2D8C: LD C,$00 ; make sign byte positive and continue +L2D8C: LD C,#00 ; make sign byte positive and continue ; ------------- ; Store integer ; ------------- ; this routine stores an integer in DE at address HL. ; It is called from mult, truncate, negate and sgn. -; The sign byte $00 +ve or $FF -ve is in C. +; The sign byte #00 +ve or #FF -ve is in C. ; If negative, the number is stored in 2's complement form so that it is ; ready to be added. ;; INT-STORE L2D8E: PUSH HL ; preserve HL - LD (HL),$00 ; first byte zero shows integer not exponent + LD (HL),#00 ; first byte zero shows integer not exponent INC HL ; LD (HL),C ; then store the sign byte INC HL ; @@ -14211,7 +14159,7 @@ L2D8E: PUSH HL ; preserve HL XOR C ; xor sign 00000000 11111111 LD (HL),A ; store 2's complement. INC HL ; - LD (HL),$00 ; last byte always zero for integers. + LD (HL),#00 ; last byte always zero for integers. ; is not used and need not be looked at when ; testing for zero but comes into play should ; an integer be converted to fp. @@ -14227,7 +14175,7 @@ L2D8E: PUSH HL ; preserve HL ;; FP-TO-BC L2DA2: RST 28H ;; FP-CALC set HL to - DEFB $38 ;;end-calc point to last value. + DEFB #38 ;;end-calc point to last value. LD A,(HL) ; get first of 5 bytes AND A ; and test @@ -14236,17 +14184,17 @@ L2DA2: RST 28H ;; FP-CALC set HL to ; The value is first rounded up and then converted to integer. RST 28H ;; FP-CALC x. - DEFB $A2 ;;stk-half x. 1/2. - DEFB $0F ;;addition x + 1/2. - DEFB $27 ;;int int(x + .5) - DEFB $38 ;;end-calc + DEFB #A2 ;;stk-half x. 1/2. + DEFB #0F ;;addition x + 1/2. + DEFB #27 ;;int int(x + .5) + DEFB #38 ;;end-calc ; now delete but leave HL pointing at integer ;; FP-DELETE L2DAD: RST 28H ;; FP-CALC - DEFB $02 ;;delete - DEFB $38 ;;end-calc + DEFB #02 ;;delete + DEFB #38 ;;end-calc PUSH HL ; save pointer. PUSH DE ; and STKEND. @@ -14283,7 +14231,7 @@ L2DAD: RST 28H ;; FP-CALC ;; LOG(2^A) L2DC1: LD D,A ; store a copy of A in D. RLA ; test sign bit of A. - SBC A,A ; now $FF if negative or $00 + SBC A,A ; now #FF if negative or #00 LD E,A ; sign byte to E. LD C,A ; and to C XOR A ; clear A @@ -14297,14 +14245,14 @@ L2DC1: LD D,A ; store a copy of A in D. RST 28H ;; FP-CALC - DEFB $34 ;;stk-data .30103 (log 2) - DEFB $EF ;;Exponent: $7F, Bytes: 4 - DEFB $1A,$20,$9A,$85 ;; - DEFB $04 ;;multiply + DEFB #34 ;;stk-data .30103 (log 2) + DEFB #EF ;;Exponent: #7F, Bytes: 4 + DEFB #1A,#20,#9A,#85 ;; + DEFB #04 ;;multiply - DEFB $27 ;;int + DEFB #27 ;;int - DEFB $38 ;;end-calc + DEFB #38 ;;end-calc ; ------------------- ; Floating point to A @@ -14344,34 +14292,34 @@ L2DE1: POP AF ; restore value and success flag and ;; PRINT-FP L2DE3: RST 28H ;; FP-CALC - DEFB $31 ;;duplicate - DEFB $36 ;;less-0 - DEFB $00 ;;jump-true + DEFB #31 ;;duplicate + DEFB #36 ;;less-0 + DEFB #00 ;;jump-true - DEFB $0B ;;to L2DF2, PF-NEGTVE + DEFB #0B ;;to L2DF2, PF-NEGTVE - DEFB $31 ;;duplicate - DEFB $37 ;;greater-0 - DEFB $00 ;;jump-true + DEFB #31 ;;duplicate + DEFB #37 ;;greater-0 + DEFB #00 ;;jump-true - DEFB $0D ;;to L2DF8, PF-POSTVE + DEFB #0D ;;to L2DF8, PF-POSTVE ; must be zero itself - DEFB $02 ;;delete - DEFB $38 ;;end-calc + DEFB #02 ;;delete + DEFB #38 ;;end-calc - LD A,$30 ; prepare the character '0' + LD A,#30 ; prepare the character '0' RST 10H ; PRINT-A RET ; return. -> ; --- ;; PF-NEGTVE -L2DF2: DEFB $2A ;;abs - DEFB $38 ;;end-calc +L2DF2: DEFB #2A ;;abs + DEFB #38 ;;end-calc - LD A,$2D ; the character '-' + LD A,#2D ; the character '-' RST 10H ; PRINT-A @@ -14380,12 +14328,12 @@ L2DF2: DEFB $2A ;;abs RST 28H ;; FP-CALC ;; PF-POSTVE -L2DF8: DEFB $A0 ;;stk-zero x,0. begin by - DEFB $C3 ;;st-mem-3 x,0. clearing a temporary - DEFB $C4 ;;st-mem-4 x,0. output buffer to - DEFB $C5 ;;st-mem-5 x,0. fifteen zeros. - DEFB $02 ;;delete x. - DEFB $38 ;;end-calc x. +L2DF8: DEFB #A0 ;;stk-zero x,0. begin by + DEFB #C3 ;;st-mem-3 x,0. clearing a temporary + DEFB #C4 ;;st-mem-4 x,0. output buffer to + DEFB #C5 ;;st-mem-5 x,0. fifteen zeros. + DEFB #02 ;;delete x. + DEFB #38 ;;end-calc x. EXX ; in case called from 'str$' then save the PUSH HL ; pointer to whatever comes after @@ -14395,15 +14343,15 @@ L2DF8: DEFB $A0 ;;stk-zero x,0. begin by ;; PF-LOOP L2E01: RST 28H ;; FP-CALC - DEFB $31 ;;duplicate x,x. - DEFB $27 ;;int x,int x. - DEFB $C2 ;;st-mem-2 x,int x. - DEFB $03 ;;subtract x-int x. fractional part. - DEFB $E2 ;;get-mem-2 x-int x, int x. - DEFB $01 ;;exchange int x, x-int x. - DEFB $C2 ;;st-mem-2 int x, x-int x. - DEFB $02 ;;delete int x. - DEFB $38 ;;end-calc int x. + DEFB #31 ;;duplicate x,x. + DEFB #27 ;;int x,int x. + DEFB #C2 ;;st-mem-2 x,int x. + DEFB #03 ;;subtract x-int x. fractional part. + DEFB #E2 ;;get-mem-2 x-int x, int x. + DEFB #01 ;;exchange int x, x-int x. + DEFB #C2 ;;st-mem-2 int x, x-int x. + DEFB #02 ;;delete int x. + DEFB #38 ;;end-calc int x. ; ; mem-2 holds the fractional part. @@ -14420,7 +14368,7 @@ L2E01: RST 28H ;; FP-CALC CALL L2D7F ; routine INT-FETCH gets x in DE ; (but x is not deleted) - LD B,$10 ; set B, bit counter, to 16d + LD B,#10 ; set B, bit counter, to 16d LD A,D ; test if AND A ; high byte is zero @@ -14435,7 +14383,7 @@ L2E01: RST 28H ;; FP-CALC ; LD D,E ; transfer E to D - LD B,$08 ; and reduce the bit counter to 8. + LD B,#08 ; and reduce the bit counter to 8. ;; PF-SAVE L2E1E: PUSH DE ; save the part before decimal point. @@ -14457,39 +14405,39 @@ L2E1E: PUSH DE ; save the part before decimal point. ;; PF-SMALL L2E24: RST 28H ;; FP-CALC int x = 0. -L2E25: DEFB $E2 ;;get-mem-2 int x = 0, x-int x. - DEFB $38 ;;end-calc +L2E25: DEFB #E2 ;;get-mem-2 int x = 0, x-int x. + DEFB #38 ;;end-calc LD A,(HL) ; fetch exponent of positive fractional number - SUB $7E ; subtract + SUB #7E ; subtract CALL L2DC1 ; routine LOG(2^A) calculates leading digits. LD D,A ; transfer count to D - LD A,($5CAC) ; fetch total MEM-5-1 + LD A,(#5CAC) ; fetch total MEM-5-1 SUB D ; - LD ($5CAC),A ; MEM-5-1 + LD (#5CAC),A ; MEM-5-1 LD A,D ; CALL L2D4F ; routine E-TO-FP RST 28H ;; FP-CALC - DEFB $31 ;;duplicate - DEFB $27 ;;int - DEFB $C1 ;;st-mem-1 - DEFB $03 ;;subtract - DEFB $E1 ;;get-mem-1 - DEFB $38 ;;end-calc + DEFB #31 ;;duplicate + DEFB #27 ;;int + DEFB #C1 ;;st-mem-1 + DEFB #03 ;;subtract + DEFB #E1 ;;get-mem-1 + DEFB #38 ;;end-calc CALL L2DD5 ; routine FP-TO-A PUSH HL ; save HL - LD ($5CA1),A ; MEM-3-1 + LD (#5CA1),A ; MEM-3-1 DEC A ; RLA ; SBC A,A ; INC A ; - LD HL,$5CAB ; address MEM-5-1 leading digit counter + LD HL,#5CAB ; address MEM-5-1 leading digit counter LD (HL),A ; store counter INC HL ; address MEM-5-2 total digits ADD A,(HL) ; add counter to contents @@ -14509,14 +14457,14 @@ L2E25: DEFB $E2 ;;get-mem-2 int x = 0, x-int x. ; the accumulator holds the exponent. ;; PF-LARGE -L2E56: SUB $80 ; make exponent positive - CP $1C ; compare to 28 +L2E56: SUB #80 ; make exponent positive + CP #1C ; compare to 28 JR C,L2E6F ; to PF-MEDIUM if integer <= 2^27 CALL L2DC1 ; routine LOG(2^A) - SUB $07 ; + SUB #07 ; LD B,A ; - LD HL,$5CAC ; address MEM-5-1 the leading digits counter. + LD HL,#5CAC ; address MEM-5-1 the leading digits counter. ADD A,(HL) ; add A to contents LD (HL),A ; store updated value. LD A,B ; @@ -14533,7 +14481,7 @@ L2E6F: EX DE,HL ; SET 7,D ; LD A,L ; EXX ; - SUB $80 ; + SUB #80 ; LD B,A ; ; the branch was here to handle bits in DE with 8 or 16 in B if small int @@ -14548,8 +14496,8 @@ L2E7B: SLA E ; C> PUSH AF ; save count. PUSH DE ; and normal STKEND - LD DE,$0000 ; dummy value for STKEND at start of ROM + LD DE,#0000 ; dummy value for STKEND at start of ROM ; Note. not a fault but this has to be ; moved elsewhere when running in RAM. ; e.g. with Expandor Systems 'Soft ROM'. @@ -16345,26 +16293,26 @@ L33F8: RET Z ; return if zero. >> ; floating-point numbers in the calculator's memory area. ;; LOC-MEM -L3406: LD C,A ; store the original number $00-$1F. +L3406: LD C,A ; store the original number #00-#1F. RLCA ; double. RLCA ; quadruple. ADD A,C ; now add original to multiply by five. LD C,A ; place the result in C. - LD B,$00 ; set B to 0. + LD B,#00 ; set B to 0. ADD HL,BC ; add to form address of start of number in HL. RET ; return. ; ------------------------------ -; Get from memory area ($E0 etc.) +; Get from memory area (#E0 etc.) ; ------------------------------ -; Literals $E0 to $FF -; A holds $00-$1F offset. +; Literals #E0 to #FF +; A holds #00-#1F offset. ; The calculator stack increases by 5 bytes. ;; get-mem-xx L340F: PUSH DE ; save STKEND - LD HL,($5C68) ; MEM is base address of the memory cells. + LD HL,(#5C68) ; MEM is base address of the memory cells. CALL L3406 ; routine LOC-MEM so that HL = first byte CALL L33C0 ; routine MOVE-FP moves 5 bytes with memory ; check. @@ -16398,23 +16346,23 @@ L341B: LD H,D ; save STKEND - required for result RET ; return. ; -------------------------------- -; Store in a memory area ($C0 etc.) +; Store in a memory area (#C0 etc.) ; -------------------------------- -; Offsets $C0 to $DF +; Offsets #C0 to #DF ; Although 32 memory storage locations can be addressed, only six -; $C0 to $C5 are required by the ROM and only the thirty bytes (6*5) +; #C0 to #C5 are required by the ROM and only the thirty bytes (6*5) ; required for these are allocated. Spectrum programmers who wish to ; use the floating point routines from assembly language may wish to ; alter the system variable MEM to point to 160 bytes of RAM to have ; use the full range available. -; A holds the derived offset $00-$1F. +; A holds the derived offset #00-#1F. ; This is a unary operation, so on entry HL points to the last value and DE ; points to STKEND. ;; st-mem-xx L342D: PUSH HL ; save the result pointer. EX DE,HL ; transfer to DE. - LD HL,($5C68) ; fetch MEM the base of memory area. + LD HL,(#5C68) ; fetch MEM the base of memory area. CALL L3406 ; routine LOC-MEM sets HL to the destination. EX DE,HL ; swap - HL is start, DE is destination. CALL L33C0 ; routine MOVE-FP. @@ -16434,7 +16382,7 @@ L342D: PUSH HL ; save the result pointer. ; On exit, HL=result, DE=stkend. ;; exchange -L343C: LD B,$05 ; there are five bytes to be swapped +L343C: LD B,#05 ; there are five bytes to be swapped ; start of loop. @@ -16467,7 +16415,7 @@ L343E: LD A,(DE) ; each byte of second ; and Dr Frank O'Hara, published 1983 by Melbourne House. ;; series-xx -L3449: LD B,A ; parameter $00 - $1F to B counter +L3449: LD B,A ; parameter #00 - #1F to B counter CALL L335E ; routine GEN-ENT-1 is called. ; A recursive call to a special entry point ; in the calculator that puts the B register @@ -16480,24 +16428,24 @@ L3449: LD B,A ; parameter $00 - $1F to B counter ; The initialization phase. - DEFB $31 ;;duplicate x,x - DEFB $0F ;;addition x+x - DEFB $C0 ;;st-mem-0 x+x - DEFB $02 ;;delete . - DEFB $A0 ;;stk-zero 0 - DEFB $C2 ;;st-mem-2 0 + DEFB #31 ;;duplicate x,x + DEFB #0F ;;addition x+x + DEFB #C0 ;;st-mem-0 x+x + DEFB #02 ;;delete . + DEFB #A0 ;;stk-zero 0 + DEFB #C2 ;;st-mem-2 0 ; a loop is now entered to perform the algebraic calculation for each of ; the numbers in the series ;; G-LOOP -L3453: DEFB $31 ;;duplicate v,v. - DEFB $E0 ;;get-mem-0 v,v,x+2 - DEFB $04 ;;multiply v,v*x+2 - DEFB $E2 ;;get-mem-2 v,v*x+2,v - DEFB $C1 ;;st-mem-1 - DEFB $03 ;;subtract - DEFB $38 ;;end-calc +L3453: DEFB #31 ;;duplicate v,v. + DEFB #E0 ;;get-mem-0 v,v,x+2 + DEFB #04 ;;multiply v,v*x+2 + DEFB #E2 ;;get-mem-2 v,v*x+2,v + DEFB #C1 ;;st-mem-1 + DEFB #03 ;;subtract + DEFB #38 ;;end-calc ; the previous pointer is fetched from the machine stack to H'L' where it ; addresses one of the numbers of the series following the series literal. @@ -16510,20 +16458,20 @@ L3453: DEFB $31 ;;duplicate v,v. ; H'L' value goes on the machine stack and is ; then loaded as usual with the next address. - DEFB $0F ;;addition - DEFB $01 ;;exchange - DEFB $C2 ;;st-mem-2 - DEFB $02 ;;delete + DEFB #0F ;;addition + DEFB #01 ;;exchange + DEFB #C2 ;;st-mem-2 + DEFB #02 ;;delete - DEFB $35 ;;dec-jr-nz - DEFB $EE ;;back to L3453, G-LOOP + DEFB #35 ;;dec-jr-nz + DEFB #EE ;;back to L3453, G-LOOP ; when the counted loop is complete the final subtraction yields the result ; for example SIN X. - DEFB $E1 ;;get-mem-1 - DEFB $03 ;;subtract - DEFB $38 ;;end-calc + DEFB #E1 ;;get-mem-1 + DEFB #03 ;;subtract + DEFB #38 ;;end-calc RET ; return with H'L' pointing to location ; after last number in series. @@ -16535,7 +16483,7 @@ L3453: DEFB $31 ;;duplicate v,v. ; integer or floating point, on calculator stack. ;; abs -L346A: LD B,$FF ; signal abs +L346A: LD B,#FF ; signal abs JR L3474 ; forward to NEG-TEST ; ----------------------- @@ -16548,7 +16496,7 @@ L346A: LD B,$FF ; signal abs L346E: CALL L34E9 ; call routine TEST-ZERO and RET C ; return if so leaving zero unchanged. - LD B,$00 ; signal negate required before joining + LD B,#00 ; signal negate required before joining ; common code. ;; NEG-TEST @@ -16559,8 +16507,8 @@ L3474: LD A,(HL) ; load first byte and ; for floating point numbers a single bit denotes the sign. INC HL ; address the first byte of mantissa. - LD A,B ; action flag $FF=abs, $00=neg. - AND $80 ; now $80 $00 + LD A,B ; action flag #FF=abs, #00=neg. + AND #80 ; now #80 #00 OR (HL) ; sets bit 7 for abs RLA ; sets carry for abs and if number negative CCF ; complement carry flag @@ -16583,9 +16531,9 @@ L3483: PUSH DE ; save STKEND. POP HL ; restore the result pointer. - LD A,B ; $FF=abs, $00=neg - OR C ; $FF for abs, no change neg - CPL ; $00 for abs, switched for neg + LD A,B ; #FF=abs, #00=neg + OR C ; #FF for abs, no change neg + CPL ; #00 for abs, switched for neg LD C,A ; transfer result to sign byte. CALL L2D8E ; routine INT-STORE to re-write the integer. @@ -16606,11 +16554,11 @@ L3492: CALL L34E9 ; call routine TEST-ZERO and PUSH DE ; save pointer to STKEND. - LD DE,$0001 ; the result will be 1. + LD DE,#0001 ; the result will be 1. INC HL ; skip over the exponent. RL (HL) ; rotate the sign bit into the carry flag. DEC HL ; step back to point to the result. - SBC A,A ; byte will be $FF if negative, $00 if positive. + SBC A,A ; byte will be #FF if negative, #00 if positive. LD C,A ; store the sign byte in the C register. CALL L2D8E ; routine INT-STORE to overwrite the last ; value with 0001 and sign. @@ -16692,10 +16640,10 @@ L34BC: CALL L2BF1 ; routine STK-FETCH fetches the string CALL L2C8D ; routine ALPHA sets carry if 'A-Z' or 'a-z'. JR C,L34D3 ; forward to USR-RANGE if ASCII. - SUB $90 ; make udgs range 0-20d + SUB #90 ; make udgs range 0-20d JR C,L34E7 ; to REPORT-A if too low. e.g. usr " ". - CP $15 ; Note. this test is not necessary. + CP #15 ; Note. this test is not necessary. JR NC,L34E7 ; to REPORT-A if higher than 20. INC A ; make range 1-21d to match LSBs of ASCII @@ -16705,11 +16653,11 @@ L34D3: DEC A ; make range of bits 0-4 start at zero ADD A,A ; multiply by eight ADD A,A ; and lose any set bits ADD A,A ; range now 0 - 25*8 - CP $A8 ; compare to 21*8 + CP #A8 ; compare to 21*8 JR NC,L34E7 ; to REPORT-A if originally higher ; than 'U','u' or graphics U. - LD BC,($5C7B) ; fetch the UDG system variable value. + LD BC,(#5C7B) ; fetch the UDG system variable value. ADD A,C ; add the offset to character LD C,A ; and store back in register C. JR NC,L34E4 ; forward to USR-STACK if no overflow. @@ -16723,7 +16671,7 @@ L34E4: JP L2D2B ; jump back and exit via STACK-BC to store ;; REPORT-A L34E7: RST 08H ; ERROR-1 - DEFB $09 ; Error Report: Invalid argument + DEFB #09 ; Error Report: Invalid argument ; ------------- ; Test for zero @@ -16756,7 +16704,7 @@ L34E9: PUSH HL ; preserve HL which is used to address. RET ; return with carry set if zero. ; ----------------------- -; Greater than zero ($37) +; Greater than zero (#37) ; ----------------------- ; Test if the last value on the calculator stack is greater than zero. ; This routine is also called directly from the end-tests of the comparison @@ -16768,7 +16716,7 @@ L34F9: CALL L34E9 ; routine TEST-ZERO RET C ; return if was zero as this ; is also the Boolean 'false' value. - LD A,$FF ; prepare XOR mask for sign bit + LD A,#FF ; prepare XOR mask for sign bit JR L3507 ; forward to SIGN-TO-C ; to put sign in carry ; (carry will become set if sign is positive) @@ -16776,7 +16724,7 @@ L34F9: CALL L34E9 ; routine TEST-ZERO ; as appropriate. ; ------------------------ -; Handle NOT operator ($30) +; Handle NOT operator (#30) ; ------------------------ ; This overwrites the last value with 1 if it was zero else with zero ; if it was any other value. @@ -16820,7 +16768,7 @@ L3507: INC HL ; address 2nd byte. ;; FP-0/1 L350B: PUSH HL ; save pointer to the first byte - LD A,$00 ; load accumulator with zero - without + LD A,#00 ; load accumulator with zero - without ; disturbing flags. LD (HL),A ; zero to first byte INC HL ; address next @@ -16917,7 +16865,7 @@ L352D: EX DE,HL ; make HL point to the number. RET ; return. ; ----------------------------------- -; Perform comparison ($09-$0E, $11-$16) +; Perform comparison (#09-#0E, #11-#16) ; ----------------------------------- ; True binary operations. ; @@ -16973,13 +16921,13 @@ L352D: EX DE,HL ; make HL point to the number. ;; no-l-eql, etc. L353B: LD A,B ; transfer literal to accumulator. - SUB $08 ; subtract eight - which is not useful. + SUB #08 ; subtract eight - which is not useful. BIT 2,A ; isolate '>', '<', '='. JR NZ,L3543 ; skip to EX-OR-NOT with these. - DEC A ; else make $00-$02, $08-$0A to match bits 0-2. + DEC A ; else make #00-#02, #08-#0A to match bits 0-2. ;; EX-OR-NOT L3543: RRCA ; the first RRCA sets carry for a swap. @@ -17107,8 +17055,8 @@ L3585: POP BC ; discard length L3588: PUSH AF ; save A and carry RST 28H ;; FP-CALC - DEFB $A0 ;;stk-zero an initial false value. - DEFB $38 ;;end-calc + DEFB #A0 ;;stk-zero an initial false value. + DEFB #38 ;;end-calc ; both numeric and string paths converge here. @@ -17132,7 +17080,7 @@ L358C: POP AF ; pop carry - will be set if eql/neql RET ; return. ; ------------------------- -; String concatenation ($17) +; String concatenation (#17) ; ------------------------- ; This literal combines two strings into one e.g. LET a$ = b$ + c$ ; The two parameters of the two strings to be combined are on the stack. @@ -17190,8 +17138,8 @@ L35B7: POP BC ; now second length ; the CALCULATE routine. ;; STK-PNTRS -L35BF: LD HL,($5C65) ; fetch STKEND value from system variable. - LD DE,$FFFB ; the value -5 +L35BF: LD HL,(#5C65) ; fetch STKEND value from system variable. + LD DE,#FFFB ; the value -5 PUSH HL ; push STKEND value. ADD HL,DE ; subtract 5 from HL. @@ -17213,7 +17161,7 @@ L35C9: CALL L2DD5 ; routine FP-TO-A puts the number in A. PUSH AF ; save the argument. - LD BC,$0001 ; one space required. + LD BC,#0001 ; one space required. RST 30H ; BC-SPACES makes DE point to start POP AF ; restore the number. @@ -17229,10 +17177,10 @@ L35C9: CALL L2DD5 ; routine FP-TO-A puts the number in A. ;; REPORT-Bd L35DC: RST 08H ; ERROR-1 - DEFB $0A ; Error Report: Integer out of range + DEFB #0A ; Error Report: Integer out of range ; ---------------------------- -; Handle VAL and VAL$ ($1D, $18) +; Handle VAL and VAL$ (#1D, #18) ; ---------------------------- ; VAL treats the characters in a string as a numeric expression. ; e.g. VAL "2.3" = 2.3, VAL "2+4" = 6, VAL ("2" + "4") = 24. @@ -17241,12 +17189,12 @@ L35DC: RST 08H ; ERROR-1 ;; val ;; val$ -L35DE: LD HL,($5C5D) ; fetch value of system variable CH_ADD +L35DE: LD HL,(#5C5D) ; fetch value of system variable CH_ADD PUSH HL ; and save on the machine stack. - LD A,B ; fetch the literal (either $1D or $18). - ADD A,$E3 ; add $E3 to form $00 (setting carry) or $FB. - SBC A,A ; now form $FF bit 6 = numeric result - ; or $00 bit 6 = string result. + LD A,B ; fetch the literal (either #1D or #18). + ADD A,#E3 ; add #E3 to form #00 (setting carry) or #FB. + SBC A,A ; now form #FF bit 6 = numeric result + ; or #00 bit 6 = string result. PUSH AF ; save this mask on the stack CALL L2BF1 ; routine STK-FETCH fetches the string operand @@ -17257,39 +17205,39 @@ L35DE: LD HL,($5C5D) ; fetch value of system variable CH_ADD RST 30H ; BC-SPACES creates the space in workspace. POP HL ; restore start of string to HL. - LD ($5C5D),DE ; load CH_ADD with start DE in workspace. + LD (#5C5D),DE ; load CH_ADD with start DE in workspace. PUSH DE ; save the start in workspace LDIR ; copy string from program or variables or ; workspace to the workspace area. EX DE,HL ; end of string + 1 to HL DEC HL ; decrement HL to point to end of new area. - LD (HL),$0D ; insert a carriage return at end. - RES 7,(IY+$01) ; update FLAGS - signal checking syntax. + LD (HL),#0D ; insert a carriage return at end. + RES 7,(IY+#01) ; update FLAGS - signal checking syntax. CALL L24FB ; routine SCANNING evaluates string ; expression and result. RST 18H ; GET-CHAR fetches next character. - CP $0D ; is it the expected carriage return ? + CP #0D ; is it the expected carriage return ? JR NZ,L360C ; forward to V-RPORT-C if not ; 'Nonsense in BASIC'. POP HL ; restore start of string in workspace. POP AF ; restore expected result flag (bit 6). - XOR (IY+$01) ; xor with FLAGS now updated by SCANNING. - AND $40 ; test bit 6 - should be zero if result types + XOR (IY+#01) ; xor with FLAGS now updated by SCANNING. + AND #40 ; test bit 6 - should be zero if result types ; match. ;; V-RPORT-C L360C: JP NZ,L1C8A ; jump back to REPORT-C with a result mismatch. - LD ($5C5D),HL ; set CH_ADD to the start of the string again. - SET 7,(IY+$01) ; update FLAGS - signal running program. + LD (#5C5D),HL ; set CH_ADD to the start of the string again. + SET 7,(IY+#01) ; update FLAGS - signal running program. CALL L24FB ; routine SCANNING evaluates the string ; in full leaving result on calculator stack. POP HL ; restore saved character address in program. - LD ($5C5D),HL ; and reset the system variable CH_ADD. + LD (#5C5D),HL ; and reset the system variable CH_ADD. JR L35BF ; back to exit via STK-PNTRS. ; resetting the calculator stack pointers @@ -17303,16 +17251,16 @@ L360C: JP NZ,L1C8A ; jump back to REPORT-C with a result mismatch. ; ;; str$ -L361F: LD BC,$0001 ; create an initial byte in workspace +L361F: LD BC,#0001 ; create an initial byte in workspace RST 30H ; using BC-SPACES restart. - LD ($5C5B),HL ; set system variable K_CUR to new location. + LD (#5C5B),HL ; set system variable K_CUR to new location. PUSH HL ; and save start on machine stack also. - LD HL,($5C51) ; fetch value of system variable CURCHL + LD HL,(#5C51) ; fetch value of system variable CURCHL PUSH HL ; and save that too. - LD A,$FF ; select system channel 'R'. + LD A,#FF ; select system channel 'R'. CALL L1601 ; routine CHAN-OPEN opens it. CALL L2DE3 ; routine PRINT-FP outputs the number to ; workspace updating K-CUR. @@ -17321,7 +17269,7 @@ L361F: LD BC,$0001 ; create an initial byte in workspace CALL L1615 ; routine CHAN-FLAG resets flags. POP DE ; fetch saved start of string to DE. - LD HL,($5C5B) ; load HL with end of string from K_CUR. + LD HL,(#5C5B) ; load HL with end of string from K_CUR. AND A ; prepare for true subtraction. SBC HL,DE ; subtract start from end to give length. @@ -17344,19 +17292,19 @@ L361F: LD BC,$0001 ; create an initial byte in workspace ;; read-in L3645: CALL L1E94 ; routine FIND-INT1 fetches stream to A - CP $10 ; compare with 16 decimal. + CP #10 ; compare with 16 decimal. JP NC,L1E9F ; jump to REPORT-Bb if not in range 0 - 15. ; 'Integer out of range' ; (REPORT-Bd is within range) - LD HL,($5C51) ; fetch current channel CURCHL + LD HL,(#5C51) ; fetch current channel CURCHL PUSH HL ; save it CALL L1601 ; routine CHAN-OPEN opens channel CALL L15E6 ; routine INPUT-AD - the channel must have an ; input stream or else error here from stream ; stub. - LD BC,$0000 ; initialize length of string to zero + LD BC,#0000 ; initialize length of string to zero JR NC,L365F ; forward to R-I-STORE if no key detected. INC C ; increase length to one. @@ -17418,7 +17366,7 @@ L3674: CALL L2BF1 ; routine STK-FETCH to fetch and delete the L367A: EXX ; switch in set that addresses code PUSH HL ; save pointer to offset byte - LD HL,$5C67 ; address BREG in system variables + LD HL,#5C67 ; address BREG in system variables DEC (HL) ; decrement it POP HL ; restore pointer @@ -17430,7 +17378,7 @@ L367A: EXX ; switch in set that addresses code ; Note. as a general rule the calculator avoids using the IY register ; otherwise the cumbersome 4 instructions in the middle could be replaced by -; dec (iy+$2d) - three bytes instead of six. +; dec (iy+#2d) - three bytes instead of six. ; --------- @@ -17447,7 +17395,7 @@ L3686: EXX ;switch in pointer set L3687: LD E,(HL) ; the jump byte 0-127 forward, 128-255 back. LD A,E ; transfer to accumulator. RLA ; if backward jump, carry is set. - SBC A,A ; will be $FF if backward or $00 if forward. + SBC A,A ; will be #FF if backward or #00 if forward. LD D,A ; transfer to high byte. ADD HL,DE ; advance calculator pointer forward or back. EXX ; switch back. @@ -17496,25 +17444,25 @@ L369B: POP AF ; drop the calculator return address RE-ENTRY ; ------------------------ ; THE 'MODULUS' SUBROUTINE ; ------------------------ -; (offset: $32 'n-mod-m') +; (offset: #32 'n-mod-m') ; ; ;; n-mod-m L36A0: RST 28H ;; FP-CALC 17, 3. - DEFB $C0 ;;st-mem-0 17, 3. - DEFB $02 ;;delete 17. - DEFB $31 ;;duplicate 17, 17. - DEFB $E0 ;;get-mem-0 17, 17, 3. - DEFB $05 ;;division 17, 17/3. - DEFB $27 ;;int 17, 5. - DEFB $E0 ;;get-mem-0 17, 5, 3. - DEFB $01 ;;exchange 17, 3, 5. - DEFB $C0 ;;st-mem-0 17, 3, 5. - DEFB $04 ;;multiply 17, 15. - DEFB $03 ;;subtract 2. - DEFB $E0 ;;get-mem-0 2, 5. - DEFB $38 ;;end-calc 2, 5. + DEFB #C0 ;;st-mem-0 17, 3. + DEFB #02 ;;delete 17. + DEFB #31 ;;duplicate 17, 17. + DEFB #E0 ;;get-mem-0 17, 17, 3. + DEFB #05 ;;division 17, 17/3. + DEFB #27 ;;int 17, 5. + DEFB #E0 ;;get-mem-0 17, 5, 3. + DEFB #01 ;;exchange 17, 3, 5. + DEFB #C0 ;;st-mem-0 17, 3, 5. + DEFB #04 ;;multiply 17, 15. + DEFB #03 ;;subtract 2. + DEFB #E0 ;;get-mem-0 2, 5. + DEFB #38 ;;end-calc 2, 5. RET ; return. @@ -17522,7 +17470,7 @@ L36A0: RST 28H ;; FP-CALC 17, 3. ; ------------------ ; THE 'INT' FUNCTION ; ------------------ -; (offset $27: 'int' ) +; (offset #27: 'int' ) ; ; This function returns the integer of x, which is just the same as truncate ; for positive numbers. The truncate literal truncates negative numbers @@ -17532,13 +17480,13 @@ L36A0: RST 28H ;; FP-CALC 17, 3. ;; int L36AF: RST 28H ;; FP-CALC x. (= 3.4 or -3.4). - DEFB $31 ;;duplicate x, x. - DEFB $36 ;;less-0 x, (1/0) - DEFB $00 ;;jump-true x, (1/0) - DEFB $04 ;;to L36B7, X-NEG + DEFB #31 ;;duplicate x, x. + DEFB #36 ;;less-0 x, (1/0) + DEFB #00 ;;jump-true x, (1/0) + DEFB #04 ;;to L36B7, X-NEG - DEFB $3A ;;truncate trunc 3.4 = 3. - DEFB $38 ;;end-calc 3. + DEFB #3A ;;truncate trunc 3.4 = 3. + DEFB #38 ;;end-calc 3. RET ; return with + int x on stack. @@ -17546,21 +17494,21 @@ L36AF: RST 28H ;; FP-CALC x. (= 3.4 or -3.4). ;; X-NEG -L36B7: DEFB $31 ;;duplicate -3.4, -3.4. - DEFB $3A ;;truncate -3.4, -3. - DEFB $C0 ;;st-mem-0 -3.4, -3. - DEFB $03 ;;subtract -.4 - DEFB $E0 ;;get-mem-0 -.4, -3. - DEFB $01 ;;exchange -3, -.4. - DEFB $30 ;;not -3, (0). - DEFB $00 ;;jump-true -3. - DEFB $03 ;;to L36C2, EXIT -3. +L36B7: DEFB #31 ;;duplicate -3.4, -3.4. + DEFB #3A ;;truncate -3.4, -3. + DEFB #C0 ;;st-mem-0 -3.4, -3. + DEFB #03 ;;subtract -.4 + DEFB #E0 ;;get-mem-0 -.4, -3. + DEFB #01 ;;exchange -3, -.4. + DEFB #30 ;;not -3, (0). + DEFB #00 ;;jump-true -3. + DEFB #03 ;;to L36C2, EXIT -3. - DEFB $A1 ;;stk-one -3, 1. - DEFB $03 ;;subtract -4. + DEFB #A1 ;;stk-one -3, 1. + DEFB #03 ;;subtract -4. ;; EXIT -L36C2: DEFB $38 ;;end-calc -4. +L36C2: DEFB #38 ;;end-calc -4. RET ; return. @@ -17574,38 +17522,38 @@ L36C2: DEFB $38 ;;end-calc -4. ;; EXP ;; exp L36C4: RST 28H ;; FP-CALC - DEFB $3D ;;re-stack - DEFB $34 ;;stk-data - DEFB $F1 ;;Exponent: $81, Bytes: 4 - DEFB $38,$AA,$3B,$29 ;; - DEFB $04 ;;multiply - DEFB $31 ;;duplicate - DEFB $27 ;;int - DEFB $C3 ;;st-mem-3 - DEFB $03 ;;subtract - DEFB $31 ;;duplicate - DEFB $0F ;;addition - DEFB $A1 ;;stk-one - DEFB $03 ;;subtract - DEFB $88 ;;series-08 - DEFB $13 ;;Exponent: $63, Bytes: 1 - DEFB $36 ;;(+00,+00,+00) - DEFB $58 ;;Exponent: $68, Bytes: 2 - DEFB $65,$66 ;;(+00,+00) - DEFB $9D ;;Exponent: $6D, Bytes: 3 - DEFB $78,$65,$40 ;;(+00) - DEFB $A2 ;;Exponent: $72, Bytes: 3 - DEFB $60,$32,$C9 ;;(+00) - DEFB $E7 ;;Exponent: $77, Bytes: 4 - DEFB $21,$F7,$AF,$24 ;; - DEFB $EB ;;Exponent: $7B, Bytes: 4 - DEFB $2F,$B0,$B0,$14 ;; - DEFB $EE ;;Exponent: $7E, Bytes: 4 - DEFB $7E,$BB,$94,$58 ;; - DEFB $F1 ;;Exponent: $81, Bytes: 4 - DEFB $3A,$7E,$F8,$CF ;; - DEFB $E3 ;;get-mem-3 - DEFB $38 ;;end-calc + DEFB #3D ;;re-stack + DEFB #34 ;;stk-data + DEFB #F1 ;;Exponent: #81, Bytes: 4 + DEFB #38,#AA,#3B,#29 ;; + DEFB #04 ;;multiply + DEFB #31 ;;duplicate + DEFB #27 ;;int + DEFB #C3 ;;st-mem-3 + DEFB #03 ;;subtract + DEFB #31 ;;duplicate + DEFB #0F ;;addition + DEFB #A1 ;;stk-one + DEFB #03 ;;subtract + DEFB #88 ;;series-08 + DEFB #13 ;;Exponent: #63, Bytes: 1 + DEFB #36 ;;(+00,+00,+00) + DEFB #58 ;;Exponent: #68, Bytes: 2 + DEFB #65,#66 ;;(+00,+00) + DEFB #9D ;;Exponent: #6D, Bytes: 3 + DEFB #78,#65,#40 ;;(+00) + DEFB #A2 ;;Exponent: #72, Bytes: 3 + DEFB #60,#32,#C9 ;;(+00) + DEFB #E7 ;;Exponent: #77, Bytes: 4 + DEFB #21,#F7,#AF,#24 ;; + DEFB #EB ;;Exponent: #7B, Bytes: 4 + DEFB #2F,#B0,#B0,#14 ;; + DEFB #EE ;;Exponent: #7E, Bytes: 4 + DEFB #7E,#BB,#94,#58 ;; + DEFB #F1 ;;Exponent: #81, Bytes: 4 + DEFB #3A,#7E,#F8,#CF ;; + DEFB #E3 ;;get-mem-3 + DEFB #38 ;;end-calc CALL L2DD5 ; routine FP-TO-A JR NZ,L3705 ; to N-NEGTV @@ -17618,7 +17566,7 @@ L36C4: RST 28H ;; FP-CALC ;; REPORT-6b L3703: RST 08H ; ERROR-1 - DEFB $05 ; Error Report: Number too big + DEFB #05 ; Error Report: Number too big ;; N-NEGTV L3705: JR C,L370E ; to RSLT-ZERO @@ -17637,9 +17585,9 @@ L370C: LD (HL),A ; ;; RSLT-ZERO L370E: RST 28H ;; FP-CALC - DEFB $02 ;;delete - DEFB $A0 ;;stk-zero - DEFB $38 ;;end-calc + DEFB #02 ;;delete + DEFB #A0 ;;stk-zero + DEFB #38 ;;end-calc RET ; return. @@ -17652,99 +17600,99 @@ L370E: RST 28H ;; FP-CALC ;; ln L3713: RST 28H ;; FP-CALC - DEFB $3D ;;re-stack - DEFB $31 ;;duplicate - DEFB $37 ;;greater-0 - DEFB $00 ;;jump-true - DEFB $04 ;;to L371C, VALID + DEFB #3D ;;re-stack + DEFB #31 ;;duplicate + DEFB #37 ;;greater-0 + DEFB #00 ;;jump-true + DEFB #04 ;;to L371C, VALID - DEFB $38 ;;end-calc + DEFB #38 ;;end-calc ;; REPORT-Ab L371A: RST 08H ; ERROR-1 - DEFB $09 ; Error Report: Invalid argument + DEFB #09 ; Error Report: Invalid argument ;; VALID -L371C: DEFB $A0 ;;stk-zero - DEFB $02 ;;delete - DEFB $38 ;;end-calc +L371C: DEFB #A0 ;;stk-zero + DEFB #02 ;;delete + DEFB #38 ;;end-calc LD A,(HL) ; - LD (HL),$80 ; + LD (HL),#80 ; CALL L2D28 ; routine STACK-A RST 28H ;; FP-CALC - DEFB $34 ;;stk-data - DEFB $38 ;;Exponent: $88, Bytes: 1 - DEFB $00 ;;(+00,+00,+00) - DEFB $03 ;;subtract - DEFB $01 ;;exchange - DEFB $31 ;;duplicate - DEFB $34 ;;stk-data - DEFB $F0 ;;Exponent: $80, Bytes: 4 - DEFB $4C,$CC,$CC,$CD ;; - DEFB $03 ;;subtract - DEFB $37 ;;greater-0 - DEFB $00 ;;jump-true - DEFB $08 ;;to L373D, GRE.8 + DEFB #34 ;;stk-data + DEFB #38 ;;Exponent: #88, Bytes: 1 + DEFB #00 ;;(+00,+00,+00) + DEFB #03 ;;subtract + DEFB #01 ;;exchange + DEFB #31 ;;duplicate + DEFB #34 ;;stk-data + DEFB #F0 ;;Exponent: #80, Bytes: 4 + DEFB #4C,#CC,#CC,#CD ;; + DEFB #03 ;;subtract + DEFB #37 ;;greater-0 + DEFB #00 ;;jump-true + DEFB #08 ;;to L373D, GRE.8 - DEFB $01 ;;exchange - DEFB $A1 ;;stk-one - DEFB $03 ;;subtract - DEFB $01 ;;exchange - DEFB $38 ;;end-calc + DEFB #01 ;;exchange + DEFB #A1 ;;stk-one + DEFB #03 ;;subtract + DEFB #01 ;;exchange + DEFB #38 ;;end-calc INC (HL) ; RST 28H ;; FP-CALC ;; GRE.8 -L373D: DEFB $01 ;;exchange - DEFB $34 ;;stk-data - DEFB $F0 ;;Exponent: $80, Bytes: 4 - DEFB $31,$72,$17,$F8 ;; - DEFB $04 ;;multiply - DEFB $01 ;;exchange - DEFB $A2 ;;stk-half - DEFB $03 ;;subtract - DEFB $A2 ;;stk-half - DEFB $03 ;;subtract - DEFB $31 ;;duplicate - DEFB $34 ;;stk-data - DEFB $32 ;;Exponent: $82, Bytes: 1 - DEFB $20 ;;(+00,+00,+00) - DEFB $04 ;;multiply - DEFB $A2 ;;stk-half - DEFB $03 ;;subtract - DEFB $8C ;;series-0C - DEFB $11 ;;Exponent: $61, Bytes: 1 - DEFB $AC ;;(+00,+00,+00) - DEFB $14 ;;Exponent: $64, Bytes: 1 - DEFB $09 ;;(+00,+00,+00) - DEFB $56 ;;Exponent: $66, Bytes: 2 - DEFB $DA,$A5 ;;(+00,+00) - DEFB $59 ;;Exponent: $69, Bytes: 2 - DEFB $30,$C5 ;;(+00,+00) - DEFB $5C ;;Exponent: $6C, Bytes: 2 - DEFB $90,$AA ;;(+00,+00) - DEFB $9E ;;Exponent: $6E, Bytes: 3 - DEFB $70,$6F,$61 ;;(+00) - DEFB $A1 ;;Exponent: $71, Bytes: 3 - DEFB $CB,$DA,$96 ;;(+00) - DEFB $A4 ;;Exponent: $74, Bytes: 3 - DEFB $31,$9F,$B4 ;;(+00) - DEFB $E7 ;;Exponent: $77, Bytes: 4 - DEFB $A0,$FE,$5C,$FC ;; - DEFB $EA ;;Exponent: $7A, Bytes: 4 - DEFB $1B,$43,$CA,$36 ;; - DEFB $ED ;;Exponent: $7D, Bytes: 4 - DEFB $A7,$9C,$7E,$5E ;; - DEFB $F0 ;;Exponent: $80, Bytes: 4 - DEFB $6E,$23,$80,$93 ;; - DEFB $04 ;;multiply - DEFB $0F ;;addition - DEFB $38 ;;end-calc +L373D: DEFB #01 ;;exchange + DEFB #34 ;;stk-data + DEFB #F0 ;;Exponent: #80, Bytes: 4 + DEFB #31,#72,#17,#F8 ;; + DEFB #04 ;;multiply + DEFB #01 ;;exchange + DEFB #A2 ;;stk-half + DEFB #03 ;;subtract + DEFB #A2 ;;stk-half + DEFB #03 ;;subtract + DEFB #31 ;;duplicate + DEFB #34 ;;stk-data + DEFB #32 ;;Exponent: #82, Bytes: 1 + DEFB #20 ;;(+00,+00,+00) + DEFB #04 ;;multiply + DEFB #A2 ;;stk-half + DEFB #03 ;;subtract + DEFB #8C ;;series-0C + DEFB #11 ;;Exponent: #61, Bytes: 1 + DEFB #AC ;;(+00,+00,+00) + DEFB #14 ;;Exponent: #64, Bytes: 1 + DEFB #09 ;;(+00,+00,+00) + DEFB #56 ;;Exponent: #66, Bytes: 2 + DEFB #DA,#A5 ;;(+00,+00) + DEFB #59 ;;Exponent: #69, Bytes: 2 + DEFB #30,#C5 ;;(+00,+00) + DEFB #5C ;;Exponent: #6C, Bytes: 2 + DEFB #90,#AA ;;(+00,+00) + DEFB #9E ;;Exponent: #6E, Bytes: 3 + DEFB #70,#6F,#61 ;;(+00) + DEFB #A1 ;;Exponent: #71, Bytes: 3 + DEFB #CB,#DA,#96 ;;(+00) + DEFB #A4 ;;Exponent: #74, Bytes: 3 + DEFB #31,#9F,#B4 ;;(+00) + DEFB #E7 ;;Exponent: #77, Bytes: 4 + DEFB #A0,#FE,#5C,#FC ;; + DEFB #EA ;;Exponent: #7A, Bytes: 4 + DEFB #1B,#43,#CA,#36 ;; + DEFB #ED ;;Exponent: #7D, Bytes: 4 + DEFB #A7,#9C,#7E,#5E ;; + DEFB #F0 ;;Exponent: #80, Bytes: 4 + DEFB #6E,#23,#80,#93 ;; + DEFB #04 ;;multiply + DEFB #0F ;;addition + DEFB #38 ;;end-calc RET ; return. @@ -17772,7 +17720,7 @@ L373D: DEFB $01 ;;exchange ;--------------------------------- ; THE 'REDUCE ARGUMENT' SUBROUTINE ;--------------------------------- -; (offset $39: 'get-argt') +; (offset #39: 'get-argt') ; ; This routine performs two functions on the angle, in radians, that forms ; the argument to the sine and cosine functions. @@ -17807,45 +17755,45 @@ L373D: DEFB $01 ;;exchange ;; get-argt L3783: RST 28H ;; FP-CALC X. - DEFB $3D ;;re-stack - DEFB $34 ;;stk-data - DEFB $EE ;;Exponent: $7E, + DEFB #3D ;;re-stack + DEFB #34 ;;stk-data + DEFB #EE ;;Exponent: #7E, ;;Bytes: 4 - DEFB $22,$F9,$83,$6E ;; X, 1/(2*PI) - DEFB $04 ;;multiply X/(2*PI) = fraction - DEFB $31 ;;duplicate - DEFB $A2 ;;stk-half - DEFB $0F ;;addition - DEFB $27 ;;int + DEFB #22,#F9,#83,#6E ;; X, 1/(2*PI) + DEFB #04 ;;multiply X/(2*PI) = fraction + DEFB #31 ;;duplicate + DEFB #A2 ;;stk-half + DEFB #0F ;;addition + DEFB #27 ;;int - DEFB $03 ;;subtract now range -.5 to .5 + DEFB #03 ;;subtract now range -.5 to .5 - DEFB $31 ;;duplicate - DEFB $0F ;;addition now range -1 to 1. - DEFB $31 ;;duplicate - DEFB $0F ;;addition now range -2 to +2. + DEFB #31 ;;duplicate + DEFB #0F ;;addition now range -1 to 1. + DEFB #31 ;;duplicate + DEFB #0F ;;addition now range -2 to +2. ; quadrant I (0 to +1) and quadrant IV (-1 to 0) are now correct. ; quadrant II ranges +1 to +2. ; quadrant III ranges -2 to -1. - DEFB $31 ;;duplicate Y, Y. - DEFB $2A ;;abs Y, abs(Y). range 1 to 2 - DEFB $A1 ;;stk-one Y, abs(Y), 1. - DEFB $03 ;;subtract Y, abs(Y)-1. range 0 to 1 - DEFB $31 ;;duplicate Y, Z, Z. - DEFB $37 ;;greater-0 Y, Z, (1/0). + DEFB #31 ;;duplicate Y, Y. + DEFB #2A ;;abs Y, abs(Y). range 1 to 2 + DEFB #A1 ;;stk-one Y, abs(Y), 1. + DEFB #03 ;;subtract Y, abs(Y)-1. range 0 to 1 + DEFB #31 ;;duplicate Y, Z, Z. + DEFB #37 ;;greater-0 Y, Z, (1/0). - DEFB $C0 ;;st-mem-0 store as possible sign + DEFB #C0 ;;st-mem-0 store as possible sign ;; for cosine function. - DEFB $00 ;;jump-true - DEFB $04 ;;to L37A1, ZPLUS with quadrants II and III. + DEFB #00 ;;jump-true + DEFB #04 ;;to L37A1, ZPLUS with quadrants II and III. ; else the angle lies in quadrant I or IV and value Y is already correct. - DEFB $02 ;;delete Y. delete the test value. - DEFB $38 ;;end-calc Y. + DEFB #02 ;;delete Y. delete the test value. + DEFB #38 ;;end-calc Y. RET ; return. with Q1 and Q4 >>> @@ -17855,20 +17803,20 @@ L3783: RST 28H ;; FP-CALC X. ; Y will hold -2 to -1 if this is quadrant III. ;; ZPLUS -L37A1: DEFB $A1 ;;stk-one Y, Z, 1. - DEFB $03 ;;subtract Y, Z-1. Q3 = 0 to -1 - DEFB $01 ;;exchange Z-1, Y. - DEFB $36 ;;less-0 Z-1, (1/0). - DEFB $00 ;;jump-true Z-1. - DEFB $02 ;;to L37A8, YNEG +L37A1: DEFB #A1 ;;stk-one Y, Z, 1. + DEFB #03 ;;subtract Y, Z-1. Q3 = 0 to -1 + DEFB #01 ;;exchange Z-1, Y. + DEFB #36 ;;less-0 Z-1, (1/0). + DEFB #00 ;;jump-true Z-1. + DEFB #02 ;;to L37A8, YNEG ;;if angle in quadrant III ; else angle is within quadrant II (-1 to 0) - DEFB $1B ;;negate range +1 to 0. + DEFB #1B ;;negate range +1 to 0. ;; YNEG -L37A8: DEFB $38 ;;end-calc quadrants II and III correct. +L37A8: DEFB #38 ;;end-calc quadrants II and III correct. RET ; return. @@ -17876,7 +17824,7 @@ L37A8: DEFB $38 ;;end-calc quadrants II and III correct. ;---------------------- ; THE 'COSINE' FUNCTION ;---------------------- -; (offset $20: 'cos') +; (offset #20: 'cos') ; Cosines are calculated as the sine of the opposite angle rectifying the ; sign depending on the quadrant rules. ; @@ -17902,27 +17850,27 @@ L37A8: DEFB $38 ;;end-calc quadrants II and III correct. ;; cos L37AA: RST 28H ;; FP-CALC angle in radians. - DEFB $39 ;;get-argt X reduce -1 to +1 + DEFB #39 ;;get-argt X reduce -1 to +1 - DEFB $2A ;;abs ABS X. 0 to 1 - DEFB $A1 ;;stk-one ABS X, 1. - DEFB $03 ;;subtract now opposite angle + DEFB #2A ;;abs ABS X. 0 to 1 + DEFB #A1 ;;stk-one ABS X, 1. + DEFB #03 ;;subtract now opposite angle ;; although sign is -ve. - DEFB $E0 ;;get-mem-0 fetch the sign indicator - DEFB $00 ;;jump-true - DEFB $06 ;;fwd to L37B7, C-ENT + DEFB #E0 ;;get-mem-0 fetch the sign indicator + DEFB #00 ;;jump-true + DEFB #06 ;;fwd to L37B7, C-ENT ;;forward to common code if in QII or QIII. - DEFB $1B ;;negate else make sign +ve. - DEFB $33 ;;jump - DEFB $03 ;;fwd to L37B7, C-ENT + DEFB #1B ;;negate else make sign +ve. + DEFB #33 ;;jump + DEFB #03 ;;fwd to L37B7, C-ENT ;; with quadrants I and IV. ;-------------------- ; THE 'SINE' FUNCTION ;-------------------- -; (offset $1F: 'sin') +; (offset #1F: 'sin') ; This is a fundamental transcendental function from which others such as cos ; and tan are directly, or indirectly, derived. ; It uses the series generator to produce Chebyshev polynomials. @@ -17941,39 +17889,39 @@ L37AA: RST 28H ;; FP-CALC angle in radians. ;; sin L37B5: RST 28H ;; FP-CALC angle in radians - DEFB $39 ;;get-argt reduce - sign now correct. + DEFB #39 ;;get-argt reduce - sign now correct. ;; C-ENT -L37B7: DEFB $31 ;;duplicate - DEFB $31 ;;duplicate - DEFB $04 ;;multiply - DEFB $31 ;;duplicate - DEFB $0F ;;addition - DEFB $A1 ;;stk-one - DEFB $03 ;;subtract +L37B7: DEFB #31 ;;duplicate + DEFB #31 ;;duplicate + DEFB #04 ;;multiply + DEFB #31 ;;duplicate + DEFB #0F ;;addition + DEFB #A1 ;;stk-one + DEFB #03 ;;subtract - DEFB $86 ;;series-06 - DEFB $14 ;;Exponent: $64, Bytes: 1 - DEFB $E6 ;;(+00,+00,+00) - DEFB $5C ;;Exponent: $6C, Bytes: 2 - DEFB $1F,$0B ;;(+00,+00) - DEFB $A3 ;;Exponent: $73, Bytes: 3 - DEFB $8F,$38,$EE ;;(+00) - DEFB $E9 ;;Exponent: $79, Bytes: 4 - DEFB $15,$63,$BB,$23 ;; - DEFB $EE ;;Exponent: $7E, Bytes: 4 - DEFB $92,$0D,$CD,$ED ;; - DEFB $F1 ;;Exponent: $81, Bytes: 4 - DEFB $23,$5D,$1B,$EA ;; - DEFB $04 ;;multiply - DEFB $38 ;;end-calc + DEFB #86 ;;series-06 + DEFB #14 ;;Exponent: #64, Bytes: 1 + DEFB #E6 ;;(+00,+00,+00) + DEFB #5C ;;Exponent: #6C, Bytes: 2 + DEFB #1F,#0B ;;(+00,+00) + DEFB #A3 ;;Exponent: #73, Bytes: 3 + DEFB #8F,#38,#EE ;;(+00) + DEFB #E9 ;;Exponent: #79, Bytes: 4 + DEFB #15,#63,#BB,#23 ;; + DEFB #EE ;;Exponent: #7E, Bytes: 4 + DEFB #92,#0D,#CD,#ED ;; + DEFB #F1 ;;Exponent: #81, Bytes: 4 + DEFB #23,#5D,#1B,#EA ;; + DEFB #04 ;;multiply + DEFB #38 ;;end-calc RET ; return. ;----------------------- ; THE 'TANGENT' FUNCTION ;----------------------- -; (offset $21: 'tan') +; (offset #21: 'tan') ; ; Evaluates tangent x as sin(x) / cos(x). ; @@ -17996,19 +17944,19 @@ L37B7: DEFB $31 ;;duplicate ;; tan L37DA: RST 28H ;; FP-CALC x. - DEFB $31 ;;duplicate x, x. - DEFB $1F ;;sin x, sin x. - DEFB $01 ;;exchange sin x, x. - DEFB $20 ;;cos sin x, cos x. - DEFB $05 ;;division sin x/cos x (= tan x). - DEFB $38 ;;end-calc tan x. + DEFB #31 ;;duplicate x, x. + DEFB #1F ;;sin x, sin x. + DEFB #01 ;;exchange sin x, x. + DEFB #20 ;;cos sin x, cos x. + DEFB #05 ;;division sin x/cos x (= tan x). + DEFB #38 ;;end-calc tan x. RET ; return. ;---------------------- ; THE 'ARCTAN' FUNCTION ;---------------------- -; (Offset $24: 'atn') +; (Offset #24: 'atn') ; the inverse tangent function with the result in radians. ; This is a fundamental transcendental function from which others such as asn ; and acs are directly, or indirectly, derived. @@ -18017,66 +17965,66 @@ L37DA: RST 28H ;; FP-CALC x. ;; atn L37E2: CALL L3297 ; routine re-stack LD A,(HL) ; fetch exponent byte. - CP $81 ; compare to that for 'one' + CP #81 ; compare to that for 'one' JR C,L37F8 ; forward, if less, to SMALL RST 28H ;; FP-CALC - DEFB $A1 ;;stk-one - DEFB $1B ;;negate - DEFB $01 ;;exchange - DEFB $05 ;;division - DEFB $31 ;;duplicate - DEFB $36 ;;less-0 - DEFB $A3 ;;stk-pi/2 - DEFB $01 ;;exchange - DEFB $00 ;;jump-true - DEFB $06 ;;to L37FA, CASES + DEFB #A1 ;;stk-one + DEFB #1B ;;negate + DEFB #01 ;;exchange + DEFB #05 ;;division + DEFB #31 ;;duplicate + DEFB #36 ;;less-0 + DEFB #A3 ;;stk-pi/2 + DEFB #01 ;;exchange + DEFB #00 ;;jump-true + DEFB #06 ;;to L37FA, CASES - DEFB $1B ;;negate - DEFB $33 ;;jump - DEFB $03 ;;to L37FA, CASES + DEFB #1B ;;negate + DEFB #33 ;;jump + DEFB #03 ;;to L37FA, CASES ;; SMALL L37F8: RST 28H ;; FP-CALC - DEFB $A0 ;;stk-zero + DEFB #A0 ;;stk-zero ;; CASES -L37FA: DEFB $01 ;;exchange - DEFB $31 ;;duplicate - DEFB $31 ;;duplicate - DEFB $04 ;;multiply - DEFB $31 ;;duplicate - DEFB $0F ;;addition - DEFB $A1 ;;stk-one - DEFB $03 ;;subtract - DEFB $8C ;;series-0C - DEFB $10 ;;Exponent: $60, Bytes: 1 - DEFB $B2 ;;(+00,+00,+00) - DEFB $13 ;;Exponent: $63, Bytes: 1 - DEFB $0E ;;(+00,+00,+00) - DEFB $55 ;;Exponent: $65, Bytes: 2 - DEFB $E4,$8D ;;(+00,+00) - DEFB $58 ;;Exponent: $68, Bytes: 2 - DEFB $39,$BC ;;(+00,+00) - DEFB $5B ;;Exponent: $6B, Bytes: 2 - DEFB $98,$FD ;;(+00,+00) - DEFB $9E ;;Exponent: $6E, Bytes: 3 - DEFB $00,$36,$75 ;;(+00) - DEFB $A0 ;;Exponent: $70, Bytes: 3 - DEFB $DB,$E8,$B4 ;;(+00) - DEFB $63 ;;Exponent: $73, Bytes: 2 - DEFB $42,$C4 ;;(+00,+00) - DEFB $E6 ;;Exponent: $76, Bytes: 4 - DEFB $B5,$09,$36,$BE ;; - DEFB $E9 ;;Exponent: $79, Bytes: 4 - DEFB $36,$73,$1B,$5D ;; - DEFB $EC ;;Exponent: $7C, Bytes: 4 - DEFB $D8,$DE,$63,$BE ;; - DEFB $F0 ;;Exponent: $80, Bytes: 4 - DEFB $61,$A1,$B3,$0C ;; - DEFB $04 ;;multiply - DEFB $0F ;;addition - DEFB $38 ;;end-calc +L37FA: DEFB #01 ;;exchange + DEFB #31 ;;duplicate + DEFB #31 ;;duplicate + DEFB #04 ;;multiply + DEFB #31 ;;duplicate + DEFB #0F ;;addition + DEFB #A1 ;;stk-one + DEFB #03 ;;subtract + DEFB #8C ;;series-0C + DEFB #10 ;;Exponent: #60, Bytes: 1 + DEFB #B2 ;;(+00,+00,+00) + DEFB #13 ;;Exponent: #63, Bytes: 1 + DEFB #0E ;;(+00,+00,+00) + DEFB #55 ;;Exponent: #65, Bytes: 2 + DEFB #E4,#8D ;;(+00,+00) + DEFB #58 ;;Exponent: #68, Bytes: 2 + DEFB #39,#BC ;;(+00,+00) + DEFB #5B ;;Exponent: #6B, Bytes: 2 + DEFB #98,#FD ;;(+00,+00) + DEFB #9E ;;Exponent: #6E, Bytes: 3 + DEFB #00,#36,#75 ;;(+00) + DEFB #A0 ;;Exponent: #70, Bytes: 3 + DEFB #DB,#E8,#B4 ;;(+00) + DEFB #63 ;;Exponent: #73, Bytes: 2 + DEFB #42,#C4 ;;(+00,+00) + DEFB #E6 ;;Exponent: #76, Bytes: 4 + DEFB #B5,#09,#36,#BE ;; + DEFB #E9 ;;Exponent: #79, Bytes: 4 + DEFB #36,#73,#1B,#5D ;; + DEFB #EC ;;Exponent: #7C, Bytes: 4 + DEFB #D8,#DE,#63,#BE ;; + DEFB #F0 ;;Exponent: #80, Bytes: 4 + DEFB #61,#A1,#B3,#0C ;; + DEFB #04 ;;multiply + DEFB #0F ;;addition + DEFB #38 ;;end-calc RET ; return. @@ -18084,7 +18032,7 @@ L37FA: DEFB $01 ;;exchange ;---------------------- ; THE 'ARCSIN' FUNCTION ;---------------------- -; (Offset $22: 'asn') +; (Offset #22: 'asn') ; the inverse sine function with result in radians. ; derived from arctan function above. ; Error A unless the argument is between -1 and +1 inclusive. @@ -18119,20 +18067,20 @@ L37FA: DEFB $01 ;;exchange ;; asn L3833: RST 28H ;; FP-CALC x. - DEFB $31 ;;duplicate x, x. - DEFB $31 ;;duplicate x, x, x. - DEFB $04 ;;multiply x, x*x. - DEFB $A1 ;;stk-one x, x*x, 1. - DEFB $03 ;;subtract x, x*x-1. - DEFB $1B ;;negate x, 1-x*x. - DEFB $28 ;;sqr x, sqr(1-x*x) = y - DEFB $A1 ;;stk-one x, y, 1. - DEFB $0F ;;addition x, y+1. - DEFB $05 ;;division x/y+1. - DEFB $24 ;;atn a/2 (half the angle) - DEFB $31 ;;duplicate a/2, a/2. - DEFB $0F ;;addition a. - DEFB $38 ;;end-calc a. + DEFB #31 ;;duplicate x, x. + DEFB #31 ;;duplicate x, x, x. + DEFB #04 ;;multiply x, x*x. + DEFB #A1 ;;stk-one x, x*x, 1. + DEFB #03 ;;subtract x, x*x-1. + DEFB #1B ;;negate x, 1-x*x. + DEFB #28 ;;sqr x, sqr(1-x*x) = y + DEFB #A1 ;;stk-one x, y, 1. + DEFB #0F ;;addition x, y+1. + DEFB #05 ;;division x/y+1. + DEFB #24 ;;atn a/2 (half the angle) + DEFB #31 ;;duplicate a/2, a/2. + DEFB #0F ;;addition a. + DEFB #38 ;;end-calc a. RET ; return. @@ -18140,7 +18088,7 @@ L3833: RST 28H ;; FP-CALC x. ;------------------------- ; THE 'ARCCOS' FUNCTION ;------------------------- -; (Offset $23: 'acs') +; (Offset #23: 'acs') ; the inverse cosine function with the result in radians. ; Error A unless the argument is between -1 and +1. ; Result in range 0 to pi. @@ -18167,11 +18115,11 @@ L3833: RST 28H ;; FP-CALC x. ;; acs L3843: RST 28H ;; FP-CALC x. - DEFB $22 ;;asn asn(x). - DEFB $A3 ;;stk-pi/2 asn(x), pi/2. - DEFB $03 ;;subtract asn(x) - pi/2. - DEFB $1B ;;negate pi/2 -asn(x) = acs(x). - DEFB $38 ;;end-calc acs(x). + DEFB #22 ;;asn asn(x). + DEFB #A3 ;;stk-pi/2 asn(x), pi/2. + DEFB #03 ;;subtract asn(x) - pi/2. + DEFB #1B ;;negate pi/2 -asn(x) = acs(x). + DEFB #38 ;;end-calc acs(x). RET ; return. @@ -18179,7 +18127,7 @@ L3843: RST 28H ;; FP-CALC x. ; -------------------------- ; THE 'SQUARE ROOT' FUNCTION ; -------------------------- -; (Offset $28: 'sqr') +; (Offset #28: 'sqr') ; This routine is remarkable only in its brevity - 7 bytes. ; It wasn't written here but in the ZX81 where the programmers had to squeeze ; a bulky operating sytem into an 8K ROM. It simply calculates @@ -18189,19 +18137,19 @@ L3843: RST 28H ;; FP-CALC x. ;; sqr L384A: RST 28H ;; FP-CALC - DEFB $31 ;;duplicate - DEFB $30 ;;not - DEFB $00 ;;jump-true - DEFB $1E ;;to L386C, LAST + DEFB #31 ;;duplicate + DEFB #30 ;;not + DEFB #00 ;;jump-true + DEFB #1E ;;to L386C, LAST - DEFB $A2 ;;stk-half - DEFB $38 ;;end-calc + DEFB #A2 ;;stk-half + DEFB #38 ;;end-calc ; ------------------------------ ; THE 'EXPONENTIATION' OPERATION ; ------------------------------ -; (Offset $06: 'to-power') +; (Offset #06: 'to-power') ; This raises the first number X to the power of the second number Y. ; As with the ZX80, ; 0 ^ 0 = 1. @@ -18211,17 +18159,17 @@ L384A: RST 28H ;; FP-CALC ;; to-power L3851: RST 28H ;; FP-CALC X, Y. - DEFB $01 ;;exchange Y, X. - DEFB $31 ;;duplicate Y, X, X. - DEFB $30 ;;not Y, X, (1/0). - DEFB $00 ;;jump-true - DEFB $07 ;;to L385D, XISO if X is zero. + DEFB #01 ;;exchange Y, X. + DEFB #31 ;;duplicate Y, X, X. + DEFB #30 ;;not Y, X, (1/0). + DEFB #00 ;;jump-true + DEFB #07 ;;to L385D, XISO if X is zero. ; else X is non-zero. Function 'ln' will catch a negative value of X. - DEFB $25 ;;ln Y, LN X. - DEFB $04 ;;multiply Y * LN X. - DEFB $38 ;;end-calc + DEFB #25 ;;ln Y, LN X. + DEFB #04 ;;multiply Y * LN X. + DEFB #38 ;;end-calc JP L36C4 ; jump back to EXP routine -> @@ -18231,35 +18179,35 @@ L3851: RST 28H ;; FP-CALC X, Y. ; begin by deleting the known zero to leave Y the power factor. ;; XISO -L385D: DEFB $02 ;;delete Y. - DEFB $31 ;;duplicate Y, Y. - DEFB $30 ;;not Y, (1/0). - DEFB $00 ;;jump-true - DEFB $09 ;;to L386A, ONE if Y is zero. +L385D: DEFB #02 ;;delete Y. + DEFB #31 ;;duplicate Y, Y. + DEFB #30 ;;not Y, (1/0). + DEFB #00 ;;jump-true + DEFB #09 ;;to L386A, ONE if Y is zero. - DEFB $A0 ;;stk-zero Y, 0. - DEFB $01 ;;exchange 0, Y. - DEFB $37 ;;greater-0 0, (1/0). - DEFB $00 ;;jump-true 0. - DEFB $06 ;;to L386C, LAST if Y was any positive + DEFB #A0 ;;stk-zero Y, 0. + DEFB #01 ;;exchange 0, Y. + DEFB #37 ;;greater-0 0, (1/0). + DEFB #00 ;;jump-true 0. + DEFB #06 ;;to L386C, LAST if Y was any positive ;; number. ; else force division by zero thereby raising an Arithmetic overflow error. ; There are some one and two-byte alternatives but perhaps the most formal ; might have been to use end-calc; rst 08; defb 05. - DEFB $A1 ;;stk-one 0, 1. - DEFB $01 ;;exchange 1, 0. - DEFB $05 ;;division 1/0 ouch! + DEFB #A1 ;;stk-one 0, 1. + DEFB #01 ;;exchange 1, 0. + DEFB #05 ;;division 1/0 ouch! ; --- ;; ONE -L386A: DEFB $02 ;;delete . - DEFB $A1 ;;stk-one 1. +L386A: DEFB #02 ;;delete . + DEFB #A1 ;;stk-one 1. ;; LAST -L386C: DEFB $38 ;;end-calc last value is 1 or 0. +L386C: DEFB #38 ;;end-calc last value is 1 or 0. RET ; return. Whew! @@ -18280,7 +18228,7 @@ L386C: DEFB $38 ;;end-calc last value is 1 or 0. ;; KEYS L386E: PUSH IX - BIT 4,(IY+$01) ; [FLAGS] Test if in 128K mode + BIT 4,(IY+#01) ; [FLAGS] Test if in 128K mode JR Z,L3879 ; Z=in 48K mode CALL L3A42 ; Attempt to scan the keypad @@ -18297,17 +18245,17 @@ L3879: CALL L02BF ; Scan the keyboard ; In this way the state of the other three outputs are maintained when the state of the LSB of L is changed and sent out to register 14 of the AY-3-8912. ;; READ_OUTPUTS -L387F: LD C,$FD ; FFFD = Address of the - LD D,$FF ; command register (register 7) - LD E,$BF ; BFFD = Address of the +L387F: LD C,#FD ; FFFD = Address of the + LD D,#FF ; command register (register 7) + LD E,#BF ; BFFD = Address of the LD B,D ; data register (register 14) - LD A,$07 + LD A,#07 OUT (C),A ; Select command register IN H,(C) ; Read its status - LD A,$0E + LD A,#0E OUT (C),A ; Select data register IN A,(C) ; Read its status - OR $F0 ; Mask off the input lines + OR #F0 ; Mask off the input lines LD L,A ; L=state of output lines at the RET ; keypad socket @@ -18318,7 +18266,7 @@ L387F: LD C,$FD ; FFFD = Address of the ;; SET_REG14 L3896: LD B,D - LD A,$0E + LD A,#0E OUT (C),A ; Select the data register LD B,E OUT (C),L ; Send L out to the data register @@ -18331,7 +18279,7 @@ L3896: LD B,D ;; GET_REG14 L389F: LD B,D - LD A,$0E + LD A,#0E OUT (C),A ; Select the data register IN A,(C) ; Read the input line RET @@ -18342,7 +18290,7 @@ L389F: LD B,D ;; RESET_LINE L38A7: LD A,L - AND $FE ; Reset bit 0 of L + AND #FE ; Reset bit 0 of L LD L,A JR L3896 ; Send out L to the data register @@ -18352,7 +18300,7 @@ L38A7: LD A,L ;; SET_LINE L38AD: LD A,L - OR $01 ; Set bit 0 of L + OR #01 ; Set bit 0 of L LD L,A JR L3896 ; Send out L to the data register @@ -18372,7 +18320,7 @@ L38B3: DJNZ L38B3 ;; DELAY2 L38B6: PUSH BC - LD B,$10 + LD B,#10 CALL L38B3 ; Inner delay of 135 T-States POP BC DJNZ L38B6 @@ -18388,7 +18336,7 @@ L38B6: PUSH BC L38C0: PUSH BC CALL L389F ; Read the state of the input line POP BC - AND $20 ; Test bit 5, the input line + AND #20 ; Test bit 5, the input line JR Z,L38CB ; Exit if input line found low DJNZ L38C0 ; Repeat until timeout expires @@ -18404,7 +18352,7 @@ L38CB: RET L38CC: PUSH BC CALL L389F ; Read the state of the input line POP BC - AND $20 ; Test bit 5, the input line + AND #20 ; Test bit 5, the input line JR NZ,L38D7 ; Exit if input line found low DJNZ L38CC ; Repeat until timeout expires @@ -18418,7 +18366,7 @@ L38D7: RET ;; READ_STATUS L38D8: CALL L387F ; Read the output lines - LD B,$01 ; Read in one bit + LD B,#01 ; Read in one bit JR L38E4 ; ---------------- @@ -18429,13 +18377,13 @@ L38D8: CALL L387F ; Read the output lines ;; READ_NIBBLE L38DF: CALL L387F ; Read the state of the output lines - LD B,$04 ; Read in four bits + LD B,#04 ; Read in four bits ;; READ_BIT L38E4: PUSH BC CALL L389F ; Read the input line from the keypad POP BC - AND $20 ; This line should initially be high + AND #20 ; This line should initially be high JR Z,L392D ; Z=read in a 0, there must be an error XOR A ; The bits read in will be stored in register A @@ -18445,17 +18393,17 @@ L38EE: PUSH BC ; Preserve the loop count and any bits PUSH AF ; read in so far CALL L38AD ; Set the output line high - LD B,$A3 ; Monitor for 17609 T-states for the + LD B,#A3 ; Monitor for 17609 T-states for the CALL L38C0 ; input line to go low JR NZ,L392B ; NZ=the line did not go low CALL L38A7 ; Set the output line low JR L3901 ; Insert a delay of 12 T-states -L38FF: DEFB $FF, $FF +L38FF: DEFB #FF, #FF ;; BL_CONTINUE -L3901: LD B,$2B ; Delay for 564 T-states +L3901: LD B,#2B ; Delay for 564 T-states CALL L38B3 CALL L389F ; Read in the bit value BIT 5,A @@ -18475,12 +18423,12 @@ L3914: RRA ; Shift the carry bit into bit 0 of A PUSH AF ; Save bits read in CALL L38AD ; Set the output line high - LD B,$26 ; Delay for 499 T-states + LD B,#26 ; Delay for 499 T-states CALL L38B3 CALL L38A7 ; Set the output line low - LD B,$23 ; Delay for 460 T-states + LD B,#23 ; Delay for 460 T-states CALL L38B3 POP AF ; Retrieve read in bits @@ -18503,7 +18451,7 @@ L392B: POP AF L392D: CALL L38AD ; Set the output line high XOR A ; Clear FLAGS nibble - LD ($5B88),A ; [FLAGS/ROW3] + LD (#5B88),A ; [FLAGS/ROW3] INC A ; Return zero flag reset SCF @@ -18528,60 +18476,60 @@ L392D: CALL L38AD ; Set the output line high ;; ATTEMPT_POLL L3938: CALL L387F ; Read the output line states - LD A,($5B88) ; [FLAGS/ROW3] Has communications already been - AND $80 ; established with the keypad? + LD A,(#5B88) ; [FLAGS/ROW3] Has communications already been + AND #80 ; established with the keypad? JR NZ,L3999 ; NZ=yes, so skip the poll CALL L389F ; Read the input line - AND $20 ; It should be high initially + AND #20 ; It should be high initially JR Z,L392D ; Z=error, input line found low - LD A,($5B88) ; [FLAGS/ROW3] Test if poll counter already zero thus + LD A,(#5B88) ; [FLAGS/ROW3] Test if poll counter already zero thus AND A ; indicating a previous comms error JR NZ,L395A ; NZ=ready to poll the keypad INC A ; Indicate comms not established - LD ($5B88),A ; [FLAGS/ROW3] - LD A,$4C ; Reset the poll counter - LD ($5B89),A ; [ROW2/ROW1] + LD (#5B88),A ; [FLAGS/ROW3] + LD A,#4C ; Reset the poll counter + LD (#5B89),A ; [ROW2/ROW1] JR L399C ; Exit the routine ;;POLL_KEYPAD -L395A: LD A,($5B89) ; [ROW2/ROW1] Decrement the poll counter +L395A: LD A,(#5B89) ; [ROW2/ROW1] Decrement the poll counter DEC A - LD ($5B89),A ; [ROW2/ROW1] + LD (#5B89),A ; [ROW2/ROW1] JR NZ,L399C ; Exit the routine if it is not yet zero ; The poll counter has reached zero so a poll of the keypad can now occur. XOR A - LD ($5B88),A ; [FLAGS/ROW3] Indicate that a poll can occur - LD ($5B89),A ; [ROW2/ROW1] - LD ($5B8A),A ; [ROW4/ROW5] Clear all the row nibble stores + LD (#5B88),A ; [FLAGS/ROW3] Indicate that a poll can occur + LD (#5B89),A ; [ROW2/ROW1] + LD (#5B8A),A ; [ROW4/ROW5] Clear all the row nibble stores CALL L38A7 ; Set the output line low - LD B,$21 ; Wait up to 3569 T-States for the + LD B,#21 ; Wait up to 3569 T-States for the CALL L38C0 ; input line to go low JR NZ,L392D ; NZ=line did not go low CALL L38AD ; Set the output line high - LD B,$24 ; Wait up to 3893 T-States for the + LD B,#24 ; Wait up to 3893 T-States for the CALL L38CC ; input line to go high JR Z,L392D ; NZ=line did not go high CALL L38A7 ; Set the output line low - LD B,$0F + LD B,#0F CALL L38B6 ; Delay for 4070 T-States CALL L38DF ; Read in a nibble of data JR NZ,L392D ; NZ=error occurred when reading in nibble SET 7,A ; Set bit 7 - AND $F0 ; Keep only the upper four bits + AND #F0 ; Keep only the upper four bits ; (Bit 6 will be set if poll successful) - LD ($5B88),A ; [FLAGS/ROW3] Store the flags nibble + LD (#5B88),A ; [FLAGS/ROW3] Store the flags nibble XOR A SRL A ; Exit: Zero flag set, Carry flag reset RET @@ -18605,15 +18553,15 @@ L399C: XOR A ; Poll counter not zero ;; KEYPAD_SCAN L39A0: CALL L3938 ; Try to poll the keypad - LD A,($5B88) ; [FLAGS/ROW3] Test the flags nibble + LD A,(#5B88) ; [FLAGS/ROW3] Test the flags nibble CPL - AND $C0 ; Bits 6 and 7 must be set in FLAGS + AND #C0 ; Bits 6 and 7 must be set in FLAGS RET NZ ; NZ=poll was not successful ; The poll was successful so now read in data for the five keypad rows. - LD IX,$5B8A ; [ROW4/ROW5] - LD B,$05 ; The five rows + LD IX,#5B8A ; [ROW4/ROW5] + LD B,#05 ; The five rows ;; KS_LOOP L39B0: PUSH BC ; Save counter @@ -18630,7 +18578,7 @@ L39B0: PUSH BC ; Save counter POP BC ; Fetch the nibble loop counter PUSH BC LD C,A ; Move the nibble read in to C - LD A,(IX+$00) ; Fetch the nibble store + LD A,(IX+#00) ; Fetch the nibble store BIT 0,B ; Test if an upper or lower nibble JR Z,L39D6 ; Z=upper nibble @@ -18638,15 +18586,15 @@ L39B0: PUSH BC ; Save counter SRL C SRL C SRL C - AND $F0 ; Mask off the lower nibble of the + AND #F0 ; Mask off the lower nibble of the JR L39D8 ; nibble store ;; KS_UPPER -L39D6: AND $0F ; Mask off the upper nibble of the nibble store +L39D6: AND #0F ; Mask off the upper nibble of the nibble store ;; KS_STORE L39D8: OR C ; Combine the existing and new - LD (IX+$00),A ; nibbles and store them + LD (IX+#00),A ; nibbles and store them ;; KS_NEXT L39DC: POP BC ; Retrieve the row counter @@ -18660,13 +18608,13 @@ L39E3: DJNZ L39B0 ; Repeat for the next keypad row ; All five rows have now been read so compose a unique code for the key pressed. - LD E,$80 ; Signal no key press found yet - LD IX,$5B88 ; [FLAGS/ROW3] - LD HL,$3A3F ; Point to the key mask data - LD B,$03 ; Scan three nibbles + LD E,#80 ; Signal no key press found yet + LD IX,#5B88 ; [FLAGS/ROW3] + LD HL,#3A3F ; Point to the key mask data + LD B,#03 ; Scan three nibbles ;; GEN_LOOP -L39F0: LD A,(IX+$00) ; Fetch a pair of nibbles +L39F0: LD A,(IX+#00) ; Fetch a pair of nibbles AND (HL) ; This will mask off the FLAGS nibble and the SHIFT/0 key JR Z,L3A17 ; Z=no key pressed in these nibbles @@ -18679,14 +18627,14 @@ L39F0: LD A,(IX+$00) ; Fetch a pair of nibbles LD A,B ; Move loop counter to A JR L3A01 ; A delay of 12 T-States -L39FF: DEFB $FF, $FF ; Unused locations +L39FF: DEFB #FF, #FF ; Unused locations ;; GEN_CONT L3A01: DEC A ; These lines of code generate base SLA A ; values of 7, 15 and 23 for the three SLA A ; nibble stores 5B88, 5B89 & 5B8A. SLA A - OR $07 + OR #07 LD B,A ; B=(loop counter-1)*8+7 POP AF ; Fetch the byte of key press data @@ -18713,7 +18661,7 @@ L3A17: INC IX ; Point to the next nibble store JR NZ,L3A27 ; NZ=no keys were pressed LD A,E ; Copy the key code - AND $FC ; Test for the '.' key (E=1) + AND #FC ; Test for the '.' key (E=1) JR Z,L3A27 ; Z='.' key pressed DEC E @@ -18722,22 +18670,22 @@ L3A17: INC IX ; Point to the next nibble store ; The E register now holds a unique key code value between 1 and 17. ;; GEN_POINT -L3A27: LD A,($5B8A) ; [ROW4/ROW5] Test if the SHIFT key was pressed - AND $08 +L3A27: LD A,(#5B8A) ; [ROW4/ROW5] Test if the SHIFT key was pressed + AND #08 JR Z,L3A34 ; Z=the SHIFT key was not pressed ; The SHIFT key was pressed or no key was pressed. LD A,E ; Fetch the key code - AND $7F ; Mask off 'no key pressed' bit - ADD A,$12 ; Add on a shift offset of 12 + AND #7F ; Mask off 'no key pressed' bit + ADD A,#12 ; Add on a shift offset of 12 LD E,A ; Add a base offset of 5A to all key codes. Note that no key press will result in a key code of DA. This is the only code with bit 7 set and so will be detected later. ;; GEN_NOSHIFT L3A34: LD A,E - ADD A,$5A ; Add a base offset of 5A + ADD A,#5A ; Add a base offset of 5A LD E,A ; Return key codes in range 5B - 7D XOR A RET ; Exit: Zero flag set, key found OK @@ -18758,7 +18706,7 @@ L3A3C: XOR A ; Exit: Zero flag reset indicating an ; ---------------- ;; KEY_MASKS -L3A3F: DEFB $0F, $FF, $F2 ; Key mask data +L3A3F: DEFB #0F, #FF, #F2 ; Key mask data ; --------------- ; READ THE KEYPAD @@ -18788,23 +18736,23 @@ L3A3F: DEFB $0F, $FF, $F2 ; Key mask data ; decrement the KSTATE system variable Call Counters. The keypad routine 'knows' of the existence of keyboard key codes but the reverse is not true. ;; KEYPAD -L3A42: LD E,$80 ; Signal no key pressed - LD A,($5C78) ; [FRAMES] - AND $01 ; Scan the keypad every other +L3A42: LD E,#80 ; Signal no key pressed + LD A,(#5C78) ; [FRAMES] + AND #01 ; Scan the keypad every other JR NZ,L3A4F ; interrupt CALL L39A0 RET NZ ; NZ=no valid key pressed ;; KP_CHECK -L3A4F: LD HL,$5C00 ; [KSTATE0] Test the first KSTATE variable +L3A4F: LD HL,#5C00 ; [KSTATE0] Test the first KSTATE variable ;; KP_LOOP L3A52: BIT 7,(HL) ; Is the set free? JR NZ,L3A62 ; NZ=yes LD A,(HL) ; Fetch the un-decoded key value - CP $5B ; Is it a keyboard code? + CP #5B ; Is it a keyboard code? JR C,L3A62 ; C=yes, so do not decrement counter INC HL @@ -18812,11 +18760,11 @@ L3A52: BIT 7,(HL) ; Is the set free? DEC HL JR NZ,L3A62 ; If the counter reaches zero, then ; signal the set is free - LD (HL),$FF + LD (HL),#FF ;; KP_CH_SET L3A62: LD A,L ; Jump back and test the second set if - LD HL,$5C04 ; [KSTATE4] not yet considered + LD HL,#5C04 ; [KSTATE4] not yet considered CP L JR NZ,L3A52 @@ -18824,12 +18772,12 @@ L3A62: LD A,L ; Jump back and test the second set if RET NZ ; return if invalid LD A,E ; Test if the key in the first set is being - LD HL,$5C00 ; [KSTATE0] repeated + LD HL,#5C00 ; [KSTATE0] repeated CP (HL) JR Z,L3A9E ; Jump if being repeated EX DE,HL ; Save the address of KSTATE0 - LD HL,$5C04 ; [KSTATE4] Test if the key in the second set is + LD HL,#5C04 ; [KSTATE4] Test if the key in the second set is CP (HL) ; being repeated JR Z,L3A9E ; Jump if being repeated @@ -18846,10 +18794,10 @@ L3A62: LD A,L ; Jump back and test the second set if L3A83: LD E,A ; Pass the key code to the E register LD (HL),A ; and to KSTATE0/4 INC HL - LD (HL),$0A ; Set the '10 Call Counter' to 10 + LD (HL),#0A ; Set the '10 Call Counter' to 10 INC HL - LD A,($5C09) ; [REPDEL] Fetch the initial repeat delay + LD A,(#5C09) ; [REPDEL] Fetch the initial repeat delay SRL A ; Divide delay by two LD (HL),A ; Store the repeat delay INC HL @@ -18861,8 +18809,8 @@ L3A83: LD E,A ; Pass the key code to the E register ;; KP_END L3A94: LD A,E - LD ($5C08),A ; [LAST_K] Store the key value in LAST_K - LD HL,$5C3B ; FLAGS + LD (#5C08),A ; [LAST_K] Store the key value in LAST_K + LD HL,#5C3B ; FLAGS SET 5,(HL) ; Signal a new key pressed RET @@ -18872,12 +18820,12 @@ L3A94: LD A,E ;; KP_REPEAT L3A9E: INC HL - LD (HL),$0A ; Reset the '10 Call Counter' to 10 + LD (HL),#0A ; Reset the '10 Call Counter' to 10 INC HL DEC (HL) ; Decrement the repeat delay RET NZ ; Return if not zero - LD A,($5C0A) ; [REPPER] The subsequent repeat delay is + LD A,(#5C0A) ; [REPPER] The subsequent repeat delay is SRL A ; divided by two and stored LD (HL),A INC HL @@ -18891,13 +18839,13 @@ L3A9E: INC HL ;; KP_TEST L3AAE: LD A,E - LD HL,$5B66 ; FLAGS3 Test if in BASIC or EDIT mode + LD HL,#5B66 ; FLAGS3 Test if in BASIC or EDIT mode BIT 0,(HL) JR Z,L3ABC ; Z=EDIT mode ; Test key codes when in BASIC/CALCULATOR mode - CP $6D ; Test for shifted keys + CP #6D ; Test for shifted keys JR NC,L3AD4 ; and signal an error if found ;; KPT_OK @@ -18907,18 +18855,18 @@ L3ABA: XOR A ; Signal valid key code ; Test key codes when in EDIT/MENU mode. ;; KPT_EDIT -L3ABC: CP $80 ; Test for no key press +L3ABC: CP #80 ; Test for no key press JR NC,L3AD4 ; NC=no key press - CP $6C ; Test for SHIFT on its own + CP #6C ; Test for SHIFT on its own JR NZ,L3ABA ; NZ=valid key code -L3AC4: DEFB $00, $00, $00 ; Delay for 64 T-States - DEFB $00, $00, $00 - DEFB $00, $00, $00 - DEFB $00, $00, $00 - DEFB $00, $00, $00 - DEFB $00 +L3AC4: DEFB #00, #00, #00 ; Delay for 64 T-States + DEFB #00, #00, #00 + DEFB #00, #00, #00 + DEFB #00, #00, #00 + DEFB #00, #00, #00 + DEFB #00 ;; KPT_INVALID L3AD4: XOR A ; Signal invalid key code @@ -18932,11 +18880,11 @@ L3AD4: XOR A ; Signal invalid key code ;; KP_DECODE L3AD7: PUSH HL ; Save the KSTATE pointer LD A,E - SUB $5B ; Reduce the key code range to - LD D,$00 ; 00 - 22 and transfer to DE + SUB #5B ; Reduce the key code range to + LD D,#00 ; 00 - 22 and transfer to DE LD E,A - LD HL,$5B66 ; FLAGS3 Test if in EDIT or BASIC mode + LD HL,#5B66 ; FLAGS3 Test if in EDIT or BASIC mode BIT 0,(HL) JR Z,L3AEA ; Z=EDIT/MENU mode @@ -18949,7 +18897,7 @@ L3AD7: PUSH HL ; Save the KSTATE pointer ;; KPD_EDIT L3AEA: LD HL,L3B25 ; Use Table 4 for unshifted key - CP $11 ; presses + CP #11 ; presses JR C,L3B0F ; Deal with shifted keys in EDIT/MENU mode. @@ -18958,24 +18906,24 @@ L3AEA: LD HL,L3B25 ; Use Table 4 for unshifted key ; it actually performs no function when editing a BASIC program. LD HL,L3B21 - CP $15 ; Test for SHIFT 1 + CP #15 ; Test for SHIFT 1 JR Z,L3B0F - CP $16 ; Test for SHIFT 2 + CP #16 ; Test for SHIFT 2 JR Z,L3B0F JR L3B01 ; Delay for 12 T-States -L3AFE: DEFB $00, $FF, $FF ; Unused locations +L3AFE: DEFB #00, #FF, #FF ; Unused locations ;; KPD_CONT -L3B01: CP $17 ; Test for SHIFT 3 +L3B01: CP #17 ; Test for SHIFT 3 JR Z,L3B0F ; Use Table 2 with SHIFT 4 (delete to beginning of word) and SHIFT 5 (delete to end of word). LD HL,L3B18 - CP $21 ; Test for SHIFT 4 and above + CP #21 ; Test for SHIFT 4 and above JR NC,L3B0F ;Use Table 1 for all other shifted key presses. @@ -18993,83 +18941,77 @@ L3B0F: ADD HL,DE ; Look up the key value ; -------------------------------- ;; KPD_TABLE1 -L3B13: DEFB $2E, $0D, $33 ; '.', ENTER, 3 - DEFB $32, $31 ; 2, 1 +L3B13: DEFB #2E, #0D, #33 ; '.', ENTER, 3 + DEFB #32, #31 ; 2, 1 ;; KPD_TABLE2 -L3B18: DEFB $29, $28, $2A ; ), (, * - DEFB $2F, $2D, $39 ; /, - , 9 - DEFB $38, $37, $2B ; 8, 7, + +L3B18: DEFB #29, #28, #2A ; ), (, * + DEFB #2F, #2D, #39 ; /, - , 9 + DEFB #38, #37, #2B ; 8, 7, + ;; KPD_TABLE3 -L3B21: DEFB $36, $35, $34 ; 6, 5, 4 - DEFB $30 ; 0 +L3B21: DEFB #36, #35, #34 ; 6, 5, 4 + DEFB #30 ; 0 ;; KPD_TABLE4 -L3B25: DEFB $A5, $0D, $A6 ; Bottom, ENTER, Top - DEFB $A7, $A8, $A9 ; End of line, Start of line, TOGGLE - DEFB $AA, $0B, $0C ; DEL right, Up, DEL - DEFB $07, $09, $0A ; CMND, Right, Down - DEFB $08, $AC, $AD ; Left, Down ten, Up ten - DEFB $AE, $AF ; End word, Beginning of word - DEFB $B0, $B1, $B2 ; DEL to end of line, DEL to start of line, SHIFT TOGGLE - DEFB $B3, $B4 ; DEL to end of word, DEL to beginning of word +L3B25: DEFB #A5, #0D, #A6 ; Bottom, ENTER, Top + DEFB #A7, #A8, #A9 ; End of line, Start of line, TOGGLE + DEFB #AA, #0B, #0C ; DEL right, Up, DEL + DEFB #07, #09, #0A ; CMND, Right, Down + DEFB #08, #AC, #AD ; Left, Down ten, Up ten + DEFB #AE, #AF ; End word, Beginning of word + DEFB #B0, #B1, #B2 ; DEL to end of line, DEL to start of line, SHIFT TOGGLE + DEFB #B3, #B4 ; DEL to end of word, DEL to beginning of word ; ----------------------------- ; PRINT NEW ERROR MESSAGE PATCH ; ----------------------------- -L3B3B: BIT 4,(IY+$01) ; FLAGS 3 - In 128K mode? +L3B3B: BIT 4,(IY+#01) ; FLAGS 3 - In 128K mode? JR NZ,L3B46 ; NZ=128K mode ; In 48K mode - XOR A ; Replicate code from standard ROM that the patch over-wrote - LD DE,$1536 + LD DE,#1536 RET ; In 128K mode - -L3B46: LD HL,$010F ; Vector table entry in Editor ROM -> JP $03A2 +L3B46: LD HL,#010F ; Vector table entry in Editor ROM -> JP #03A2 ; Return to Editor ROM at address in HL - L3B49: EX (SP),HL ; Change the return address - JP $5B00 ; Page Editor ROM and return to the address on the stack + JP #5B00 ; Page Editor ROM and return to the address on the stack ; ------------------------------------- ; STATEMENT INTERPRETATION RETURN PATCH ; ------------------------------------- -L3B4D: BIT 4,(IY+$01) ; In 128K mode? +L3B4D: BIT 4,(IY+#01) ; In 128K mode? JR NZ,L3B58 ; NZ=128K mode ; In 48K mode - - BIT 7,(IY+$0A) ; replicate code from standard ROM that the patch over-wrote + BIT 7,(IY+#0A) ; replicate code from standard ROM that the patch over-wrote RET ; In 128K mode - -L3B58: LD HL,$0112 ; Handle in Editor ROM by jumping to Vector table entry in Editor ROM -> JP #182A +L3B58: LD HL,#0112 ; Handle in Editor ROM by jumping to Vector table entry in Editor ROM -> JP #182A JR L3B49 ; -------------------------- ; GO TO NEXT STATEMENT PATCH ; -------------------------- -L3B5D: BIT 4,(IY+$01) ; In 128K mode? +L3B5D: BIT 4,(IY+#01) ; In 128K mode? JR NZ,L3B67 ; NZ=128K mode ; In 48K mode - RST 18H ; replicate code from standard ROM that the patch over-wrote - CP $0D + CP #0D RET ; In 128K mode -L3B67: LD HL,$0115 ; Handle in Editor ROM by jumping to Vector table entry in Editor ROM -> JP #18A8 +L3B67: LD HL,#0115 ; Handle in Editor ROM by jumping to Vector table entry in Editor ROM -> JP #18A8 JR L3B49 ; -------------------------------------- @@ -19078,7 +19020,7 @@ L3B67: LD HL,$0115 ; Handle in Editor ROM by jumping to Vector tabl ;; KEYSCAN2 L3B6C: CALL L028E ; KEYSCAN Scan the keyboard - LD C,$00 + LD C,#00 JR NZ,L3B80 ; NZ=multiple keys CALL L031E ; K_TEST @@ -19090,7 +19032,7 @@ L3B6C: CALL L028E ; KEYSCAN Scan the keyboard JP L2657 ; S_CONT Get string and continue scanning ;; KPI_SCAN -L3B80: BIT 4,(IY+$01) ; 128K mode? +L3B80: BIT 4,(IY+#01) ; 128K mode? JP Z,L2660 ; S_IK$_STK Z=no, stack keyboard code DI ; Disable interrupts whilst scanning @@ -19106,27 +19048,27 @@ L3B80: BIT 4,(IY+$01) ; 128K mode? JP L2657 ; S_CONT Get string and continue scanning ;; KPI_INVALID -L3B9A: LD C,$00 ; Signal no key, i.e. length=0 +L3B9A: LD C,#00 ; Signal no key, i.e. length=0 JP L2660 ; S_IK$_STK ; --------------------- ; PRINT TOKEN/UDG PATCH ; --------------------- -L3B9F: CP $A3 ; SPECTRUM (T) +L3B9F: CP #A3 ; SPECTRUM (T) JR Z,L3BAF - CP $A4 ; PLAY (U) + CP #A4 ; PLAY (U) JR Z,L3BAF ; In 48K mode here -L3BA7: SUB $A5 ; Check as per original ROM - JP NC,$0B5F +L3BA7: SUB #A5 ; Check as per original ROM + JP NC,#0B5F - JP $0B56 ; Rejoin original ROM routine + JP #0B56 ; Rejoin original ROM routine -L3BAF: BIT 4,(IY+$01) ; FLAGS3 - Bit 4=1 if in 128K mode +L3BAF: BIT 4,(IY+#01) ; FLAGS3 - Bit 4=1 if in 128K mode JR Z,L3BA7 ; Rejoin code for when in 48K mode ; In 128K mode here @@ -19134,14 +19076,14 @@ L3BAF: BIT 4,(IY+$01) ; FLAGS3 - Bit 4=1 if in 128K mode LD DE,L3BC9 PUSH DE ; Stack return address - SUB $A3 ; Check whether the SPECTRUM token + SUB #A3 ; Check whether the SPECTRUM token LD DE,L3BD2 ; SPECTRUM token JR Z,L3BC3 LD DE,L3BDA ; PLAY token -L3BC3: LD A,$04 ; Signal not RND, INKEY$ or PI so that a trailing space is printed +L3BC3: LD A,#04 ; Signal not RND, INKEY$ or PI so that a trailing space is printed PUSH AF JP L0C17 ; Rejoin printing routine PO-TABLE+3 @@ -19149,31 +19091,28 @@ L3BC3: LD A,$04 ; Signal not RND, INKEY$ or PI so that a trailin L3BC9: SCF ; Return as if no trailing space - BIT 1,(IY+$01) ; Test if printer is in use + BIT 1,(IY+#01) ; Test if printer is in use RET NZ ; NZ=printer in use - JP $0B03 ; PO-FETCH - Return via Position Fetch routine + JP #0B03 ; PO-FETCH - Return via Position Fetch routine -L3BD2: DEFM "SPECTRU" ; SPECTRUM token - DEFB 'M'+$80 - -L3BDA: DEFM "PLA" ; PLAY token - DEFB 'Y'+$80 +L3BD2: DC "SPECTRUM" ; SPECTRUM token +L3BDA: DC "PLAY" ; PLAY token ;; KP_SCAN2 L3BDE: JP L3C01 ; This is not called from either ROM. It can be used to scan the keypad. -L3BE1: DEFB $00, $00, $00 ; Unused locations - DEFB $00, $00, $00 - DEFB $00, $00, $00 - DEFB $00, $00, $00 - DEFB $00, $00, $00 - DEFB $00, $00, $00 - DEFB $00, $00, $00 - DEFB $00, $00, $00 - DEFB $00, $00, $00 - DEFB $00, $00, $00 - DEFB $FF, $FF +L3BE1: DEFB #00, #00, #00 ; Unused locations + DEFB #00, #00, #00 + DEFB #00, #00, #00 + DEFB #00, #00, #00 + DEFB #00, #00, #00 + DEFB #00, #00, #00 + DEFB #00, #00, #00 + DEFB #00, #00, #00 + DEFB #00, #00, #00 + DEFB #00, #00, #00 + DEFB #FF, #FF ;; KP_SCAN L3C01: JP L39A0 ; This was to be called via the vector table in the EDITOR ROM but due to a programming error it never gets called. @@ -19196,26 +19135,26 @@ L3C0D: JP L3C10 ; shown the year '1986' in varying ink colours. This leads to a display that shows all possible ink colours on all possible paper colours. ;; TV_TUNER -L3C10: LD A,$7F ; Test for the BREAK key - IN A,($FE) +L3C10: LD A,#7F ; Test for the BREAK key + IN A,(#FE) RRA RET C ; C=SPACE not pressed - LD A,$FE - IN A,($FE) + LD A,#FE + IN A,(#FE) RRA RET C ; C=SPACE not pressed - LD A,$07 - OUT ($FE),A ; Set the border to white + LD A,#07 + OUT (#FE),A ; Set the border to white - LD A,$02 ; Open channel 2 (main screen) - CALL $1601 + LD A,#02 ; Open channel 2 (main screen) + CALL #1601 XOR A - LD ($5C3C),A ; [TV_FLAG] Signal using main screen + LD (#5C3C),A ; [TV_FLAG] Signal using main screen - LD A,$16 ; Print character 'AT' + LD A,#16 ; Print character 'AT' RST 10H XOR A ; Print character '0' @@ -19224,7 +19163,7 @@ L3C10: LD A,$7F ; Test for the BREAK key XOR A ; Print character '0' RST 10H - LD E,$08 ; Number of characters per colour + LD E,#08 ; Number of characters per colour LD B,E ; Paper counter + 1 LD D,B ; Ink counter + 1 @@ -19236,7 +19175,7 @@ L3C34: LD A,B ; Calculate the paper colour RL A ADD A,D ; Add the ink colour DEC A - LD ($5C8F),A ; [ATTR_T] Store as temporary attribute value + LD (#5C8F),A ; [ATTR_T] Store as temporary attribute value LD HL,L3C8F ; TVT_DATA Point to the 'year' data LD C,E ; Get number of characters to print @@ -19254,18 +19193,18 @@ L3C45: LD A,(HL) ; Fetch a character from the data DEC D ; Next ink colour JR NZ,L3C34 ; Produce next row with new ink colour - LD HL,$4800 ; Point to 2nd third of display file + LD HL,#4800 ; Point to 2nd third of display file LD D,H LD E,L INC DE ; Point to the next display cell XOR A LD (HL),A ; Clear first display cell - LD BC,$0FFF + LD BC,#0FFF LDIR ; Clear lower 2 thirds of display file EX DE,HL ; HL points to start of attributes file - LD DE,$5900 ; Point to 2nd third of attributes file - LD BC,$0200 + LD DE,#5900 ; Point to 2nd third of attributes file + LD BC,#0200 LDIR ; Copy screen attributes ; Now that the display has been constructed, produce a continuous cycle of a 440 Hz tone for 1 second followed by a period of silence for 1 second (actually 962ms). @@ -19273,11 +19212,11 @@ L3C45: LD A,(HL) ; Fetch a character from the data DI ; Disable interrupts so that a pure tone can be generated ;; TVT_TONE -L3C68: LD DE,$0370 ; DE=twice the tone frequency in Hz - LD L,$07 ; Border colour of white +L3C68: LD DE,#0370 ; DE=twice the tone frequency in Hz + LD L,#07 ; Border colour of white ;; TVT_DURATION -L3C6D: LD BC,$0099 ; Delay for 950.4us +L3C6D: LD BC,#0099 ; Delay for 950.4us ;; TVT_PERIOD L3C70: DEC BC @@ -19286,9 +19225,9 @@ L3C70: DEC BC JR NZ,L3C70 LD A,L - XOR $10 ; Toggle the speaker output whilst + XOR #10 ; Toggle the speaker output whilst LD L,A ; preserving the border colour - OUT ($FE),A + OUT (#FE),A DEC DE ; Generate the tone for 1 second LD A,D @@ -19297,7 +19236,7 @@ L3C70: DEC BC ; At this point the speaker is turned off, so delay for 1 second. - LD BC,$0000 ; Delay for 480.4us + LD BC,#0000 ; Delay for 480.4us ;; TVT_DELAY1 L3C83: DEC BC @@ -19314,45 +19253,57 @@ L3C88: DEC BC ; Delay for 480.4us JR L3C68 ; Repeat the tone cycle ;; TVT_DATA -L3C8F: DEFB $13, $00 ; Bright, off - DEFB $31, $39 ; '1', '9' - DEFB $13, $01 ; Bright, on - DEFB $38, $36 ; '8', '6' - +L3C8F: DEFB #13, #00 ; Bright, off + DEFB #31, #39 ; '1', '9' + DEFB #13, #01 ; Bright, on + DEFB #38, #36 ; '8', '6' +L3C97: ; ------ ; UNUSED ; ------ -L3C97: - BLOCK #3CF0-$,0 ;15600 + BLOCK #3CF0-$,0 ;15600 ;> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >; ; ╔═══════════════════════════╗ ; ║ дополнения для SP48 !! ║ ; ║ для перехода EXP-BAS48 ║ ; ║ 16 байт + 22 байта ║ ; ╚═══════════════════════════╝ - - LD HL,#C0 ; POINT - вход в MENU из BASIC 48. for ZX_MODE.ASM - RET_FROM_BIOS_TO_BASIC48 + ;!FIXIT сделать выбор страницы макросом с условиями компиляции, + ;чтоб можно было компилить vROM как для работы с ПЗУ, так и полностью без него + LD HL,#C0 ; POINT - вход в MENU из BASIC 48. for ZX_MODE.ASM - RET_FROM_BIOS_TO_BASIC48 + //LD HL,#3CF0 ; POINT - вход в MENU из BASIC 48. for ZX_MODE.ASM - RET_FROM_BIOS_TO_BASIC48 JR JMP_EX +;> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >; +;> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >; BLOCK #3CF8-$,0 JMP_EX: PUSH HL PUSH AF - LD A,ROM.BIOS ; переход в BIOS - OUT (CNF_PORT.ON),A + + //LD A,ROM.BIOS ; переход в BIOS + //LD A,ROM.EXPANSION ; переход в EXPANSION + + ;!FIXIT сделать выбор страницы макросом с условиями компиляции, + ;чтоб можно было компилить vROM как для работы с ПЗУ, так и полностью без него + //LD A,0 + //OUT (CNF_PORT.ON),A + LD A,ROM.EXTENSION + OUT (SYS_PORT.ROM),A + ; POP AF RET ; возврат ;< < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < <; - BLOCK $3D00-$,00 ;15616 + BLOCK #3D00-$,00 ;15616 ; ------------------------------- ; THE 'ZX SPECTRUM CHARACTER SET' ; ------------------------------- - +;; font ;; char-set -; $20 - Character: ' ' CHR$(32) +; #20 - Character: ' ' CHR$(32) L3D00: DEFB %00000000 DEFB %00000000 @@ -19363,7 +19314,7 @@ L3D00: DEFB %00000000 DEFB %00000000 DEFB %00000000 -; $21 - Character: '!' CHR$(33) +; #21 - Character: '!' CHR$(33) DEFB %00000000 DEFB %00010000 @@ -19374,7 +19325,7 @@ L3D00: DEFB %00000000 DEFB %00010000 DEFB %00000000 -; $22 - Character: '"' CHR$(34) +; #22 - Character: '"' CHR$(34) DEFB %00000000 DEFB %00100100 @@ -19385,7 +19336,7 @@ L3D00: DEFB %00000000 DEFB %00000000 DEFB %00000000 -; $23 - Character: '#' CHR$(35) +; #23 - Character: '#' CHR$(35) DEFB %00000000 DEFB %00100100 @@ -19396,7 +19347,7 @@ L3D00: DEFB %00000000 DEFB %00100100 DEFB %00000000 -; $24 - Character: '$' CHR$(36) +; #24 - Character: '$' CHR$(36) DEFB %00000000 DEFB %00001000 @@ -19407,7 +19358,7 @@ L3D00: DEFB %00000000 DEFB %00111110 DEFB %00001000 -; $25 - Character: '%' CHR$(37) +; #25 - Character: '%' CHR$(37) DEFB %00000000 DEFB %01100010 @@ -19418,7 +19369,7 @@ L3D00: DEFB %00000000 DEFB %01000110 DEFB %00000000 -; $26 - Character: '&' CHR$(38) +; #26 - Character: '&' CHR$(38) DEFB %00000000 DEFB %00010000 @@ -19429,7 +19380,7 @@ L3D00: DEFB %00000000 DEFB %00111010 DEFB %00000000 -; $27 - Character: ''' CHR$(39) +; #27 - Character: ''' CHR$(39) DEFB %00000000 DEFB %00001000 @@ -19440,7 +19391,7 @@ L3D00: DEFB %00000000 DEFB %00000000 DEFB %00000000 -; $28 - Character: '(' CHR$(40) +; #28 - Character: '(' CHR$(40) DEFB %00000000 DEFB %00000100 @@ -19451,7 +19402,7 @@ L3D00: DEFB %00000000 DEFB %00000100 DEFB %00000000 -; $29 - Character: ')' CHR$(41) +; #29 - Character: ')' CHR$(41) DEFB %00000000 DEFB %00100000 @@ -19462,7 +19413,7 @@ L3D00: DEFB %00000000 DEFB %00100000 DEFB %00000000 -; $2A - Character: '*' CHR$(42) +; #2A - Character: '*' CHR$(42) DEFB %00000000 DEFB %00000000 @@ -19473,7 +19424,7 @@ L3D00: DEFB %00000000 DEFB %00010100 DEFB %00000000 -; $2B - Character: '+' CHR$(43) +; #2B - Character: '+' CHR$(43) DEFB %00000000 DEFB %00000000 @@ -19484,7 +19435,7 @@ L3D00: DEFB %00000000 DEFB %00001000 DEFB %00000000 -; $2C - Character: ',' CHR$(44) +; #2C - Character: ',' CHR$(44) DEFB %00000000 DEFB %00000000 @@ -19495,7 +19446,7 @@ L3D00: DEFB %00000000 DEFB %00001000 DEFB %00010000 -; $2D - Character: '-' CHR$(45) +; #2D - Character: '-' CHR$(45) DEFB %00000000 DEFB %00000000 @@ -19506,7 +19457,7 @@ L3D00: DEFB %00000000 DEFB %00000000 DEFB %00000000 -; $2E - Character: '.' CHR$(46) +; #2E - Character: '.' CHR$(46) DEFB %00000000 DEFB %00000000 @@ -19517,7 +19468,7 @@ L3D00: DEFB %00000000 DEFB %00011000 DEFB %00000000 -; $2F - Character: '/' CHR$(47) +; #2F - Character: '/' CHR$(47) DEFB %00000000 DEFB %00000000 @@ -19528,7 +19479,7 @@ L3D00: DEFB %00000000 DEFB %00100000 DEFB %00000000 -; $30 - Character: '0' CHR$(48) +; #30 - Character: '0' CHR$(48) DEFB %00000000 DEFB %00111100 @@ -19539,7 +19490,7 @@ L3D00: DEFB %00000000 DEFB %00111100 DEFB %00000000 -; $31 - Character: '1' CHR$(49) +; #31 - Character: '1' CHR$(49) DEFB %00000000 DEFB %00011000 @@ -19550,7 +19501,7 @@ L3D00: DEFB %00000000 DEFB %00111110 DEFB %00000000 -; $32 - Character: '2' CHR$(50) +; #32 - Character: '2' CHR$(50) DEFB %00000000 DEFB %00111100 @@ -19561,7 +19512,7 @@ L3D00: DEFB %00000000 DEFB %01111110 DEFB %00000000 -; $33 - Character: '3' CHR$(51) +; #33 - Character: '3' CHR$(51) DEFB %00000000 DEFB %00111100 @@ -19572,7 +19523,7 @@ L3D00: DEFB %00000000 DEFB %00111100 DEFB %00000000 -; $34 - Character: '4' CHR$(52) +; #34 - Character: '4' CHR$(52) DEFB %00000000 DEFB %00001000 @@ -19583,7 +19534,7 @@ L3D00: DEFB %00000000 DEFB %00001000 DEFB %00000000 -; $35 - Character: '5' CHR$(53) +; #35 - Character: '5' CHR$(53) DEFB %00000000 DEFB %01111110 @@ -19594,7 +19545,7 @@ L3D00: DEFB %00000000 DEFB %00111100 DEFB %00000000 -; $36 - Character: '6' CHR$(54) +; #36 - Character: '6' CHR$(54) DEFB %00000000 DEFB %00111100 @@ -19605,7 +19556,7 @@ L3D00: DEFB %00000000 DEFB %00111100 DEFB %00000000 -; $37 - Character: '7' CHR$(55) +; #37 - Character: '7' CHR$(55) DEFB %00000000 DEFB %01111110 @@ -19616,7 +19567,7 @@ L3D00: DEFB %00000000 DEFB %00010000 DEFB %00000000 -; $38 - Character: '8' CHR$(56) +; #38 - Character: '8' CHR$(56) DEFB %00000000 DEFB %00111100 @@ -19627,7 +19578,7 @@ L3D00: DEFB %00000000 DEFB %00111100 DEFB %00000000 -; $39 - Character: '9' CHR$(57) +; #39 - Character: '9' CHR$(57) DEFB %00000000 DEFB %00111100 @@ -19638,7 +19589,7 @@ L3D00: DEFB %00000000 DEFB %00111100 DEFB %00000000 -; $3A - Character: ':' CHR$(58) +; #3A - Character: ':' CHR$(58) DEFB %00000000 DEFB %00000000 @@ -19649,7 +19600,7 @@ L3D00: DEFB %00000000 DEFB %00010000 DEFB %00000000 -; $3B - Character: ';' CHR$(59) +; #3B - Character: ';' CHR$(59) DEFB %00000000 DEFB %00000000 @@ -19660,7 +19611,7 @@ L3D00: DEFB %00000000 DEFB %00010000 DEFB %00100000 -; $3C - Character: '<' CHR$(60) +; #3C - Character: '<' CHR$(60) DEFB %00000000 DEFB %00000000 @@ -19671,7 +19622,7 @@ L3D00: DEFB %00000000 DEFB %00000100 DEFB %00000000 -; $3D - Character: '=' CHR$(61) +; #3D - Character: '=' CHR$(61) DEFB %00000000 DEFB %00000000 @@ -19682,7 +19633,7 @@ L3D00: DEFB %00000000 DEFB %00000000 DEFB %00000000 -; $3E - Character: '>' CHR$(62) +; #3E - Character: '>' CHR$(62) DEFB %00000000 DEFB %00000000 @@ -19693,7 +19644,7 @@ L3D00: DEFB %00000000 DEFB %00010000 DEFB %00000000 -; $3F - Character: '?' CHR$(63) +; #3F - Character: '?' CHR$(63) DEFB %00000000 DEFB %00111100 @@ -19704,7 +19655,7 @@ L3D00: DEFB %00000000 DEFB %00001000 DEFB %00000000 -; $40 - Character: '@' CHR$(64) +; #40 - Character: '@' CHR$(64) DEFB %00000000 DEFB %00111100 @@ -19715,7 +19666,7 @@ L3D00: DEFB %00000000 DEFB %00111100 DEFB %00000000 -; $41 - Character: 'A' CHR$(65) +; #41 - Character: 'A' CHR$(65) DEFB %00000000 DEFB %00111100 @@ -19726,7 +19677,7 @@ L3D00: DEFB %00000000 DEFB %01000010 DEFB %00000000 -; $42 - Character: 'B' CHR$(66) +; #42 - Character: 'B' CHR$(66) DEFB %00000000 DEFB %01111100 @@ -19737,7 +19688,7 @@ L3D00: DEFB %00000000 DEFB %01111100 DEFB %00000000 -; $43 - Character: 'C' CHR$(67) +; #43 - Character: 'C' CHR$(67) DEFB %00000000 DEFB %00111100 @@ -19748,7 +19699,7 @@ L3D00: DEFB %00000000 DEFB %00111100 DEFB %00000000 -; $44 - Character: 'D' CHR$(68) +; #44 - Character: 'D' CHR$(68) DEFB %00000000 DEFB %01111000 @@ -19759,7 +19710,7 @@ L3D00: DEFB %00000000 DEFB %01111000 DEFB %00000000 -; $45 - Character: 'E' CHR$(69) +; #45 - Character: 'E' CHR$(69) DEFB %00000000 DEFB %01111110 @@ -19770,7 +19721,7 @@ L3D00: DEFB %00000000 DEFB %01111110 DEFB %00000000 -; $46 - Character: 'F' CHR$(70) +; #46 - Character: 'F' CHR$(70) DEFB %00000000 DEFB %01111110 @@ -19781,7 +19732,7 @@ L3D00: DEFB %00000000 DEFB %01000000 DEFB %00000000 -; $47 - Character: 'G' CHR$(71) +; #47 - Character: 'G' CHR$(71) DEFB %00000000 DEFB %00111100 @@ -19792,7 +19743,7 @@ L3D00: DEFB %00000000 DEFB %00111100 DEFB %00000000 -; $48 - Character: 'H' CHR$(72) +; #48 - Character: 'H' CHR$(72) DEFB %00000000 DEFB %01000010 @@ -19803,7 +19754,7 @@ L3D00: DEFB %00000000 DEFB %01000010 DEFB %00000000 -; $49 - Character: 'I' CHR$(73) +; #49 - Character: 'I' CHR$(73) DEFB %00000000 DEFB %00111110 @@ -19814,7 +19765,7 @@ L3D00: DEFB %00000000 DEFB %00111110 DEFB %00000000 -; $4A - Character: 'J' CHR$(74) +; #4A - Character: 'J' CHR$(74) DEFB %00000000 DEFB %00000010 @@ -19825,7 +19776,7 @@ L3D00: DEFB %00000000 DEFB %00111100 DEFB %00000000 -; $4B - Character: 'K' CHR$(75) +; #4B - Character: 'K' CHR$(75) DEFB %00000000 DEFB %01000100 @@ -19836,7 +19787,7 @@ L3D00: DEFB %00000000 DEFB %01000010 DEFB %00000000 -; $4C - Character: 'L' CHR$(76) +; #4C - Character: 'L' CHR$(76) DEFB %00000000 DEFB %01000000 @@ -19847,7 +19798,7 @@ L3D00: DEFB %00000000 DEFB %01111110 DEFB %00000000 -; $4D - Character: 'M' CHR$(77) +; #4D - Character: 'M' CHR$(77) DEFB %00000000 DEFB %01000010 @@ -19858,7 +19809,7 @@ L3D00: DEFB %00000000 DEFB %01000010 DEFB %00000000 -; $4E - Character: 'N' CHR$(78) +; #4E - Character: 'N' CHR$(78) DEFB %00000000 DEFB %01000010 @@ -19869,7 +19820,7 @@ L3D00: DEFB %00000000 DEFB %01000010 DEFB %00000000 -; $4F - Character: 'O' CHR$(79) +; #4F - Character: 'O' CHR$(79) DEFB %00000000 DEFB %00111100 @@ -19880,7 +19831,7 @@ L3D00: DEFB %00000000 DEFB %00111100 DEFB %00000000 -; $50 - Character: 'P' CHR$(80) +; #50 - Character: 'P' CHR$(80) DEFB %00000000 DEFB %01111100 @@ -19891,7 +19842,7 @@ L3D00: DEFB %00000000 DEFB %01000000 DEFB %00000000 -; $51 - Character: 'Q' CHR$(81) +; #51 - Character: 'Q' CHR$(81) DEFB %00000000 DEFB %00111100 @@ -19902,7 +19853,7 @@ L3D00: DEFB %00000000 DEFB %00111100 DEFB %00000000 -; $52 - Character: 'R' CHR$(82) +; #52 - Character: 'R' CHR$(82) DEFB %00000000 DEFB %01111100 @@ -19913,7 +19864,7 @@ L3D00: DEFB %00000000 DEFB %01000010 DEFB %00000000 -; $53 - Character: 'S' CHR$(83) +; #53 - Character: 'S' CHR$(83) DEFB %00000000 DEFB %00111100 @@ -19924,7 +19875,7 @@ L3D00: DEFB %00000000 DEFB %00111100 DEFB %00000000 -; $54 - Character: 'T' CHR$(84) +; #54 - Character: 'T' CHR$(84) DEFB %00000000 DEFB %11111110 @@ -19935,7 +19886,7 @@ L3D00: DEFB %00000000 DEFB %00010000 DEFB %00000000 -; $55 - Character: 'U' CHR$(85) +; #55 - Character: 'U' CHR$(85) DEFB %00000000 DEFB %01000010 @@ -19946,7 +19897,7 @@ L3D00: DEFB %00000000 DEFB %00111100 DEFB %00000000 -; $56 - Character: 'V' CHR$(86) +; #56 - Character: 'V' CHR$(86) DEFB %00000000 DEFB %01000010 @@ -19957,7 +19908,7 @@ L3D00: DEFB %00000000 DEFB %00011000 DEFB %00000000 -; $57 - Character: 'W' CHR$(87) +; #57 - Character: 'W' CHR$(87) DEFB %00000000 DEFB %01000010 @@ -19968,7 +19919,7 @@ L3D00: DEFB %00000000 DEFB %00100100 DEFB %00000000 -; $58 - Character: 'X' CHR$(88) +; #58 - Character: 'X' CHR$(88) DEFB %00000000 DEFB %01000010 @@ -19979,7 +19930,7 @@ L3D00: DEFB %00000000 DEFB %01000010 DEFB %00000000 -; $59 - Character: 'Y' CHR$(89) +; #59 - Character: 'Y' CHR$(89) DEFB %00000000 DEFB %10000010 @@ -19990,7 +19941,7 @@ L3D00: DEFB %00000000 DEFB %00010000 DEFB %00000000 -; $5A - Character: 'Z' CHR$(90) +; #5A - Character: 'Z' CHR$(90) DEFB %00000000 DEFB %01111110 @@ -20001,7 +19952,7 @@ L3D00: DEFB %00000000 DEFB %01111110 DEFB %00000000 -; $5B - Character: '[' CHR$(91) +; #5B - Character: '[' CHR$(91) DEFB %00000000 DEFB %00001110 @@ -20012,7 +19963,7 @@ L3D00: DEFB %00000000 DEFB %00001110 DEFB %00000000 -; $5C - Character: '\' CHR$(92) +; #5C - Character: '\' CHR$(92) DEFB %00000000 DEFB %00000000 @@ -20023,7 +19974,7 @@ L3D00: DEFB %00000000 DEFB %00000100 DEFB %00000000 -; $5D - Character: ']' CHR$(93) +; #5D - Character: ']' CHR$(93) DEFB %00000000 DEFB %01110000 @@ -20034,7 +19985,7 @@ L3D00: DEFB %00000000 DEFB %01110000 DEFB %00000000 -; $5E - Character: '^' CHR$(94) +; #5E - Character: '^' CHR$(94) DEFB %00000000 DEFB %00010000 @@ -20045,7 +19996,7 @@ L3D00: DEFB %00000000 DEFB %00010000 DEFB %00000000 -; $5F - Character: '_' CHR$(95) +; #5F - Character: '_' CHR$(95) DEFB %00000000 DEFB %00000000 @@ -20056,7 +20007,7 @@ L3D00: DEFB %00000000 DEFB %00000000 DEFB %11111111 -; $60 - Character: 'ukp' CHR$(96) +; #60 - Character: 'ukp' CHR$(96) DEFB %00000000 DEFB %00011100 @@ -20067,7 +20018,7 @@ L3D00: DEFB %00000000 DEFB %01111110 DEFB %00000000 -; $61 - Character: 'a' CHR$(97) +; #61 - Character: 'a' CHR$(97) DEFB %00000000 DEFB %00000000 @@ -20078,7 +20029,7 @@ L3D00: DEFB %00000000 DEFB %00111100 DEFB %00000000 -; $62 - Character: 'b' CHR$(98) +; #62 - Character: 'b' CHR$(98) DEFB %00000000 DEFB %00100000 @@ -20089,7 +20040,7 @@ L3D00: DEFB %00000000 DEFB %00111100 DEFB %00000000 -; $63 - Character: 'c' CHR$(99) +; #63 - Character: 'c' CHR$(99) DEFB %00000000 DEFB %00000000 @@ -20100,7 +20051,7 @@ L3D00: DEFB %00000000 DEFB %00011100 DEFB %00000000 -; $64 - Character: 'd' CHR$(100) +; #64 - Character: 'd' CHR$(100) DEFB %00000000 DEFB %00000100 @@ -20111,7 +20062,7 @@ L3D00: DEFB %00000000 DEFB %00111100 DEFB %00000000 -; $65 - Character: 'e' CHR$(101) +; #65 - Character: 'e' CHR$(101) DEFB %00000000 DEFB %00000000 @@ -20122,7 +20073,7 @@ L3D00: DEFB %00000000 DEFB %00111100 DEFB %00000000 -; $66 - Character: 'f' CHR$(102) +; #66 - Character: 'f' CHR$(102) DEFB %00000000 DEFB %00001100 @@ -20133,7 +20084,7 @@ L3D00: DEFB %00000000 DEFB %00010000 DEFB %00000000 -; $67 - Character: 'g' CHR$(103) +; #67 - Character: 'g' CHR$(103) DEFB %00000000 DEFB %00000000 @@ -20144,7 +20095,7 @@ L3D00: DEFB %00000000 DEFB %00000100 DEFB %00111000 -; $68 - Character: 'h' CHR$(104) +; #68 - Character: 'h' CHR$(104) DEFB %00000000 DEFB %01000000 @@ -20155,7 +20106,7 @@ L3D00: DEFB %00000000 DEFB %01000100 DEFB %00000000 -; $69 - Character: 'i' CHR$(105) +; #69 - Character: 'i' CHR$(105) DEFB %00000000 DEFB %00010000 @@ -20166,7 +20117,7 @@ L3D00: DEFB %00000000 DEFB %00111000 DEFB %00000000 -; $6A - Character: 'j' CHR$(106) +; #6A - Character: 'j' CHR$(106) DEFB %00000000 DEFB %00000100 @@ -20177,7 +20128,7 @@ L3D00: DEFB %00000000 DEFB %00100100 DEFB %00011000 -; $6B - Character: 'k' CHR$(107) +; #6B - Character: 'k' CHR$(107) DEFB %00000000 DEFB %00100000 @@ -20188,7 +20139,7 @@ L3D00: DEFB %00000000 DEFB %00100100 DEFB %00000000 -; $6C - Character: 'l' CHR$(108) +; #6C - Character: 'l' CHR$(108) DEFB %00000000 DEFB %00010000 @@ -20199,7 +20150,7 @@ L3D00: DEFB %00000000 DEFB %00001100 DEFB %00000000 -; $6D - Character: 'm' CHR$(109) +; #6D - Character: 'm' CHR$(109) DEFB %00000000 DEFB %00000000 @@ -20210,7 +20161,7 @@ L3D00: DEFB %00000000 DEFB %01010100 DEFB %00000000 -; $6E - Character: 'n' CHR$(110) +; #6E - Character: 'n' CHR$(110) DEFB %00000000 DEFB %00000000 @@ -20221,7 +20172,7 @@ L3D00: DEFB %00000000 DEFB %01000100 DEFB %00000000 -; $6F - Character: 'o' CHR$(111) +; #6F - Character: 'o' CHR$(111) DEFB %00000000 DEFB %00000000 @@ -20232,7 +20183,7 @@ L3D00: DEFB %00000000 DEFB %00111000 DEFB %00000000 -; $70 - Character: 'p' CHR$(112) +; #70 - Character: 'p' CHR$(112) DEFB %00000000 DEFB %00000000 @@ -20243,7 +20194,7 @@ L3D00: DEFB %00000000 DEFB %01000000 DEFB %01000000 -; $71 - Character: 'q' CHR$(113) +; #71 - Character: 'q' CHR$(113) DEFB %00000000 DEFB %00000000 @@ -20254,7 +20205,7 @@ L3D00: DEFB %00000000 DEFB %00000100 DEFB %00000110 -; $72 - Character: 'r' CHR$(114) +; #72 - Character: 'r' CHR$(114) DEFB %00000000 DEFB %00000000 @@ -20265,7 +20216,7 @@ L3D00: DEFB %00000000 DEFB %00100000 DEFB %00000000 -; $73 - Character: 's' CHR$(115) +; #73 - Character: 's' CHR$(115) DEFB %00000000 DEFB %00000000 @@ -20276,7 +20227,7 @@ L3D00: DEFB %00000000 DEFB %01111000 DEFB %00000000 -; $74 - Character: 't' CHR$(116) +; #74 - Character: 't' CHR$(116) DEFB %00000000 DEFB %00010000 @@ -20287,7 +20238,7 @@ L3D00: DEFB %00000000 DEFB %00001100 DEFB %00000000 -; $75 - Character: 'u' CHR$(117) +; #75 - Character: 'u' CHR$(117) DEFB %00000000 DEFB %00000000 @@ -20298,7 +20249,7 @@ L3D00: DEFB %00000000 DEFB %00111000 DEFB %00000000 -; $76 - Character: 'v' CHR$(118) +; #76 - Character: 'v' CHR$(118) DEFB %00000000 DEFB %00000000 @@ -20309,7 +20260,7 @@ L3D00: DEFB %00000000 DEFB %00010000 DEFB %00000000 -; $77 - Character: 'w' CHR$(119) +; #77 - Character: 'w' CHR$(119) DEFB %00000000 DEFB %00000000 @@ -20320,7 +20271,7 @@ L3D00: DEFB %00000000 DEFB %00101000 DEFB %00000000 -; $78 - Character: 'x' CHR$(120) +; #78 - Character: 'x' CHR$(120) DEFB %00000000 DEFB %00000000 @@ -20331,7 +20282,7 @@ L3D00: DEFB %00000000 DEFB %01000100 DEFB %00000000 -; $79 - Character: 'y' CHR$(121) +; #79 - Character: 'y' CHR$(121) DEFB %00000000 DEFB %00000000 @@ -20342,7 +20293,7 @@ L3D00: DEFB %00000000 DEFB %00000100 DEFB %00111000 -; $7A - Character: 'z' CHR$(122) +; #7A - Character: 'z' CHR$(122) DEFB %00000000 DEFB %00000000 @@ -20353,7 +20304,7 @@ L3D00: DEFB %00000000 DEFB %01111100 DEFB %00000000 -; $7B - Character: '{' CHR$(123) +; #7B - Character: '{' CHR$(123) DEFB %00000000 DEFB %00001110 @@ -20364,7 +20315,7 @@ L3D00: DEFB %00000000 DEFB %00001110 DEFB %00000000 -; $7C - Character: '|' CHR$(124) +; #7C - Character: '|' CHR$(124) DEFB %00000000 DEFB %00001000 @@ -20375,7 +20326,7 @@ L3D00: DEFB %00000000 DEFB %00001000 DEFB %00000000 -; $7D - Character: '}' CHR$(125) +; #7D - Character: '}' CHR$(125) DEFB %00000000 DEFB %01110000 @@ -20386,7 +20337,7 @@ L3D00: DEFB %00000000 DEFB %01110000 DEFB %00000000 -; $7E - Character: '~' CHR$(126) +; #7E - Character: '~' CHR$(126) DEFB %00000000 DEFB %00010100 @@ -20397,7 +20348,7 @@ L3D00: DEFB %00000000 DEFB %00000000 DEFB %00000000 -; $7F - Character: '(c)' CHR$(127) +; #7F - Character: '(c)' CHR$(127) DEFB %00111100 DEFB %01000010 @@ -20408,6 +20359,4 @@ L3D00: DEFB %00000000 DEFB %01000010 DEFB %00111100 - END - - +; END \ No newline at end of file diff --git a/Shared_Includes b/Shared_Includes index 6e27011..a0e68ce 160000 --- a/Shared_Includes +++ b/Shared_Includes @@ -1 +1 @@ -Subproject commit 6e27011b6259b0256ce65d91a53ef1185223eafa +Subproject commit a0e68ce3a19bd47537585e49bfbf5e45fab197a1 diff --git a/TR-DOS_6.11Q_PENTAGON512.ROM b/TR-DOS_6.11Q_PENTAGON512.ROM new file mode 100644 index 0000000..503d84c Binary files /dev/null and b/TR-DOS_6.11Q_PENTAGON512.ROM differ diff --git a/TRDOS/TR_HDD_4.ASZ b/TRDOS/TR_HDD_4.ASZ new file mode 100644 index 0000000..a08b573 --- /dev/null +++ b/TRDOS/TR_HDD_4.ASZ @@ -0,0 +1,251 @@ +File_Start DEFL $ + DISPLAY "====================================================" +;███████████████████████████████████████████████████████████████████████ + +HDD_PROG: + ;!TEST 06/01/2024 убираем лишние телодвижения + ;LD C,BIOS.HDD_INIT and #BF + ;CALL HD_CMD + LD C,BIOS.HDD_INIT + CALL EXP_FNS + ; + JP C,HDD_PROG_E + LD HL,SYS_PAGE.HD_IDF_ADR.ModelNum + LD B,32 +HDD_PROG_L: + DI + IN A,(SLOT3) + LD D,A + LD A,SYS_PAGE + OUT (SLOT3),A + LD A,L + XOR 1 + LD L,A + LD C,(HL) + LD A,L + XOR 1 + LD L,A + INC HL + LD A,D + OUT (SLOT3),A +; RET_PAGE3 + EI + LD A,C + PUSH BC + RST #10 + POP BC + DJNZ HDD_PROG_L + ;!TEST 06/01/2024 убираем лишние телодвижения + ;LD C,BIOS.HDD_RECAL and #BF + ;CALL HD_CMD + LD C,BIOS.HDD_RECAL + CALL EXP_FNS + ; + JP NC,AUTO_03E1 + +HDD_ERROR: + CALL PRINT_HEX_A + LD HL,HD_TX + JP AUTO_03E4 + +; JP AUTO_03E1 + +HDD_PROG_E: + LD HL,HD_TX2 + JP AUTO_03E4 + +; +HDD_SET: +.loop: LD A,(DE) + INC DE + CP " " + JR Z,.loop + CP "\r" + JR Z,.check + ; + DEC DE + DEC DE + JP CHOOSE_HDD + ; +; [x] new tr-hdd +.check: DI + LD C,SLOT3 + IN B,(C) + LD A,SYS_PAGE + OUT (SLOT3),A + ; + LD E,DRIVE_CODES.TRDOS.HDD + LD A,(SYS_PAGE.CURRENT_DIR_DRIVE_COPY) + CP #FF + JR Z,.init + CP E + JR C,.init + ; + LD (SYS_PAGE.CURRENT_DIR_DRIVE),A + OUT (C),B + PUSH DE + AND #0F + LD C,BIOS.HDD_PART + CALL EXP_FNS + POP DE + JR C,CHOOSE_HDD.error + JR .exit + ; +.init: OUT (C),B + PUSH DE + LD C,BIOS.HDD_INIT + CALL EXP_FNS + POP DE + JP C,HDD_PROG_E + ; +.exit: LD C,BIOS.SET_DISK_REDIR + JP EXP_FNS + + +;[x] 29/01/2024 +;выход: A: bit1 - Primary/Secondary, bit0 - master/slave, bit2..3: использующийся раздел в MBR +CHOOSE_HDD: +.loop: LD A,(DE) + INC DE + CP " " + JR Z,.loop + LD A,(DE) + CP "\r" + JR Z,.error + ; номер раздела + LD A,(DE) + CP "4" + JR NC,.error + CP "0" + JR C,.error + SUB "0" + RLA + RLA + LD C,A + ; Primary/Secondary, master/slave + DEC DE + LD A,(DE) + CP "4" + JR NC,.error + CP "0" + JR C,.error + SUB "0" + OR C + ; +.part: PUSH AF + LD C,BIOS.HDD_PART + CALL EXP_FNS + POP BC + JR C,.error + ; + ; + ;CALL RESTORE_CURRENT_DIR + IN A,(SLOT3) + EX AF,AF' + LD A,SYS_PAGE + OUT (SLOT3),A + LD A,(SYS_PAGE.CURRENT_DIR_DRIVE) + CP #FF + JR Z,.skip + LD (SYS_PAGE.CURRENT_DIR_DRIVE_COPY),A + XOR A + DEC A + LD (SYS_PAGE.CURRENT_DIR_DRIVE),A +.skip: EX AF,AF' + OUT (SLOT3),A + ; + ; + ;XOR A + LD C,0 ; обнулить C + LD A,B + ;OR #40 + ;LD B,A + ; + ; PUSH AF + ; LD A,(ZX_VARS.OPER_DISK) + ; LD C,BIOS.GET_DRV_ST + ; CALL EXP_FNS + ; POP BC + ; JR C,.error + ; ; + ; AND #40 ;!HARDCODE HDD + ; LD C,A ; обнулить C + ; LD A,B + ; RET NZ + ; + PUSH BC + LD BC,(ZX_VARS.OPER_DISK - 1) + ; LD B,A + ; XOR A + LD C,BIOS.HDD_TO_DRV + CALL EXP_FNS + POP AF + RET + ; +.error: ;AND %1101'1111 + ;CP "*" + ;JR Z,.set_from_sys_page + LD HL,MSG_3 + JP ERR_EXIT + ; +; .setUp_HDD: +; PUSH BC +; LD A,(ZX_VARS.OPER_DISK) +; LD B,A +; XOR A +; LD C,BIOS.HDD_TO_DRV +; CALL EXP_FNS +; POP BC +; RET + ; +;.set_from_sys_page: +; !!! + + +; [x] new tr-hdd +RESTORE_CURRENT_DIR: + PUSH AF + ; + LD C,BIOS.GET_DISK_REDIR + CALL EXP_FNS + ;CP #40 + ;JR C,.exit_Res_Dir + ;AND #0F + LD H,A + ; + IN A,(SLOT3) + EX AF,AF' + LD A,SYS_PAGE + OUT (SLOT3),A + ; + LD A,(SYS_PAGE.CURRENT_DIR_DRIVE) + CP H + JR NZ,.exit_Res_Dir + + LD HL,(SYS_PAGE.CURRENT_DIR_SEC_L) + LD DE,(SYS_PAGE.CURRENT_DIR_SEC_H) + LD A,H + OR L + OR D + OR E + JR Z,.exit_Res_Dir + ; + LD (SYS_PAGE.MSD_CAT_SEC),HL + LD (SYS_PAGE.MSD_CAT_SEC2),DE +.exit_Res_Dir: + EX AF,AF' + OUT (SLOT3),A + POP AF + RET + ; +;███████████████████████████████████████████████████████████████████████ +BOOT_PART_2: + IF DEFtrd_boot_small + INCBIN 'build/boot.bin',248 + ELSE + INCBIN 'build/boot.bin',248,181 + ENDIF +.SIZE EQU $-BOOT_PART_2 +;███████████████████████████████████████████████████████████████████████ + DISPLAY "TR_HDD_4.ASZ size: ",/A,$-File_Start + DISPLAY "====================================================" diff --git a/TRDOS/TR_MSD_2.ASZ b/TRDOS/TR_MSD_2.ASZ deleted file mode 100644 index 5677375..0000000 --- a/TRDOS/TR_MSD_2.ASZ +++ /dev/null @@ -1,609 +0,0 @@ -; -; for INCLUDE -; MS-DOS system -; -;********************************** - -MSDOS_FIND_FILE: - PUSH DE ; ИМЯ ИСКОМОГО ФАЙЛА - CALL MSDOS_1ST_FL - POP DE - RET C -FIND_LOOP_ALL: - CALL MSDOS_KOMP_FL - RET Z ; ВОЗВРАТ - ФАЙЛ НАЙДЕН !! -MSDOS_FIND_NEXT: - CALL MSDOS_NEXT_FL - JR NC,FIND_LOOP_ALL - RET - -;*********************************************** -; -;*********************************************** -MSDOS_1ST_FL: - PUSH DE - CALL READ_BPB - CALL READ_1ST_DIR - POP DE -MSDOS_TEST_FL: - PUSH DE - DI - IN A,(PAGE3) - LD E,A - LD A,SYS_PAGE - OUT (PAGE3),A - LD A,E - LD E,(HL) - OUT (PAGE3),A - EI - LD A,E - POP DE - AND A - SCF - RET Z ; КОНЕЦ КАТАЛОГА - CP 0E5H - SCF - CCF -; DEC A ; СТЕРТЫЙ ФАЙЛ -; AND A - RET -;********************************** -MSDOS_NEXT_FL: - PUSH DE - LD DE,20H - ADD HL,DE - DI - IN A,(PAGE3) - LD D,A - LD A,SYS_PAGE - OUT (PAGE3),A - LD A,(COUNT_FL) - DEC A - LD (COUNT_FL),A - LD E,A - LD A,D - OUT (PAGE3),A -; RET_PAGE3 - EI - LD A,E - POP DE - AND A ; СБРОС CF !! - JR NZ,MSDOS_TEST_FL - PUSH DE - DI - IN A,(PAGE3) - LD D,A - LD A,SYS_PAGE - OUT (PAGE3),A - LD A,(COUNT_SEC) - DEC A - LD (COUNT_SEC),A - LD E,A - LD A,D - OUT (PAGE3),A -; RET_PAGE3 - EI - LD A,E - POP DE - AND A - SCF - RET Z - PUSH DE - CALL READ_NEXT_DIR - POP DE - LD HL,MS_DIR - JR MSDOS_TEST_FL - -;********************************** -MSDOS_CAT: - PUSH DE - CALL AUTO_1D97 ; CLS - CALL OPEN_CH2 - LD A,13 - RST 10H - POP DE ; СТРОКА ПОСЛЕ CAT - -CAT_SPACES: - LD A,(DE) - CP 20H - JR NZ,CAT_NO_SPACE - INC DE - JR CAT_SPACES -CAT_NO_SPACE: - CP 13 - JR NZ,CAT_ALL - LD DE,CAT_FILES -CAT_ALL: -; CALL MSDOS_FIND_FILE - CALL MSDOS_1ST_FL - JR C,CAT_END -CAT_LOOP: - JR Z,CAT_NO_PRINT - CALL MSDOS_KOMP_FL - JR NZ,CAT_NO_PRINT - PUSH HL - PUSH DE - CALL OPEN_CH2 - POP DE - POP HL -; CALL COPY_NAME_MSD - CALL PRINT_MSD_NAME - CALL PRINT_MSD_DATS -; CALL MSDOS_FIND_NEXT -CAT_NO_PRINT: - CALL MSDOS_NEXT_FL - JR NC,CAT_LOOP -CAT_END: - CALL OPEN_CH0 - JP AUTO_03E1 - -PRINT_MSD_NAME: - PUSH HL - PUSH DE - LD HL,FL_NAME - LD A,' ' - RST 10H - LD A,' ' - RST 10H - LD B,8 -PRINT_MSD_L1: - LD A,(HL) - RST 10H - INC HL - DJNZ PRINT_MSD_L1 - LD A,' ' - RST 10H - LD B,3 -PRINT_MSD_L2: - LD A,(HL) - RST 10H - INC HL - DJNZ PRINT_MSD_L2 - LD A,6 - RST 10H - - POP DE - POP HL - RET - -PRINT_MSD_DATS: - PUSH HL - PUSH DE - LD HL,FL_PLACE+1 - LD A,(HL) - DEC HL - CALL PRINT_HEX_A - LD A,(HL) - DEC HL - CALL PRINT_HEX_A - LD A,(HL) - DEC HL - CALL PRINT_HEX_A - LD A,' ' - RST 10H - LD A,(HL) - DEC HL - CALL PRINT_HEX_A - LD A,(HL) - DEC HL - CALL PRINT_HEX_A - LD A,13 - RST 10H - POP DE - POP HL - RET -;********************************************** -CAT_FILES: DB '*.*',13 -;********************************************** -COPY_NAME_MSD: - PUSH HL - PUSH DE - DI - IN A,(PAGE3) - LD C,A - LD A,SYS_PAGE - OUT (PAGE3),A - LD A,C - LD DE,FL_NAME - LD BC,11 - LDIR - - LD BC,15 - ADD HL,BC - LD BC,5 - LDIR - - LD L,(HL) - OUT (PAGE3),A -; RET_PAGE3 - EI - LD A,L - POP DE - POP HL - AND A ; A = 0 ДЛЯ ФАЙЛА ДЛИНОЙ < 16 Мб. - RET -;********************************************* - -;****************************************************** -CMD_MSDOS: ; MS-DOS командер !! -;****************************************************** - CALL SINTAX_RET - LD HL,WORDS -LOOP_FIND2: - LD DE,(ADR_DOS_COM) - INC DE ; Пропустить / - - LD A,(HL) - AND A - JR Z,END_TAB - LD B,A - INC HL -LOOP_FIND: - LD A,(DE) - AND 223 - CP (HL) - JR NZ,NEXT_WORD - INC DE - INC HL - DJNZ LOOP_FIND - LD A,(DE) - CP 13 - JR Z,CMD_EXE1 - CP 20H - JR Z,CMD_EXE - JR NEXT_WORD2 -CMD_EXE: - INC DE -CMD_EXE1: - LD A,(HL) - INC HL - LD H,(HL) - LD L,A - CALL JP_HL - JP AUTO_03E1 -JP_HL: - JP (HL) - -NEXT_WORD: - INC HL - DJNZ NEXT_WORD -NEXT_WORD2: - INC HL - INC HL - JR LOOP_FIND2 - -END_TAB: - INC DE - LD A,(DE) - CP ':' - DEC DE - JR NZ,END_TAB3 - LD A,(DE) - AND 223 - SUB 'A' - JR C,END_TAB3 - CP 4 - JR NC,END_TAB2 - LD (OPER_DISK),A - LD (CONT_DISK),A - LD B,A - LD A,(PDOS_COPY) - AND 7CH - OR B - LD (PDOS_COPY),A - OUT (P_DOS_FF),A - JP AUTO_03E1 - -END_TAB2: - SUB 4 - CP RAMD_KEY_NUM - JR NC,END_TAB3 - CALL RAMD_SET1 - JP AUTO_03E1 - -END_TAB3: - LD A,0 - JP LOAD_RMD_XX - -MSD_ERR: - LD HL,MSDOS_MSG - JP AUTO_03E4 - -;************************************ - -LOAD_RMD: - CALL RAMD_SYM ; получить номер RAM-Disk из (DE) - JP C,MSD_ERR -LOAD_RMD_XX: - LD (MED_START+1),A ; сохранить - CALL MSDOS_FIND_FILE - JP C,MSD_ERR - - CALL RMD_BLKS_FL ; B - число блоков , DE - абсолютный сектор - LD A,(MED_START+1) - PUSH AF - CALL CLEAR_RMD_A ; освободить RAM-Disk A - POP AF - CALL GET_RMD_A ; установить RAM-Disk A размером B - - LD HL,0C000H - CALL MSDOS_READ_FILE - JP AUTO_03E1 - -SAVE_RMD: - CALL RAMD_SYM ; получить номер RAM-Disk из (DE) - JP C,MSD_ERR - LD (MED_START+1),A - CALL MSDOS_FIND_FILE - JP C,MSD_ERR - - CALL RMD_BLKS_FL - - LD A,(MED_START+1) - CALL TEST_RAMD ; проверить наличие RAM-Disk A размером B - JP C,MSD_ERR ; A - номер первого блока - JP Z,MSD_ERR - - LD HL,0C000H - CALL MSDOS_WRITE_FILE - JP AUTO_03E1 - -RMD_BLKS_FL: - LD A,(FL_SIZE+2) - PUSH HL - LD HL,(FL_SIZE) - LD B,A - AND A - RL L - RL H - RL B - AND A - RL L - RL H - RL B - LD A,H - OR L - JR Z,RMD_BLKS_L2 - INC B -RMD_BLKS_L2: - POP HL - RET ; B - ЧИСЛО БЛОКОВ RAM_DISK - -;**************************************** -MSDOS_KOMP_FL: ; DE - ИМЯ ФАЙЛА СО *,? - ; HL - ИМЯ В КАТАЛОГЕ - CALL COPY_NAME_MSD ; ПЕРЕМЕСТИТЬ ИМЯ В ОБЛАСТЬ TR-DOS - LD A,(FL_NAME) - AND A - JR NZ,KOMP_CONT1 - LD A,2 ; КОНЕЦ КАТАЛОГА - AND A ; NZ - ИМЯ НЕ СОВПАДАЕТ - RET - -KOMP_CONT1: - CP 0A5h - JR NZ,KOMP_CONT2 - LD A,1 ; СТЕРТЫЙ ФАЙЛ - ИМЯ НЕ СОВПАДАЕТ - AND A - RET - -KOMP_CONT2: - PUSH DE - PUSH HL - LD HL,FL_NAME - CALL MSDOS_KOMP_ALL - POP HL - POP DE - RET - -MSDOS_KOMP_ALL: - LD A,(DE) - INC DE - CP 20H - JR Z,MSDOS_KOMP_ALL - CP 13 - JR Z,KOMP_ERROR_NAME ; НЕВЕРНОЕ ИМЯ - DEC DE - - LD B,8 - CALL KOMP_TX - RET NZ - - LD A,(DE) - CP '.' - JR Z,KOMP_POINT - CP 13 - JR Z,KOMP_SPACING3 - CP 20H - JR Z,KOMP_SPACING3 -KOMP_ERROR_NAME: ; НЕВЕРНОЕ ИМЯ - LD A,1 - AND A - RET - -KOMP_POINT: - INC DE - - LD B,3 - CALL KOMP_TX - RET NZ - LD A,(DE) - CP 13 - RET Z - CP 20H - RET Z - JR KOMP_ERROR_NAME - -;**************************************************** -KOMP_TX: - LD A,(DE) - CP 13 - JR Z,KOMP_SPACING - CP 20H - JR Z,KOMP_SPACING - CP '.' - JR Z,KOMP_SPACING - CP '?' - JR Z,KOMP_EX_OK - CP '*' - JR Z,KOMP_EX_OK2 - CP 'a' - JR C,KOMP_EXEC - CP 'z'+1 - JR NC,KOMP_EXEC - AND 223 -KOMP_EXEC: - CP (HL) - RET NZ ; нет совпадения -KOMP_EX_OK: - INC DE -KOMP_EX_OK2: - INC HL - DJNZ KOMP_TX - CP '*' - JR NZ,KOMP_NO_STAR1 - INC DE -KOMP_NO_STAR1: - XOR A - RET - -KOMP_SPACING3: - LD B,3 -KOMP_SPACING: - LD A,20H -KOMP_L2: - CP (HL) - INC HL - RET NZ - DJNZ KOMP_L2 - RET - -;************************************************ - -CALC_CLAST: ; HL - стартовый кластер - PUSH BC - PUSH HL - DEC HL - DEC HL - DI - IN A,(PAGE3) - EX AF,AF' - LD A,SYS_PAGE - OUT (PAGE3),A - LD A,(MS_BPB+CLAST_SIZE) - - EX DE,HL - LD BC,0 - - LD HL,0 - LD IX,0 - -CALC_CL_LP: - ADD IX,DE - ADC HL,BC - - DEC A - JR NZ,CALC_CL_LP - - LD DE,(MSD_DAT_SEC) - LD BC,(MSD_DAT_SEC2) - - ADD IX,DE - ADC HL,BC ; HL,IX - СМЕЩЕНИЕ КЛАСТЕРА ОТ НАЧАЛА ДАННЫХ - - EX AF,AF' - OUT (PAGE3),A - - PUSH IX - EX (SP),HL - POP IX - EX DE,HL - - EI - POP HL - POP BC - RET - -HD_TX: DB ' ERR_HD',0A0H -HD_TX2: DB 'HDD not found',0A0H -MSG_3: DB 'ERROR...',0A0H -MSDOS_MSG: DB 'File not found...',0A0H -NO_MEMORY: DB 'No RAM-Disk MEM',0A0H - -WORDS: - DB 5,'CLEAR' ; очистить RAM-Disk - DW CLEAR_RAMD_X - DB 3,'CAT' ; каталог MS-DOS - DW MSDOS_CAT - DB 3,'DIR' ; каталог MS-DOS - DW MSDOS_CAT - DB 3,'HDD' ; подключить HDD - DW HDD_SET - DB 3,'FDD' ; подключить FDD - DW FDD_SET - DB 3,'RMD' ; подключить RMD - DW RAMD_SET - DB 3,'HDT' ; тест HDD - DW HDD_PROG - DB 2,'RD' ; тест RAM-Disk space - DW RAMD_FAT_PROG - DB 4,'SAVE' ; сохранить RAM-Disk - DW SAVE_RMD - DB 4,'LOAD' ; загрузить RAM-Disk - DW LOAD_RMD - DB 4,'TBON' ; включить турбо - DW TB_ONOFF - DB 5,'TBOFF' ; выключить турбо - DW TB_ONOFF - DB 4,'INIT' ; инизиализация - DW INIT_RMD - DB 8,"SPRINTER" - DW SPR_1 - DB 2,"AY" - DW AY8910 - DB 0 - -;SAVE_AUTOEXEC: -; LD C,0FEH -; CALL EXP_FNS -; RET -AY8910: - LD A,0EAH - LD C,0F3H - CALL EXP_FNS - EI - CALL AUTO_1D97 - AND A - RET - -SPR_1: - LD A,(DE) - INC DE - CP 20H - JR Z,SPR_1 - CP "1" - LD C,0F0H - JR Z,SP_1 - CP "2" - SCF - RET NZ - LD C,0F1H -SP_1: LD A,(DE) - CP 21H - CCF - RET C - CALL EXP_FNS - EI - CALL AUTO_1D97 - AND A - RET - - -;**************************************************** -;***************************************** -; ERRORS -;***************************************** -; 0 - ГЛАВНАЯ ПРОВЕРКА ПРОГРАММЫ -; 1 - НЕВЕРНЫЙ ФОРМАТ ИМЕНИ -; 2 - КОНЕЦ КАТАЛОГА -; diff --git a/TRDOS/TR_MSD_3.ASZ b/TRDOS/TR_MSD_3.ASZ index 4cc80f0..3243a8f 100644 --- a/TRDOS/TR_MSD_3.ASZ +++ b/TRDOS/TR_MSD_3.ASZ @@ -1,9 +1,17 @@ - +File_Start DEFL $ + DISPLAY "====================================================" +;███████████████████████████████████████████████████████████████████████ INIT_RMD: - LD C,9FH - CALL EXP_FNS - EI - RET + DI + LD BC,BIOS.REINIT.FREE_NO_ZX_MEM ; [ ] free zx pages! + ;!TEST 06/01/2024 сохраняем состояние прерываний зачем-то + CALL EXP_FNS + ; [ ] 23/02/2024 грохаем перехват ресета + LD A,ACEX.RET_PORT + LD BC,BIOS.SET_PORTS + JP EXP_FNS + ; + ; DI ; LD C,PAGE3 @@ -26,18 +34,17 @@ INIT_RMD: RAMD_FAT_PROG: CALL AUTO_1D97 ; CLS - CALL OPEN_CH2 - LD HL,RAMD_FAT + CALL OPEN_CH2 + LD HL,SYS_PAGE.RAM_TABLE RAMD_F_L1: DI - IN A,(PAGE3) + IN A,(SLOT3) LD C,A LD A,SYS_PAGE - OUT (PAGE3),A + OUT (SLOT3),A LD A,C LD C,(HL) - OUT (PAGE3),A -; RET_PAGE3 + OUT (SLOT3),A EI PUSH HL LD A,C @@ -48,22 +55,28 @@ RAMD_F_L1: CALL OPEN_CH0 JP AUTO_03E1 ;*************************************************************************** +;[x] исправлен баг с неработающими командами TBON/TBOFF TB_ONOFF: - DEC DE - DEC DE - LD A,(DE) - CP 'F' - JR Z,TB_OFF_EXE - CP 'f' - JR Z,TB_OFF_EXE -TB_ON_EXE: - LD C,8Fh - LD A,4 - JP EXP_FNS -TB_OFF_EXE: - LD C,8Fh - LD A,3 - JP EXP_FNS + DEC DE + DEC DE + LD A,(DE) + OR %0010'0000 + CP 'f' + LD C,BIOS.FN_TURBO + LD A,BIOS.FN_TURBO.OFF + JR Z,.set + ; + LD A,BIOS.FN_TURBO.ON +.set: JP EXP_FNS + +; TB_ON_EXE: +; LD C,BIOS.FN_TURBO +; LD A,4 +; JP EXP_FNS +; TB_OFF_EXE: +; LD C,BIOS.FN_TURBO +; LD A,3 +; JP EXP_FNS ; ;*************************************************************************** ; @@ -76,21 +89,21 @@ TB_OFF_EXE: ; загрузки ;*************************************************************************** MSDOS_WRITE_FILE: - LD (CONT_BUF_ADR),HL ; адрес загрузки - LD (MED_START),A ; страница загрузки - LD A,6 + LD (ZX_VARS.CONT_BUF_ADR),HL ; адрес загрузки + LD (ZX_VARS.MED_START),A ; страница загрузки + LD A,TRDOS_ROM_CMD.WRITE JR MSDOS_R_W_FILE ; MSDOS_READ_FILE: - LD (CONT_BUF_ADR),HL ; адрес загрузки - LD (MED_START),A ; страница загрузки - LD A,5 + LD (ZX_VARS.CONT_BUF_ADR),HL ; адрес загрузки + LD (ZX_VARS.MED_START),A ; страница загрузки + LD A,TRDOS_ROM_CMD.READ MSDOS_R_W_FILE: - LD (MED_LEN),A -; beg=start_claster ; Получить начальный кластер - LD IX,(START_CLASTER) ; стартовый кластер -; next=beg -; max=file_len ; длина в кластерах + LD (ZX_VARS.MED_LEN),A + ; beg=start_claster. Получить начальный кластер + LD IX,(ZX_VARS.START_CLUSTER) ; стартовый кластер + ; next=beg + ; max=file_len. длина в кластерах CALL GET_FILE_CLASTERS_BC ; LD A,B ; CALL PRINT_HEX_A @@ -100,14 +113,14 @@ msd_rf_cont2: ; max2=blk_len ; длина блока в кластерах ; DI ; GET_BLK_CLASTERS_L -; IN A,(PAGE3) +; IN A,(SLOT3) ; EX AF,AF' ; LD A,SYS_PAGE -; OUT (PAGE3),A +; OUT (SLOT3),A ; LD A,(C_P_B) ; LD L,A ; EX AF,AF' -; OUT (PAGE3),A +; OUT (SLOT3),A ; EI LD L,128 @@ -209,32 +222,31 @@ READ_num_clasters_from_beg: CALL CLAST_TO_SEC PUSH AF - LD A,(MED_LEN) + LD A,(ZX_VARS.MED_LEN) LD C,A - SUB 5 + SUB TRDOS_ROM_CMD.READ JR Z,CONT_XX1 DEC A JR NZ,SKEEP_XX1 + ;TRDOS_ROM_CMD.WRITE CONT_XX1: POP AF ADD A,A INC A - LOOP_128: - PUSH AF PUSH DE PUSH IX PUSH BC - LD HL,(CONT_BUF_ADR) - LD A,(MED_START) + LD HL,(ZX_VARS.CONT_BUF_ADR) + LD A,(ZX_VARS.MED_START) CALL MSD_R_W_UT - LD (CONT_BUF_ADR),HL - LD (MED_START),A + LD (ZX_VARS.CONT_BUF_ADR),HL + LD (ZX_VARS.MED_START),A POP BC POP IX @@ -265,14 +277,15 @@ SKEEP_XX1: POP IX RET ;***************************************** -MADE_next_blk: - PUSH BC - LD C,95h - CALL EXP_FNS - POP BC - INC L ; SET ZF, if END BLK !!! - LD HL,0C000H - RET +;!TODO посмотреть +; MADE_next_blk: +; PUSH BC +; LD C,BIOS.GetMemPageNext +; CALL EXP_FNS +; POP BC +; INC L ; SET ZF, if END BLK !!! +; LD HL,#C000 +; RET ;***************************************** CLAST_TO_SEC: @@ -281,14 +294,14 @@ CLAST_TO_SEC: CALL CALC_CLAST DI - IN A,(PAGE3) + IN A,(SLOT3) LD B,A LD A,SYS_PAGE - OUT (PAGE3),A - LD A,(MS_BPB+CLAST_SIZE) + OUT (SLOT3),A + LD A,(SYS_PAGE.MS_BPB+CLAST_SIZE) LD C,A LD A,B - OUT (PAGE3),A + OUT (SLOT3),A EI POP AF @@ -308,7 +321,6 @@ CLAST_TO_SEC_L2: LD B,L LD A,H POP HL - RET @@ -324,19 +336,19 @@ FAT_DE_to_HL: PUSH BC PUSH IX DI - IN A,(PAGE3) + IN A,(SLOT3) LD C,A LD A,SYS_PAGE - OUT (PAGE3),A + OUT (SLOT3),A LD A,C - LD HL,(FAT_FLAG) - LD BC,(MS_BPB+SEC_SIZE) ; размер сектора - OUT (PAGE3),A + LD HL,(SYS_PAGE.FAT_FLAG) + LD BC,(SYS_PAGE.MS_BPB+SEC_SIZE) ; размер сектора + OUT (SLOT3),A EI PUSH HL LD A,H - AND 80H + AND #80 LD C,A LD H,D LD L,E @@ -386,20 +398,20 @@ CALL_ALL: AND B LD H,A - LD BC,MS_FAT + LD BC,SYS_PAGE.MS_FAT ADD HL,BC DI - IN A,(PAGE3) + IN A,(SLOT3) LD C,A LD A,SYS_PAGE - OUT (PAGE3),A + OUT (SLOT3),A LD A,C - LD (FAT_FLAG),DE + LD (SYS_PAGE.FAT_FLAG),DE LD C,(HL) ; считать кластер INC HL LD B,(HL) INC HL - OUT (PAGE3),A + OUT (SLOT3),A ; RET_PAGE3 EI POP AF @@ -412,18 +424,18 @@ FAT_HALF_L: JR NZ,FAT_HALF_L FAT_HALF: BIT 7,D - LD A,0FFH + LD A,#FF JR NZ,FAT_16_L2 - LD A,0FH + LD A,#0F AND B LD B,A - LD A,0FH + LD A,#0F FAT_16_L2: CP B JR NZ,NO_END_CLAST -FAT_ALL: +;FAT_ALL: LD A,C - CP 0F0H + CP #F0 JR C,NO_END_CLAST LD L,C LD H,B @@ -433,9 +445,17 @@ FAT_ALL: POP AF SCF RET +;----------------------------------------------------------------------- - BLOCK #09FF-$, #FF - BLOCK #0A01-$, #FF +;----------------------------------------------------------------------- + + ;INCLUDE 'trdos/tr_msd_4.asz' + +;----------------------------------------------------------------------- + _mInfoBLOCK #09FF-$, #FF + ;родионовский вектор прерывания + DW #FFFF +;----------------------------------------------------------------------- NO_END_CLAST: ; PUSH AF @@ -453,8 +473,9 @@ NO_END_CLAST: AND A RET -ERROR_FAT: - LD HL,MSG_3 ; ERROR +ERROR_MSG: + LD HL,MSG_3 ; ERROR msg + ;LD HL,AUTO_29B2 ; ERROR msg JP AUTO_03E4 ;********************************************** @@ -469,14 +490,14 @@ READ_FAT_SEC: LD D,0 DI - IN A,(PAGE3) + IN A,(SLOT3) LD L,A LD A,SYS_PAGE - OUT (PAGE3),A + OUT (SLOT3),A LD A,L - LD IX,(MSD_FAT_SEC) - LD HL,(MSD_FAT_SEC2) - OUT (PAGE3),A + LD IX,(SYS_PAGE.MSD_FAT_SEC) + LD HL,(SYS_PAGE.MSD_FAT_SEC2) + OUT (SLOT3),A EI LD BC,0 @@ -488,21 +509,20 @@ READ_FAT_SEC: PUSH HL POP IX - LD HL,(CONT_BUF_ADR) - LD A,(MED_START) + LD HL,(ZX_VARS.CONT_BUF_ADR) + LD A,(ZX_VARS.MED_START) PUSH AF PUSH HL - LD HL,MS_FAT + LD HL,SYS_PAGE.MS_FAT LD A,SYS_PAGE - LD B,2 - LD C,5 + LD BC,256*2 + TRDOS_ROM_CMD.READ CALL MSD_R_W_UT POP HL POP AF - LD (CONT_BUF_ADR),HL - LD (MED_START),A + LD (ZX_VARS.CONT_BUF_ADR),HL + LD (ZX_VARS.MED_START),A POP DE POP BC @@ -517,17 +537,17 @@ READ_FAT_SEC: GET_FILE_CLASTERS_BC: DI - IN A,(PAGE3) + IN A,(SLOT3) LD L,A LD A,SYS_PAGE - OUT (PAGE3),A + OUT (SLOT3),A LD A,L - LD HL,(CLASTER_LEN) - OUT (PAGE3),A + LD HL,(SYS_PAGE.CLUSTER_LEN) + OUT (SLOT3),A ; RET_PAGE3 EI - LD BC,(FL_SIZE) - LD A,(FL_SIZE+2) + LD BC,(ZX_VARS.FL_SIZE) + LD A,(ZX_VARS.FL_SIZE+2) LD DE,0 SCF GET_FL_CL_2: ; вычисление количества кластеров в файле @@ -545,52 +565,664 @@ GET_FL_L2: RET Z INC BC RET -;*************************************************************************** -HDD_PROG: - LD C,0 - CALL HD_CMD - JP C,HDD_PROG_E - LD HL,HD_IDF_ADR+54 - LD B,32 -HDD_PROG_L: +;********************************** +; MS-DOS system +;********************************** + +MSDOS_FIND_FILE: + PUSH DE ; ИМЯ ИСКОМОГО ФАЙЛА + CALL MSDOS_1ST_FL + POP DE + RET C +FIND_LOOP_ALL: + CALL MSDOS_KOMP_FL + RET Z ; ВОЗВРАТ - ФАЙЛ НАЙДЕН !! +;MSDOS_FIND_NEXT: + CALL MSDOS_NEXT_FL + JR NC,FIND_LOOP_ALL + RET + +;*********************************************** +; +; CHECK_BPB: +; IN A,(SLOT3) +; LD E,A +; LD A,SYS_PAGE +; DI +; OUT (SLOT3),A +; ; +; LD A,(SYS_PAGE.BPB_PARSED) +; ADD A,1 +; ; +; LD A,E +; OUT (SLOT3),A +; EI +; RET +;*********************************************** +MSDOS_1ST_FL: + PUSH DE + ; 15/07/2024 + ;CALL CHECK_BPB + CALL READ_BPB + ;CALL C,READ_BPB + ; + CALL READ_1ST_DIR + POP DE +MSDOS_TEST_FL: + PUSH DE DI - IN A,(PAGE3) + IN A,(SLOT3) + LD E,A + LD A,SYS_PAGE + OUT (SLOT3),A + LD A,E + ; [x] 07/07/2024 пропуск LFN + PUSH HL + LD DE,#0B ; FAT_DIRECTORY_RECORD.ATTRIBUT + ADD HL,DE + LD D,(HL) + POP HL + ; + LD E,(HL) + OUT (SLOT3),A + EI + ; [x] 07/07/2024 пропуск LFN + LD A,D + CP #0F ; FAT_ATTR.LFS_Entry + JR NZ,.nxt + POP DE + JR MSDOS_NEXT_FL + ; +.nxt: LD A,E + POP DE + AND A + SCF + RET Z ; КОНЕЦ КАТАЛОГА + CP #E5 + JR Z,MSDOS_NEXT_FL + AND A + RET + +;********************** +MSDOS_NEXT_FL: + PUSH DE + LD DE,32 ; FAT_DIRECTORY_RECORD size + ADD HL,DE + DI + IN A,(SLOT3) LD D,A LD A,SYS_PAGE - OUT (PAGE3),A - LD A,L - XOR 1 - LD L,A - LD C,(HL) - LD A,L - XOR 1 - LD L,A - INC HL + OUT (SLOT3),A + LD A,(SYS_PAGE.COUNT_FL) + DEC A + LD (SYS_PAGE.COUNT_FL),A + LD E,A LD A,D - OUT (PAGE3),A + OUT (SLOT3),A ; RET_PAGE3 EI - LD A,C - PUSH BC - RST 10H - POP BC - DJNZ HDD_PROG_L - LD C,1 - CALL HD_CMD - JP NC,AUTO_03E1 + LD A,E + POP DE + AND A ; СБРОС CF !! + JR NZ,MSDOS_TEST_FL + PUSH DE + DI + IN A,(SLOT3) + LD D,A + LD A,SYS_PAGE + OUT (SLOT3),A + LD A,(SYS_PAGE.COUNT_SEC) + DEC A + LD (SYS_PAGE.COUNT_SEC),A + LD E,A + LD A,D + OUT (SLOT3),A +; RET_PAGE3 + EI + LD A,E + POP DE + AND A + SCF + RET Z + PUSH DE + CALL READ_NEXT_DIR + POP DE + LD HL,SYS_PAGE.MS_DIR + JR MSDOS_TEST_FL -HDD_ERROR: +;********************************** +MSDOS_CAT: + PUSH DE + CALL AUTO_1D97 ; CLS + CALL OPEN_CH2 + LD A,"\r" + RST #10 + POP DE ; СТРОКА ПОСЛЕ CAT +.loop: LD A,(DE) + CP " " + ;JR NZ,CAT_NO_SPACE + INC DE + JR Z,.loop + DEC DE + ;CAT_NO_SPACE: + CP "\r" + JR NZ,CAT_ALL + LD DE,CAT_FILES +CAT_ALL: +; CALL MSDOS_FIND_FILE + CALL MSDOS_1ST_FL + JR C,CAT_END +CAT_LOOP: + JR Z,CAT_NO_PRINT + CALL MSDOS_KOMP_FL + JR NZ,CAT_NO_PRINT + PUSH HL + PUSH DE + CALL OPEN_CH2 + POP DE + POP HL +; CALL COPY_NAME_MSD + CALL PRINT_MSD_NAME + CALL PRINT_MSD_DATS +; CALL MSDOS_FIND_NEXT +CAT_NO_PRINT: + CALL MSDOS_NEXT_FL + JR NC,CAT_LOOP +CAT_END: + CALL OPEN_CH0 + JP AUTO_03E1 + +PRINT_MSD_NAME: + PUSH HL + PUSH DE + LD HL,ZX_VARS.FL_NAME + LD A,' ' + RST #10 + LD A,' ' + RST #10 + ; + LD B,8 +.L1: LD A,(HL) + ;AND #7F ; баг с именем, если на FAT имена с UTF8 + RST #10 + INC HL + DJNZ .L1 + ; + LD A,' ' + RST #10 + ; + LD B,3 +.L2: LD A,(HL) + ;AND #7F ; баг с именем, если на FAT имена с UTF8 + RST #10 + INC HL + DJNZ .L2 + ; + LD A,6 + RST #10 + POP DE + POP HL + RET + +PRINT_MSD_DATS: + PUSH HL + PUSH DE + LD HL,ZX_VARS.FL_PLACE+1 + LD A,(HL) + DEC HL CALL PRINT_HEX_A - LD HL,HD_TX + LD A,(HL) + DEC HL + CALL PRINT_HEX_A + LD A,(HL) + DEC HL + CALL PRINT_HEX_A + LD A,' ' + RST 10H + LD A,(HL) + DEC HL + CALL PRINT_HEX_A + LD A,(HL) + DEC HL + CALL PRINT_HEX_A + LD A,13 + RST 10H + POP DE + POP HL + RET +;********************************************** +CAT_FILES: DB '*.*',13 +;********************************************** +COPY_NAME_MSD: + PUSH HL + PUSH DE + DI + IN A,(SLOT3) + LD C,A + LD A,SYS_PAGE + OUT (SLOT3),A + LD A,C + LD DE,ZX_VARS.FL_NAME + LD BC,11 + LDIR + + LD BC,15 + ADD HL,BC + LD BC,5 + LDIR + + LD L,(HL) + OUT (SLOT3),A +; RET_PAGE3 + EI + LD A,L + POP DE + POP HL + AND A ; A = 0 ДЛЯ ФАЙЛА ДЛИНОЙ < 16 Мб. + RET +;********************************************* + +;****************************************************** +CMD_MSDOS: ; MS-DOS командер !! +;****************************************************** + CALL SINTAX_RET + LD HL,WORDS +LOOP_FIND2: + LD DE,(ZX_VARS.ADR_DOS_COM) + INC DE ; Пропустить / + + LD A,(HL) + AND A + JR Z,END_TAB + LD B,A + INC HL +LOOP_FIND: + LD A,(DE) + AND 223 + CP (HL) + JR NZ,NEXT_WORD + INC DE + INC HL + DJNZ LOOP_FIND + LD A,(DE) + CP "\r" + JR Z,CMD_EXE1 + CP ' ' + JR Z,CMD_EXE + JR NEXT_WORD2 +CMD_EXE: + INC DE +CMD_EXE1: + LD A,(HL) + INC HL + LD H,(HL) + LD L,A + CALL JP_HL + JP AUTO_03E1 +JP_HL: JP (HL) + +NEXT_WORD: + INC HL + DJNZ NEXT_WORD +NEXT_WORD2: + INC HL + INC HL + JR LOOP_FIND2 + +END_TAB: + INC DE + LD A,(DE) + CP ':' + DEC DE + JR NZ,END_TAB3 + LD A,(DE) + AND 223 + SUB 'A' + JR C,END_TAB3 + CP 4 + JR NC,END_TAB2 + LD (ZX_VARS.OPER_DISK),A + LD (ZX_VARS.CONT_DISK),A + LD B,A + LD A,(ZX_VARS.PDOS_COPY) + AND #7C + OR B + LD (ZX_VARS.PDOS_COPY),A + OUT (FDC_93.DrvCTRL),A + ; [ ] 19/07/2024 на каждый диск трдос свой раздел hdd можно замапить + LD C,BIOS.GET_DISK_REDIR + CALL EXP_FNS + CP #40 + JR C,.exit + ; + AND #0F + LD C,BIOS.HDD_PART + CALL EXP_FNS + ;LD HL,MSG_3 + ;CALL C,AUTO_03C3 + ; +.exit: JP AUTO_03E1 + +END_TAB2: + SUB 4 + CP SYS_PAGE.RAMD_KEYS.NUM + JR NC,END_TAB3 + CALL RAMD_SET1 + JP AUTO_03E1 + +END_TAB3: + LD A,0 + JP LOAD_RMD_XX + +MSD_ERR: + LD HL,MSDOS_MSG ; File not found... JP AUTO_03E4 -; JP AUTO_03E1 +;************************************ -HDD_PROG_E: - LD HL,HD_TX2 - JP AUTO_03E4 -; -;*************************************************************************** +LOAD_RMD: + CALL RAMD_SYM ; получить номер RAM-Disk из (DE) + JP C,MSD_ERR +LOAD_RMD_XX: + LD (ZX_VARS.MED_START+1),A ; сохранить + CALL MSDOS_FIND_FILE + JP C,MSD_ERR + + CALL RMD_BLKS_FL ; B - число блоков , DE - абсолютный сектор + LD A,(ZX_VARS.MED_START+1) + PUSH AF + CALL CLEAR_RMD_A ; освободить RAM-Disk A + POP AF + CALL GET_RMD_A ; установить RAM-Disk A размером B + + LD HL,#C000 + CALL MSDOS_READ_FILE + JP AUTO_03E1 + +SAVE_RMD: + CALL RAMD_SYM ; получить номер RAM-Disk из (DE) + JP C,MSD_ERR + LD (ZX_VARS.MED_START+1),A + CALL MSDOS_FIND_FILE + JP C,MSD_ERR + + CALL RMD_BLKS_FL + + LD A,(ZX_VARS.MED_START+1) + CALL TEST_RAMD ; проверить наличие RAM-Disk A размером B + JP C,MSD_ERR ; A - номер первого блока + JP Z,MSD_ERR + + LD HL,#C000 + CALL MSDOS_WRITE_FILE + JP AUTO_03E1 + +RMD_BLKS_FL: + LD A,(ZX_VARS.FL_SIZE+2) + PUSH HL + LD HL,(ZX_VARS.FL_SIZE) + LD B,A + AND A + RL L + RL H + RL B + AND A + RL L + RL H + RL B + LD A,H + OR L + JR Z,RMD_BLKS_L2 + INC B +RMD_BLKS_L2: + POP HL + RET ; B - ЧИСЛО БЛОКОВ RAM_DISK + +;**************************************** +; DE - ИМЯ ФАЙЛА СО *,? +; HL - ИМЯ В КАТАЛОГЕ +MSDOS_KOMP_FL: + CALL COPY_NAME_MSD ; ПЕРЕМЕСТИТЬ ИМЯ В ОБЛАСТЬ TR-DOS + LD A,(ZX_VARS.FL_NAME) + AND A + JR NZ,KOMP_CONT1 + LD A,2 ; КОНЕЦ КАТАЛОГА + AND A ; NZ - ИМЯ НЕ СОВПАДАЕТ + RET + +KOMP_CONT1: + CP 0A5h + JR NZ,KOMP_CONT2 + LD A,1 ; СТЕРТЫЙ ФАЙЛ - ИМЯ НЕ СОВПАДАЕТ + AND A + RET + +KOMP_CONT2: + PUSH DE + PUSH HL + LD HL,ZX_VARS.FL_NAME + CALL MSDOS_KOMP_ALL + POP HL + POP DE + RET + +MSDOS_KOMP_ALL: + LD A,(DE) + INC DE + CP " " + JR Z,MSDOS_KOMP_ALL + CP "\r" + JR Z,KOMP_ERROR_NAME ; НЕВЕРНОЕ ИМЯ + DEC DE + + LD B,8 + CALL KOMP_TX + RET NZ + + LD A,(DE) + CP "." + JR Z,KOMP_POINT + CP "\r" + JR Z,KOMP_SPACING3 + CP " " + JR Z,KOMP_SPACING3 +KOMP_ERROR_NAME: ; НЕВЕРНОЕ ИМЯ + LD A,1 + AND A + RET + +KOMP_POINT: + INC DE + + LD B,3 + CALL KOMP_TX + RET NZ + LD A,(DE) + CP 13 + RET Z + CP 20H + RET Z + JR KOMP_ERROR_NAME + +;**************************************************** +KOMP_TX: + LD A,(DE) + CP "\r" + JR Z,KOMP_SPACING + CP " " + JR Z,KOMP_SPACING + CP "." + JR Z,KOMP_SPACING + CP "?" + JR Z,KOMP_EX_OK + CP "*" + JR Z,KOMP_EX_OK2 + CP "a" + JR C,KOMP_EXEC + CP "z"+1 + JR NC,KOMP_EXEC + AND %1101'1111 +KOMP_EXEC: + CP (HL) + RET NZ ; нет совпадения +KOMP_EX_OK: + INC DE +KOMP_EX_OK2: + INC HL + DJNZ KOMP_TX + CP '*' + JR NZ,KOMP_NO_STAR1 + INC DE +KOMP_NO_STAR1: + XOR A + RET + +KOMP_SPACING3: + LD B,3 +KOMP_SPACING: + LD A,20H +KOMP_L2: + CP (HL) + INC HL + RET NZ + DJNZ KOMP_L2 + RET + +;************************************************ + +CALC_CLAST: ; HL - стартовый кластер + PUSH BC + PUSH HL + DEC HL + DEC HL + DI + IN A,(SLOT3) + EX AF,AF' + LD A,SYS_PAGE + OUT (SLOT3),A + LD A,(SYS_PAGE.MS_BPB+CLAST_SIZE) + + EX DE,HL + LD BC,0 + LD H,B + LD L,B + LD HX,B + LD LX,B + +CALC_CL_LP: + ADD IX,DE + ADC HL,BC + + DEC A + JR NZ,CALC_CL_LP + + LD DE,(SYS_PAGE.MSD_DAT_SEC) + LD BC,(SYS_PAGE.MSD_DAT_SEC2) + + ADD IX,DE + ADC HL,BC ; HL,IX - СМЕЩЕНИЕ КЛАСТЕРА ОТ НАЧАЛА ДАННЫХ + + EX AF,AF' + OUT (SLOT3),A + + PUSH IX + EX (SP),HL + POP IX + EX DE,HL + + EI + POP HL + POP BC + RET + + +HD_TX: DC ' - HDD error' +;HD_TX: DC 'HDD error #' +HD_TX2: DC 'HDD not found' +MSG_3: DC '*ERROR*' +MSDOS_MSG: DC 'File not found' +NO_MEMORY: DC 'Out of memory' +;NO_MEMORY: DC 'No RAM-Disk MEM' + +WORDS: + DB 3,'CAT' ; каталог MS-DOS + DW MSDOS_CAT + DB 3,'DIR' ; каталог MS-DOS + DW MSDOS_CAT + DB 3,'HDD' ; подключить HDD + DW HDD_SET + DB 3,'FDD' ; подключить FDD + DW FDD_SET + DB 3,'RMD' ; подключить RMD + DW RAMD_SET + DB 3,'HDT' ; тест HDD + DW HDD_PROG + DB 2,'RD' ; тест RAM-Disk space + DW RAMD_FAT_PROG + DB 4,'SAVE' ; сохранить RAM-Disk + DW SAVE_RMD + DB 4,'LOAD' ; загрузить RAM-Disk + DW LOAD_RMD + DB 4,'TBON' ; включить турбо + DW TB_ONOFF + DB 5,'TBOFF' ; выключить турбо + DW TB_ONOFF + DB 4,'INIT' ; реинизиализация + DW INIT_RMD + DB 5,'CLEAR' ; очистить RAM-Disk + DW CLEAR_RAMD_X + DB 8,"SPRINTER" + DW SPR_1 + DB 2,"AY" + DW AY8910 + DB 0 + +;SAVE_AUTOEXEC: +; LD C,0FEH +; CALL EXP_FNS +; RET +AY8910: + LD A,#EA + LD C,#F3 ;!HARDCODE BIOS.SPRINTER_ALL + CALL EXP_FNS + ;!TEST 06/01/2024 сохраняем состояние прерываний зачем-то + ;EI + ; + CALL AUTO_1D97 + AND A + RET + +SPR_1: LD A,(DE) + INC DE + CP " " + JR Z,SPR_1 + CP "1" + LD C,BIOS.RST_CONF.SP97_1 + JR Z,SP_1 + CP "2" + SCF + RET NZ + LD C,BIOS.RST_CONF.SP97_2 +SP_1: LD A,(DE) + CP " "+1 + CCF + RET C + CALL EXP_FNS + CALL AUTO_1D97 + AND A + RET + + +;**************************************************** +;***************************************** +; ERRORS +;***************************************** +; 0 - ГЛАВНАЯ ПРОВЕРКА ПРОГРАММЫ +; 1 - НЕВЕРНЫЙ ФОРМАТ ИМЕНИ +; 2 - КОНЕЦ КАТАЛОГА +;███████████████████████████████████████████████████████████████████████ + DISPLAY "TR_MSD_3.ASZ size: ",/A,$-File_Start + DISPLAY "====================================================" diff --git a/TRDOS/TR_MSD_S.ASZ b/TRDOS/TR_MSD_S.ASZ index bb1fed1..a7e7010 100644 --- a/TRDOS/TR_MSD_S.ASZ +++ b/TRDOS/TR_MSD_S.ASZ @@ -1,31 +1,35 @@ -; -; for INCLUDE +File_Start DEFL $ + DISPLAY "====================================================" +;███████████████████████████████████████████████████████████████████████ + +;******************************************** ; MS-DOS system -; ;******************************************** ; MS-DOS utilites ;******************************************** - -;************************************************ -;* Программа чтения/записи MS-DOS дисков * -;* 1. Адрес буфера - HL * -;* 2. Номер сектора - DE * -;* 3. Число секторов - B * -;* 4. Команда - C * -;* 5. Страница ОЗУ - A * -;************************************************ - -HDD_REDIR: - POP AF - CALL HD_CMD - RET NC - JP HDD_ERROR - MSD_R_W_UT: PUSH AF CALL DISK_REDIR - CP 40H - JR NC,HDD_REDIR + CP #40 + JR C,.NOT_HDD + ;************************************************ + ;* Подпрограмма чтения/записи MS-DOS дисков * + ;* 1. Адрес буфера - HL * + ;* 2. Номер сектора - DE * + ;* 3. Число секторов - B * + ;* 4. Команда - C * + ;* 5. Страница ОЗУ - A * + ;************************************************ +.HDD: POP AF + ;!TEST 06/01/2024 убираем лишние телодвижения + ;CALL HD_CMD + SET 6,C + CALL EXP_FNS + ; + RET NC + JP HDD_ERROR + ;************************************************ +.NOT_HDD: POP AF EX AF,AF' LD A,C @@ -51,7 +55,7 @@ MSD_R_W_UT: ; EX (SP),HL ; POP IX ; LD C,12H -; LD A,(OPER_DISK) +; LD A,(ZX_VARS.OPER_DISK) ; DI ; PUSH IY ; CALL HD_CMD @@ -72,7 +76,7 @@ MSD_R_W_UT: ; EX (SP),HL ; POP IX ; LD C,13H -; LD A,(OPER_DISK) +; LD A,(ZX_VARS.OPER_DISK) ; DI ; PUSH IY ; CALL HD_CMD @@ -92,45 +96,51 @@ MSD_R_W_UT: MSD_cmd4: PUSH HL - PUSH AF + ;PUSH AF ;!TEST 21/2/2024 CALL RESET_WG - POP AF + ;POP AF ;!TEST 21/2/2024 POP HL LD B,1 - LD DE,0 + ;!TEST 21/2/2024 + ; LD DE,0 + XOR A + LD D,A + LD E,A MSD_cmd5: - LD A,0 - LD (RD_WR_COM),A + ; LD A,0 + ; A=0 + LD (ZX_VARS.RD_WR_COM),A EX AF,AF' JR MSD_RWU1 MSD_cmd6: - LD A,255 - LD (RD_WR_COM),A + ; A=0 + ;LD A,255 + DEC A + LD (ZX_VARS.RD_WR_COM),A EX AF,AF' JR MSD_RWU1 PREPARE1: - LD (MED_START),A - LD (CONT_BUF_ADR),HL + LD (ZX_VARS.MED_START),A + LD (ZX_VARS.CONT_BUF_ADR),HL DI - IN A,(PAGE2) + IN A,(SLOT2) LD C,A LD A,SYS_PAGE - OUT (PAGE2),A + OUT (SLOT2),A - LD A,(DS_1440-4000H) - AND BIT_MASK_1440 + LD A,(SYS_PAGE.DS_1440-4000H) + AND SYS_PAGE.DS_1440.IS_SET SET 0,A - LD (DS_1440-4000H),A + LD (SYS_PAGE.DS_1440-4000H),A LD A,C - OUT (PAGE2),A + OUT (SLOT2),A EI CALL Z,RES_1440 CALL NZ,SET_1440 - CALL CALC_SECTOR - LD (CONT_SEC),DE - LD A,(RD_WR_COM) + LD (ZX_VARS.CONT_SEC),DE + LD A,(ZX_VARS.RD_WR_COM) RET MSD_RWU1: @@ -142,79 +152,79 @@ MSD_RWU1: MSD_R_W_LOOP: POP HL POP BC - LD A,(MED_START) + LD A,(ZX_VARS.MED_START) INC B DEC B - LD DE,(CONT_SEC) + LD DE,(ZX_VARS.CONT_SEC) RET Z DEC B PUSH BC PUSH HL - LD (CONT_BUF_ADR),HL - LD A,(CONT_SEC) - LD (SEC_NUM),A - LD A,(CONT_TRK) + LD (ZX_VARS.CONT_BUF_ADR),HL + LD A,(ZX_VARS.CONT_SEC) + LD (ZX_VARS.SEC_NUM),A + LD A,(ZX_VARS.CONT_TRK) CALL Global_trk - LD A,(RD_WR_COM) + LD A,(ZX_VARS.RD_WR_COM) OR A PUSH AF CALL Z,MSD_3F0E POP AF CALL NZ,MSD_3F0A DI - IN A,(PAGE2) - LD C,A + IN A,(SLOT2) + LD C,A LD A,SYS_PAGE - OUT (PAGE2),A - LD DE,(MS_BPB+SEC_SIZE-4000h) - LD A,C - OUT (PAGE2),A + OUT (SLOT2),A + LD DE,(SYS_PAGE.MS_BPB+SEC_SIZE-#4000) + LD A,C + OUT (SLOT2),A EI POP HL ADD HL,DE - LD A,H - OR L - JR NZ,MSD_NO_PAGE + LD A,H + OR L + JR NZ,MSD_NO_PAGE DI - IN A,(PAGE2) - LD C,A - LD A,SYS_PAGE - OUT (PAGE2),A - LD A,(MED_START) - LD HL,RAMD_FAT-4000H - LD L,A - LD L,(HL) - LD A,C - OUT (PAGE2),A + IN A,(SLOT2) + LD C,A + LD A,SYS_PAGE + OUT (SLOT2),A + LD A,(ZX_VARS.MED_START) + LD HL,SYS_PAGE.RAM_TABLE-#4000 + LD L,A + LD L,(HL) + LD A,C + OUT (SLOT2),A EI - LD A,L - LD HL,0C000H - LD (MED_START),A + LD A,L + LD HL,#C000 + LD (ZX_VARS.MED_START),A MSD_NO_PAGE: - LD (CONT_BUF_ADR),HL + LD (ZX_VARS.CONT_BUF_ADR),HL PUSH HL DI - IN A,(PAGE2) - LD C,A + IN A,(SLOT2) + LD C,A LD A,SYS_PAGE - OUT (PAGE2),A - LD A,(DS_1440-4000H) - RES 0,A - LD (DS_1440-4000H),A - LD A,(MSD_SECS-4000h) + OUT (SLOT2),A + LD A,(SYS_PAGE.DS_1440-#4000) + AND %1111'1110 + LD (SYS_PAGE.DS_1440-#4000),A + LD A,(SYS_PAGE.MSD_SECS-#4000) LD L,A - LD A,C - OUT (PAGE2),A + LD A,C + OUT (SLOT2),A EI LD A,L - LD HL,CONT_SEC + LD HL,ZX_VARS.CONT_SEC INC (HL) CP (HL) JP NZ,MSD_R_W_LOOP LD (HL),0 - LD HL,CONT_TRK + LD HL,ZX_VARS.CONT_TRK INC (HL) JP MSD_R_W_LOOP ;***************************************** @@ -226,30 +236,30 @@ MSD_3F0A: MSD_3F0E: LD A,128 MSD_3F10: - LD (COMAND_WG),A + LD (ZX_VARS.COMAND_WG),A MSD_3F13: LD D,5 ; ЧИСЛО ПОВТОРЕНИЙ MSD_3F15: PUSH DE PUSH IX DI - IN A,(PAGE3) + IN A,(SLOT3) EX AF,AF' - LD A,(MED_START) - OUT (PAGE3),A + LD A,(ZX_VARS.MED_START) + OUT (SLOT3),A AND A JR Z,NO_OFF_SCR - LD A,0C0H + LD A,#C0 OUT (RGADR),A NO_OFF_SCR: LD IX,MSD_RET_ADR - LD A,(SEC_NUM) + LD A,(ZX_VARS.SEC_NUM) INC A - OUT (WG_SEC),A - LD HL,(CONT_BUF_ADR) + OUT (FDC_93.Sector),A + LD HL,(ZX_VARS.CONT_BUF_ADR) LD C,127 - LD A,(COMAND_WG) - OUT (WG_COM),A + LD A,(ZX_VARS.COMAND_WG) + OUT (FDC_93.Command),A CP 160 JP Z,MSD_3FBA ; ЗАПИСЬ СЕКТОРА JP MSD_3FD5 ; ЧТЕНИЕ СЕКТОРА @@ -257,16 +267,15 @@ MSD_RET_ADR: LD A,0 OUT (RGADR),A EX AF,AF' - OUT (PAGE3),A + OUT (SLOT3),A POP IX POP DE EI - IN A,(WG_COM) + IN A,(FDC_93.Command) LD B,A AND 127 RET Z - -MSD_3F39: +;MSD_3F39: LD HL,READ_ONLY_MSG AND '@' JR NZ,MSD_3F4B @@ -281,7 +290,7 @@ MSD_3F48: LD HL,DISK_ERROR_MSG MSD_3F4B: LD A,208 - OUT (WG_COM),A + OUT (FDC_93.Command),A LD A,B AND 1 JP NZ,AUTO_3EE7 @@ -292,11 +301,11 @@ MSD_3F4B: RST PRINT_LN LD HL,AUTO_2A13 RST PRINT_LN - IN A,(WG_TRK) + IN A,(FDC_93.Track) CALL AUTO_1DA3 LD HL,AUTO_2A18 RST PRINT_LN - IN A,(WG_SEC) + IN A,(FDC_93.Sector) CALL AUTO_1DA3 LD HL,AUTO_29FE RST PRINT_LN @@ -310,10 +319,10 @@ MSD_3F7B: JR NZ,MSD_3F7B CALL exit_No_disk LD A,7 - LD (DOS_ERR_2),A + LD (ZX_VARS.DOS_ERR_2),A JP AUTO_01D3 MSD_3F94: - LD A,(CONT_TRK) + LD A,(ZX_VARS.CONT_TRK) CALL Global_trk CALL pause_750ms JP MSD_3F13 @@ -323,7 +332,7 @@ MSD_3FA0: CALL SWITCH_DT PUSH DE CALL AUTO_3D98 ; RESET_WG - LD A,(CONT_TRK) + LD A,(ZX_VARS.CONT_TRK) CALL Global_trk ; ПОЗИЦИОНИРОВАНИЕ POP DE JP MSD_3F15 @@ -331,25 +340,25 @@ MSD_3FA0: SWITCH_DT: DI - IN A,(PAGE2) + IN A,(SLOT2) LD C,A LD A,SYS_PAGE - OUT (PAGE2),A - LD A,(DS_1440-4000H) + OUT (SLOT2),A + LD A,(SYS_PAGE.DS_1440-4000H) BIT 0,A JR Z,NO_SW_DT - XOR BIT_MASK_1440 - LD (DS_1440-4000H),A - AND BIT_MASK_1440 + XOR SYS_PAGE.DS_1440.IS_SET + LD (SYS_PAGE.DS_1440-4000H),A + AND SYS_PAGE.DS_1440.IS_SET LD A,C - OUT (PAGE2),A + OUT (SLOT2),A EI - CALL Z,RES_1440 - CALL NZ,SET_1440 - RET + JR Z,RES_1440 + JR SET_1440 + ; NO_SW_DT: LD A,C - OUT (PAGE2),A + OUT (SLOT2),A EI RET @@ -359,8 +368,8 @@ NO_SW_DT: MSD_3FBA: LD B,4 MSD_3FBC: - IN A,(P_DOS_FF) - AND 192 + IN A,(FDC_93.DrvCTRL) + AND #C0 JR NZ,MSD_3FD1 INC DE LD A,E @@ -370,8 +379,8 @@ MSD_3FBC: MSD_RET_IX: JP (IX) MSD_3FCA: - IN A,(P_DOS_FF) - AND 192 + IN A,(FDC_93.DrvCTRL) + AND #C0 JR Z,MSD_3FCA JP M,MSD_RET_IX MSD_3FD1: @@ -383,8 +392,8 @@ MSD_3FD1: MSD_3FD5: LD B,4 MSD_3FD7: - IN A,(P_DOS_FF) - AND 192 + IN A,(FDC_93.DrvCTRL) + AND #C0 JR NZ,MSD_3FEC INC DE LD A,E @@ -394,8 +403,8 @@ MSD_3FD7: MSD_RET_IX2: JP (IX) MSD_3FE5: - IN A,(P_DOS_FF) - AND 192 + IN A,(FDC_93.DrvCTRL) + AND #C0 JR Z,MSD_3FE5 JP M,MSD_RET_IX2 MSD_3FEC: @@ -406,288 +415,283 @@ MSD_3FEC: ;**************************************** RES_1440: - LD A,01h - OUT (0BDh),A + LD A,FDD_Density.SET_720 + OUT (FDD_Density),A RET SET_1440: - LD A,21h - OUT (0BDh),A + LD A,FDD_Density.SET_1440 + OUT (FDD_Density),A RET READ_BPB: CALL DISK_REDIR - CP 40H - JR NC,HDD_REDIR2 + ; LD C,BIOS.GET_DISK_REDIR + ; CALL EXP_FNS + CP #40 + JR NC,.HDD CP 4 - JP NC,ERROR_MSDOS - + JP NC,ERROR_MSG + ; CALL SET_DISK - - CALL MAIN_BPB + ; + CALL .MAIN RET NC - JP ERROR_MSDOS - -HDD_REDIR2: - - CALL MAIN_BPB + JP ERROR_MSG + ; +.HDD: CALL .MAIN RET NC - -SPACIAL_BPB: + ; old hdd LD IX,0 - LD DE,63 + LD DE,63 ;!HARDCODE LD A,SYS_PAGE - LD HL,MS_BPB - LD C,5 - LD B,1 + LD HL,SYS_PAGE.MS_BPB + ; + LD BC,256*1 + TRDOS_ROM_CMD.READ CALL MSD_R_W_UT - CALL BPB_PARAMS + ; + CALL .PARAMS RET NC - JP ERROR_MSDOS + JP ERROR_MSG + ; +.MAIN: LD A,SYS_PAGE + LD HL,SYS_PAGE.MS_BPB + LD C,TRDOS_ROM_CMD.READ_BPB + CALL MSD_R_W_UT -MAIN_BPB: - LD IX,0 - LD DE,0 - LD A,SYS_PAGE - LD HL,MS_BPB - LD C,4 - LD B,1 - CALL MSD_R_W_UT - CALL BPB_PARAMS - RET - -; LD C,18H -; LD A,(OPER_DISK) -; CALL HD_CMD - -; DI -; IN A,(PAGE3) -; EX AF,AF' -; LD A,SYS_PAGE -; OUT (PAGE3),A -; -; LD A,(MS_BPB+S_P_T) ; Количество секторов на трек -; LD L,A -; -; EX AF,AF' -; OUT (PAGE3),A -; EI -; -; LD A,(OPER_DISK) -; LD C,19H -; CALL HD_CMD - -BPB_PARAMS: + ;CALL BPB_PARAMS + ;RET + ; + ; LD C,18H + ; LD A,(ZX_VARS.OPER_DISK) + ; CALL HD_CMD + ; ; + ; DI + ; IN A,(SLOT3) + ; EX AF,AF' + ; LD A,SYS_PAGE + ; OUT (SLOT3),A + ; ; + ; LD A,(SYS_PAGE.MS_BPB+S_P_T) ; Количество секторов на трек + ; LD L,A + ; ; + ; EX AF,AF' + ; OUT (SLOT3),A + ; EI + ; ; + ; LD A,(ZX_VARS.OPER_DISK) + ; LD C,19H + ; CALL HD_CMD +.PARAMS: DI - IN A,(PAGE3) + IN A,(SLOT3) EX AF,AF' LD A,SYS_PAGE - OUT (PAGE3),A + OUT (SLOT3),A - LD A,(MS_BPB+FORM_CODE) - CP 0F0H - JP C,ERROR_BPB + LD A,(SYS_PAGE.MS_BPB+FORM_CODE) + CP #F0 + JP C,.ERROR_BPB - LD HL,MS_BPB+FAT_ID - LD DE,FAT1_MSG + LD DE,SYS_PAGE.MS_BPB+FAT_ID + LD HL,.FAT1_MSG LD B,4 -R_BPB_L1: - LD A,(DE) +.L1: LD A,(DE) CP ' ' - JR NZ,R_BPB_L11 + JR NZ,.L11 INC DE - JR R_BPB_L1 -R_BPB_L11: - CP (HL) - JR NZ,PC_DOS_BPB + JR .L1 +.L11: CP (HL) + JR NZ,.PC_DOS INC HL INC DE - DJNZ R_BPB_L1 - LD A,(HL) + DJNZ .L1 + LD A,(DE) CP '6' - LD HL,81FFH ; FAT16 флаг - JR Z,BPB_FAT + LD HL,#81FF ; FAT16 флаг + JR Z,.FAT CP '2' - JP NZ,ERROR_BPB + JP NZ,.ERROR_BPB -PC_DOS_BPB: - LD HL,01FFH ; FAT12 флаг -BPB_FAT: - LD (FAT_FLAG),HL +.PC_DOS: + LD HL,#01FF ; FAT12 флаг +.FAT: LD (SYS_PAGE.FAT_FLAG),HL - LD A,(MS_BPB+S_P_T) ; Количество секторов на трек - LD (MSD_SECS),A + LD A,(SYS_PAGE.MS_BPB+S_P_T) ; Количество секторов на трек + LD (SYS_PAGE.MSD_SECS),A - BIT 7,H + ; BIT 7,H + ; LD IX,0 + ; LD HL,0 ; вычислить начальный сектор FAT + ; JR Z,.NO_LD_SPECIAL - LD IX,0 - LD HL,0 ; вычислить начальный сектор FAT - - JR Z,NO_LD_SPECIAL - LD IX,(MS_BPB+SPECIAL_SECS) - LD HL,(MS_BPB+SPECIAL_SECS+2) -NO_LD_SPECIAL: + LD IX,(SYS_PAGE.MS_BPB+SPECIAL_SECS) + LD HL,(SYS_PAGE.MS_BPB+SPECIAL_SECS+2) +;.NO_LD_SPECIAL: LD BC,0 - LD DE,(MS_BPB+RESERV_SECS) + LD DE,(SYS_PAGE.MS_BPB+RESERV_SECS) ADD IX,DE ADC HL,BC - LD (MSD_FAT_SEC),IX ; начальный сектор FAT - LD (MSD_FAT_SEC2),HL ; начальный сектор FAT + LD (SYS_PAGE.MSD_FAT_SEC),IX ; начальный сектор FAT + LD (SYS_PAGE.MSD_FAT_SEC2),HL ; начальный сектор FAT - LD DE,(MS_BPB+S_P_F) ; число секторов в FAT - LD BC,0 + LD DE,(SYS_PAGE.MS_BPB+S_P_F) ; число секторов в FAT + ;LD BC,0 - LD A,(MS_BPB+FATS_NUM) ; количество FATs -NEXT_ADD: + LD A,(SYS_PAGE.MS_BPB+FATS_NUM) ; количество FATs +.NEXT_ADD: ADD IX,DE ADC HL,BC DEC A - JR NZ,NEXT_ADD + JR NZ,.NEXT_ADD - LD (MSD_CAT_SEC),IX ; начальный сектор DIR - LD (MSD_CAT_SEC2),HL ; начальный сектор DIR + LD (SYS_PAGE.MSD_CAT_SEC),IX ; начальный сектор DIR + LD (SYS_PAGE.MSD_CAT_SEC2),HL ; начальный сектор DIR - LD BC,(MS_BPB+SEC_SIZE) ; Размер сектора + LD BC,(SYS_PAGE.MS_BPB+SEC_SIZE) ; Размер сектора + LD A,B RL C - RL B + RLA RL C - RL B + RLA RL C - RL B - LD C,B + RLA + LD C,A LD B,0 ; BC - число файловых записей в секторе - LD A,C - LD (F_P_S),A + LD (SYS_PAGE.FilesPerSector),A - LD DE,(MS_BPB+FLS_NUM) ; Число файловых записей + LD DE,(SYS_PAGE.MS_BPB+FLS_NUM) ; Число файловых записей EX DE,HL DEC HL XOR A -NEXT_ADD2: +.NEXT_ADD2: INC A - JR Z,ERROR_BPB + JR Z,.ERROR_BPB SBC HL,BC - JR NC,NEXT_ADD2 + JR NC,.NEXT_ADD2 EX DE,HL LD E,A ; A - число секторов в DIR - LD D,0 LD BC,0 - LD (S_P_C),A + LD D,B + LD (SYS_PAGE.SectorsPerCluster),A ADD IX,DE ; Начало DATA area ADC HL,BC - LD (MSD_DAT_SEC),IX - LD (MSD_DAT_SEC2),HL + LD (SYS_PAGE.MSD_DAT_SEC),IX + LD (SYS_PAGE.MSD_DAT_SEC2),HL - LD BC,(MS_BPB+SEC_SIZE) ; Размер сектора - LD HL,0 - LD A,(MS_BPB+CLAST_SIZE) + LD BC,(SYS_PAGE.MS_BPB+SEC_SIZE) ; Размер сектора + ; D = 0 + LD H,D + LD L,D + LD E,D + LD A,(SYS_PAGE.MS_BPB+CLAST_SIZE) LD D,A - LD A,0 -NEXT_ADD3: + XOR A +.NEXT_ADD3: ADD HL,BC ; Вычисление длины кластера - ADC A,0 + ADC A,E DEC D - JR NZ,NEXT_ADD3 + JR NZ,.NEXT_ADD3 - LD (CLASTER_LEN),HL - LD B,0 + LD (SYS_PAGE.CLUSTER_LEN),HL + LD B,E LD C,A - LD (CLASTER_LEN2),BC - - LD HL,0 - LD BC,(MS_BPB+S_P_T) - LD A,(MS_BPB+H_P_S) -BPB_L1: ; ВЫЧИСЛИТЬ КОЛИЧЕСТВО СЕКТОРОВ НА ЦИЛИНДР + LD (SYS_PAGE.CLUSTER_LEN2),BC + ; + ; DE=0 + EX DE,HL ;LD HL,0 + LD BC,(SYS_PAGE.MS_BPB+S_P_T) + LD A,(SYS_PAGE.MS_BPB+H_P_S) +.BPB_L1:; ВЫЧИСЛИТЬ КОЛИЧЕСТВО СЕКТОРОВ НА ЦИЛИНДР ADD HL,BC DEC A - JR NZ,BPB_L1 - LD (S_X_H),HL - + JR NZ,.BPB_L1 + LD (SYS_PAGE.S_X_H),HL + ; EX AF,AF' - OUT (PAGE3),A - EI + OUT (SLOT3),A + CALL RESTORE_CURRENT_DIR ; [x] new tr-hdd AND A + EI RET - -ERROR_BPB: +.ERROR_BPB: EX AF,AF' - OUT (PAGE3),A + OUT (SLOT3),A SCF EI RET - - -ERROR_MSDOS: - LD HL,MSG_3 - JP AUTO_03E4 - -FAT1_MSG: DB 'FAT1' + ; +; .ERROR_MSDOS: +; LD HL,MSG_3 +; JP AUTO_03E4 + ; +.FAT1_MSG: + DB 'FAT1' ;******************************************** READ_NEXT_DIR: DI - IN A,(PAGE3) + IN A,(SLOT3) EX AF,AF' LD A,SYS_PAGE - OUT (PAGE3),A - LD DE,(MSD_CONT_SEC) - LD IX,(MSD_CONT_SEC2) + OUT (SLOT3),A + LD DE,(SYS_PAGE.MSD_CONT_SEC) + LD IX,(SYS_PAGE.MSD_CONT_SEC2) JR READ_NEXT2 ;******************************************** READ_1ST_DIR: DI - IN A,(PAGE3) + IN A,(SLOT3) EX AF,AF' LD A,SYS_PAGE - OUT (PAGE3),A - LD IX,(MSD_CAT_SEC2) ; - LD DE,(MSD_CAT_SEC) ; НАЧАЛЬНЫЙ СЕКТОР КАТАЛОГА - LD (MSD_CONT_SEC),DE - LD (MSD_CONT_SEC2),IX - LD A,(S_P_C) ; СЕКТОРОВ В КАТАЛОГЕ - LD (COUNT_SEC),A + OUT (SLOT3),A + LD IX,(SYS_PAGE.MSD_CAT_SEC2) + LD DE,(SYS_PAGE.MSD_CAT_SEC) ; НАЧАЛЬНЫЙ СЕКТОР КАТАЛОГА + LD (SYS_PAGE.MSD_CONT_SEC),DE + LD (SYS_PAGE.MSD_CONT_SEC2),IX + LD A,(SYS_PAGE.SectorsPerCluster) ; СЕКТОРОВ В КАТАЛОГЕ + LD (SYS_PAGE.COUNT_SEC),A READ_NEXT2: EX AF,AF' - OUT (PAGE3),A + OUT (SLOT3),A ; RET_PAGE3 EI - LD HL,MS_DIR + LD HL,SYS_PAGE.MS_DIR LD A,SYS_PAGE - LD B,1 - LD C,5 + LD BC,256*1 + TRDOS_ROM_CMD.READ CALL MSD_R_W_UT DI - IN A,(PAGE3) + IN A,(SLOT3) EX AF,AF' LD A,SYS_PAGE - OUT (PAGE3),A + OUT (SLOT3),A - LD DE,(MSD_CONT_SEC) + LD DE,(SYS_PAGE.MSD_CONT_SEC) INC DE - LD (MSD_CONT_SEC),DE + LD (SYS_PAGE.MSD_CONT_SEC),DE LD A,D OR E JR NZ,READ_NEXT3 - LD IX,(MSD_CONT_SEC2) + LD IX,(SYS_PAGE.MSD_CONT_SEC2) INC IX - LD (MSD_CONT_SEC2),IX + LD (SYS_PAGE.MSD_CONT_SEC2),IX READ_NEXT3: - LD A,(F_P_S) ; ФАЙЛОВ В СЕКТОРЕ - LD (COUNT_FL),A + LD A,(SYS_PAGE.FilesPerSector) ; ФАЙЛОВ В СЕКТОРЕ + LD (SYS_PAGE.COUNT_FL),A EX AF,AF' - OUT (PAGE3),A + OUT (SLOT3),A ; RET_PAGE3 EI - LD HL,MS_DIR + LD HL,SYS_PAGE.MS_DIR AND A RET @@ -704,11 +708,11 @@ CALC_SECT_L1: PUSH BC EX DE,HL DI - IN A,(PAGE3) + IN A,(SLOT3) EX AF,AF' LD A,SYS_PAGE - OUT (PAGE3),A - LD BC,(MS_BPB+S_P_T) + OUT (SLOT3),A + LD BC,(SYS_PAGE.MS_BPB+S_P_T) XOR A LOOP_TRK: SBC HL,BC @@ -716,14 +720,14 @@ LOOP_TRK: INC A JR NZ,LOOP_TRK POP BC - JP ERROR_BPB + JP READ_BPB.ERROR_BPB SEC_ENDER: ADD HL,BC LD H,A ; ТРЕК ; LD L,L ; СЕКТОР EX AF,AF' - OUT (PAGE3),A + OUT (SLOT3),A EI EX DE,HL POP BC @@ -732,8 +736,8 @@ SEC_ENDER: ;************************************************ REDIR_LINE_CODING: - LD (MED_START),HL - LD HL,(DOS_CH_ADR) + LD (ZX_VARS.MED_START),HL + LD HL,(ZX_VARS.DOS_CH_ADR) LD A,(HL) CP '/' RET Z @@ -751,18 +755,19 @@ PRINT_HEX_SYM: PUSH HL PUSH DE PUSH BC - AND 0FH + AND #0F ADD A,'0' CP '9'+1 JR C,NO_ADD ADD A,7 NO_ADD: - RST 10H + RST #10 POP BC POP DE POP HL RET - ;******************************************* - +;███████████████████████████████████████████████████████████████████████ + DISPLAY "TR_MSD_S.ASZ size: ",/A,$-File_Start + DISPLAY "====================================================" diff --git a/TRDOS/TR_RMD_S.ASZ b/TRDOS/TR_RMD_S.ASZ index ef8d6b2..9f39e1f 100644 --- a/TRDOS/TR_RMD_S.ASZ +++ b/TRDOS/TR_RMD_S.ASZ @@ -1,13 +1,16 @@ +File_Start DEFL $ + DISPLAY "====================================================" +;███████████████████████████████████████████████████████████████████████ + + DEFINE NEW_RAMDRV_READ 1 + DISK_REDIR: - PUSH HL + ;PUSH HL PUSH BC - LD A,(OPER_DISK) - AND 3 - LD C,0CFH + LD C,BIOS.GET_DISK_REDIR CALL EXP_FNS - EI POP BC - POP HL + ;POP HL RET R_W_REDIR: @@ -21,7 +24,7 @@ ERROR_DISK: RECALL_1E70: CALL RES_1440 - LD A,(RD_WR_COM) + LD A,(ZX_VARS.RD_WR_COM) PUSH BC PUSH HL CALL READ_TRK_NUM @@ -35,27 +38,211 @@ RECALL_RAMD: JR Z,ERROR_DISK JP READ_WRITE_RAMD -RECALL_MSD: - JR ERROR_DISK ; переход на ошибку диска +; RECALL_MSD: +; JR ERROR_DISK ; переход на ошибку диска TEST_RAMD: PUSH HL - LD C,0CEH + LD C,BIOS.GET_RAMD_ST CALL EXP_FNS - EI + ;!TEST 06/01/2024 сохраняем состояние прерываний зачем-то + EI + ; POP HL RET -; ╔═══════════════════════════════════╗ -; ║ RD/WR SECTOR HL - BUFER ║\ -; ║ CONT_SEC - SEC/TRK FOR READ/WRITE ║\ -; ║ COM_RD_WR - команда чтение/запись ║\ -; ║ 0 - чтение, 255 - запись ║\ -; ╚═══════════════════════════════════╝\ -; \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ -READ_WRITE_RAMD: +RAMD_X12: ; проверка диска + LD (ZX_VARS.OPER_DISK),A + CALL DISK_REDIR + CP 4 + JR C,X_AUTO_3DCE + CP 20 + RET C +; JR C,RAMD_TEST +;NO_DISK2: + JP AUTO_3EE7 ; NO_DISK +X_AUTO_3DCE: + CALL RES_1440 + LD A,(ZX_VARS.OPER_DISK) + JP AUTO_3DCE + +;************************************* +RAMD_X14: ; FORMATING + CALL get_disk_type + PUSH AF + PUSH BC + PUSH HL + CALL DISK_REDIR + CP 4 + JR C,DISK_FORM + CP 20 + JR C,RAMD_FORMAT + JP READ_ONLY + +DISK_FORM: + LD A,(ZX_VARS.MED_START+1) + CP #14 + JR Z,QVICK_FORMAT + POP HL + POP BC + POP AF + JP AUTO_1EE0 + +QVICK_FORMAT: + POP HL + POP BC + POP AF + JR Q_FORM_1 + +RAMD_FORMAT: + SUB 4 + + CALL TEST_RAMD + JP C,READ_ONLY + CALL NZ,CLEAR_RAMD + + POP HL + POP BC + POP AF + LD B,#28 ; размер 640K + CALL DISK_REDIR + SUB 4 + + CALL GET_RAM_BLK ; ВЫДЕЛЕНИЕ ПАМЯТИ +; LD C,A ; КЛЮЧ RAM-Disk +Q_FORM_1: + LD HL,ZX_VARS.BUFFER ; CLEAR DISK ZX_VARS.BUFFER + LD DE,ZX_VARS.BUFFER+1 + LD BC,#FF + LD (HL),0 + LDIR + + LD DE,0 +RAMD_F_LOOP: + LD HL,ZX_VARS.BUFFER + LD B,1 + PUSH DE + CALL WRITE_DISK + POP DE + INC E + LD A,E + CP 8 + JR NZ,RAMD_F_LOOP + LD HL,2544 + LD A,22 + JP AUTO_1F55 + +;************************************* +CLEAR_RAMD_X: + CALL RAMD_SYM + JR NC,CLEAR_RMD_A + DEC DE + LD A,(DE) + CP 13 + SCF + RET NZ +CLEAR_RAMD: + CALL DISK_REDIR +;CLEAR_NEXT: + SUB 4 + RET C + CP SYS_PAGE.RAMD_KEYS.NUM + CCF + RET C + +CLEAR_RMD_A: + PUSH HL + PUSH DE + PUSH BC + LD C,BIOS.FreeMemRMD + CALL EXP_FNS ; вызвать функцию + ;!TEST 06/01/2024 сохраняем состояние прерываний зачем-то + ;EI + ; + POP BC + POP DE + POP HL + RET + +;********************************************************* +; B - ЧИСЛО ТРЕБУЕМЫХ БЛОКОВ, A - КЛЮЧ RAM-Disk +GET_RMD_A: +GET_RAM_BLK: + LD C,BIOS.GetMemRMD + CALL EXP_FNS ; A,L - КЛЮЧ RAM-Disk - номер первого блока + ;!TEST 06/01/2024 сохраняем состояние прерываний зачем-то + ;EI + ; + RET NC +;NO_MEM: + LD HL,NO_MEMORY + JP ERR_EXIT + +;********************************************************* +READ_ONLY: + LD HL,READ_ONLY_MSG ; Read only !! + JP ERR_EXIT + +FDD_SET: + LD A,(ZX_VARS.OPER_DISK) + LD B,A + LD C,BIOS.FDD_TO_DRV + ;!TEST 06/01/2024 сохраняем состояние прерываний зачем-то + JP EXP_FNS + ;CALL EXP_FNS + ;EI + ;RET + ; + +RAMD_SET: + CALL RAMD_SYM + ;RET C + JP C,ERROR_MSG +RAMD_SET1: + PUSH AF + LD A,(ZX_VARS.OPER_DISK) + LD B,A + POP AF + LD C,BIOS.RAMD_TO_DRV + ;!TEST 06/01/2024 сохраняем состояние прерываний зачем-то + JP EXP_FNS + ;CALL EXP_FNS + ;EI + ;RET + ; + +RAMD_SYM: + LD A,(DE) + INC DE + CP ' ' + JR Z,RAMD_SYM + AND %1101'1111 + CP 'E' + RET C + SUB 'E' + CP SYS_PAGE.RAMD_KEYS.NUM + CCF + RET C + PUSH AF + LD A,(DE) + CP ':' + INC DE + JR Z,RAMD_SYM_OK + DEC DE + CP ' '+1 + JR C,RAMD_SYM_OK + POP AF + SCF + RET +RAMD_SYM_OK: + POP AF + RET + +; +;======================================================================- +; READ_WRITE_RAMD: ; ; CALL DISK_REDIR ; SUB 4 @@ -68,14 +255,14 @@ READ_WRITE_RAMD: ; LD HL,RAMD_KEYS ; ADD A,L ; LD L,A -; IN A,(PAGE3) +; IN A,(SLOT3) ; LD C,A ; LD A,SYS_PAGE ; DI -; OUT (PAGE3),A +; OUT (SLOT3),A ; LD L,(HL) ; LD A,C -; OUT (PAGE3),A +; OUT (SLOT3),A ; EI ; LD A,L ; 1-st block ; POP HL @@ -92,7 +279,7 @@ READ_WRITE_RAMD: ; PUSH DE ; PUSH BC ; -; LD DE,(CONT_SEC) +; LD DE,(ZX_VARS.CONT_SEC) ; LD A,D ; ФИЗИЧЕСКИЕ -> ЛОГИЧЕСКИЕ !!! ; RRCA ; RRCA @@ -106,7 +293,7 @@ READ_WRITE_RAMD: ; AND 0FH ; LD D,A ; -; LD A,(RD_WR_COM) +; LD A,(ZX_VARS.RD_WR_COM) ; AND A ; JR Z,RAMD_READ ; PUSH AF @@ -127,7 +314,7 @@ READ_WRITE_RAMD: ; POP HL ; POP AF ; OUT (RGADR),A -; LD DE,(CONT_SEC) +; LD DE,(ZX_VARS.CONT_SEC) ; ; LD A,B ; @@ -153,328 +340,259 @@ READ_WRITE_RAMD: ; ; LD B,0 ; -; LD (CONT_SEC),DE +; LD (ZX_VARS.CONT_SEC),DE ; AND A ; RET -; -; +;======================================================================- + +;*********************************************************************** +READ_WRITE_RAMD: + IFN NEW_RAMDRV_READ +; ╔═══════════════════════════════════╗ +; ║ RD/WR SECTOR ║\ +; ║ HL - BUFFER ║\ +; ║ B - Number of sectors ║\ +; ║ CONT_SEC - SEC/TRK FOR READ/WRITE ║\ +; ║ RD_WR_COM - команда чтение/запись ║\ +; ║ 0 - чтение, 255 - запись ║\ +; ╚═══════════════════════════════════╝\ +; \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ INC B -WD_WR_RAMD_LOOP: +.WD_WR_RAMD_LOOP: DEC B RET Z PUSH BC PUSH HL - CALL RD_WR_1SEC + CALL .RD_WR_1SEC POP HL - CALL RAMD_NEXT_SEC + CALL .RAMD_NEXT_SEC POP BC - JR WD_WR_RAMD_LOOP + JR .WD_WR_RAMD_LOOP -RAMD_NEXT_SEC: +.RAMD_NEXT_SEC: PUSH HL - LD HL,CONT_SEC + LD HL,ZX_VARS.CONT_SEC LD A,16 INC (HL) CP (HL) - JR NZ,RAMD_NEXT_1 + JR NZ,.RAMD_NEXT_1 LD (HL),0 INC HL INC (HL) -RAMD_NEXT_1: +.RAMD_NEXT_1: POP HL - LD BC,0100h + LD BC,#100 ADD HL,BC RET -RD_WR_1SEC: - LD DE,(CONT_SEC) - CALL PAGE_CALC2 +.RD_WR_1SEC: + LD DE,(ZX_VARS.CONT_SEC) + CALL .PAGE_CALC2 DI - LD A,(RD_WR_COM) - AND 0C0H + LD A,(ZX_VARS.RD_WR_COM) + AND #C0 OUT (RGADR),A LD A,H - CP 0A0H - LD A,(RD_WR_COM) + CP #A0 + LD A,(ZX_VARS.RD_WR_COM) LD E,0 LD D,C SET 6,D - JR C,RD_WR_C000 - -RD_WR_4000: + JR C,.RD_WR_C000 + ;RD_WR_4000: RES 7,D ; DE - адрес данных RAMD - LD C,PAGE1 + LD C,SLOT1 EX AF,AF' IN A,(C) EX AF,AF' OUT (C),B -;****** ПЕРЕМЕЩЕНИЕ ДАННЫХ ***** - LD BC,100H + ; ПЕРЕМЕЩЕНИЕ ДАННЫХ + LD BC,#100 AND A - JR NZ,MOVE_NOT_EX3 + JR NZ,.MOVE_NOT_EX3 EX DE,HL -MOVE_NOT_EX3: +.MOVE_NOT_EX3: LDIR ; работать здесь же, в TR-DOS !!! AND A - JR NZ,MOVE_NOT_EX4 + JR NZ,.MOVE_NOT_EX4 EX DE,HL -MOVE_NOT_EX4: -;******************************* +.MOVE_NOT_EX4: + ;******************* EX AF,AF' - OUT (PAGE1),A + OUT (SLOT1),A EX AF,AF' ; RET_PAGE1 -MOVE_RET: +.MOVE_RET: LD A,0 OUT (RGADR),A EI RET - -RD_WR_C000: + ; +.RD_WR_C000: SET 7,D - LD C,PAGE3 + LD C,SLOT3 EX AF,AF' IN A,(C) EX AF,AF' OUT (C),B -;****** ПЕРЕМЕЩЕНИЕ ДАННЫХ ***** - LD BC,100H + ; ПЕРЕМЕЩЕНИЕ ДАННЫХ + LD BC,#100 AND A - JR NZ,MOVE_NOT_EX1 + JR NZ,.MOVE_NOT_EX1 EX DE,HL -MOVE_NOT_EX1: +.MOVE_NOT_EX1: LDIR ; работать здесь же, в TR-DOS !!! AND A - JR NZ,MOVE_NOT_EX2 + JR NZ,.MOVE_NOT_EX2 EX DE,HL -MOVE_NOT_EX2: -;******************************* + ;******************** +.MOVE_NOT_EX2: EX AF,AF' - OUT (PAGE3),A + OUT (SLOT3),A EX AF,AF' -; RET_PAGE3 - JR MOVE_RET - -;********************************************** -PAGE_CALC2: + ; RET_PAGE3 + JR .MOVE_RET + ; +.PAGE_CALC2: LD A,D ; ФИЗИЧЕСКИЕ -> ЛОГИЧЕСКИЕ !!! RRCA RRCA RRCA RRCA LD D,A - AND 0F0H + AND #F0 OR E LD E,A LD A,D - AND 0FH + AND #0F LD D,A PUSH HL - LD C,98h + LD C,BIOS.RAMD_CALC_PAGE CALL DISK_REDIR SUB 4 CALL EXP_FNS ; вычисление адреса и страницы RAM-Disk - EI + ;!TEST 06/01/2024 сохраняем состояние прерываний зачем-то + ;EI + ; LD B,A LD C,H POP HL - EI + ;EI RET NC JP ERROR_DISK +;******************************************** - - -;********************************************* -RAMD_X12: ; проверка диска - LD (OPER_DISK),A - CALL DISK_REDIR - CP 4 - JR C,X_AUTO_3DCE - CP 20 - RET C -; JR C,RAMD_TEST -NO_DISK2: - JP AUTO_3EE7 ; NO_DISK - -X_AUTO_3DCE: - CALL RES_1440 - LD A,(OPER_DISK) - JP AUTO_3DCE - -;************************************* -RAMD_X14: ; FORMATING - CALL get_disk_type - PUSH AF - PUSH BC - PUSH HL - CALL DISK_REDIR - CP 4 - JR C,DISK_FORM - CP 20 - JR C,RAMD_FORMAT - JP READ_ONLY - -DISK_FORM: - LD A,(MED_START+1) - CP 14H - JR Z,QVICK_FORMAT - POP HL - POP BC - POP AF - JP AUTO_1EE0 - -QVICK_FORMAT: - POP HL - POP BC - POP AF - JR Q_FORM_1 - -RAMD_FORMAT: - SUB 4 - - CALL TEST_RAMD - JP C,READ_ONLY - CALL NZ,CLEAR_RAMD - - POP HL - POP BC - POP AF - LD B,28H ; размер 640K - CALL DISK_REDIR - SUB 4 - - CALL GET_RAM_BLK ; ВЫДЕЛЕНИЕ ПАМЯТИ -; LD C,A ; КЛЮЧ RAM-Disk -Q_FORM_1: - LD HL,BUFER ; CLEAR DISK BUFER - LD DE,BUFER+1 - LD BC,0FFh - LD (HL),0 - LDIR - - LD DE,0 -RAMD_F_LOOP: - LD HL,BUFER - LD B,1 - PUSH DE - CALL WRITE_DISK - POP DE - INC E - LD A,E - CP 8 - JR NZ,RAMD_F_LOOP - LD HL,2544 - LD A,22 - JP AUTO_1F55 - -;************************************* -CLEAR_RAMD_X: - CALL RAMD_SYM - JR NC,CLEAR_RMD_A - DEC DE - LD A,(DE) - CP 13 - SCF - RET NZ -CLEAR_RAMD: - CALL DISK_REDIR -CLEAR_NEXT: - SUB 4 - RET C - CP RAMD_KEY_NUM - CCF - RET C - -CLEAR_RMD_A: - PUSH HL - PUSH DE - PUSH BC - LD C,93h ; очистка RAM-Disk - CALL EXP_FNS ; вызвать функцию - EI - POP BC - POP DE - POP HL + ELSE + +;******************************************** +; ╔═══════════════════════════════════╗ +; ║ RD/WR SECTOR ║\ +; ║ HL - BUFFER ║\ +; ║ B - Number of sectors ║\ +; ║ CONT_SEC - SEC/TRK FOR READ/WRITE ║\ +; ║ RD_WR_COM - команда чтение/запись ║\ +; ║ 0 - чтение, 255 - запись ║\ +; ╚═══════════════════════════════════╝\ +; \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ + INC B + DEC B + RET Z + ; + PUSH BC + PUSH HL + ; сохраняем кол-во секторов для чтения + LD C,B + ; накручиваем счётчик r/w секторов + LD HL,(ZX_VARS.CONT_SEC) + LD D,H + LD E,L + ;!TODO переделать эту тупость на математику + LD A,16 +.loop: INC L + CP L + JR NZ,.skip + INC H + LD L,0 +.skip: DJNZ .loop + ; + ; сохраняем накрученный счётчик + LD (ZX_VARS.CONT_SEC),HL + ; ФИЗИЧЕСКИЙ СЕКТОР -> ЛОГИЧЕСКИЙ + LD A,D + RRCA + RRCA + RRCA + RRCA + LD D,A + AND #F0 + OR E + LD E,A + LD A,D + AND #0F + LD D,A + ; восстанавливаем кол-во секторов для чтения + LD B,C + ;Get RAM Block ID + LD A,(ZX_VARS.OPER_DISK) + AND 3 + LD C,BIOS.GET_DRV_ST ; не убивает DE и B + CALL EXP_FNS + JP C,.ERROR + SUB 4 + LD C,BIOS.GET_RAMD_ST ; не убивает DE и B + CALL EXP_FNS + JP C,.ERROR + ; A = RAM Block ID + EX AF,AF' + ; + POP HL + ; Get command r/w + LD A,(ZX_VARS.RD_WR_COM) + EX AF,AF' + LD C,BIOS.BLK_RD_WR + CALL EXP_FNS + ; HL = адрес буфера для следующего сектора + POP BC + JP C,AUTO_3EE7 + LD B,0 RET -;********************************************************* -GET_RMD_A: -GET_RAM_BLK: ; B - ЧИСЛО ТРЕБУЕМЫХ БЛОКОВ, A - КЛЮЧ RAM-Disk - LD C,92h - CALL EXP_FNS ; A,L - КЛЮЧ RAM-Disk - номер первого блока - EI - RET NC -NO_MEM: - LD HL,NO_MEMORY - JP ERR_EXIT - -;********************************************************* -READ_ONLY: - LD HL,READ_ONLY_MSG ; Read only !! - JP ERR_EXIT - -FDD_SET: - LD A,(OPER_DISK) - LD B,A - LD C,0CCH - CALL EXP_FNS - EI - RET - -HDD_SET: - LD C,0 - CALL HD_CMD - JP C,HDD_PROG_E - - LD A,(OPER_DISK) - LD B,A - LD A,0 - LD C,0CDH - CALL EXP_FNS - EI - RET - -RAMD_SET: - CALL RAMD_SYM - RET C -RAMD_SET1: - PUSH AF - LD A,(OPER_DISK) - LD B,A - POP AF - LD C,0CBH - CALL EXP_FNS - EI - RET - -RAMD_SYM: - LD A,(DE) - INC DE - CP 20H - JR Z,RAMD_SYM - AND 223 - CP 'E' - RET C - SUB 'E' - CP 16 - CCF - RET C - PUSH AF - LD A,(DE) - CP ':' - INC DE - JR Z,RAMD_SYM_OK - DEC DE - CP 21H - JR C,RAMD_SYM_OK - POP AF - SCF - RET -RAMD_SYM_OK: - POP AF - RET +.ERROR: POP HL + POP BC + JP AUTO_3EE7 ;Disk error +; ╔════════════════════════════════════════════════╗ +; ║ RD/WR SECTOR ║\ +; ║ HL - BUFER ║\ +; ║ DE - ABS sector в 256b блоках ║\ +; ║ B - число данных в 256b блоках ║\ +; ║ A - block RAM ║\ +; ║ A' - команда чтение/запись/чтение ROM Disk ║\ +; ║ 0 - read, 255 - write, 70 - read ROM DISK ║\ +; ║ ** NOT USED TR-DOS VARS ** ║\ +; ╚════════════════════════════════════════════════╝\ +; \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ +; RAMD_NEXT_SEC: +; PUSH HL +; LD HL,ZX_VARS.CONT_SEC +; LD A,16 +; INC (HL) +; CP (HL) +; JR NZ,.RAMD_NEXT_1 +; LD (HL),0 +; INC HL +; INC (HL) +; .RAMD_NEXT_1: +; POP HL +; LD BC,#100 +; ADD HL,BC +; RET + ENDIF +;*********************************************************************** +;███████████████████████████████████████████████████████████████████████ + DISPLAY "TR_RMD_S.ASZ size: ",/A,$-File_Start + DISPLAY "====================================================" \ No newline at end of file diff --git a/TRDOS/boot/boot.asm b/TRDOS/boot/boot.asm new file mode 100755 index 0000000..b04578d --- /dev/null +++ b/TRDOS/boot/boot.asm @@ -0,0 +1,601 @@ + IF DEFtrd_boot_small + +;======================================================================; + INCLUDE 'inc/rom_routines.inc' + INCLUDE 'Shared_Includes/constants/ZX_VARS.inc' + INCLUDE 'Shared_Includes/constants/zx_char_codes.inc' + INCLUDE 'Shared_Includes/constants/standart_colors.inc' +;======================================================================; + + +;======================================================================; +collor_A EQU 0x03 +collor_B EQU 0x02 +collor_N EQU 0x04 +collor_M EQU 0x08 +collor_T EQU 0x07 +org_addr EQU #5d3b +;======================================================================; + + +; Variables +;======================================================================; +ColumnNumber EQU #70E0 +Columns EQU 3 +;======================================================================; + + +;======================================================================; + ORG org_addr +bstart: DW #100 ; line number = 1 + DW l1end - l1begin ; line length +l1begin: DB ZX_Token.border, ZX_Token.not, ZX_Token.pi, ":" + DB ZX_Token.randomize, ZX_Token.usr, ZX_Token.val, '"',"23907",'"' + DB ":", ZX_Token.rem, ":", ZX_Token.run + DB '"' +BootName: DB ZX_Char.tab, 10, 32 + DB "MAXBOOT v9.1" +.size EQU $-BootName + DB '"', ZX_Char.carriage_return +;======================================================================; + +;#70F6 - disk name + +;======================================================================; +START_BOOT: ;Permanent current colours, etc, as set up by colour statements. + LD (iy+#53),COLORS.ZX.CYAN ;5d63 fd 36 53 05 . 6 S . +l5d67h: CALL BASIC_FN.x48.cls ;5d67 cd 6b 0d . k . + ADD HL,BC ;5d6a 09 . + ; HL = 6801 + ; read 9 sectors + LD BC,#0905 ;5d6b 01 05 09 . . . + PUSH HL ;5d6e e5 . + CALL #3D13 ;5d6f cd 13 3d . . = + ;PR-STRING + LD DE,BootName ;5d72 11 52 5d . R ] + LD C,BootName.size ;5d75 0e 0f . . + CALL #203C ;5d77 cd 3c 20 . < + ;CHAN_OPEN + ; Open channel 2 (main screen) + LD A,#02 ;5d7a 3e 02 > . + CALL #1601 ;5d7c cd 01 16 . . . + ; + POP HL ;5d7f e1 . + LD D,H ;5d80 54 T + LD E,L ;5d81 5d ] +loopDir: LD BC,8 ; смещение на тип файла ;5d82 01 08 00 . . . + DEC (HL) ;5d85 35 5 + JR Z,.nextFile ;5d86 28 28 ( ( + INC (HL) ;5d88 34 4 + JR Z,.EXIT ;5d89 28 2a ( * + ; + PUSH HL ;5d8b e5 . + ADD HL,BC ;5d8c 09 . + LD A,(HL) ;5d8d 7e ~ + POP HL ;5d8e e1 . + CP "B" ;5d8f fe 42 . B + JR NZ,.nextFile ;5d91 20 1d . + PUSH HL ;5d93 e5 . + ;PRINT-A + LD A," " ;5d94 3e 20 > + RST #10 ;5d96 d7 . + ; (#5C51) == #5D2B + ; (#5D2B) == #09F4 + ; вывод имени файла +.loopPrint: LD A,(HL) ;5d97 7e ~ + RST #10 ;5d98 d7 . + LDI ;5d99 ed a0 . . + JP PE,.loopPrint ;5d9b ea 97 5d . . ] + ; подсчёт колонок для правильного вывода имён файлов + LD HL,ColumnNumber ;5d9e 21 e0 70 ! . p + INC (HL) ;5da1 34 4 + LD A,(HL) ;5da2 7e ~ +.loopColumn: SUB Columns ;5da3 d6 03 . . + JR Z,.ColumnThree ;5da5 28 05 ( . + JR NC,.loopColumn ;5da7 30 fa 0 . + LD A," " ;5da9 3e 20 > + RST #10 ;5dab d7 . +.ColumnThree: LD A," " ;5dac 3e 20 > + RST #10 ;5dae d7 . + ; + POP HL ;5daf e1 . +.nextFile: LD C,#10 ;5db0 0e 10 . . + ADD HL,BC ;5db2 09 . + JR loopDir ;5db3 18 cd . . +.EXIT: ; +;;;;;;;;;;;;;;;;; + ; B = 0 + ; Рисовалка курсора атрибутами. Перемещение курсора +MAIN_LOOP: LD C,B ;5db5 48 H +l5db6h: LD HL,#57F5 ;5db6 21 f5 57 ! . W + LD DE,#000B ;5db9 11 0b 00 . . . + LD A,D ;5dbc 7a z +l5dbdh: LD B,#03 ;5dbd 06 03 . . +l5dbfh: ADD HL,DE ;5dbf 19 . + CP C ;5dc0 b9 . + JR Z,l5dc9h ;5dc1 28 06 ( . + INC A ;5dc3 3c < + DJNZ l5dbfh ;5dc4 10 f9 . . + DEC HL ;5dc6 2b + + JR l5dbdh ;5dc7 18 f4 . . + ; +l5dc9h: LD B,#0A ;5dc9 06 0a . . + LD DE,(#70DE) ;5dcb ed 5b de 70 . [ . p + LD (#70DE),HL ;5dcf 22 de 70 " . p + LD A,#05 ;5dd2 3e 05 > . +l5dd4h: LD (DE),A ;5dd4 12 . + INC DE ;5dd5 13 . + LD (HL),#1E ;5dd6 36 1e 6 . + INC HL ;5dd8 23 # + DJNZ l5dd4h ;5dd9 10 f9 . . + LD HL,#5C08 ;5ddb 21 08 5c ! . \ + LD (HL),H ;5dde 74 t +l5ddfh: LD A,(HL) ;5ddf 7e ~ + OR #20 ;5de0 f6 20 . + SUB #20 ;5de2 d6 20 . + JR Z,l5d67h ;5de4 28 81 ( . + SUB L ;5de6 95 . + LD B,#02 ;5de7 06 02 . . +l5de9h: JR Z,l5e0fh ;5de9 28 24 ( $ + DEC A ;5deb 3d = + JR Z,l5e13h ;5dec 28 25 ( % + DEC A ;5dee 3d = + JR Z,l5e11h ;5def 28 20 ( + DEC A ;5df1 3d = + JR Z,l5e0dh ;5df2 28 19 ( . + SUB B ;5df4 90 . + JR Z,RUN_BASIC ;5df5 28 2d ( - + SUB #03 ;5df7 d6 03 . . + JR Z,RUN_BASIC ;5df9 28 29 ( ) + SUB #06 ;5dfb d6 06 . . + DJNZ l5de9h ;5dfd 10 ea . . + SUB #1E ;5dff d6 1e . . + JR Z,l5e11h ;5e01 28 0e ( . + SUB #0E ;5e03 d6 0e . . + JR Z,l5e0fh ;5e05 28 08 ( . + DEC A ;5e07 3d = + JR Z,l5e13h ;5e08 28 09 ( . + DEC A ;5e0a 3d = + JR NZ,l5ddfh ;5e0b 20 d2 . +l5e0dh: SUB #02 ;5e0d d6 02 . . +l5e0fh: SUB #04 ;5e0f d6 04 . . +l5e11h: ADD A,#02 ;5e11 c6 02 . . +l5e13h: ADD A,C ;5e13 81 . + LD BC,(ColumnNumber) ;5e14 ed 4b e0 70 . K . p + DEC C ;5e18 0d . + INC A ;5e19 3c < + JP M,l5db6h ;5e1a fa b6 5d . . ] + INC C ;5e1d 0c . + CP C ;5e1e b9 . + LD C,A ;5e1f 4f O + JR C,l5db6h ;5e20 38 94 8 . + JR MAIN_LOOP ;5e22 18 91 . . + ; + ; запуск васика + ; A = 0 +RUN_BASIC: LD B,A ;5e24 47 G + LD A,C ;5e25 79 y + INC A ;5e26 3c < + LD C,L ;5e27 4d M + LD HL,#67F9 ;5e28 21 f9 67 ! . g +.loop: ADD HL,BC ;5e2b 09 . + DEC A ;5e2c 3d = + JR NZ,.loop ;5e2d 20 fc . + ; + LD DE,BootName ;5e2f 11 52 5d . R ] + LDIR ;5e32 ed b0 . . + JP #3D03 ;5e34 c3 03 3d . . = + + + + ;ADD A,B ;5e37 80 . + ;XOR D ;5e38 aa . + ;DEFB 001h,000h ;5e39 01 00 . . + +StartLineNum: DB 0 + DW 0 + ;DB #80 +l1end: + + EXPORT StartLineNum + EXPORT org_addr + + + ELSE + +;======================================================================; + INCLUDE 'inc/rom_routines.inc' + INCLUDE 'Shared_Includes/constants/ZX_VARS.inc' + INCLUDE 'Shared_Includes/constants/zx_char_codes.inc' + INCLUDE 'Shared_Includes/constants/standart_colors.inc' +;======================================================================; + +;======================================================================= +collor_A EQU 0x03 +collor_B EQU 0x02 +collor_N EQU 0x04 +collor_M EQU 0x08 +collor_T EQU 0x07 +org_addr EQU #5d3b + +;======================================================================= +DiskName EQU catBuff + #08F5 +.size EQU 8 + +Columns EQU 3 + +vROMbootSize EQU bstart +;======================================================================= + + + ORG org_addr + +bstart: DW #100 ; line number = 1 + DW l1end-l1begin ; line length +l1begin: DB ZX_Token.randomize,ZX_Token.usr,"0" ; 'rand' 'usr' 0 + DB ZX_Char.number + DB #00,#00 : DW start : DB #00 ; start address + DB ZX_Char.carriage_return +l1end: DW #200 ; line number = 2 + DW l2end-l2begin ; line length +l2begin: DB ZX_Token.randomize,ZX_Token.usr,"0" ; ':' 'rand' 'usr' 0 + DB ZX_Char.number + DB #00,#00 : DW 15619 : DB #00 ; start address + DB ":",ZX_Token.rem,":",ZX_Token.run,'"' +filename: DB "boot ",'"',":" ; ':' 'rem' run +;======================================================================= + + ;org #5d65 +start: LD (memSP),SP +NewDisk: ;CALL clear_screen + LD BC,#0905 + LD DE,0 + LD HL,catBuff + CALL #3D13 + LD A,"a" + LD (main.markPos),A + LD A,1 + JP keys.setCP + ; +; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ALIGN #10 +TXT_BUTTONS: +.prev: DB '<<< PgUp' +.next: DB 'PgDn >>>' + ; +main.CurrentPage: + DB 1 +main.PagesCounter: + DB 1 +; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ; +main: LD A,(.CurrentPage) + LD (.PagesCounter),A +.nextLoop: CALL PRINT_HELP + LD A,collor_T + LD (var_collor),A + LD HL,#50CC + LD (var_printPos),HL + LD HL,DiskName + + + LD B,8 +.p1: LD A,(HL) + PUSH HL + CALL printChar + POP HL + INC L + DJNZ .p1 + ; LD A,L + ; CP low (catBuff + #08FD) + ; JR NZ,.p1 + + LD HL,#4000 + LD (var_printPos),HL + ; вычитывание каталога +.buffPointer+1: LD HL,catBuff +.markPos+2: LD BC,"aa" +.l1: LD A,(HL) + DEC A + JR Z,.nextRec + ; + JP M,DirShowDone + ; + SET 3,L + LD A,(HL) + CP "B" + RES 3,L + JR NZ,.nextRec + ; две спец кнопки + LD A,C ; C - текущий файл + CP "y" + JR NC,PRINT_NEXT_BUTTONS ; "::PREV::" "::NEXT::" + ; + ; проходной прогон? + LD A,(.PagesCounter) + DEC A + JR NZ,.nextHiddenRec + ; basic file + LD A,C + CP B ; выбранный файл + LD A,collor_A + JR NZ,.notMarked + ; выделение файла и копирование его в строку запуска + XOR collor_M + ; + LD DE,filename + PUSH BC + LD BC,8 + LDIR + POP BC + RES 3,L + ; +.notMarked: CALL prn_txt +.nextHiddenRec: INC C +.nextRec: LD DE,#10 + ADD HL,DE + JR .l1 + ; + +PRINT_NEXT_BUTTONS: + LD A,(main.PagesCounter) + LD (keys.nxtPage),A + DEC A + ;JR Z,.noChange + JR Z,keys + LD (main.PagesCounter),A + LD (main.buffPointer),HL +.noChange: ;PUSH AF + ;CALL PRINT_HELP + ;POP AF + ;JP Z,keys + JR keys.toMain + +PRINT_HELP: LD HL,#5040 + LD (var_printPos),HL + LD A,collor_N + PUSH BC + LD C," " + LD HL,TXT_BUTTONS.prev + CALL prn_txt + ; + LD A,collor_N + CALL prn_txt + ; + POP BC + RET + + ; +DirShowDone: XOR A + LD (keys.nxtPage),A + ;CALL PRINT_HELP +keys: RES 5,(iy+1) +.w1: BIT 5,(iy+1) + JR Z,.w1 + LD A,(iy-#32) + ; + CP B + JR Z,exit + CP #0D ; enter + JR Z,exit + CP " " ; space + JP Z,NewDisk + ; + CP #04 ; pgUp + LD E,-1 + JR Z,.prevPage + ; +.pgdn: CP #05 ; pgDn + LD E,1 + JR Z,.nextPage + ; +.left: CP #08 ; left + JR NZ,.sl + DEC B + JR .c1 + ; +.sl: CP #0B ; up + JR NZ,.sd + DEC B + DEC B + DEC B + JR .c1 + ; +.sd: CP #0A ; down + JR NZ,.su + INC B + INC B + INC B + JR .c1 + ; +.su: CP #09 ; right + JR NZ,.sr + INC B + JR .c1 + ; +.sr: CP "a" + JR C,keys + CP C + JR NC,keys + LD B,A + ; +.c1: LD A,B + CP "a" + JR NC,.sf1 + LD A,"a" +.sf1: CP C + JR C,.sf2 + LD A,C + DEC A +.sf2: LD (main.markPos),A +.toMain: JP main.nextLoop + +; DE - +24 or -24 +.nextPage: ; +.nxtPage+1: LD A,0 + AND A + JR Z,.skip + XOR A + LD (.nxtPage),A + ; +; DE - +24 or -24 +.prevPage: LD A,(main.CurrentPage) + ADD A,E + JR Z,.skip + ; +.setCP: LD H,A + LD L,A + LD (main.CurrentPage),HL + LD HL,catBuff + LD (main.buffPointer),HL +.skip: CALL clear_screen + JR .toMain + + + +exit: LD A,C + CP "a" + JP Z,NewDisk +memSP+1: LD SP,0 + RET + +printChar: LD H,A + ADD A,A + ADD A,A + ADD A,A + LD L,A + LD A,H + RLCA + RLCA + RLCA + AND 0x07 + ADD A,0x3c + LD H,A +var_printPos+1: LD DE,0x4000 + +.l1: LD A,(HL) + RRCA + OR (HL) + INC HL + LD (DE),A + INC D + LD (DE),A + INC D + LD A,D + AND 0x07 + JR NZ,.l1 + LD A,D + SUB 0x08 + LD D,A + LD A,E + ADD A,0x20 + LD E,A + AND 0x20 + JR NZ,.l1 + LD HL,(var_printPos) + LD A,H + RRCA + RRCA + RRCA + ADD A,0x50 + LD H,A +var_collor+1: LD A,0 + LD (HL),A + SET 5,L + XOR collor_A ^ collor_B + LD (HL),A + ; + LD HL,var_printPos + LD A,(HL) + ADD A,0x21 + AND 0xdf + LD (HL),A + RET NZ + INC HL + LD A,(HL) + ADD A,0x08 + LD (HL),A + RET + ; + ; + +clear_screen: XOR A + OUT (0xfe),A + LD (ZX_VARS.ATTR_P),A + LD (ZX_VARS.BORDER),A + JP BASIC_FN.x48.cls + +; A - current file +; choose_color: CP B ; выбранный файл. #C7 +; LD A,collor_A +; SCF +; RET NZ +; XOR collor_M +; RET + + +; A - COLOR +; C - char of text button +; HL - Text +prn_txt: LD (var_collor),A + LD A,C + PUSH HL + CALL printChar + LD A," " + CALL printChar + POP HL + ; +.loop: LD A,(HL) + INC HL + PUSH HL + CALL printChar + POP HL + LD A,L + AND 0x07 + JR NZ,.loop + ; + LD A,(var_printPos) + AND 0x1f + RET Z + LD A," " + PUSH HL + CALL printChar + POP HL + RET + ; + ; + +; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; ALIGN #10 +; TXT_BUTTONS: +; .prev: DB '<< PgDn ' +; .next: DB '>> PgUp ' +; ; +; main.CurrentPage: +; DB 1 +; main.PagesCounter: +; DB 1 +; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +StartLineNum: DB 0 + DW 0 + ;DB #80 +l2end: +;bend: + DISPLAY "printChar ",/A,$-printChar + DISPLAY "code ",/A,$-start + ;ds -$&0x0f + ;ALIGN #10 +;filename EQU $ +catBuff EQU #6000 ;$ + (-$&0x0f) + + ASSERT l2end < catBuff,"ERROR!!! Code leaks to catBuff" + EXPORT StartLineNum + EXPORT org_addr +; + + ENDIF \ No newline at end of file diff --git a/TRDOS/boot/boot.inc b/TRDOS/boot/boot.inc new file mode 100644 index 0000000..bd197d3 --- /dev/null +++ b/TRDOS/boot/boot.inc @@ -0,0 +1,2 @@ +StartLineNum: EQU 0x00005F2E +org_addr: EQU 0x00005D3B diff --git a/ZX_EXP.ASM b/ZX_EXP.ASM index f3c28c9..ddb1096 100644 --- a/ZX_EXP.ASM +++ b/ZX_EXP.ASM @@ -11,10 +11,10 @@ ORG 0 SPRIN2 EQU 2 ; 1 - включение Sprinter-1 первой прошивкой - ; 2 - включение Sprinter-2 первой прошивкой + ; 2 - включение Sprinter-2 первой прошивкой INCLUDE 'INC/SPRINT00.INC' ; константы, макросы.. - INCLUDE 'INC/CHAR_CODES.INC' + INCLUDE 'shared_includes/constants/zx_char_codes.inc' PORT_JOI EQU 0FFh ;****************************** @@ -204,39 +204,41 @@ REST_LOOP: RESTART_TXT_L EQU $-RESTART_TXT ;********************************** + BLOCK #100 - $,255 +; Выполняется с адреса #C000 SETUP_TXT: - LD A,CNF_0+D_ROM16ON OUT (CNF_PORT),A - LD HL,1000H - LD DE,8000H - LD BC,3000H + LD HL,#1000 + LD DE,#8000 + LD BC,#3000 LDIR LD A,CNF_0+D_ROM16OFF OUT (CNF_PORT),A - LD HL,08005H + LD HL,#8005 - LD A,0FEh - LD BC,204Eh + LD A,#FE + LD BC,#204E ;ALL_MODE OUT (C),A - LD A,7FH - IN A,(0FEH) + LD A,#7F + IN A,(#FE) CPL AND 1 EX AF,AF' - LD A,0FFh + LD A,#FF OUT (C),A EX AF,AF' JP (HL) - SETUP_TXT_LEN EQU $-SETUP_TXT +;********************************** + SYSTEM_ID_TXT: DB "NEW_BIOS" @@ -659,20 +661,21 @@ NO_CONFIG_: POP HL ; конфигурация LD A,H - CP 0FFH + CP #FF JR NZ,NO_SETUP_1 LD A,L - IF SPRIN2 EQ 2 - CP 0FDH + IF SPRIN2 = 2 + CP #FD ; LD BC,0FFFDH ; Конфигурация Sprinter-2 -PG_SP1 equ 0ECH -PG_SP2 equ 0EEH -PG_AY equ 0EAH -ELSE +PG_SP1 EQU #EC +PG_SP2 EQU #EE +PG_AY EQU #EA + + ELSE ; LD BC,0FFFEH ; Конфигурация Sprinter-1 - CP 0FEH - PG_AY equ 0EAH + CP #FE +PG_AY EQU #EA ENDIF JR NZ,NO_SETUP_2 ; AND A @@ -704,19 +707,19 @@ ELSE LD BC,204Eh ; system_port OUT (C),A - LD SP,0BFFFH + LD SP,#BFFF LD HL,L_PENTAGON CALL SINC_DEF - LD SP,0BFFFH + LD SP,#BFFF LD HL,L_PENTAGON CALL SINC_DEF LD HL,SETUP_TXT - LD DE,0C000H + LD DE,#C000 LD BC,SETUP_TXT_LEN LDIR - CALL 0C000H + CALL #C000 JP NO_SETUP_1 GOTO_SPEC: @@ -735,7 +738,7 @@ NO_SETUP_2: NO_SETUP_1: - LD A,(0A8h) + LD A,(TABLE_X + 8) OUT (LPT1_D),A LD A,0FEh ; ACC-off @@ -743,7 +746,7 @@ NO_SETUP_1: OUT (C),A SND_TEST_RET: - LD SP,0BFFFH + LD SP,#BFFF LD HL,L_PENTAGON CALL SINC_DEF @@ -1396,8 +1399,9 @@ LOOP_EQ: ; OUT (LPT1_D),A RET +; ;********************************************** -; DSS 3C10h,255 +; BLOCK #3C10 - $,255 ;KBD_RET: ; LD A,D_ROM16OFF ; OUT (SYS_PORT_OFF),A @@ -1422,10 +1426,10 @@ LOOP_EQ: ; ; CALL KBD_OFF ; CALL DOS_ON ; JR KBD_RET2 - ;****************************************************** - BLOCK 3CC0h - $,255 +;****************************************************** + BLOCK #3CC0 - $,255 MAGIC_1: ; ЗАГЛУШКА ДЛЯ MAGIC PUSH AF LD A,D_ROM16OFF @@ -1579,9 +1583,8 @@ HDD_MSG_LEN EQU $-HDD_MSG ;HDD_MSG_NO: DB "Boot record not found" ;HDD_NO_LEN EQU $-HDD_MSG_NO - SAVE_AUTOSTART: - LD HL,8000H + LD HL,#8000 LD DE,HDD_MSG LD B,HDD_MSG_LEN SAVE_AUTO_L1: @@ -1596,7 +1599,7 @@ SAVE_AUTO_L1: CALL EXP_HDD RET C - LD HL,8000H + LD HL,#8000 LD A,0 LD DE,1 LD IX,0 @@ -1701,43 +1704,44 @@ kbd_loop2: AND A RET +;***********************************************************************; +;!FIXIT not used + BLOCK #3FD0 - $,0 +; FN1_RET: +; PUSH AF +; LD A,D_ROM16ON +; OUT (CNF_PORT),A +; POP AF +; RST #18 +; JR FN1_RET - BLOCK 3FD0H - $,0 -FN1_RET: - PUSH AF - LD A,D_ROM16ON - OUT (CNF_PORT),A - POP AF - RST 18H - JR FN1_RET - -;****************************************** - BLOCK 3FE0H - $,255 - -SOUND_TEST: - LD A,D_ROM16ON ; AROM16 = 1 - OUT (CNF_PORT),A - JP SND_TEST_RET - - BLOCK 3FE8H - $,255 -HDD_EXE: +;***********************************************************************; +;!FIXIT not used + BLOCK #3FE0 - $,255 +; SOUND_TEST: +; LD A,D_ROM16ON ; AROM16 = 1 +; OUT (CNF_PORT),A +; JP SND_TEST_RET + +;***********************************************************************; + BLOCK #3FE8 - $,255 EXP_HDD: PUSH AF LD A,D_ROM16ON OUT (CNF_PORT),A POP AF RET - - BLOCK 3FF0H-$,255 - - BLOCK 3FF8H-$,255 +;***********************************************************************; + BLOCK #3FF0-$,255 +;***********************************************************************; + BLOCK #3FF8-$,255 EXP_FNS_RET: PUSH AF LD A,D_ROM16OFF OUT (SYS_PORT_OFF),A JP EXP_FNS -;****************************************** - BLOCK 4000h-$,255 +;***********************************************************************; + BLOCK #4000-$,255 ; diff --git a/ZX_EXP/EXP_FN2.ASM b/ZX_EXP/EXP_FN2.ASM index 8abdb5b..75178f0 100644 --- a/ZX_EXP/EXP_FN2.ASM +++ b/ZX_EXP/EXP_FN2.ASM @@ -708,14 +708,14 @@ INIT_SYS_ALL: LD (HL),0 LDIR - LD DE,ZG_ADRESS + LD DE,ZG_ADDRESS LD (WIN_ZG-4000h),DE LD HL,L_SCORPION LD (CONFIG_ALL-4000h),HL LD DE,CNF_0 LD (CONFIG_DE-4000h),DE - LD HL,TASK_DATA-4000h ; убить все задачи + LD HL,TASK_DATA-4000h ; убить все задачи ;SYS_PAGE.CURRENT_TASK.ID LD DE,TASK_DATA+1-4000h LD BC,0FFH LD (HL),0 diff --git a/ZX_EXP/EXP_HDD.ASM b/ZX_EXP/EXP_HDD.ASM index 24d029c..04b1b9d 100644 --- a/ZX_EXP/EXP_HDD.ASM +++ b/ZX_EXP/EXP_HDD.ASM @@ -4,7 +4,7 @@ MACRO WAIT_HDD .LL1: - LD BC,P_HDST + LD BC,IDE.Read.Status IN A,(C) BIT 7,A JR NZ,.LL1 @@ -17,29 +17,28 @@ HD_EXP_EXE: CALL HD_CMD_X JP HD_EXP_RET -HD_CMD: - POP AF +HD_CMD: POP AF CALL HD_CMD_X JP HD_DOS_RET -HD_CMD_X: ; C - COMAND ( 5 - RD, 6 - WR ) +HD_CMD_X: ; C - COMAND ( 5 - RD, 6 - WR ) PUSH AF - LD A,C ; 0 - INIT, 1 - DIAG + LD A,C AND A - JP Z,HD_CMD_0 ; инициализация + JP Z,HD_CMD_0 ; 0 - инициализация DEC A - JP Z,HD_CMD_1 ; ?? + JP Z,HD_CMD_1 ; 1 - DIAG DEC A - JP Z,HD_CMD_2 ; тест + JP Z,HD_CMD_2 ; 2 - тест DEC A - JP Z,HD_CMD_3 ; preread + JP Z,HD_CMD_3 ; 3 - preread DEC A - JP Z,HD_CMD_4 ; read bpb + JP Z,HD_CMD_4 ; 4 - read bpb DEC A - JP Z,HD_CMD_5 ; read + JP Z,HD_CMD_5 ; 5 - read DEC A - JP Z,HD_CMD_6 ; write + JP Z,HD_CMD_6 ; 6 - write DEC A JP Z,FN_HDD_PART POP AF @@ -47,16 +46,15 @@ HD_CMD_X: ; C - COMAND ( 5 - RD, 6 - WR ) RET HD_BPB_PREP: - LD D,A - IN A,(PAGE3) + IN A,(SLOT3) EX AF,AF' LD A,SYS_PAGE - OUT (PAGE3),A - LD A,(HD_IDF_ADR+12) + OUT (SLOT3),A + LD A,(SYS_PAGE.HD_IDF_ADR.sectors) LD E,A EX AF,AF' - OUT (PAGE3),A + OUT (SLOT3),A LD A,D LD D,0 LD IX,0 @@ -76,16 +74,16 @@ HD_PREPARE: HD_PREP_L1: LD A,B - LD BC,P_S_CNT ; Установить число секторов для чтения + LD BC,IDE.Write.Counter ; Установить число секторов для чтения OUT (C),A - LD BC,P_S_NUM + LD BC,IDE.Write.Sector OUT (C),L ; СЕКТОР - LD BC,P_C_LOW + LD BC,IDE.Write.CylinderLow OUT (C),E ; дорожка low - LD BC,P_C_HIG + LD BC,IDE.Write.CylinderHigh OUT (C),D ; дорожка high - LD BC,P_HD_CS + LD BC,IDE.Write.DeviceHead DEC B IN A,(C) AND 0F0H @@ -112,19 +110,18 @@ HD_CMD_3: ; RET C EXX - LD C,PAGE3 + LD C,SLOT3 IN B,(C) EXX - OUT (PAGE3),A + OUT (SLOT3),A EX AF,AF' LD A,0C0H OUT (RGADR),A - LD BC,P_CMD - LD A,20H + LD BC,IDE.Write.Command + LD A,#20 ; OUT (C),A - AND A RET @@ -159,16 +156,16 @@ HD_RD_CMD: HD_RD_L1: EXX - LD C,PAGE3 + LD C,SLOT3 IN B,(C) EXX - OUT (PAGE3),A + OUT (SLOT3),A EX AF,AF' LD A,0C0H OUT (RGADR),A - LD BC,P_CMD + LD BC,IDE.Write.Command LD A,20H OUT (C),A @@ -184,7 +181,7 @@ HD_RET: EXX OUT (C),B EXX - LD BC,P_ERR + LD BC,IDE.Read.Error IN A,(C) AND A SCF @@ -195,7 +192,7 @@ HD_RET: RET HD_READ_CONT: - LD BC,P_DATS + LD BC,IDE.Read.Data HD_RD_CONT1: DUP 16 @@ -216,14 +213,14 @@ HD_RD_CONT2: JR NZ,HD_RD_L2 LD A,SYS_PAGE - OUT (PAGE3),A + OUT (SLOT3),A EX AF,AF' - LD HL,RAMD_FAT + LD HL,SYS_PAGE.RAM_TABLE LD L,A LD A,(HL) - OUT (PAGE3),A + OUT (SLOT3),A EX AF,AF' - LD HL,0C000H + LD HL,#C000 JR HD_RD_L2 ;*********************************************** @@ -243,13 +240,13 @@ HD_WR_CMD: RET C EXX - LD C,PAGE3 + LD C,SLOT3 IN B,(C) EXX - OUT (PAGE3),A + OUT (SLOT3),A EX AF,AF' - LD BC,P_CMD + LD BC,IDE.Write.Command LD A,30H OUT (C),A @@ -262,7 +259,7 @@ HD_WR_L2: ;####################################### IF HDD_TYPE - LD BC,P_DATS+100H + LD BC,IDE.Read.Data+100H LD D,32 HD_WR_CONT1: DUP 16 @@ -274,7 +271,7 @@ HD_WR_CONT1: ;####################################### ELSE LD D,64 - LD BC,P_DATS+100H + LD BC,IDE.Read.Data+100H HD_WR_LOOP: @@ -316,15 +313,15 @@ HD_WR_LOOP: JR NZ,HD_WR_L2 LD A,SYS_PAGE - OUT (PAGE3),A + OUT (SLOT3),A EX AF,AF' - LD HL,RAMD_FAT + LD HL,SYS_PAGE.RAM_TABLE LD L,A LD A,(HL) - OUT (PAGE3),A + OUT (SLOT3),A EX AF,AF' - LD HL,0C000H + LD HL,#C000 JR HD_WR_L2 ;******************************************************** @@ -333,14 +330,14 @@ HD_CMD_1: POP AF HD_CMD1_EX: ld a,0A0h - LD BC,P_HD_CS + LD BC,IDE.Write.DeviceHead OUT (C),A LD A,90h ; DIAGNOSTICS CALL HD_CMD_EXE AND A BIT 0,A RET Z - LD BC,P_ERR + LD BC,IDE.Read.Error IN A,(C) CP 1 RET Z @@ -354,7 +351,7 @@ HD_CMD_2: LD E,0 - LD BC,P_HD_CS + LD BC,IDE.Write.DeviceHead LD A,0A0H OUT (C),A @@ -364,7 +361,7 @@ HD_CMD_2: SET 0,E NO_HDD1: - LD BC,P_HD_CS + LD BC,IDE.Write.DeviceHead LD A,0B0H OUT (C),A @@ -383,24 +380,22 @@ NO_HDD2: TEST_HDD_DRV: LD HL,01FEH - LD BC,P_S_CNT + LD BC,IDE.Write.Counter OUT (C),L - LD BC,P_S_NUM + LD BC,IDE.Write.Sector OUT (C),H - LD BC,P_S_CNT+256 + LD BC,IDE.Write.Counter+256 IN A,(C) CP L RET NZ - LD BC,P_S_NUM+256 + LD BC,IDE.Write.Sector+256 IN A,(C) CP H RET HD_CMD_0: - POP AF - - LD BC,P_HD_CS + LD BC,IDE.Write.DeviceHead LD A,0A0H OUT (C),A @@ -412,14 +407,14 @@ HD_C0_L3: WAIT_HDD - LD BC,P_CMD + LD BC,IDE.Write.Command LD A,0ECH OUT (C),A WAIT_HDD ;HD_C0_L1: ; -; LD BC,P_HDST +; LD BC,IDE.Read.Status ; IN A,(C) ; BIT 7,A ; JR NZ,HD_C0_L1 @@ -431,7 +426,7 @@ HD_C0_L3: RET HD_ABSENT: - LD BC,P_HD_CS + LD BC,IDE.Write.DeviceHead LD A,0B0H OUT (C),A @@ -442,40 +437,40 @@ HD_ABSENT: RET HD_C0_L2: - LD BC,P_DATS - LD HL,HD_IDF_ADR - IN A,(PAGE3) + LD BC,IDE.Read.Data + LD HL,SYS_PAGE.HD_IDF_ADR + IN A,(SLOT3) LD D,A LD A,SYS_PAGE - OUT (PAGE3),A + OUT (SLOT3),A INIR INIR ;HD_C0_L4: -; LD BC,P_HDST +; LD BC,IDE.Read.Status ; IN A,(C) ; BIT 7,A ; JR NZ,HD_C0_L4 - LD A,(HD_IDF_ADR+12) ; число секторов + LD A,(SYS_PAGE.HD_IDF_ADR.sectors) ; число секторов LD C,A LD B,0 LD HL,0 - LD A,(HD_IDF_ADR+6) ; число головок + LD A,(SYS_PAGE.HD_IDF_ADR.heads) ; число головок LOOP_XX: ADD HL,BC DEC A JR NZ,LOOP_XX - LD (HD_IDF_ADR+4),HL + LD (SYS_PAGE.HD_IDF_ADR.sec_cyl),HL WAIT_HDD - LD BC,P_HD_CS + LD BC,IDE.Write.DeviceHead DEC B IN A,(C) AND 010H LD B,A - LD A,(HD_IDF_ADR+6) ; число головок + LD A,(SYS_PAGE.HD_IDF_ADR.heads) ; число головок DEC A AND 0FH @@ -483,22 +478,22 @@ LOOP_XX: OR B LD H,A - LD A,(HD_IDF_ADR+99) + LD A,(SYS_PAGE.HD_IDF_ADR+99) ;!HARDCODE BIT 1,A JR Z,HD_C0_NO_LBA SET 6,H HD_C0_NO_LBA: - LD BC,P_HD_CS + LD BC,IDE.Write.DeviceHead OUT (C),H - LD A,(HD_IDF_ADR+12) ; число секторов + LD A,(SYS_PAGE.HD_IDF_ADR.sectors) ; число секторов - LD BC,P_S_CNT + LD BC,IDE.Write.Counter OUT (C),A LD A,D - OUT (PAGE3),A + OUT (SLOT3),A LD A,91H ; SET HDD PARAMETERS CALL HD_CMD_EXE @@ -512,7 +507,7 @@ HD_C0_NO_LBA: HD_CMD_EXE: CALL HD_WAIT RET C - LD BC,P_CMD + LD BC,IDE.Write.Command OUT (C),A HD_WAIT: PUSH DE @@ -522,7 +517,7 @@ HD_WAIT: LD DE,0 HD_WAIT1: - LD BC,P_HDST + LD BC,IDE.Read.Status IN A,(C) BIT 7,A JR Z,HD_W_EXIT @@ -565,7 +560,7 @@ HD_CALC_SECS: RET NZ ; ошибка, слишком большой HDD.. PUSH BC - LD BC,P_HD_CS + LD BC,IDE.Write.DeviceHead DEC B IN A,(C) BIT 6,A @@ -577,14 +572,14 @@ HD_CALC_SECS: PUSH IX POP HL - IN A,(PAGE3) + IN A,(SLOT3) LD C,A LD A,SYS_PAGE - OUT (PAGE3),A + OUT (SLOT3),A LD A,C - LD (COPY_PAGE3),A + LD (SYS_PAGE.COPY_SLOT3),A - LD BC,(HD_IDF_ADR+4) ; число секторов на цилиндре + LD BC,(SYS_PAGE.HD_IDF_ADR.sec_cyl) ; число секторов на цилиндре ; HL,DE - номер сектора ; BC - число секторов на цилиндре @@ -609,7 +604,7 @@ NO_ADD: INC DE DIV_END: ; DE - результат, HL - остаток ; DE - цилиндр - LD A,(HD_IDF_ADR+12) ; A - число секторов на дорожке + LD A,(SYS_PAGE.HD_IDF_ADR.sectors) ; A - число секторов на дорожке ; HL - номер сектора в цилиндре LD B,0 LD C,A @@ -626,8 +621,8 @@ HD_CALC_LOOP2: INC L LD H,A ; HL - HEAD,SEC - LD A,(COPY_PAGE3) - OUT (PAGE3),A + LD A,(SYS_PAGE.COPY_SLOT3) + OUT (SLOT3),A POP BC AND A @@ -636,11 +631,11 @@ HD_CALC_LOOP2: FN_HDD_PART: POP AF BIT 0,A - LD A,#21 ; !HARDCODE + LD A,IDE.Chanel.Primary JR Z,.SET_CH - LD A,#01 ; !HARDCODE + LD A,IDE.Chanel.Secondary .SET_CH: - OUT (#BC),A ; !HARDCODE IDE.Chanel.Choose + OUT (IDE.Chanel.Set),A RET ; DB 'HDD_DRV_END' diff --git a/ZX_EXP/EXP_LP2.ASM b/ZX_EXP/EXP_LP2.ASM index 1e7b664..a9f757e 100644 --- a/ZX_EXP/EXP_LP2.ASM +++ b/ZX_EXP/EXP_LP2.ASM @@ -868,7 +868,7 @@ LP_BEG_P: ; for low printer & save WIN_GET_ZG: ; DE - адрес куда переслать фонт - LD HL,ZG_ADRESS + LD HL,ZG_ADDRESS LD BC,800H LDIR AND A @@ -1837,19 +1837,22 @@ WIN_PUT_SYM: ; DE - CALL LP_END_P RET -WIN_MOVE_WIN: ; HL - размер окна - ; DE - положение окна - AND A ; A - номер окна - SCF ; IX - новое положение окна +; HL - размер окна +; DE - положение окна +; A - номер окна +; IX - новое положение окна +WIN_MOVE_WIN: + AND A + SCF RET NZ PUSH IX PUSH HL - LD B,0FFH + LD B,0FFH ;!HARDCODE SHARED_PAGE LD IX,0C000H CALL WIN_COPY_WIN1 POP HL POP DE - LD B,0FFH + LD B,0FFH ;!HARDCODE SHARED_PAGE LD IX,0C000H CALL WIN_REST_WIN1 AND A diff --git a/ZX_EXP/EXP_SCR.ASM b/ZX_EXP/EXP_SCR.ASM index 7bbe1f7..76cb825 100644 --- a/ZX_EXP/EXP_SCR.ASM +++ b/ZX_EXP/EXP_SCR.ASM @@ -33,16 +33,15 @@ PIC_S MACRO pg,cnt,adr ALIGN 8 LP_SCR_MNU: ; -; LP_S 040h,14,040E7H -; -; LP_S 040h,14,04807H -; LP_S 040h,14,04827H -; LP_S 040h,14,04847H -; LP_S 040h,14,04867H -; LP_S 040h,14,04887H -; LP_S 040h,14,048A7H -; LP_S 040h,14,048C7H -; LP_S 040h,14,048E7H +; LP_S %0100'0000,14,#40E7 +; LP_S %0100'0000,14,#4807 +; LP_S %0100'0000,14,#4827 +; LP_S %0100'0000,14,#4847 +; LP_S %0100'0000,14,#4867 +; LP_S %0100'0000,14,#4887 +; LP_S %0100'0000,14,#48A7 +; LP_S %0100'0000,14,#48C7 +; LP_S %0100'0000,14,#48E7 ; ; DEFB 0FFh,0,0,0 @@ -50,43 +49,43 @@ LP_SCR_80: DB 40,32,0,0,1BH,0,0,0 DB 0,0,0,0,0,0,0,0 -; LP_S 01100010B,40,4000H -; LP_S 01100010B,40,4028H -; LP_S 01100010B,40,4050H -; LP_S 01100010B,40,4078H -; LP_S 01100010B,40,40A0H -; LP_S 01100010B,40,40C8H +; LP_S %0110'0010,40,4000H +; LP_S %0110'0010,40,4028H +; LP_S %0110'0010,40,4050H +; LP_S %0110'0010,40,4078H +; LP_S %0110'0010,40,40A0H +; LP_S %0110'0010,40,40C8H ; -; LP_S 01100010B,40,4800H -; LP_S 01100010B,40,4828H -; LP_S 01100010B,40,4850H -; LP_S 01100010B,40,4878H -; LP_S 01100010B,40,48A0H -; LP_S 01100010B,40,48C8H +; LP_S %0110'0010,40,4800H +; LP_S %0110'0010,40,4828H +; LP_S %0110'0010,40,4850H +; LP_S %0110'0010,40,4878H +; LP_S %0110'0010,40,48A0H +; LP_S %0110'0010,40,48C8H ; -; LP_S 01100010B,40,5000H -; LP_S 01100010B,40,5028H -; LP_S 01100010B,40,5050H -; LP_S 01100010B,40,5078H -; LP_S 01100010B,40,50A0H -; LP_S 01100010B,40,50C8H +; LP_S %0110'0010,40,5000H +; LP_S %0110'0010,40,5028H +; LP_S %0110'0010,40,5050H +; LP_S %0110'0010,40,5078H +; LP_S %0110'0010,40,50A0H +; LP_S %0110'0010,40,50C8H ; -; LP_S 01100100B,40,4000H -; LP_S 01100100B,40,4028H -; LP_S 01100100B,40,4050H -; LP_S 01100100B,40,4078H -; LP_S 01100100B,40,40A0H -; LP_S 01100100B,40,40C8H +; LP_S %0110'0100,40,4000H +; LP_S %0110'0100,40,4028H +; LP_S %0110'0100,40,4050H +; LP_S %0110'0100,40,4078H +; LP_S %0110'0100,40,40A0H +; LP_S %0110'0100,40,40C8H ; -; LP_S 01100100B,40,4800H -; LP_S 01100100B,40,4828H -; LP_S 01100100B,40,4850H -; LP_S 01100100B,40,4878H -; LP_S 01100100B,40,48A0H -; LP_S 01100100B,40,48C8H +; LP_S %0110'0100,40,4800H +; LP_S %0110'0100,40,4828H +; LP_S %0110'0100,40,4850H +; LP_S %0110'0100,40,4878H +; LP_S %0110'0100,40,48A0H +; LP_S %0110'0100,40,48C8H ; -; LP_S 01100100B,40,5000H -; LP_S 01100100B,40,5028H +; LP_S %0110'0100,40,5000H +; LP_S %0110'0100,40,5028H ; ; DEFB 0FFh,0,0,0 ; @@ -94,43 +93,43 @@ LP_SCR_40: DB 40,32,0,0,7BH,0,0,0 DB 0,0,0,0,0,0,0,0 ; -; LP_S 01000100B,40,5050H -; LP_S 01000100B,40,5078H -; LP_S 01000100B,40,50A0H -; LP_S 01000100B,40,50C8H +; LP_S %0100'0100,40,5050H +; LP_S %0100'0100,40,5078H +; LP_S %0100'0100,40,50A0H +; LP_S %0100'0100,40,50C8H ; -; LP_S 01000110B,40,4000H -; LP_S 01000110B,40,4028H -; LP_S 01000110B,40,4050H -; LP_S 01000110B,40,4078H -; LP_S 01000110B,40,40A0H -; LP_S 01000110B,40,40C8H +; LP_S %0100'0110,40,4000H +; LP_S %0100'0110,40,4028H +; LP_S %0100'0110,40,4050H +; LP_S %0100'0110,40,4078H +; LP_S %0100'0110,40,40A0H +; LP_S %0100'0110,40,40C8H ; -; LP_S 01000110B,40,4800H -; LP_S 01000110B,40,4828H -; LP_S 01000110B,40,4850H -; LP_S 01000110B,40,4878H -; LP_S 01000110B,40,48A0H -; LP_S 01000110B,40,48C8H +; LP_S %0100'0110,40,4800H +; LP_S %0100'0110,40,4828H +; LP_S %0100'0110,40,4850H +; LP_S %0100'0110,40,4878H +; LP_S %0100'0110,40,48A0H +; LP_S %0100'0110,40,48C8H ; -; LP_S 01000110B,40,5000H -; LP_S 01000110B,40,5028H -; LP_S 01000110B,40,5050H -; LP_S 01000110B,40,5078H -; LP_S 01000110B,40,50A0H -; LP_S 01000110B,40,50C8H +; LP_S %0100'0110,40,5000H +; LP_S %0100'0110,40,5028H +; LP_S %0100'0110,40,5050H +; LP_S %0100'0110,40,5078H +; LP_S %0100'0110,40,50A0H +; LP_S %0100'0110,40,50C8H ; -; LP_S 01001000B,40,4000H -; LP_S 01001000B,40,4028H -; LP_S 01001000B,40,4050H -; LP_S 01001000B,40,4078H -; LP_S 01001000B,40,40A0H -; LP_S 01001000B,40,40C8H +; LP_S %0100'1000,40,4000H +; LP_S %0100'1000,40,4028H +; LP_S %0100'1000,40,4050H +; LP_S %0100'1000,40,4078H +; LP_S %0100'1000,40,40A0H +; LP_S %0100'1000,40,40C8H ; -; LP_S 01001000B,40,4800H -; LP_S 01001000B,40,4828H -; LP_S 01001000B,40,4850H -; LP_S 01001000B,40,4878H +; LP_S %0100'1000,40,4800H +; LP_S %0100'1000,40,4828H +; LP_S %0100'1000,40,4850H +; LP_S %0100'1000,40,4878H ; ; DEFB 0FFh,0,0,0 ; @@ -138,68 +137,66 @@ LP_SCR_32: DB 32,24,4,4,30H,1,0,0 DB 0,0,0,0,0,0,0,0 ; -; LP_S 040h,32,04000H -; LP_S 040h,32,04020H -; LP_S 040h,32,04040H -; LP_S 040h,32,04060H -; LP_S 040h,32,04080H -; LP_S 040h,32,040A0H -; LP_S 040h,32,040C0H -; LP_S 040h,32,040E0H +; LP_S %040h',32,4000H +; LP_S %040h',32,4020H +; LP_S %040h',32,4040H +; LP_S %040h',32,4060H +; LP_S %040h',32,4080H +; LP_S %040h',32,40A0H +; LP_S %040h',32,40C0H +; LP_S %040h',32,40E0H ; -; LP_S 040h,32,04800H -; LP_S 040h,32,04820H -; LP_S 040h,32,04840H -; LP_S 040h,32,04860H -; LP_S 040h,32,04880H -; LP_S 040h,32,048A0H -; LP_S 040h,32,048C0H -; LP_S 040h,32,048E0H +; LP_S %040h',32,4800H +; LP_S %040h',32,4820H +; LP_S %040h',32,4840H +; LP_S %040h',32,4860H +; LP_S %040h',32,4880H +; LP_S %040h',32,48A0H +; LP_S %040h',32,48C0H +; LP_S %040h',32,48E0H ; -; LP_S 040h,32,05000H -; LP_S 040h,32,05020H -; LP_S 040h,32,05040H -; LP_S 040h,32,05060H -; LP_S 040h,32,05080H -; LP_S 040h,32,050A0H -; LP_S 040h,32,050C0H -; LP_S 040h,32,050E0H -; -; LP_S 0FFh,0,0 +; LP_S %040h',32,5000H +; LP_S %040h',32,5020H +; LP_S %040h',32,5040H +; LP_S %040h',32,5060H +; LP_S %040h',32,5080H +; LP_S %040h',32,50A0H +; LP_S %040h',32,50C0H +; LP_S %040h',32,50E0H ; +; LP_S %0FFh',0,0; LP_SCR_64: DB 32,24,4,4,9BH,0,0,0 DB 0,0,0,0,0,0,0,0 ; -; LP_S 06Ah,32,04000H -; LP_S 06Ah,32,04020H -; LP_S 06Ah,32,04040H -; LP_S 06Ah,32,04060H -; LP_S 06Ah,32,04080H -; LP_S 06Ah,32,040A0H -; LP_S 06Ah,32,040C0H -; LP_S 06Ah,32,040E0H +; LP_S %06Ah',32,4000H +; LP_S %06Ah',32,4020H +; LP_S %06Ah',32,4040H +; LP_S %06Ah',32,4060H +; LP_S %06Ah',32,4080H +; LP_S %06Ah',32,40A0H +; LP_S %06Ah',32,40C0H +; LP_S %06Ah',32,40E0H ; -; LP_S 06Ah,32,04800H -; LP_S 06Ah,32,04820H -; LP_S 06Ah,32,04840H -; LP_S 06Ah,32,04860H -; LP_S 06Ah,32,04880H -; LP_S 06Ah,32,048A0H -; LP_S 06Ah,32,048C0H -; LP_S 06Ah,32,048E0H +; LP_S %06Ah',32,4800H +; LP_S %06Ah',32,4820H +; LP_S %06Ah',32,4840H +; LP_S %06Ah',32,4860H +; LP_S %06Ah',32,4880H +; LP_S %06Ah',32,48A0H +; LP_S %06Ah',32,48C0H +; LP_S %06Ah',32,48E0H ; -; LP_S 06Ah,32,05000H -; LP_S 06Ah,32,05020H -; LP_S 06Ah,32,05040H -; LP_S 06Ah,32,05060H -; LP_S 06Ah,32,05080H -; LP_S 06Ah,32,050A0H -; LP_S 06Ah,32,050C0H -; LP_S 06Ah,32,050E0H +; LP_S %06Ah',32,5000H +; LP_S %06Ah',32,5020H +; LP_S %06Ah',32,5040H +; LP_S %06Ah',32,5060H +; LP_S %06Ah',32,5080H +; LP_S %06Ah',32,50A0H +; LP_S %06Ah',32,50C0H +; LP_S %06Ah',32,50E0H ; -; LP_S 0FFh,0,0 - +; LP_S %0FFh',0,0 PIC_320X256_1: DB 40,32,0,0,20H,0,8,0 DB 0,0,0,0,0,0,0,0 diff --git a/ZX_EXP/FONT.ASM b/ZX_EXP/FONT.ASM index bde6d66..46f9495 100644 --- a/ZX_EXP/FONT.ASM +++ b/ZX_EXP/FONT.ASM @@ -1,4 +1,4 @@ -ZG_ADRESS: +ZG_ADDRESS: DB 000h,07Eh,07Eh,06Ch,010h,038h,010h,000h,0FFh,000h,0FFh,00Fh,03Ch,03Fh,07Fh,018h DB 080h,002h,018h,066h,07Fh,03Eh,000h,018h,018h,018h,000h,000h,000h,000h,000h,000h DB 000h,030h,06Ch,06Ch,030h,000h,038h,060h,018h,060h,000h,000h,000h,000h,000h,006h diff --git a/ZX_EXP/SERVICE.ASM b/ZX_EXP/SERVICE.ASM index 74c38c6..567fc72 100644 --- a/ZX_EXP/SERVICE.ASM +++ b/ZX_EXP/SERVICE.ASM @@ -3,7 +3,7 @@ SERVICE: LD HL,SR_TAB LD DE,SR_MENU - LD BC,SR_LEN + LD BC,SR_MENU.Size PUSH HL CALL RUN_MENU ;09f3 POP HL @@ -30,9 +30,8 @@ SR_MENU: DC 'TURBO ON ' DC 'Clear RAM' DC 'RETURN' - DC ' ' ; маркер конца - -SR_LEN EQU $-SR_MENU + DC " " ; маркер конца +.Size EQU $-SR_MENU ;***************************** @@ -109,7 +108,7 @@ CLEAR_RAM: RST 18h IFDEF ZX_BIOS ; при очистке памяти из меню спектрума поломается возврат в DSS по CAD, поэтому отключаем возврат - LD A,#EE ;!HARDCODE Conf_port.RET_PORT + LD A,#EE ;!HARDCODE ACEX.RET_PORT LD BC,0*256 + #F8 ;!HARDCODE BIOS.SET_PORTS CALL #3D13 ;!HARDCODE ToBIOS_3D13 ENDIF @@ -177,7 +176,7 @@ IS_MENU: DC 'Pentagon 512' DC 'Restart ' DC 'RETURN' - DC ' ' ; маркер конца + DC " " ; маркер конца .Size EQU $-IS_MENU ;****************************** @@ -218,10 +217,10 @@ SPRINTER_2X: JP RESET_1 ; сброс без перезагрузки AY8910: - LD D,#35 - CALL CMOS_RD - OR 1 - CALL CMOS_WR + ;LD D,#35 + ;CALL CMOS_RD + ;OR 1 + ;CALL CMOS_WR LD BC,204Eh ; port all_mode IN A,(C) @@ -232,10 +231,10 @@ AY8910: JR SPRINTER_ALL SPRINTER_1: - LD D,35H - CALL CMOS_RD - AND 0FEh - CALL CMOS_WR + ;LD D,35H + ;CALL CMOS_RD + ;AND 0FEh + ;CALL CMOS_WR LD BC,204Eh IN A,(C) @@ -627,12 +626,12 @@ SCORPION: PENTAGON: CALL CNF_PN_320 - LD DE,CNF_2+D_TBON + LD DE,CNF_1+D_TBON JR CONFIG_SET1 PENTAGON512: CALL CNF_PN_320 - LD DE,CNF_2+D_TBON+CNF_512 + LD DE,CNF_1+D_TBON+CNF_512 ; JR CONFIG_SET1 CONFIG_SET1: @@ -691,7 +690,7 @@ UTILIT: CALL DOS_ON LD A,0 ; DETECT_HDD - CALL HDD_EXE + CALL EXP_HDD CALL DOS_OFF JR C,DISK_UTILIT diff --git a/ZX_EXP/TEST.ASM b/ZX_EXP/TEST.ASM index b08dd4d..4941bdb 100644 --- a/ZX_EXP/TEST.ASM +++ b/ZX_EXP/TEST.ASM @@ -277,9 +277,9 @@ ERR_TST_M: ;************************************** CALL_DOS_MOVE: - LD DE,5C00H-DOS_PROG_LEN + LD DE,DOS_PROG.Exec LD HL,DOS_PROG - LD BC,DOS_PROG_LEN + LD BC,DOS_PROG.Size LDIR RET ; @@ -295,34 +295,36 @@ CALL_DOS1: LD (5C63H),DE LD (5C65H),DE CALL CALL_DOS_MOVE - JP 5C00H-DOS_PROG_LEN + JP DOS_PROG.Exec CALL_DOS: PUSH HL PUSH DE PUSH BC PUSH AF CALL CALL_DOS_MOVE - LD A,13H - LD (5C00H-DOS_PROG_LEN+DOS_PROG_A),A + LD A,#13 ; #13 из AUTO_1303 + LD (DOS_PROG.Patch),A POP AF POP BC POP DE POP HL - JP 5C00H-DOS_PROG_LEN + JP DOS_PROG.Exec DOS_PROG: - PUSH AF - XOR A - OUT (SYS_PORT_OFF),A - POP AF - CALL 3D03H -DOS_PROG_A EQU $-DOS_PROG-1 - PUSH AF - LD A,0 - OUT (CNF_PORT),A - POP AF - RET -DOS_PROG_LEN EQU $-DOS_PROG + DISP #5C00 - DOS_PROG.Size ;!HARDCODE +.Exec: PUSH AF + XOR A + OUT (SYS_PORT_OFF),A + POP AF +.Patch+2: CALL #3D03 + PUSH AF + LD A,0 + OUT (CNF_PORT),A + POP AF + RET +.Size EQU $ - .Exec + ENT + CONT_PROG: LD HL,1AFDH @@ -334,7 +336,4 @@ CONT_PROG: LD A,0E8H LD (DE),A JP SW_ROM - - - - +; \ No newline at end of file diff --git a/ZX_EXP2.ASM b/ZX_EXP2.ASM index 394d614..3f72b3c 100644 --- a/ZX_EXP2.ASM +++ b/ZX_EXP2.ASM @@ -3,27 +3,28 @@ DEVICE ZXSPECTRUM128 ORG 0 - INCLUDE 'INC/SPRINT00.INC' ; константы, макросы.. -;****************************** -; ***** BEGIN EXPANSION ***** -;****************************** + ;INCLUDE 'INC/SPRINT00.INC' ; константы, макросы.. + INCLUDE 'shared_includes/constants/sp2000.INC' ; константы, макросы.. + ; *************************** + ; ***** BEGIN EXPANSION ***** + ; *************************** START: DI HALT -;*************************** +;***********************************************************************; BLOCK #10-$,255 RET -;*************************** +;***********************************************************************; BLOCK #38-$,255 EI RETI -;*************************** +;***********************************************************************; BLOCK #66-$,#C9 RETN -;*************************** +;***********************************************************************; BLOCK #100-$,255 - INCLUDE 'EXP/EXP_HDD.ASM' + INCLUDE 'ZX_EXP/EXP_HDD.ASM' ; INCLUDE 'EXP_KBD.ASZ' ;GLOBAL_RESET: @@ -38,50 +39,58 @@ START: ; PUSH HL ; DI ; RET - +;***********************************************************************; BLOCK #3FD0-$,255 +; PUSH AF +; LD A,D_ROM16OFF +; OUT (SYS_PORT_ON),A +; POP AF +; HD_CMD_XR_RET: +; RET - PUSH AF - LD A,D_ROM16OFF - OUT (SYS_PORT_ON),A - POP AF -HD_CMD_XR_RET: - RET - +;***********************************************************************; + BLOCK #3FD7-$,255 HD_CMD_XR: JP HD_CMD -;************************ +;***********************************************************************; +;!FIXIT not used BLOCK #3FE0-$,255 -SND_TEST_RET: - LD A,D_ROM16OFF - OUT (SYS_PORT_OFF),A - JP SND_TEST_RET +; SND_TEST_RET: +; LD A,D_ROM16OFF +; OUT (SYS_PORT_OFF),A +; JP SND_TEST_RET -;*************************** +;***********************************************************************; BLOCK #3FE8-$,255 HD_EXP_RET: PUSH AF - LD A,D_ROM16OFF - OUT (SYS_PORT_ON),A + LD A,CNF_PORT.ZX_BIOS + ;!TEST + ;OUT (SYS_PORT_ON),A + OUT (CNF_PORT),A + ; JP HD_EXP_EXE +;***********************************************************************; BLOCK #3FF0-$,255 - HD_DOS_RET: PUSH AF DI - LD A,D_ROM16OFF - OUT (SYS_PORT_OFF),A + LD A,CNF_PORT.ZX_BIOS + OUT (SYS_PORT.OFF),A JR HD_CMD_XR +;***********************************************************************; + BLOCK #3FF8-$,255 EXP_FNS_RET: PUSH AF - LD A,D_ROM16OFF - OUT (SYS_PORT_OFF),A - JP HD_CMD_XR_RET + LD A,CNF_PORT.ZX_BIOS + OUT (SYS_PORT.OFF),A + //JP HD_CMD_XR_RET + RET -;****************************************** +;***********************************************************************; BLOCK #4000-$,255 ; ; diff --git a/inc/char_codes.inc b/inc/char_codes.inc deleted file mode 100644 index 4d8c5c7..0000000 --- a/inc/char_codes.inc +++ /dev/null @@ -1,203 +0,0 @@ -; ZX Spectrum char codes -; By Marcos Cruz (programandala.net) - -; --------------------------------------------------------------------- -; Characters (new format) -ZX_Char: -; Not used equ 0x00 -; Not used equ 0x01 -; Not used equ 0x02 -; Not used equ 0x03 -; Not used equ 0x04 -; Not used equ 0x05 -.caps equ 0x06 ; toggle caps lock -.print_comma equ 0x06 ; (when printed) -.edit equ 0x07 ; edit -.esc equ 0x07 ; escape -.cursor_left equ 0x08 -.backspace equ 0x08 -.right equ 0x09 ; cursor right -.cursor_down equ 0x0A -.cursor_up equ 0x0B -.delete_left equ 0x0C ; delete (backspace) -.form_feed equ 0x0C ; used for printing -.carriage_return equ 0x0D ; enter key -.extended_mode equ 0x0E ; -.number equ 0x0E ; -.graphics equ 0x0F ; toggle graphics mode -.ink equ 0x10 -.paper equ 0x11 -.flash equ 0x12 -.bright equ 0x13 -.inverse equ 0x14 -.over equ 0x15 -.at equ 0x16 -.tab equ 0x17 ; tab (screen only) -; Not used equ 0x18 -; Not used equ 0x19 -; Not used equ 0x1A -; Not used equ 0x1B -; Not used equ 0x1C -; Not used equ 0x1D -; Not used equ 0x1E -; Not used equ 0x1F -.space equ 0x20 - -; Standart symbols -; #21 ! #22 " #23 # #24 $ #25 % #26 & #27 , #28 ( -; #29 ) #2A * #2B + #2C , #2D - #2F . #2F / #30 0 -; #31 1 #32 2 #33 3 #34 4 #35 5 #36 6 #37 7 #38 8 -; #39 9 #3A : #3B ; #3C < #3D = #3E > #3F ? #40 @ -; #41 A #42 B #43 C #44 D #45 E #46 F #47 G #48 H -; #49 I #4A J #4B K #4C L #4D M #4E N #4F O #50 P -; #51 Q #52 R #53 S #54 T #55 U #56 V #57 W #58 X -; #59 Y #5A Z #5B [ #5C / #5D ] #5E ^ #5F _ #60 ? -; #61 a #62 b #63 c #64 d #65 e #66 f #67 g #68 h -; #69 i #6A j #6B k #6C l #6D m #6E n #6F o #70 p -; #71 q #72 r #73 s #74 t #75 u #76 v #77 w #78 x -; #79 y #7A z #7B { #7C | #7D } #7E ~ -.copyright equ 0x7F ; copyright sign - -; --------------------------------------------------------------------- -; User Defined Graphics -; 0 1 2 3 4 5 6 7 -;| | | #| |# | |# #| | | | #| |# | |# #| -;| | | | | | | | | #| | #| | #| | #| -; 8 9 A B C D E F -;| | | #| |# | |# #| | | | #| |# | |# #| -;|# | |# | |# | |# | |# #| |# #| |# #| |# #| -ZX_UDG: -.block_0 equ 0x80 -.block_1 equ 0x81 -.block_2 equ 0x82 -.block_3 equ 0x83 -.block_4 equ 0x84 -.block_5 equ 0x85 -.block_6 equ 0x86 -.block_7 equ 0x87 -.block_8 equ 0x88 -.block_9 equ 0x89 -.block_A equ 0x8A -.block_B equ 0x8B -.block_C equ 0x8C -.block_D equ 0x8D -.block_E equ 0x8E -.block_F equ 0x8F -.a equ 0x90 -.b equ 0x91 -.c equ 0x92 -.d equ 0x93 -.e equ 0x94 -.f equ 0x95 -.g equ 0x96 -.h equ 0x97 -.i equ 0x98 -.j equ 0x99 -.k equ 0x9A -.l equ 0x9B -.m equ 0x9C -.n equ 0x9D -.o equ 0x9E -.p equ 0x9F -.q equ 0xA0 -.r equ 0xA1 -.s equ 0xA2 -.t equ 0xA3 ; token SPECTRUM in 128 basic -.u equ 0xA4 ; token PLAY in 128 basic -; --------------------------------------------------------------------- -; Tokens -ZX_Token -.spectrum equ 0xA3 ; UDG T in 48 basic -.play equ 0xA4 ; UDG U in 48 basic -.rnd equ 0xA5 -.inkey_dollar equ 0xA6 -.pi equ 0xA7 -.fn equ 0xA8 -.point equ 0xA9 -.screen_dollar equ 0xAA -.attr equ 0xAB -.at equ 0xAC -.tab equ 0xAD -.val_dollar equ 0xAE -.code equ 0xAF -.val equ 0xB0 -.len equ 0xB1 -.sin equ 0xB2 -.cos equ 0xB3 -.tan equ 0xB4 -.asn equ 0xB5 -.acs equ 0xB6 -.atn equ 0xB7 -.ln equ 0xB8 -.exp equ 0xB9 -.int equ 0xBA -.sqr equ 0xBB -.sgn equ 0xBC -.abs equ 0xBD -.peek equ 0xBE -.in equ 0xBF -.usr equ 0xC0 -.str_dollar equ 0xC1 -.chr_dollar equ 0xC2 -.not equ 0xC3 -.bin equ 0xC4 -.or equ 0xC5 -.and equ 0xC6 -.less_or_equal equ 0xC7 -.greater_or_equal equ 0xC8 -.not_equal equ 0xC9 -.line equ 0xCA -.then equ 0xCB -.to equ 0xCC -.step equ 0xCD -.def_fn equ 0xCE -.cat equ 0xCF -.format equ 0xD0 -.move equ 0xD1 -.erase equ 0xD2 -.open_channel equ 0xD3 -.close_channel equ 0xD4 -.merge equ 0xD5 -.verify equ 0xD6 -.beep equ 0xD7 -.circle equ 0xD8 -.ink equ 0xD9 -.paper equ 0xDA -.flash equ 0xDB -.bright equ 0xDC -.inverse equ 0xDD -.over equ 0xDE -.out equ 0xDF -.lprint equ 0xE0 -.llist equ 0xE1 -.stop equ 0xE2 -.read equ 0xE3 -.data equ 0xE4 -.restore equ 0xE5 -.new equ 0xE6 -.border equ 0xE7 -.continue equ 0xE8 -.dim equ 0xE9 -.rem equ 0xEA -.for equ 0xEB -.go_to equ 0xEC -.go_sub equ 0xED -.input equ 0xEE -.load equ 0xEF -.list equ 0xF0 -.let equ 0xF1 -.pause equ 0xF2 -.next equ 0xF3 -.poke equ 0xF4 -.print equ 0xF5 -.plot equ 0xF6 -.run equ 0xF7 -.save equ 0xF8 -.randomize equ 0xF9 -.if equ 0xFA -.cls equ 0xFB -.draw equ 0xFC -.clear equ 0xFD -.return equ 0xFE -.copy equ 0xFF -; --------------------------------------------------------------------- \ No newline at end of file diff --git a/inc/rom_routines.inc b/inc/rom_routines.inc index 4a011dd..a0c1941 100644 --- a/inc/rom_routines.inc +++ b/inc/rom_routines.inc @@ -27,1134 +27,1141 @@ ; 2017-02-09: Add two additional entry points, and two 128K routines. ; ============================================================== + MACRO RST_ROM name + RST #20 + DW name + ENDM -rom_0058: equ 0x0058 ; XXX TODO -- name -rom_abs: equ 0x346A -rom_acs: equ 0x3843 -rom_add_back: equ 0x3004 -rom_add_ch_1: equ 0x0F8B -rom_add_char: equ 0x0F81 -rom_add_char_keeping_current_mode: equ 0x0F85 -rom_add_rep_6: equ 0x309F -rom_addend_0: equ 0x2FF9 -rom_addition: equ 0x3014 -rom_addn_oflw: equ 0x303C -rom_all_added: equ 0x300D -rom_alpha: equ 0x2C8D -rom_alphanum: equ 0x2C88 -rom_arc_end: equ 0x245F -rom_arc_loop: equ 0x2425 -rom_arc_start: equ 0x2439 -rom_asn: equ 0x3833 -rom_atn: equ 0x37E2 -rom_auto_l_1: equ 0x17CE -rom_auto_l_2: equ 0x17E1 -rom_auto_l_3: equ 0x17E4 -rom_auto_l_4: equ 0x17ED -rom_auto_list: equ 0x1795 -rom_bc_spaces: equ 0x0030 -rom_be_end: equ 0x03F6 -rom_be_h_and_l_lp: equ 0x03D6 -rom_be_ix_plus_0: equ 0x03D4 -rom_be_ix_plus_1: equ 0x03D3 -rom_be_ix_plus_2: equ 0x03D2 -rom_be_ix_plus_3: equ 0x03D1 -rom_beep: equ 0x03F8 -rom_beeper: equ 0x03B5 -rom_bin_digit: equ 0x2CA2 -rom_bin_end: equ 0x2CB3 -rom_bits_zero: equ 0x3283 -rom_border: equ 0x2294 -rom_border_1: equ 0x22A6 -rom_border_2297: equ 0x2297 ; secondary entry to rom_border -rom_border_229b: equ 0x229B ; secondary entry to rom_border -rom_both_null: equ 0x3572 -rom_break_key: equ 0x1F54 ; return the carry flag reset if SHIFT and BREAK keys are both being pressed. -rom_byte_comp: equ 0x3564 -rom_byte_zero: equ 0x327E -rom_c_arc_ge1: equ 0x235A -rom_c_ent: equ 0x37B7 -rom_c_r_gre_1: equ 0x233B -rom_ca_10_by_a_plus_c: equ 0x2F8B -rom_calculate: equ 0x335B -rom_call_jump: equ 0x162C -rom_call_sub: equ 0x15F7 -rom_cases: equ 0x37FA -rom_cat_etc: equ 0x1793 -rom_cd_prms1: equ 0x247D -rom_ch_add_plus_1: equ 0x0074 -rom_chan_flag: equ 0x1615 -rom_chan_k: equ 0x1634 -rom_chan_op_1: equ 0x1610 -rom_chan_open: equ 0x1601 ; open a channel (channel in A) -rom_chan_p: equ 0x164D -rom_chan_s: equ 0x1642 ; set flags for upper screen channel -rom_chan_s_1: equ 0x1646 -rom_check_end: equ 0x1BEE -rom_chn_cd_lu: equ 0x162D -rom_chrs: equ 0x35C9 -rom_circle: equ 0x2320 -rom_cl_09_1: equ 0x1CD6 -rom_cl_addr: equ 0x0E9B -rom_cl_all: equ 0x0DAF ; clear whole (upper) display area -rom_cl_attr: equ 0x0E88 -rom_cl_chan: equ 0x0D94 -rom_cl_chan_a: equ 0x0DA0 -rom_cl_line: equ 0x0E44 -rom_cl_line_1: equ 0x0E4A -rom_cl_line_2: equ 0x0E4D -rom_cl_line_3: equ 0x0E80 -rom_cl_sc_all: equ 0x0DFE -rom_cl_scr_1: equ 0x0E05 -rom_cl_scr_2: equ 0x0E0D -rom_cl_scr_3: equ 0x0E19 -rom_cl_scroll: equ 0x0E00 ; scroll the number of lines in the B register -rom_cl_set: equ 0x0DD9 -rom_cl_set_1: equ 0x0DEE -rom_cl_set_2: equ 0x0DF4 -rom_cl_str_lu: equ 0x1716 -rom_class_01: equ 0x1C1F -rom_class_02: equ 0x1C4E -rom_class_03: equ 0x1C0D -rom_class_04: equ 0x1C6C -rom_class_05: equ 0x1C11 -rom_class_07: equ 0x1C96 -rom_class_09: equ 0x1CBE -rom_class_0b: equ 0x1CDB -rom_class_tbl: equ 0x1C01 -rom_clear: equ 0x1EAC -rom_clear_1: equ 0x1EB7 -rom_clear_2: equ 0x1EDC -rom_clear_prb: equ 0x0EDF -rom_clear_run: equ 0x1EAF -rom_clear_sp: equ 0x1097 -rom_close: equ 0x16E5 -rom_close_0_16EB: equ 0x16EB -rom_close_1: equ 0x16FC -rom_close_2: equ 0x1701 -rom_close_str: equ 0x171C -rom_cls: equ 0x0D6B ; CLS -rom_cls_1: equ 0x0D87 -rom_cls_2: equ 0x0D89 -rom_cls_3: equ 0x0D8E -rom_cls_lower: equ 0x0D6E -rom_co_change: equ 0x226C -rom_co_temp_1: equ 0x21E1 -rom_co_temp_2: equ 0x21E2 -rom_co_temp_3: equ 0x21F2 -rom_co_temp_4: equ 0x21FC -rom_co_temp_5: equ 0x2211 -rom_co_temp_6: equ 0x2228 -rom_co_temp_7: equ 0x2234 -rom_co_temp_8: equ 0x223E -rom_co_temp_9: equ 0x2246 -rom_co_temp_a: equ 0x2257 -rom_co_temp_b: equ 0x2258 -rom_co_temp_c: equ 0x2273 -rom_co_temp_d: equ 0x227D -rom_co_temp_e: equ 0x2287 -rom_code: equ 0x3669 -rom_comma_sp: equ 0x1537 -rom_continue: equ 0x1E5F -rom_copy: equ 0x0EAC -rom_copy_1: equ 0x0EB2 -rom_copy_2: equ 0x0EC9 -rom_copy_3: equ 0x0ED3 -rom_copy_buff: equ 0x0ECD -rom_copy_end: equ 0x0EDA -rom_copy_l_1: equ 0x0EFD -rom_copy_l_2: equ 0x0F0C -rom_copy_l_3: equ 0x0F14 -rom_copy_l_4: equ 0x0F18 -rom_copy_l_5: equ 0x0F1E -rom_copy_line: equ 0x0EF4 -rom_copyright: equ 0x1539 -rom_cos: equ 0x37AA -rom_count_one: equ 0x31FA -rom_cp_lines: equ 0x1980 -rom_ctlchrtab: equ 0x0A11 -rom_d_l_diag: equ 0x24D4 -rom_d_l_hr_vt: equ 0x24DB -rom_d_l_loop: equ 0x24CE -rom_d_l_plot: equ 0x24EC -rom_d_l_range: equ 0x24F7 -rom_d_l_step: equ 0x24DF -rom_d_letter: equ 0x2C1F -rom_d_no_loop: equ 0x2C2E -rom_d_rport_c: equ 0x2C05 -rom_d_run: equ 0x2C15 -rom_d_size: equ 0x2C2D -rom_data: equ 0x1E27 -rom_data_1: equ 0x1E2C -rom_data_2: equ 0x1E37 -rom_de_comma_paren_de_plus_1_paren: equ 0x2AEE -rom_dec_jr_nz: equ 0x367A -rom_dec_rpt_c: equ 0x2CCF -rom_dec_sto_1: equ 0x2CD5 -rom_dec_to_fp: equ 0x2C9B -rom_decimal: equ 0x2CCB -rom_def_fn: equ 0x1F60 -rom_def_fn_1: equ 0x1F6A -rom_def_fn_2: equ 0x1F7D -rom_def_fn_3: equ 0x1F86 -rom_def_fn_4: equ 0x1F89 -rom_def_fn_5: equ 0x1F94 -rom_def_fn_6: equ 0x1FA6 -rom_def_fn_7: equ 0x1FBD -rom_delete: equ 0x33A1 -rom_differ: equ 0x19DD -rom_dim: equ 0x2C02 -rom_dim_clear: equ 0x2C7C -rom_dim_sizes: equ 0x2C7F -rom_div_34th: equ 0x31DB -rom_div_loop: equ 0x31D2 -rom_div_start: equ 0x31E2 -rom_division: equ 0x31AF -rom_divn_expt: equ 0x313D -rom_dl_larger: equ 0x24CB -rom_dl_x_ge_y: equ 0x24C4 -rom_double_a: equ 0x338C -rom_dr_3_prms: equ 0x238D -rom_dr_prms: equ 0x23C1 -rom_dr_sin_nz: equ 0x23A3 -rom_draw: equ 0x2382 -rom_draw_line: equ 0x24B7 -rom_draw_line_24BA: equ 0x24BA ; entry point of the draw_line routine -rom_draw_save: equ 0x2497 -rom_drw_steps: equ 0x2420 -rom_e_divsn: equ 0x2D6D -rom_e_end: equ 0x2D7B -rom_e_fetch: equ 0x2D6E -rom_e_format: equ 0x2CEB -rom_e_fp_jump: equ 0x2D18 -rom_e_l_1: equ 0x1A15 -rom_e_line_no: equ 0x19FB -rom_e_loop: equ 0x2D60 -rom_e_save: equ 0x2D55 -rom_e_to_fp: equ 0x2D4F -rom_e_tst_end: equ 0x2D71 -rom_each_s_1: equ 0x1990 -rom_each_s_2: equ 0x1998 -rom_each_s_3: equ 0x199A -rom_each_s_4: equ 0x19A5 -rom_each_s_5: equ 0x19AD -rom_each_s_6: equ 0x19B1 -rom_each_stmt: equ 0x198B -rom_ed_again: equ 0x0F30 -rom_ed_blank: equ 0x1150 -rom_ed_c_done: equ 0x117C -rom_ed_c_end: equ 0x117E -rom_ed_contr: equ 0x0F6C -rom_ed_copy: equ 0x111D -rom_ed_cur: equ 0x1011 -rom_ed_delete: equ 0x1015 -rom_ed_down: equ 0x0FF3 -rom_ed_edge: equ 0x1031 -rom_ed_edge_1: equ 0x103E -rom_ed_edge_2: equ 0x1051 -rom_ed_edit: equ 0x0FA9 -rom_ed_end: equ 0x1026 -rom_ed_enter: equ 0x1024 -rom_ed_error: equ 0x107F -rom_ed_full: equ 0x1167 -rom_ed_graph: equ 0x107C -rom_ed_ignore: equ 0x101E -rom_ed_keys: equ 0x0F92 -rom_ed_keys_t: equ 0x0FA0 -rom_ed_left: equ 0x1007 -rom_ed_list: equ 0x106E -rom_ed_loop: equ 0x0F38 -rom_ed_right: equ 0x100C -rom_ed_spaces: equ 0x115E -rom_ed_stop: equ 0x1001 -rom_ed_symbol: equ 0x1076 -rom_ed_up: equ 0x1059 -rom_editor: equ 0x0F2C -rom_end_calc: equ 0x369B -rom_end_compl: equ 0x30A3 -rom_end_tests: equ 0x358C -rom_ent_table: equ 0x338E -rom_error_1: equ 0x0008 -rom_error_2: equ 0x0053 -rom_error_3: equ 0x0055 -rom_ex_or_not: equ 0x3543 -rom_exchange: equ 0x343C -rom_exit: equ 0x36C2 -rom_exp: equ 0x36C4 -rom_expt_1num: equ 0x1C82 -rom_expt_2num: equ 0x1C7A -rom_expt_exp: equ 0x1C8C -rom_f_found: equ 0x1D7C -rom_f_l_s: equ 0x1D34 -rom_f_loop: equ 0x1D64 -rom_f_reorder: equ 0x1D16 -rom_f_use_1: equ 0x1D10 -rom_fetch_num: equ 0x1CDE -rom_fetch_two: equ 0x2FBA -rom_find_i_1: equ 0x1E9C -rom_find_int1: equ 0x1E94 -rom_find_int2: equ 0x1E99 -rom_first_3d: equ 0x3380 -rom_fn_skpovr: equ 0x28AB -rom_for: equ 0x1D03 -rom_form_exp: equ 0x33DE -rom_fp_0_or_1: equ 0x350B -rom_fp_a_end: equ 0x2DE1 -rom_fp_calc: equ 0x0028 -rom_fp_calc_2: equ 0x33A2 -rom_fp_delete: equ 0x2DAD -rom_fp_to_a: equ 0x2DD5 -rom_fp_to_bc: equ 0x2DA2 -rom_free_mem: equ 0x1F1A -rom_frst_less: equ 0x3585 -rom_full_addn: equ 0x303E -rom_g_loop: equ 0x3453 -rom_gen_ent_1: equ 0x335E -rom_gen_ent_2: equ 0x3362 -rom_get_argt: equ 0x3783 -rom_get_char: equ 0x0018 -rom_get_hl_by_de: equ 0x2AF4 -rom_get_mem_xx: equ 0x340F -rom_get_param: equ 0x1B55 -rom_go_nc_mlt: equ 0x30A5 -rom_go_sub: equ 0x1EED -rom_go_to: equ 0x1E67 -rom_go_to_2: equ 0x1E73 -rom_go_to_bc: equ 0x1E6A ; 'GO TO' line in BC register -rom_go_to_hl: equ 0x1E6C ; 'GO TO' line in HL register XXX not tested -rom_gre.8: equ 0x373D -rom_greater_0: equ 0x34F9 -rom_hl_again: equ 0x30BC -rom_hl_by_de_to_hl: equ 0x30A9 ; HL=HL*DE -rom_hl_end: equ 0x30BE -rom_hl_hl_by_de: equ 0x30A9 -rom_hl_loop: equ 0x30B1 -rom_hlxde: equ 0x30A9 ; HL=HL*DE -rom_i_carry: equ 0x2AE8 -rom_i_restore: equ 0x2AEB -rom_if: equ 0x1CF0 -rom_if_1: equ 0x1D00 -rom_in: equ 0x34A5 -rom_in_assign: equ 0x21B9 -rom_in_chan_k: equ 0x21D6 -rom_in_item_1: equ 0x20C1 -rom_in_item_2: equ 0x20D8 -rom_in_item_3: equ 0x20ED -rom_in_next_1: equ 0x21AF -rom_in_next_2: equ 0x21B2 -rom_in_pk_stk: equ 0x34B0 -rom_in_pr_1: equ 0x211A -rom_in_pr_2: equ 0x211C -rom_in_pr_3: equ 0x2129 -rom_in_prompt: equ 0x20FA -rom_in_stop: equ 0x21D0 -rom_in_var_1: equ 0x213A -rom_in_var_2: equ 0x2148 -rom_in_var_3: equ 0x215E -rom_in_var_4: equ 0x2161 -rom_in_var_5: equ 0x2174 -rom_in_var_6: equ 0x219B -rom_indexer: equ 0x16DC -rom_indexer_1: equ 0x16DB -rom_init_chan: equ 0x15AF -rom_init_strm: equ 0x15C6 -rom_input: equ 0x2089 -rom_input_1: equ 0x2096 -rom_input_2: equ 0x20AD -rom_input_ad: equ 0x15E6 -rom_int: equ 0x36AF -rom_int_case: equ 0x3483 -rom_int_exp1: equ 0x2ACC -rom_int_exp2: equ 0x2ACD -rom_int_fetch: equ 0x2D7F -rom_int_store: equ 0x2D8E -rom_int_to_fp: equ 0x2D3B -rom_ix_end: equ 0x3290 -rom_jump: equ 0x3686 -rom_jump_2: equ 0x3687 -rom_jump_true: equ 0x368F -rom_k_8_and_9: equ 0x0382 -rom_k_@_char: equ 0x03B2 -rom_k_ch_set: equ 0x02D1 -rom_k_decode: equ 0x0333 -rom_k_digit: equ 0x0367 -rom_k_e_let: equ 0x0341 -rom_k_end: equ 0x0308 -rom_k_gra_dgt: equ 0x0389 -rom_k_klc_dgt: equ 0x039D -rom_k_klc_let: equ 0x034F -rom_k_look_up: equ 0x034A -rom_k_main: equ 0x032C -rom_k_new: equ 0x02F1 -rom_k_repeat: equ 0x0310 -rom_k_st_loop: equ 0x02C6 -rom_k_test: equ 0x031E -rom_k_tokens: equ 0x0364 -rom_key_3keys: equ 0x029F -rom_key_bits: equ 0x02A1 -rom_key_chan: equ 0x1113 -rom_key_contr: equ 0x10FA -rom_key_data: equ 0x1105 -rom_key_decode: equ 0x0333 -rom_key_done2: equ 0x111B -rom_key_done: equ 0x02AB -rom_key_flag: equ 0x10F4 -rom_key_input: equ 0x10A8 -rom_key_int: equ 0x0048 -rom_key_line: equ 0x0296 -rom_key_m_cl: equ 0x10DB -rom_key_mode: equ 0x10E6 -rom_key_next: equ 0x110D -rom_key_scan: equ 0x028E -rom_key_test: equ 0x031E -rom_keyboard: equ 0x02BF -rom_l_add_string: equ 0x2BAF -rom_l_char: equ 0x2B3E -rom_l_delete_string: equ 0x2B72 -rom_l_each_ch: equ 0x2B0B -rom_l_enter: equ 0x2BA6 -rom_l_exists: equ 0x2B66 -rom_l_first: equ 0x2BEA -rom_l_in_w_or_s: equ 0x2BA3 -rom_l_length: equ 0x2B9B -rom_l_new_string: equ 0x2BC0 -rom_l_no_sp: equ 0x2B0C -rom_l_numeric: equ 0x2B59 -rom_l_single: equ 0x2B4F -rom_l_spaces: equ 0x2B29 -rom_l_string: equ 0x2BC6 -rom_l_test_ch: equ 0x2B1F -rom_last: equ 0x386C -rom_ld_8_bits: equ 0x05CA -rom_ld_block: equ 0x0802 -rom_ld_break: equ 0x056B -rom_ld_bytes: equ 0x0556 -rom_ld_ch_pr: equ 0x07AD -rom_ld_cont_1: equ 0x0819 -rom_ld_cont_2: equ 0x0825 -rom_ld_contrl: equ 0x0808 -rom_ld_data: equ 0x082E -rom_ld_data_1: equ 0x084C -rom_ld_dec: equ 0x05C4 -rom_ld_delay: equ 0x05E9 -rom_ld_edge_1: equ 0x05E7 -rom_ld_edge_2: equ 0x05E3 -rom_ld_flag: equ 0x05B3 -rom_ld_leader: equ 0x0580 -rom_ld_look_h: equ 0x0767 -rom_ld_loop: equ 0x05A9 -rom_ld_marker: equ 0x05C8 -rom_ld_name: equ 0x07A6 -rom_ld_next: equ 0x05C2 -rom_ld_prog: equ 0x0873 -rom_ld_prog_1: equ 0x08AD -rom_ld_sample: equ 0x05ED -rom_ld_start: equ 0x056C -rom_ld_sync: equ 0x058F -rom_ld_type: equ 0x078A -rom_ld_verify: equ 0x05BD -rom_ld_wait: equ 0x0574 -rom_len: equ 0x3674 -rom_less_0: equ 0x3506 -rom_less_mask: equ 0x328A -rom_let: equ 0x2AFF -rom_line_ad_1: equ 0x1974 -rom_line_addr: equ 0x196E -rom_line_draw: equ 0x2477 -rom_line_end: equ 0x1BB3 -rom_line_new: equ 0x1B9E -rom_line_no: equ 0x1695 -rom_line_no_a: equ 0x1691 -rom_line_run: equ 0x1B8A -rom_line_scan: equ 0x1B17 -rom_line_use: equ 0x1BBF -rom_line_zero: equ 0x168F -rom_list: equ 0x17F9 -rom_list_1: equ 0x17FB -rom_list_2: equ 0x1814 -rom_list_3: equ 0x181A -rom_list_4: equ 0x181F -rom_list_5: equ 0x1822 -rom_list_all: equ 0x1833 -rom_list_all_2: equ 0x1835 -rom_llist: equ 0x17F5 -rom_ln: equ 0x3713 -rom_ln_fetch: equ 0x190F -rom_ln_store: equ 0x191C -rom_loc_mem: equ 0x3406 -rom_log_paren_2_power_a_paren: equ 0x2DC1 -rom_look_p_1: equ 0x1D8B -rom_look_p_2: equ 0x1DA3 -rom_look_prog: equ 0x1D86 -rom_look_vars: equ 0x28B2 -rom_lprint: equ 0x1FC9 -rom_main_1: equ 0x12A9 -rom_main_2: equ 0x12AC -rom_main_3: equ 0x12CF -rom_main_4: equ 0x1303 -rom_main_5: equ 0x133C -rom_main_5_1349: equ 0x1349 -rom_main_6: equ 0x1373 -rom_main_7: equ 0x1376 -rom_main_8: equ 0x1384 -rom_main_9: equ 0x1386 -rom_main_add1: equ 0x157D -rom_main_add2: equ 0x15AB -rom_main_add: equ 0x155D -rom_main_exec: equ 0x12A2 -rom_main_g: equ 0x1313 ; runtime error (error in A) -rom_main_keys: equ 0x0205 -rom_make_expt: equ 0x313B -rom_make_room: equ 0x1655 -rom_mask_int: equ 0x0038 -rom_me_contrl: equ 0x08B6 -rom_me_ent_1: equ 0x093E -rom_me_ent_2: equ 0x0955 -rom_me_ent_3: equ 0x0958 -rom_me_enter: equ 0x092C -rom_me_new_l2: equ 0x08EB -rom_me_new_lp: equ 0x08D2 -rom_me_old_l1: equ 0x08DF -rom_me_old_lp: equ 0x08D7 -rom_me_old_v1: equ 0x0901 -rom_me_old_v2: equ 0x0909 -rom_me_old_v3: equ 0x0912 -rom_me_old_v4: equ 0x091E -rom_me_old_vp: equ 0x08F9 -rom_me_var_l1: equ 0x0921 -rom_me_var_l2: equ 0x0923 -rom_me_var_lp: equ 0x08F0 -rom_mlt_loop: equ 0x3114 -rom_move_fp: equ 0x33C0 -rom_mult_long: equ 0x30F0 -rom_mult_oflw: equ 0x30EF -rom_mult_rslt: equ 0x30EA -rom_multiply: equ 0x30CA -rom_n_mod_m: equ 0x36A0 -rom_n_negtv: equ 0x3705 -rom_near_zero: equ 0x3159 -rom_neg_byte: equ 0x2FAF -rom_neg_test: equ 0x3474 -rom_negate: equ 0x346E -rom_new: equ 0x11B7 -rom_next: equ 0x1DAB -rom_next_1: equ 0x1DE2 -rom_next_2: equ 0x1DE9 -rom_next_2num: equ 0x1C79 -rom_next_char: equ 0x0020 -rom_next_line: equ 0x1BD1 -rom_next_loop: equ 0x1DDA -rom_next_o_1: equ 0x19C7 -rom_next_o_2: equ 0x19CE -rom_next_o_3: equ 0x19D5 -rom_next_o_4: equ 0x19D6 -rom_next_o_5: equ 0x19DB -rom_next_one: equ 0x19B8 -rom_nil_bytes: equ 0x3272 -rom_nmi_vect: equ 0x121C -rom_no_add: equ 0x311B -rom_no_and_no: equ 0x3524 -rom_no_l_eql_etc: equ 0x353B -rom_no_reset: equ 0x0070 -rom_no_rstore: equ 0x31F9 -rom_normalise: equ 0x316C -rom_norml_now: equ 0x3186 -rom_not: equ 0x3501 -rom_not_bin: equ 0x2CB8 -rom_not_used: equ 0x1988 -rom_nu_or_str: equ 0x354E -rom_number: equ 0x18B6 -rom_numeric: equ 0x2D1B -rom_nxt_dgt_1: equ 0x2CDA -rom_nxt_dgt_2: equ 0x2D40 -rom_offst_tbl: equ 0x1A48 -rom_oflow_clr: equ 0x3195 -rom_oflw1_clr: equ 0x3146 -rom_oflw2_clr: equ 0x3151 -rom_one: equ 0x386A -rom_one_shift: equ 0x2FE5 -rom_one_space: equ 0x1652 -rom_op_str_lu: equ 0x177A -rom_open: equ 0x1736 -rom_open_1: equ 0x1756 -rom_open_2: equ 0x175D -rom_open_3: equ 0x1767 -rom_open_end: equ 0x178B -rom_open_k: equ 0x1781 -rom_open_p: equ 0x1789 -rom_open_s: equ 0x1785 -rom_or: equ 0x351B -rom_other_str: equ 0x35B7 -rom_out: equ 0x1E7A -rom_out_c_1: equ 0x18F3 -rom_out_c_2: equ 0x1909 -rom_out_ch_1: equ 0x195A -rom_out_ch_2: equ 0x1968 -rom_out_ch_3: equ 0x196C -rom_out_char: equ 0x1937 -rom_out_code: equ 0x15EF -rom_out_curs: equ 0x18E1 -rom_out_flash: equ 0x18C1 -rom_out_line1: equ 0x1865 -rom_out_line2: equ 0x187D -rom_out_line3: equ 0x1881 -rom_out_line4: equ 0x1894 -rom_out_line5: equ 0x18A1 -rom_out_line6: equ 0x18B4 -rom_out_line: equ 0x1855 -rom_out_num_1: equ 0x1A1B -rom_out_num_2: equ 0x1A28 -rom_out_num_3: equ 0x1A30 -rom_out_num_4: equ 0x1A42 -rom_out_sp_1: equ 0x192B -rom_out_sp_2: equ 0x1925 -rom_out_sp_no: equ 0x192A -rom_p_beep: equ 0x1AE3 -rom_p_border: equ 0x1AF5 -rom_p_bright: equ 0x1AEE -rom_p_cat: equ 0x1B14 -rom_p_circle: equ 0x1AE7 -rom_p_clear: equ 0x1ABB -rom_p_close: equ 0x1B02 -rom_p_cls: equ 0x1ABE -rom_p_cont: equ 0x1AB8 -rom_p_copy: equ 0x1AD6 -rom_p_data: equ 0x1ACC -rom_p_def_fn: equ 0x1AF9 -rom_p_dim: equ 0x1AA2 -rom_p_draw: equ 0x1AD2 -rom_p_erase: equ 0x1B10 -rom_p_flash: equ 0x1AED -rom_p_for: equ 0x1A90 -rom_p_format: equ 0x1B06 -rom_p_go_sub: equ 0x1A86 -rom_p_go_to: equ 0x1A7D -rom_p_if: equ 0x1A81 -rom_p_ink: equ 0x1AEB -rom_p_input: equ 0x1A9F -rom_p_int_sto: equ 0x2D8C -rom_p_inverse: equ 0x1AEF -rom_p_let: equ 0x1A7A -rom_p_list: equ 0x1AAE -rom_p_llist: equ 0x1ADC -rom_p_load: equ 0x1AE0 -rom_p_lprint: equ 0x1AD9 -rom_p_merge: equ 0x1AE2 -rom_p_move: equ 0x1B0A -rom_p_new: equ 0x1AA8 -rom_p_next: equ 0x1A98 -rom_p_open: equ 0x1AFC -rom_p_out: equ 0x1AF1 -rom_p_over: equ 0x1AF0 -rom_p_paper: equ 0x1AEC -rom_p_pause: equ 0x1AC5 -rom_p_plot: equ 0x1AC1 -rom_p_poke: equ 0x1AB1 -rom_p_print: equ 0x1A9C -rom_p_random: equ 0x1AB5 -rom_p_read: equ 0x1AC9 -rom_p_rem: equ 0x1AA5 -rom_p_restore: equ 0x1ACF -rom_p_return: equ 0x1A8D -rom_p_run: equ 0x1AAB -rom_p_save: equ 0x1ADF -rom_p_stop: equ 0x1A8A -rom_p_verify: equ 0x1AE1 -rom_pass_by: equ 0x1E39 -rom_pause: equ 0x1F3A -rom_pause_1: equ 0x1F3D -rom_pause_2: equ 0x1F49 -rom_pause_end: equ 0x1F4F -rom_peek: equ 0x34AC -rom_perm: equ 0x1C96 -rom_pf_all_9: equ 0x2EB8 -rom_pf_bits: equ 0x2E7B -rom_pf_bytes: equ 0x2E8A -rom_pf_count: equ 0x2F2D -rom_pf_dc_out: equ 0x2F5E -rom_pf_dec_0s: equ 0x2F64 -rom_pf_digits: equ 0x2EA1 -rom_pf_e_frmt: equ 0x2F6C -rom_pf_e_pos: equ 0x2F83 -rom_pf_e_sbrn: equ 0x2F4A -rom_pf_e_sign: equ 0x2F85 -rom_pf_fr_dgt: equ 0x2EEC -rom_pf_fr_exx: equ 0x2EEF -rom_pf_fractn: equ 0x2ECF -rom_pf_frn_lp: equ 0x2EDF -rom_pf_insert: equ 0x2EA9 -rom_pf_large: equ 0x2E56 -rom_pf_loop: equ 0x2E01 -rom_pf_medium: equ 0x2E6F -rom_pf_more: equ 0x2ECB -rom_pf_negtve: equ 0x2DF2 -rom_pf_not_e: equ 0x2F46 -rom_pf_out_dt: equ 0x2F59 -rom_pf_out_lp: equ 0x2F52 -rom_pf_postve: equ 0x2DF8 -rom_pf_r_back: equ 0x2F25 -rom_pf_rnd_lp: equ 0x2F18 -rom_pf_round: equ 0x2F0C -rom_pf_save: equ 0x2E1E -rom_pf_small: equ 0x2E24 -rom_pf_test_2: equ 0x2EB3 -rom_pixel_add: equ 0x22AA -rom_pl_tst_in: equ 0x22FD -rom_plot: equ 0x22DC -rom_plot_22df: equ 0x22DF ; secondary entry to PLOT -rom_plot_end: equ 0x2303 -rom_plot_loop: equ 0x22F0 -rom_plot_sub: equ 0x22E5 ; the plot subroutine (coords in BC) -rom_po_1_oper: equ 0x0A7A -rom_po_2_oper: equ 0x0A75 -rom_po_able: equ 0x0AD9 -rom_po_any: equ 0x0B24 -rom_po_at_err: equ 0x0AAC -rom_po_at_set: equ 0x0ABF -rom_po_attr: equ 0x0BDB -rom_po_attr_1: equ 0x0BFA -rom_po_attr_2: equ 0x0C08 -rom_po_back_1: equ 0x0A23 -rom_po_back_2: equ 0x0A38 -rom_po_back_3: equ 0x0A3A -rom_po_change: equ 0x0A80 -rom_po_char: equ 0x0B65 -rom_po_char_2: equ 0x0B6A -rom_po_char_3: equ 0x0B76 -rom_po_comma: equ 0x0A5F -rom_po_cont: equ 0x0A87 -rom_po_each: equ 0x0C22 -rom_po_enter: equ 0x0A4F -rom_po_f_pr: equ 0x0B1D -rom_po_fetch: equ 0x0B03 -rom_po_fill: equ 0x0AC3 -rom_po_gr_1: equ 0x0B38 -rom_po_gr_2: equ 0x0B3E -rom_po_gr_3: equ 0x0B4C -rom_po_msg: equ 0x0C0A -rom_po_quest: equ 0x0A69 -rom_po_right: equ 0x0A3D -rom_po_save: equ 0x0C3B -rom_po_scr: equ 0x0C55 -rom_po_scr_2: equ 0x0C88 -rom_po_scr_3: equ 0x0CD2 -rom_po_scr_3a: equ 0x0CF0 -rom_po_scr_4: equ 0x0D02 -rom_po_scr_4a: equ 0x0D1C -rom_po_scr_4b: equ 0x0D2D -rom_po_search: equ 0x0C41 -rom_po_space: equ 0x0AD0 -rom_po_st_e: equ 0x0AF0 -rom_po_st_pr: equ 0x0AFC -rom_po_step: equ 0x0C44 -rom_po_store: equ 0x0ADC -rom_po_t: equ 0x0B5F -rom_po_t_and_udg: equ 0x0B52 -rom_po_t_udg: equ 0x0B52 -rom_po_tab: equ 0x0AC2 -rom_po_table: equ 0x0C14 -rom_po_tokens: equ 0x0C10 -rom_po_tr_sp: equ 0x0C35 -rom_po_tv_1: equ 0x0A7D -rom_po_tv_2: equ 0x0A6D -rom_point_lp: equ 0x22D4 -rom_point_sub: equ 0x22CB -rom_point_sub_22ce: equ 0x22CE ; secondary entry to POINT-SUB -rom_pointers: equ 0x1664 -rom_poke: equ 0x1E80 -rom_pr_all: equ 0x0B7F ; "print all characters" -rom_pr_all_1: equ 0x0B93 -rom_pr_all_2: equ 0x0BA4 -rom_pr_all_3: equ 0x0BB6 -rom_pr_all_4: equ 0x0BB7 -rom_pr_all_5: equ 0x0BC1 -rom_pr_all_6: equ 0x0BD3 -rom_pr_at_tab: equ 0x201E -rom_pr_end_z: equ 0x2045 -rom_pr_item_1: equ 0x1FFC -rom_pr_item_2: equ 0x200E -rom_pr_item_3: equ 0x2024 -rom_pr_posn_1: equ 0x204E -rom_pr_posn_2: equ 0x2061 -rom_pr_posn_3: equ 0x2067 -rom_pr_posn_4: equ 0x206E -rom_pr_st_end: equ 0x2048 -rom_pr_string: equ 0x203C ; print a string (start in DE, count in BC) -rom_prb_bytes: equ 0x0EE7 -rom_prep_add: equ 0x2F9B -rom_prep_m_or_d: equ 0x30C0 -rom_print: equ 0x1FCD -rom_print_1: equ 0x1FCF -rom_print_2: equ 0x1FDF -rom_print_3: equ 0x1FE5 -rom_print_4: equ 0x1FF2 -rom_print_a: equ 0x0010 -rom_print_a_2: equ 0x15F2 -rom_print_cr: equ 0x1FF5 -rom_print_fp: equ 0x2DE3 ; print a floating point number -rom_print_out: equ 0x09F4 -rom_print_string: equ 0x203C -rom_ptr_done: equ 0x167F -rom_ptr_next: equ 0x166B -rom_r_i_store: equ 0x365F -rom_ram_check: equ 0x11DA -rom_ram_done: equ 0x11EF -rom_ram_fill: equ 0x11DC -rom_ram_read: equ 0x11E2 -rom_ram_set: equ 0x1219 -rom_rand_1: equ 0x1E5A -rom_randomize: equ 0x1E4F -rom_re_entry: equ 0x3365 -rom_re_st_two: equ 0x3293 -rom_re_stack: equ 0x3297 -rom_read: equ 0x1DED -rom_read_1: equ 0x1E0A -rom_read_2: equ 0x1E1E -rom_read_3: equ 0x1DEC -rom_read_in: equ 0x3645 -rom_rec_edit: equ 0x16D4 -rom_reclaim_1: equ 0x19E5 -rom_reclaim_2: equ 0x19E8 -rom_rem: equ 0x1BB2 -rom_remove_fp: equ 0x11A7 -rom_report_0: equ 0x1BB0 -rom_report_1: equ 0x1DD8 -rom_report_2: equ 0x1C2E -rom_report_2a: equ 0x0670 -rom_report_3: equ 0x2A20 -rom_report_4: equ 0x1F15 -rom_report_5: equ 0x0C86 -rom_report_6: equ 0x31AD -rom_report_6b: equ 0x3703 -rom_report_7: equ 0x1F36 -rom_report_8: equ 0x15E4 -rom_report_a: equ 0x34E7 -rom_report_ab: equ 0x371A -rom_report_b: equ 0x046C -rom_report_bb: equ 0x1E9F -rom_report_bc: equ 0x24F9 -rom_report_bd: equ 0x35DC -rom_report_c: equ 0x1C8A -rom_report_cb: equ 0x21CE -rom_report_d: equ 0x0D00 -rom_report_da: equ 0x0552 -rom_report_dc: equ 0x0F0A -rom_report_e: equ 0x1E08 -rom_report_fa: equ 0x0642 -rom_report_fb: equ 0x1765 -rom_report_h: equ 0x21D4 -rom_report_i: equ 0x1D84 -rom_report_j: equ 0x15C4 -rom_report_k: equ 0x2244 -rom_report_l: equ 0x1B7B -rom_report_m: equ 0x1EDA -rom_report_n: equ 0x1BEC -rom_report_oa: equ 0x160E -rom_report_ob: equ 0x1725 -rom_report_p: equ 0x2812 -rom_report_q: equ 0x288B -rom_report_r: equ 0x0806 -rom_reserve: equ 0x169E -rom_reset: equ 0x0066 -rom_rest_run: equ 0x1E45 -rom_restk_sub: equ 0x3296 -rom_restore: equ 0x1E42 -rom_result_ok: equ 0x370C -rom_return: equ 0x1F23 -rom_rom_trap: equ 0x1708 -rom_rpt_mesgs: equ 0x1391 -rom_rs_nrmlse: equ 0x32B1 -rom_rs_store: equ 0x32BD -rom_rslt_zero: equ 0x370E -rom_rstk_loop: equ 0x32B2 -rom_run: equ 0x1EA1 -rom_s_2_coord: equ 0x2522 -rom_s_alphnum: equ 0x2684 -rom_s_attr: equ 0x2672 -rom_s_attr_s: equ 0x2580 -rom_s_attr_s_2583: equ 0x2583 ; secondary entry to S-ATTR-S -rom_s_bracket: equ 0x25E8 -rom_s_cont_1: equ 0x26DD -rom_s_cont_2: equ 0x2712 -rom_s_cont_3: equ 0x2713 -rom_s_decimal: equ 0x268D -rom_s_fn: equ 0x25F5 -rom_s_fn_sbrn: equ 0x27BD -rom_s_ik_dollar_stk: equ 0x2660 -rom_s_ink_dollar_en: equ 0x2665 -rom_s_inkey_dollar: equ 0x2634 -rom_s_letter: equ 0x26C9 -rom_s_loop: equ 0x2734 -rom_s_loop_1: equ 0x24FF -rom_s_loopend: equ 0x2770 -rom_s_negate: equ 0x26DF -rom_s_next: equ 0x2790 -rom_s_no_to_string: equ 0x2707 -rom_s_not_and: equ 0x2788 -rom_s_numeric: equ 0x26C3 -rom_s_opertr: equ 0x2723 -rom_s_pi: equ 0x2627 -rom_s_pi_end: equ 0x2630 -rom_s_point: equ 0x267B -rom_s_push_po: equ 0x270D -rom_s_q_again: equ 0x25BE -rom_s_q_copy: equ 0x25CB -rom_s_q_prms: equ 0x25D9 -rom_s_quote: equ 0x25B3 -rom_s_quote_s: equ 0x250F -rom_s_rnd: equ 0x25F8 -rom_s_rnd_end: equ 0x2625 -rom_s_rport_c2: equ 0x2761 -rom_s_rport_c: equ 0x252D -rom_s_runtest: equ 0x2764 -rom_s_sc_mtch: equ 0x255A -rom_s_sc_rows: equ 0x255D -rom_s_scr_nxt: equ 0x2573 -rom_s_scr_sto: equ 0x257D -rom_s_screen_dollar: equ 0x2668 -rom_s_scrn_dollar_s: equ 0x2535 -rom_s_scrn_lp: equ 0x254F -rom_s_scrn_s: equ 0x2535 -rom_s_scrn_s_2538: equ 0x2538 ; secondary entry to S-SCRN$-S -rom_s_sd_skip: equ 0x26B6 -rom_s_stk_dec: equ 0x26B5 -rom_s_stk_lst: equ 0x274C -rom_s_string: equ 0x25DB -rom_s_syntest: equ 0x275B -rom_s_tighter: equ 0x2773 -rom_s_u_plus: equ 0x25AF -rom_sa_1_sec: equ 0x0991 -rom_sa_8_bits: equ 0x0525 -rom_sa_all: equ 0x075A ; tape save/load -rom_sa_bit_1: equ 0x0514 -rom_sa_bit_2: equ 0x0511 -rom_sa_blank: equ 0x0629 -rom_sa_bytes: equ 0x04C2 -rom_sa_code: equ 0x06C3 -rom_sa_code_1: equ 0x06E1 -rom_sa_code_2: equ 0x06F0 -rom_sa_code_3: equ 0x06F5 -rom_sa_code_4: equ 0x06F9 -rom_sa_contrl: equ 0x0970 -rom_sa_data: equ 0x0652 -rom_sa_data_1: equ 0x0692 -rom_sa_delay: equ 0x053C -rom_sa_flag: equ 0x04D0 -rom_sa_leader: equ 0x04D8 -rom_sa_line: equ 0x0716 -rom_sa_line_1: equ 0x0723 -rom_sa_loop: equ 0x04FE -rom_sa_loop_p: equ 0x0505 -rom_sa_name: equ 0x064B -rom_sa_null: equ 0x0644 -rom_sa_or_ld_end: equ 0x0554 -rom_sa_or_ld_ret: equ 0x053F -rom_sa_out: equ 0x051C -rom_sa_parity: equ 0x050E -rom_sa_scr_dollar: equ 0x06A0 -rom_sa_set: equ 0x051A -rom_sa_space: equ 0x0621 -rom_sa_start: equ 0x0507 -rom_sa_sync_1: equ 0x04EA -rom_sa_sync_2: equ 0x04F2 -rom_sa_type_0: equ 0x073A -rom_sa_type_3: equ 0x0710 -rom_sa_v_new: equ 0x0685 -rom_sa_v_old: equ 0x0672 -rom_sa_v_type: equ 0x068F -rom_save_etc: equ 0x0605 -rom_scan_ent: equ 0x336C -rom_scan_func: equ 0x2596 -rom_scan_loop: equ 0x1B52 -rom_scanning: equ 0x24FB -rom_scrl_mssg: equ 0x0CF8 -rom_sec_plus: equ 0x3575 -rom_secnd_low: equ 0x356B -rom_separator: equ 0x1B6F -rom_series_xx: equ 0x3449 -rom_set_de: equ 0x1195 -rom_set_hl: equ 0x1190 -rom_set_min: equ 0x16B0 -rom_set_permanent_colors_0x1CAD: equ 0x1CAD ; special entry point -rom_set_permanent_colors_1CAD: equ 0x1CAD ; special entry point -rom_set_stk: equ 0x16C5 -rom_set_work: equ 0x16BF -rom_sf_arg_lp: equ 0x2843 -rom_sf_arg_vl: equ 0x2852 -rom_sf_argmt1: equ 0x2802 -rom_sf_argmts: equ 0x27D9 -rom_sf_brkt_1: equ 0x27D0 -rom_sf_brkt_2: equ 0x27E4 -rom_sf_cp_def: equ 0x2814 -rom_sf_flag_6: equ 0x27E9 -rom_sf_fnd_df: equ 0x2808 -rom_sf_not_fd: equ 0x2825 -rom_sf_r_br_2: equ 0x2885 -rom_sf_rprt_c: equ 0x27E6 -rom_sf_run: equ 0x27F7 -rom_sf_syn_en: equ 0x27F4 -rom_sf_value: equ 0x288D -rom_sf_values: equ 0x2831 -rom_sfa_cp_vr: equ 0x296B -rom_sfa_end: equ 0x2991 -rom_sfa_loop: equ 0x295A -rom_sfa_match: equ 0x2981 -rom_sgn: equ 0x3492 -rom_shift_fp: equ 0x2FDD -rom_shift_len: equ 0x3055 -rom_shift_one: equ 0x316E -rom_sign_done: equ 0x2CFE -rom_sign_flag: equ 0x2CF2 -rom_sign_to_c: equ 0x3507 -rom_sin: equ 0x37B5 -rom_skip_cons: equ 0x33F7 -rom_skip_next: equ 0x33F8 -rom_skip_over: equ 0x007D -rom_skip_zero: equ 0x315E -rom_skips: equ 0x0090 -rom_sl_define: equ 0x2A94 -rom_sl_over: equ 0x2AA8 -rom_sl_rpt_c: equ 0x2A7A -rom_sl_second: equ 0x2A81 -rom_sl_store: equ 0x2AAD -rom_slicing: equ 0x2A52 -rom_small: equ 0x37F8 -rom_spare: equ 0x386E -rom_sqr: equ 0x384A -rom_st_e_part: equ 0x2CFF -rom_st_mem_xx: equ 0x342D -rom_stack_a: equ 0x2D28 -rom_stack_bc: equ 0x2D2B ; stack BC register pair -rom_stack_fetch: equ 0x2BF1 ; get last value from calculator stack -rom_stack_num: equ 0x33B4 -rom_start: equ 0x0000 -rom_start_new: equ 0x11CB -rom_stk_code: equ 0x3671 -rom_stk_const: equ 0x33C8 -rom_stk_const_xx: equ 0x341B -rom_stk_data: equ 0x33C6 -rom_stk_digit: equ 0x2D22 -rom_stk_f_arg: equ 0x2951 -rom_stk_fetch: equ 0x2BF1 -rom_stk_pntrs: equ 0x35BF -rom_stk_st_0: equ 0x2AB1 -rom_stk_sto_string: equ 0x2AB2 -rom_stk_store: equ 0x2AB6 -rom_stk_to_a: equ 0x2314 -rom_stk_to_bc: equ 0x2307 -rom_stk_var: equ 0x2996 -rom_stk_zeros: equ 0x33F1 -rom_stmt_l_1: equ 0x1B29 -rom_stmt_loop: equ 0x1B28 -rom_stmt_next: equ 0x1BF4 -rom_stmt_r_1: equ 0x1B7D -rom_stmt_ret: equ 0x1B76 -rom_stop: equ 0x1CEE -rom_str_alter: equ 0x2070 -rom_str_and_no: equ 0x352D -rom_str_data1: equ 0x1727 -rom_str_data: equ 0x171E -rom_str_dollar: equ 0x361F -rom_str_test: equ 0x3588 -rom_strings: equ 0x3559 -rom_strs_add: equ 0x359C -rom_strt_mlt: equ 0x3125 -rom_subn_only: equ 0x31F2 -rom_subtract: equ 0x300F -rom_sv_arrays: equ 0x29AE -rom_sv_ch_add: equ 0x29E0 -rom_sv_close: equ 0x29D8 -rom_sv_comma: equ 0x29C3 -rom_sv_count: equ 0x29E7 -rom_sv_dim: equ 0x2A48 -rom_sv_elem_string: equ 0x2A2C -rom_sv_loop: equ 0x29EA -rom_sv_mult: equ 0x29FB -rom_sv_number: equ 0x2A22 -rom_sv_ptr: equ 0x29C0 -rom_sv_rpt_c: equ 0x2A12 -rom_sv_simple_string: equ 0x29A1 -rom_sv_slice: equ 0x2A45 -rom_sv_slice?: equ 0x2A49 -rom_swap_byte: equ 0x343E -rom_syntax_z: equ 0x2530 -rom_t_expnent: equ 0x326C -rom_t_first: equ 0x3233 -rom_t_gr_zero: equ 0x3221 -rom_t_numeric: equ 0x3252 -rom_t_shift: equ 0x3261 -rom_t_small: equ 0x323F -rom_t_store: equ 0x3267 -rom_t_test: equ 0x325E -rom_tan: equ 0x37DA -rom_tape_msgs: equ 0x09A1 -rom_tbl_addrs: equ 0x32D7 -rom_tbl_of_ops: equ 0x2795 -rom_tbl_priors: equ 0x27B0 -rom_temp_ptr1: equ 0x0077 -rom_temp_ptr2: equ 0x0078 -rom_temps: equ 0x0D4D ; copy the permanent color items to the temporary ones -rom_temps_1: equ 0x0D5B -rom_temps_2: equ 0x0D65 -rom_test_5_sp: equ 0x33A9 -rom_test_char: equ 0x001C -rom_test_neg: equ 0x307C -rom_test_norm: equ 0x3155 -rom_test_room: equ 0x1F05 -rom_test_zero: equ 0x34E9 -rom_tkn_table: equ 0x0095 -rom_to_power: equ 0x3851 -rom_truncate: equ 0x3214 -rom_two_p_1: equ 0x1E8E -rom_two_param: equ 0x1E85 -rom_unstack_z: equ 0x1FC3 -rom_use_252: equ 0x2495 -rom_use_zero: equ 0x1CE6 -rom_usr_no: equ 0x34B3 -rom_usr_range: equ 0x34D3 -rom_usr_stack: equ 0x34E4 -rom_usr_string: equ 0x34BC -rom_v_80_byte: equ 0x2932 -rom_v_char: equ 0x28D4 -rom_v_each: equ 0x2900 -rom_v_end: equ 0x294B -rom_v_found_1: equ 0x293E -rom_v_found_2: equ 0x293F -rom_v_get_ptr: equ 0x2929 -rom_v_matches: equ 0x2912 -rom_v_next: equ 0x292A -rom_v_pass: equ 0x2943 -rom_v_rport_c: equ 0x360C -rom_v_run: equ 0x28FD -rom_v_run_or_syn: equ 0x28EF -rom_v_spaces: equ 0x2913 -rom_v_str_var: equ 0x28DE -rom_v_syntax: equ 0x2934 -rom_v_test_fn: equ 0x28E3 -rom_val_dollar: equ 0x35DE -rom_val_fet_1: equ 0x1C56 -rom_val_fet_2: equ 0x1C59 -rom_valid: equ 0x371C -rom_var_a_1: equ 0x1C22 -rom_var_a_2: equ 0x1C30 -rom_var_a_3: equ 0x1C46 -rom_vr_cont_1: equ 0x07E9 -rom_vr_cont_2: equ 0x07F4 -rom_vr_cont_3: equ 0x0800 -rom_vr_contrl: equ 0x07CB -rom_wait_key1: equ 0x15DE -rom_wait_key: equ 0x15D4 -rom_x_large: equ 0x326D -rom_x_neg: equ 0x36B7 -rom_xis0: equ 0x385D -rom_yneg: equ 0x37A8 -rom_zero_rslt: equ 0x315D -rom_zeros_4_or_5: equ 0x2FFB -rom_zplus: equ 0x37A1 -rom_zx81_name: equ 0x04AA -; ZX Spectrum 128K - -ROM_SWAP: equ 0x5B00 ; 128K paging subroutine in RAM - -rom_128_new: equ 0x0057 +; ============================================================== + MODULE BASIC_FN: +; BASIC 48 +x48: +.abs EQU #346A +.acs EQU #3843 +.add_back EQU #3004 +.add_ch_1 EQU #0F8B +.add_char EQU #0F81 +.add_char_keeping_current_mode EQU #0F85 +.add_rep_6 EQU #309F +.addend_0 EQU #2FF9 +.addition EQU #3014 +.addn_oflw EQU #303C +.all_added EQU #300D +.alpha EQU #2C8D +.alphanum EQU #2C88 +.arc_end EQU #245F +.arc_loop EQU #2425 +.arc_start EQU #2439 +.asn EQU #3833 +.atn EQU #37E2 +.auto_l_1 EQU #17CE +.auto_l_2 EQU #17E1 +.auto_l_3 EQU #17E4 +.auto_l_4 EQU #17ED +.auto_list EQU #1795 +.bc_spaces EQU #0030 +.be_end EQU #03F6 +.be_h_and_l_lp EQU #03D6 +.be_ix_plus_0 EQU #03D4 +.be_ix_plus_1 EQU #03D3 +.be_ix_plus_2 EQU #03D2 +.be_ix_plus_3 EQU #03D1 +.beep EQU #03F8 +.beeper EQU #03B5 +.bin_digit EQU #2CA2 +.bin_end EQU #2CB3 +.bits_zero EQU #3283 +.border EQU #2294 +.border_1 EQU #22A6 +.border_2297 EQU #2297 ; secondary entry to rom_border +.border_229b EQU #229B ; secondary entry to rom_border +.both_null EQU #3572 +.break_key EQU #1F54 ; return the carry flag reset if SHIFT and BREAK keys are both being pressed. +.byte_comp EQU #3564 +.byte_zero EQU #327E +.c_arc_ge1 EQU #235A +.c_ent EQU #37B7 +.c_r_gre_1 EQU #233B +.ca_10_by_a_plus_c EQU #2F8B +.calculate EQU #335B +.call_jump EQU #162C +.call_sub EQU #15F7 +.cases EQU #37FA +.cat_etc EQU #1793 +.cd_prms1 EQU #247D +.ch_add_plus_1 EQU #0074 +.chan_flag EQU #1615 +.chan_k EQU #1634 +.chan_op_1 EQU #1610 +.chan_open EQU #1601 ; open a channel (channel in A) +.chan_p EQU #164D +.chan_s EQU #1642 ; set flags for upper screen channel +.chan_s_1 EQU #1646 +.check_end EQU #1BEE +.chn_cd_lu EQU #162D +.chrs EQU #35C9 +.circle EQU #2320 +.cl_09_1 EQU #1CD6 +.cl_addr EQU #0E9B +.cl_all EQU #0DAF ; clear whole (upper) display area +.cl_attr EQU #0E88 +.cl_chan EQU #0D94 +.cl_chan_a EQU #0DA0 +.cl_line EQU #0E44 +.cl_line_1 EQU #0E4A +.cl_line_2 EQU #0E4D +.cl_line_3 EQU #0E80 +.cl_sc_all EQU #0DFE +.cl_scr_1 EQU #0E05 +.cl_scr_2 EQU #0E0D +.cl_scr_3 EQU #0E19 +.cl_scroll EQU #0E00 ; scroll the number of lines in the B register +.cl_set EQU #0DD9 +.cl_set_1 EQU #0DEE +.cl_set_2 EQU #0DF4 +.cl_str_lu EQU #1716 +.class_01 EQU #1C1F +.class_02 EQU #1C4E +.class_03 EQU #1C0D +.class_04 EQU #1C6C +.class_05 EQU #1C11 +.class_07 EQU #1C96 +.class_09 EQU #1CBE +.class_0b EQU #1CDB +.class_tbl EQU #1C01 +.clear EQU #1EAC +.clear_1 EQU #1EB7 +.clear_2 EQU #1EDC +.clear_prb EQU #0EDF +.clear_run EQU #1EAF +.clear_sp EQU #1097 +.close EQU #16E5 +.close_0_16EB EQU #16EB +.close_1 EQU #16FC +.close_2 EQU #1701 +.close_str EQU #171C +.cls EQU #0D6B ; CLS +.cls_1 EQU #0D87 +.cls_2 EQU #0D89 +.cls_3 EQU #0D8E +.cls_lower EQU #0D6E +.co_change EQU #226C +.co_temp_1 EQU #21E1 +.co_temp_2 EQU #21E2 +.co_temp_3 EQU #21F2 +.co_temp_4 EQU #21FC +.co_temp_5 EQU #2211 +.co_temp_6 EQU #2228 +.co_temp_7 EQU #2234 +.co_temp_8 EQU #223E +.co_temp_9 EQU #2246 +.co_temp_a EQU #2257 +.co_temp_b EQU #2258 +.co_temp_c EQU #2273 +.co_temp_d EQU #227D +.co_temp_e EQU #2287 +.code EQU #3669 +.comma_sp EQU #1537 +.continue EQU #1E5F +.copy EQU #0EAC +.copy_1 EQU #0EB2 +.copy_2 EQU #0EC9 +.copy_3 EQU #0ED3 +.copy_buff EQU #0ECD +.copy_end EQU #0EDA +.copy_l_1 EQU #0EFD +.copy_l_2 EQU #0F0C +.copy_l_3 EQU #0F14 +.copy_l_4 EQU #0F18 +.copy_l_5 EQU #0F1E +.copy_line EQU #0EF4 +.copyright EQU #1539 +.cos EQU #37AA +.count_one EQU #31FA +.cp_lines EQU #1980 +.ctlchrtab EQU #0A11 +.d_l_diag EQU #24D4 +.d_l_hr_vt EQU #24DB +.d_l_loop EQU #24CE +.d_l_plot EQU #24EC +.d_l_range EQU #24F7 +.d_l_step EQU #24DF +.d_letter EQU #2C1F +.d_no_loop EQU #2C2E +.d_rport_c EQU #2C05 +.d_run EQU #2C15 +.d_size EQU #2C2D +.data EQU #1E27 +.data_1 EQU #1E2C +.data_2 EQU #1E37 +.de_comma_paren_de_plus_1_parenequ EQU #2AEE +.dec_jr_nz EQU #367A +.dec_rpt_c EQU #2CCF +.dec_sto_1 EQU #2CD5 +.dec_to_fp EQU #2C9B +.decimal EQU #2CCB +.def_fn EQU #1F60 +.def_fn_1 EQU #1F6A +.def_fn_2 EQU #1F7D +.def_fn_3 EQU #1F86 +.def_fn_4 EQU #1F89 +.def_fn_5 EQU #1F94 +.def_fn_6 EQU #1FA6 +.def_fn_7 EQU #1FBD +.delete EQU #33A1 +.differ EQU #19DD +.dim EQU #2C02 +.dim_clear EQU #2C7C +.dim_sizes EQU #2C7F +.div_34th EQU #31DB +.div_loop EQU #31D2 +.div_start EQU #31E2 +.division EQU #31AF +.divn_expt EQU #313D +.dl_larger EQU #24CB +.dl_x_ge_y EQU #24C4 +.double_a EQU #338C +.dr_3_prms EQU #238D +.dr_prms EQU #23C1 +.dr_sin_nz EQU #23A3 +.draw EQU #2382 +.draw_line EQU #24B7 +.draw_line_24BA EQU #24BA ; entry point of the draw_line routine +.draw_save EQU #2497 +.drw_steps EQU #2420 +.e_divsn EQU #2D6D +.e_end EQU #2D7B +.e_fetch EQU #2D6E +.e_format EQU #2CEB +.e_fp_jump EQU #2D18 +.e_l_1 EQU #1A15 +.e_line_no EQU #19FB +.e_loop EQU #2D60 +.e_save EQU #2D55 +.e_to_fp EQU #2D4F +.e_tst_end EQU #2D71 +.each_s_1 EQU #1990 +.each_s_2 EQU #1998 +.each_s_3 EQU #199A +.each_s_4 EQU #19A5 +.each_s_5 EQU #19AD +.each_s_6 EQU #19B1 +.each_stmt EQU #198B +.ed_again EQU #0F30 +.ed_blank EQU #1150 +.ed_c_done EQU #117C +.ed_c_end EQU #117E +.ed_contr EQU #0F6C +.ed_copy EQU #111D +.ed_cur EQU #1011 +.ed_delete EQU #1015 +.ed_down EQU #0FF3 +.ed_edge EQU #1031 +.ed_edge_1 EQU #103E +.ed_edge_2 EQU #1051 +.ed_edit EQU #0FA9 +.ed_end EQU #1026 +.ed_enter EQU #1024 +.ed_error EQU #107F +.ed_full EQU #1167 +.ed_graph EQU #107C +.ed_ignore EQU #101E +.ed_keys EQU #0F92 +.ed_keys_t EQU #0FA0 +.ed_left EQU #1007 +.ed_list EQU #106E +.ed_loop EQU #0F38 +.ed_right EQU #100C +.ed_spaces EQU #115E +.ed_stop EQU #1001 +.ed_symbol EQU #1076 +.ed_up EQU #1059 +.editor EQU #0F2C +.end_calc EQU #369B +.end_compl EQU #30A3 +.end_tests EQU #358C +.ent_table EQU #338E +.error_1 EQU #0008 +.error_2 EQU #0053 +.error_3 EQU #0055 +.error_4 EQU #0058 +.ex_or_not EQU #3543 +.exchange EQU #343C +.exit EQU #36C2 +.exp EQU #36C4 +.expt_1num EQU #1C82 +.expt_2num EQU #1C7A +.expt_exp EQU #1C8C +.f_found EQU #1D7C +.f_l_s EQU #1D34 +.f_loop EQU #1D64 +.f_reorder EQU #1D16 +.f_use_1 EQU #1D10 +.fetch_num EQU #1CDE +.fetch_two EQU #2FBA +.find_i_1 EQU #1E9C +.find_int1 EQU #1E94 +.find_int2 EQU #1E99 +.first_3d EQU #3380 +.fn_skpovr EQU #28AB +.for EQU #1D03 +.form_exp EQU #33DE +.fp_0_or_1 EQU #350B +.fp_a_end EQU #2DE1 +.fp_calc EQU #0028 +.fp_calc_2 EQU #33A2 +.fp_delete EQU #2DAD +.fp_to_a EQU #2DD5 +.fp_to_bc EQU #2DA2 +.free_mem EQU #1F1A +.frst_less EQU #3585 +.full_addn EQU #303E +.g_loop EQU #3453 +.gen_ent_1 EQU #335E +.gen_ent_2 EQU #3362 +.get_argt EQU #3783 +.get_char EQU #0018 +.get_hl_by_de EQU #2AF4 +.get_mem_xx EQU #340F +.get_param EQU #1B55 +.go_nc_mlt EQU #30A5 +.go_sub EQU #1EED +.go_to EQU #1E67 +.go_to_2 EQU #1E73 +.go_to_bc EQU #1E6A ; 'GO TO' line in BC register +.go_to_hl EQU #1E6C ; 'GO TO' line in HL register XXX not tested +.gre.8 EQU #373D +.greater_0 EQU #34F9 +.hl_again EQU #30BC +.hl_by_de_to_hl EQU #30A9 ; HL=HL*DE +.hl_end EQU #30BE +.hl_hl_by_de EQU #30A9 +.hl_loop EQU #30B1 +.hlxde EQU #30A9 ; HL=HL*DE +.i_carry EQU #2AE8 +.i_restore EQU #2AEB +.if EQU #1CF0 +.if_1 EQU #1D00 +.in EQU #34A5 +.in_assign EQU #21B9 +.in_chan_k EQU #21D6 +.in_item_1 EQU #20C1 +.in_item_2 EQU #20D8 +.in_item_3 EQU #20ED +.in_next_1 EQU #21AF +.in_next_2 EQU #21B2 +.in_pk_stk EQU #34B0 +.in_pr_1 EQU #211A +.in_pr_2 EQU #211C +.in_pr_3 EQU #2129 +.in_prompt EQU #20FA +.in_stop EQU #21D0 +.in_var_1 EQU #213A +.in_var_2 EQU #2148 +.in_var_3 EQU #215E +.in_var_4 EQU #2161 +.in_var_5 EQU #2174 +.in_var_6 EQU #219B +.indexer EQU #16DC +.indexer_1 EQU #16DB +.init_chan EQU #15AF +.init_strm EQU #15C6 +.input EQU #2089 +.input_1 EQU #2096 +.input_2 EQU #20AD +.input_ad EQU #15E6 +.int EQU #36AF +.int_case EQU #3483 +.int_exp1 EQU #2ACC +.int_exp2 EQU #2ACD +.int_fetch EQU #2D7F +.int_store EQU #2D8E +.int_to_fp EQU #2D3B +.ix_end EQU #3290 +.jump EQU #3686 +.jump_2 EQU #3687 +.jump_true EQU #368F +.k_8_and_9 EQU #0382 +.k_@_char EQU #03B2 +.k_ch_set EQU #02D1 +.k_digit EQU #0367 +.k_e_let EQU #0341 +.k_end EQU #0308 +.k_gra_dgt EQU #0389 +.k_klc_dgt EQU #039D +.k_klc_let EQU #034F +.k_look_up EQU #034A +.k_main EQU #032C +.k_new EQU #02F1 +.k_repeat EQU #0310 +.k_st_loop EQU #02C6 +.k_tokens EQU #0364 +.key_3keys EQU #029F +.key_bits EQU #02A1 +.key_chan EQU #1113 +.key_contr EQU #10FA +.key_data EQU #1105 +.key_decode EQU #0333 +.key_done2 EQU #111B +.key_done EQU #02AB +.key_flag EQU #10F4 +.key_input EQU #10A8 +.key_int EQU #0048 +.key_line EQU #0296 +.key_m_cl EQU #10DB +.key_mode EQU #10E6 +.key_next EQU #110D +.key_scan EQU #028E +.key_test EQU #031E +.keyboard EQU #02BF +.l_add_string EQU #2BAF +.l_char EQU #2B3E +.l_delete_string EQU #2B72 +.l_each_ch EQU #2B0B +.l_enter EQU #2BA6 +.l_exists EQU #2B66 +.l_first EQU #2BEA +.l_in_w_or_s EQU #2BA3 +.l_length EQU #2B9B +.l_new_string EQU #2BC0 +.l_no_sp EQU #2B0C +.l_numeric EQU #2B59 +.l_single EQU #2B4F +.l_spaces EQU #2B29 +.l_string EQU #2BC6 +.l_test_ch EQU #2B1F +.last EQU #386C +.ld_8_bits EQU #05CA +.ld_block EQU #0802 +.ld_break EQU #056B +.ld_bytes EQU #0556 +.ld_ch_pr EQU #07AD +.ld_cont_1 EQU #0819 +.ld_cont_2 EQU #0825 +.ld_contrl EQU #0808 +.ld_data EQU #082E +.ld_data_1 EQU #084C +.ld_dec EQU #05C4 +.ld_delay EQU #05E9 +.ld_edge_1 EQU #05E7 +.ld_edge_2 EQU #05E3 +.ld_flag EQU #05B3 +.ld_leader EQU #0580 +.ld_look_h EQU #0767 +.ld_loop EQU #05A9 +.ld_marker EQU #05C8 +.ld_name EQU #07A6 +.ld_next EQU #05C2 +.ld_prog EQU #0873 +.ld_prog_1 EQU #08AD +.ld_sample EQU #05ED +.ld_start EQU #056C +.ld_sync EQU #058F +.ld_type EQU #078A +.ld_verify EQU #05BD +.ld_wait EQU #0574 +.len EQU #3674 +.less_0 EQU #3506 +.less_mask EQU #328A +.let EQU #2AFF +.line_ad_1 EQU #1974 +.line_addr EQU #196E +.line_draw EQU #2477 +.line_end EQU #1BB3 +.line_new EQU #1B9E +.line_no EQU #1695 +.line_no_a EQU #1691 +.line_run EQU #1B8A +.line_scan EQU #1B17 +.line_use EQU #1BBF +.line_zero EQU #168F +.list EQU #17F9 +.list_1 EQU #17FB +.list_2 EQU #1814 +.list_3 EQU #181A +.list_4 EQU #181F +.list_5 EQU #1822 +.list_all EQU #1833 +.list_all_2 EQU #1835 +.llist EQU #17F5 +.ln EQU #3713 +.ln_fetch EQU #190F +.ln_store EQU #191C +.loc_mem EQU #3406 +.log_paren_2_power_a_paren EQU #2DC1 +.look_p_1 EQU #1D8B +.look_p_2 EQU #1DA3 +.look_prog EQU #1D86 +.look_vars EQU #28B2 +.lprint EQU #1FC9 +.main_1 EQU #12A9 +.main_2 EQU #12AC +.main_3 EQU #12CF +.main_4 EQU #1303 +.main_5 EQU #133C +.main_5_1349 EQU #1349 +.main_6 EQU #1373 +.main_7 EQU #1376 +.main_8 EQU #1384 +.main_9 EQU #1386 +.main_add1 EQU #157D +.main_add2 EQU #15AB +.main_add EQU #155D +.main_exec EQU #12A2 +.main_g EQU #1313 ; runtime error (error in A) +.main_keys EQU #0205 +.make_expt EQU #313B +.make_room EQU #1655 +.mask_int EQU #0038 +.me_contrl EQU #08B6 +.me_ent_1 EQU #093E +.me_ent_2 EQU #0955 +.me_ent_3 EQU #0958 +.me_enter EQU #092C +.me_new_l2 EQU #08EB +.me_new_lp EQU #08D2 +.me_old_l1 EQU #08DF +.me_old_lp EQU #08D7 +.me_old_v1 EQU #0901 +.me_old_v2 EQU #0909 +.me_old_v3 EQU #0912 +.me_old_v4 EQU #091E +.me_old_vp EQU #08F9 +.me_var_l1 EQU #0921 +.me_var_l2 EQU #0923 +.me_var_lp EQU #08F0 +.mlt_loop EQU #3114 +.move_fp EQU #33C0 +.mult_long EQU #30F0 +.mult_oflw EQU #30EF +.mult_rslt EQU #30EA +.multiply EQU #30CA +.n_mod_m EQU #36A0 +.n_negtv EQU #3705 +.near_zero EQU #3159 +.neg_byte EQU #2FAF +.neg_test EQU #3474 +.negate EQU #346E +.new EQU #11B7 +.next EQU #1DAB +.next_1 EQU #1DE2 +.next_2 EQU #1DE9 +.next_2num EQU #1C79 +.next_char EQU #0020 +.next_line EQU #1BD1 +.next_loop EQU #1DDA +.next_o_1 EQU #19C7 +.next_o_2 EQU #19CE +.next_o_3 EQU #19D5 +.next_o_4 EQU #19D6 +.next_o_5 EQU #19DB +.next_one EQU #19B8 +.nil_bytes EQU #3272 +.nmi_vect EQU #121C +.no_add EQU #311B +.no_and_no EQU #3524 +.no_l_eql_etc EQU #353B +.no_reset EQU #0070 +.no_rstore EQU #31F9 +.normalise EQU #316C +.norml_now EQU #3186 +.not EQU #3501 +.not_bin EQU #2CB8 +.not_used EQU #1988 +.nu_or_str EQU #354E +.number EQU #18B6 +.numeric EQU #2D1B +.nxt_dgt_1 EQU #2CDA +.nxt_dgt_2 EQU #2D40 +.offst_tbl EQU #1A48 +.oflow_clr EQU #3195 +.oflw1_clr EQU #3146 +.oflw2_clr EQU #3151 +.one EQU #386A +.one_shift EQU #2FE5 +.one_space EQU #1652 +.op_str_lu EQU #177A +.open EQU #1736 +.open_1 EQU #1756 +.open_2 EQU #175D +.open_3 EQU #1767 +.open_end EQU #178B +.open_k EQU #1781 +.open_p EQU #1789 +.open_s EQU #1785 +.or EQU #351B +.other_str EQU #35B7 +.out EQU #1E7A +.out_c_1 EQU #18F3 +.out_c_2 EQU #1909 +.out_ch_1 EQU #195A +.out_ch_2 EQU #1968 +.out_ch_3 EQU #196C +.out_char EQU #1937 +.out_code EQU #15EF +.out_curs EQU #18E1 +.out_flash EQU #18C1 +.out_line1 EQU #1865 +.out_line2 EQU #187D +.out_line3 EQU #1881 +.out_line4 EQU #1894 +.out_line5 EQU #18A1 +.out_line6 EQU #18B4 +.out_line EQU #1855 +.out_num_1 EQU #1A1B +.out_num_2 EQU #1A28 +.out_num_3 EQU #1A30 +.out_num_4 EQU #1A42 +.out_sp_1 EQU #192B +.out_sp_2 EQU #1925 +.out_sp_no EQU #192A +.p_beep EQU #1AE3 +.p_border EQU #1AF5 +.p_bright EQU #1AEE +.p_cat EQU #1B14 +.p_circle EQU #1AE7 +.p_clear EQU #1ABB +.p_close EQU #1B02 +.p_cls EQU #1ABE +.p_cont EQU #1AB8 +.p_copy EQU #1AD6 +.p_data EQU #1ACC +.p_def_fn EQU #1AF9 +.p_dim EQU #1AA2 +.p_draw EQU #1AD2 +.p_erase EQU #1B10 +.p_flash EQU #1AED +.p_for EQU #1A90 +.p_format EQU #1B06 +.p_go_sub EQU #1A86 +.p_go_to EQU #1A7D +.p_if EQU #1A81 +.p_ink EQU #1AEB +.p_input EQU #1A9F +.p_int_sto EQU #2D8C +.p_inverse EQU #1AEF +.p_let EQU #1A7A +.p_list EQU #1AAE +.p_llist EQU #1ADC +.p_load EQU #1AE0 +.p_lprint EQU #1AD9 +.p_merge EQU #1AE2 +.p_move EQU #1B0A +.p_new EQU #1AA8 +.p_next EQU #1A98 +.p_open EQU #1AFC +.p_out EQU #1AF1 +.p_over EQU #1AF0 +.p_paper EQU #1AEC +.p_pause EQU #1AC5 +.p_plot EQU #1AC1 +.p_poke EQU #1AB1 +.p_print EQU #1A9C +.p_random EQU #1AB5 +.p_read EQU #1AC9 +.p_rem EQU #1AA5 +.p_restore EQU #1ACF +.p_return EQU #1A8D +.p_run EQU #1AAB +.p_save EQU #1ADF +.p_stop EQU #1A8A +.p_verify EQU #1AE1 +.pass_by EQU #1E39 +.pause EQU #1F3A +.pause_1 EQU #1F3D +.pause_2 EQU #1F49 +.pause_end EQU #1F4F +.peek EQU #34AC +.perm EQU #1C96 +.pf_all_9 EQU #2EB8 +.pf_bits EQU #2E7B +.pf_bytes EQU #2E8A +.pf_count EQU #2F2D +.pf_dc_out EQU #2F5E +.pf_dec_0s EQU #2F64 +.pf_digits EQU #2EA1 +.pf_e_frmt EQU #2F6C +.pf_e_pos EQU #2F83 +.pf_e_sbrn EQU #2F4A +.pf_e_sign EQU #2F85 +.pf_fr_dgt EQU #2EEC +.pf_fr_exx EQU #2EEF +.pf_fractn EQU #2ECF +.pf_frn_lp EQU #2EDF +.pf_insert EQU #2EA9 +.pf_large EQU #2E56 +.pf_loop EQU #2E01 +.pf_medium EQU #2E6F +.pf_more EQU #2ECB +.pf_negtve EQU #2DF2 +.pf_not_e EQU #2F46 +.pf_out_dt EQU #2F59 +.pf_out_lp EQU #2F52 +.pf_postve EQU #2DF8 +.pf_r_back EQU #2F25 +.pf_rnd_lp EQU #2F18 +.pf_round EQU #2F0C +.pf_save EQU #2E1E +.pf_small EQU #2E24 +.pf_test_2 EQU #2EB3 +.pixel_add EQU #22AA +.pl_tst_in EQU #22FD +.plot EQU #22DC +.plot_22df EQU #22DF ; secondary entry to PLOT +.plot_end EQU #2303 +.plot_loop EQU #22F0 +.plot_sub EQU #22E5 ; the plot subroutine (coords in BC) +.po_1_oper EQU #0A7A +.po_2_oper EQU #0A75 +.po_able EQU #0AD9 +.po_any EQU #0B24 +.po_at_err EQU #0AAC +.po_at_set EQU #0ABF +.po_attr EQU #0BDB +.po_attr_1 EQU #0BFA +.po_attr_2 EQU #0C08 +.po_back_1 EQU #0A23 +.po_back_2 EQU #0A38 +.po_back_3 EQU #0A3A +.po_change EQU #0A80 +.po_char EQU #0B65 +.po_char_2 EQU #0B6A +.po_char_3 EQU #0B76 +.po_comma EQU #0A5F +.po_cont EQU #0A87 +.po_each EQU #0C22 +.po_enter EQU #0A4F +.po_f_pr EQU #0B1D +.po_fetch EQU #0B03 +.po_fill EQU #0AC3 +.po_gr_1 EQU #0B38 +.po_gr_2 EQU #0B3E +.po_gr_3 EQU #0B4C +.po_msg EQU #0C0A +.po_quest EQU #0A69 +.po_right EQU #0A3D +.po_save EQU #0C3B +.po_scr EQU #0C55 +.po_scr_2 EQU #0C88 +.po_scr_3 EQU #0CD2 +.po_scr_3a EQU #0CF0 +.po_scr_4 EQU #0D02 +.po_scr_4a EQU #0D1C +.po_scr_4b EQU #0D2D +.po_search EQU #0C41 +.po_space EQU #0AD0 +.po_st_e EQU #0AF0 +.po_st_pr EQU #0AFC +.po_step EQU #0C44 +.po_store EQU #0ADC +.po_t EQU #0B5F +.po_t_and_udg EQU #0B52 +.po_t_udg EQU #0B52 +.po_tab EQU #0AC2 +.po_table EQU #0C14 +.po_tokens EQU #0C10 +.po_tr_sp EQU #0C35 +.po_tv_1 EQU #0A7D +.po_tv_2 EQU #0A6D +.point_lp EQU #22D4 +.point_sub EQU #22CB +.point_sub_22ce EQU #22CE ; secondary entry to POINT-SUB +.pointers EQU #1664 +.poke EQU #1E80 +.pr_all EQU #0B7F ; "print all characters" +.pr_all_1 EQU #0B93 +.pr_all_2 EQU #0BA4 +.pr_all_3 EQU #0BB6 +.pr_all_4 EQU #0BB7 +.pr_all_5 EQU #0BC1 +.pr_all_6 EQU #0BD3 +.pr_at_tab EQU #201E +.pr_end_z EQU #2045 +.pr_item_1 EQU #1FFC +.pr_item_2 EQU #200E +.pr_item_3 EQU #2024 +.pr_posn_1 EQU #204E +.pr_posn_2 EQU #2061 +.pr_posn_3 EQU #2067 +.pr_posn_4 EQU #206E +.pr_st_end EQU #2048 +.pr_string EQU #203C ; print a string (start in DE, count in BC) +.prb_bytes EQU #0EE7 +.prep_add EQU #2F9B +.prep_m_or_d EQU #30C0 +.print EQU #1FCD +.print_1 EQU #1FCF +.print_2 EQU #1FDF +.print_3 EQU #1FE5 +.print_4 EQU #1FF2 +.print_a EQU #0010 +.print_a_2 EQU #15F2 +.print_cr EQU #1FF5 +.print_fp EQU #2DE3 ; print a floating point number +.print_out EQU #09F4 +.print_string EQU #203C +.ptr_done EQU #167F +.ptr_next EQU #166B +.r_i_store EQU #365F +.ram_check EQU #11DA +.ram_done EQU #11EF +.ram_fill EQU #11DC +.ram_read EQU #11E2 +.ram_set EQU #1219 +.rand_1 EQU #1E5A +.randomize EQU #1E4F +.re_entry EQU #3365 +.re_st_two EQU #3293 +.re_stack EQU #3297 +.read EQU #1DED +.read_1 EQU #1E0A +.read_2 EQU #1E1E +.read_3 EQU #1DEC +.read_in EQU #3645 +.rec_edit EQU #16D4 +.reclaim_1 EQU #19E5 +.reclaim_2 EQU #19E8 +.rem EQU #1BB2 +.remove_fp EQU #11A7 +.report_0 EQU #1BB0 +.report_1 EQU #1DD8 +.report_2 EQU #1C2E +.report_2a EQU #0670 +.report_3 EQU #2A20 +.report_4 EQU #1F15 +.report_5 EQU #0C86 +.report_6 EQU #31AD +.report_6b EQU #3703 +.report_7 EQU #1F36 +.report_8 EQU #15E4 +.report_a EQU #34E7 +.report_ab EQU #371A +.report_b EQU #046C +.report_bb EQU #1E9F +.report_bc EQU #24F9 +.report_bd EQU #35DC +.report_c EQU #1C8A +.report_cb EQU #21CE +.report_d EQU #0D00 +.report_da EQU #0552 +.report_dc EQU #0F0A +.report_e EQU #1E08 +.report_fa EQU #0642 +.report_fb EQU #1765 +.report_h EQU #21D4 +.report_i EQU #1D84 +.report_j EQU #15C4 +.report_k EQU #2244 +.report_l EQU #1B7B +.report_m EQU #1EDA +.report_n EQU #1BEC +.report_oa EQU #160E +.report_ob EQU #1725 +.report_p EQU #2812 +.report_q EQU #288B +.report_r EQU #0806 +.reserve EQU #169E +.reset EQU #0066 +.rest_run EQU #1E45 +.restk_sub EQU #3296 +.restore EQU #1E42 +.result_ok EQU #370C +.return EQU #1F23 +.rom_trap EQU #1708 +.rpt_mesgs EQU #1391 +.rs_nrmlse EQU #32B1 +.rs_store EQU #32BD +.rslt_zero EQU #370E +.rstk_loop EQU #32B2 +.run EQU #1EA1 +.s_2_coord EQU #2522 +.s_alphnum EQU #2684 +.s_attr EQU #2672 +.s_attr_s EQU #2580 +.s_attr_s_2583 EQU #2583 ; secondary entry to S-ATTR-S +.s_bracket EQU #25E8 +.s_cont_1 EQU #26DD +.s_cont_2 EQU #2712 +.s_cont_3 EQU #2713 +.s_decimal EQU #268D +.s_fn EQU #25F5 +.s_fn_sbrn EQU #27BD +.s_ik_dollar_stk EQU #2660 +.s_ink_dollar_en EQU #2665 +.s_inkey_dollar EQU #2634 +.s_letter EQU #26C9 +.s_loop EQU #2734 +.s_loop_1 EQU #24FF +.s_loopend EQU #2770 +.s_negate EQU #26DF +.s_next EQU #2790 +.s_no_to_string EQU #2707 +.s_not_and EQU #2788 +.s_numeric EQU #26C3 +.s_opertr EQU #2723 +.s_pi EQU #2627 +.s_pi_end EQU #2630 +.s_point EQU #267B +.s_push_po EQU #270D +.s_q_again EQU #25BE +.s_q_copy EQU #25CB +.s_q_prms EQU #25D9 +.s_quote EQU #25B3 +.s_quote_s EQU #250F +.s_rnd EQU #25F8 +.s_rnd_end EQU #2625 +.s_rport_c2 EQU #2761 +.s_rport_c EQU #252D +.s_runtest EQU #2764 +.s_sc_mtch EQU #255A +.s_sc_rows EQU #255D +.s_scr_nxt EQU #2573 +.s_scr_sto EQU #257D +.s_screen_dollar EQU #2668 +.s_scrn_dollar_s EQU #2535 +.s_scrn_lp EQU #254F +.s_scrn_s EQU #2535 +.s_scrn_s_2538 EQU #2538 ; secondary entry to S-SCRN$-S +.s_sd_skip EQU #26B6 +.s_stk_dec EQU #26B5 +.s_stk_lst EQU #274C +.s_string EQU #25DB +.s_syntest EQU #275B +.s_tighter EQU #2773 +.s_u_plus EQU #25AF +.sa_1_sec EQU #0991 +.sa_8_bits EQU #0525 +.sa_all EQU #075A ; tape save/load +.sa_bit_1 EQU #0514 +.sa_bit_2 EQU #0511 +.sa_blank EQU #0629 +.sa_bytes EQU #04C2 +.sa_code EQU #06C3 +.sa_code_1 EQU #06E1 +.sa_code_2 EQU #06F0 +.sa_code_3 EQU #06F5 +.sa_code_4 EQU #06F9 +.sa_contrl EQU #0970 +.sa_data EQU #0652 +.sa_data_1 EQU #0692 +.sa_delay EQU #053C +.sa_flag EQU #04D0 +.sa_leader EQU #04D8 +.sa_line EQU #0716 +.sa_line_1 EQU #0723 +.sa_loop EQU #04FE +.sa_loop_p EQU #0505 +.sa_name EQU #064B +.sa_null EQU #0644 +.sa_or_ld_end EQU #0554 +.sa_or_ld_ret EQU #053F +.sa_out EQU #051C +.sa_parity EQU #050E +.sa_scr_dollar EQU #06A0 +.sa_set EQU #051A +.sa_space EQU #0621 +.sa_start EQU #0507 +.sa_sync_1 EQU #04EA +.sa_sync_2 EQU #04F2 +.sa_type_0 EQU #073A +.sa_type_3 EQU #0710 +.sa_v_new EQU #0685 +.sa_v_old EQU #0672 +.sa_v_type EQU #068F +.save_etc EQU #0605 +.scan_ent EQU #336C +.scan_func EQU #2596 +.scan_loop EQU #1B52 +.scanning EQU #24FB +.scrl_mssg EQU #0CF8 +.sec_plus EQU #3575 +.secnd_low EQU #356B +.separator EQU #1B6F +.series_xx EQU #3449 +.set_de EQU #1195 +.set_hl EQU #1190 +.set_min EQU #16B0 +.set_permanent_colors_0x1CAD EQU #1CAD ; special entry point +.set_permanent_colors_1CAD EQU #1CAD ; special entry point +.set_stk EQU #16C5 +.set_work EQU #16BF +.sf_arg_lp EQU #2843 +.sf_arg_vl EQU #2852 +.sf_argmt1 EQU #2802 +.sf_argmts EQU #27D9 +.sf_brkt_1 EQU #27D0 +.sf_brkt_2 EQU #27E4 +.sf_cp_def EQU #2814 +.sf_flag_6 EQU #27E9 +.sf_fnd_df EQU #2808 +.sf_not_fd EQU #2825 +.sf_r_br_2 EQU #2885 +.sf_rprt_c EQU #27E6 +.sf_run EQU #27F7 +.sf_syn_en EQU #27F4 +.sf_value EQU #288D +.sf_values EQU #2831 +.sfa_cp_vr EQU #296B +.sfa_end EQU #2991 +.sfa_loop EQU #295A +.sfa_match EQU #2981 +.sgn EQU #3492 +.shift_fp EQU #2FDD +.shift_len EQU #3055 +.shift_one EQU #316E +.sign_done EQU #2CFE +.sign_flag EQU #2CF2 +.sign_to_c EQU #3507 +.sin EQU #37B5 +.skip_cons EQU #33F7 +.skip_next EQU #33F8 +.skip_over EQU #007D +.skip_zero EQU #315E +.skips EQU #0090 +.sl_define EQU #2A94 +.sl_over EQU #2AA8 +.sl_rpt_c EQU #2A7A +.sl_second EQU #2A81 +.sl_store EQU #2AAD +.slicing EQU #2A52 +.small EQU #37F8 +.spare EQU #386E +.sqr EQU #384A +.st_e_part EQU #2CFF +.st_mem_xx EQU #342D +.stack_a EQU #2D28 +.stack_bc EQU #2D2B ; stack BC register pair +.stack_fetch EQU #2BF1 ; get last value from calculator stack +.stack_num EQU #33B4 +.start EQU #0000 +.start_new EQU #11CB +.stk_code EQU #3671 +.stk_const EQU #33C8 +.stk_const_xx EQU #341B +.stk_data EQU #33C6 +.stk_digit EQU #2D22 +.stk_f_arg EQU #2951 +.stk_fetch EQU #2BF1 +.stk_pntrs EQU #35BF +.stk_st_0 EQU #2AB1 +.stk_sto_string EQU #2AB2 +.stk_store EQU #2AB6 +.stk_to_a EQU #2314 +.stk_to_bc EQU #2307 +.stk_var EQU #2996 +.stk_zeros EQU #33F1 +.stmt_l_1 EQU #1B29 +.stmt_loop EQU #1B28 +.stmt_next EQU #1BF4 +.stmt_r_1 EQU #1B7D +.stmt_ret EQU #1B76 +.stop EQU #1CEE +.str_alter EQU #2070 +.str_and_no EQU #352D +.str_data1 EQU #1727 +.str_data EQU #171E +.str_dollar EQU #361F +.str_test EQU #3588 +.strings EQU #3559 +.strs_add EQU #359C +.strt_mlt EQU #3125 +.subn_only EQU #31F2 +.subtract EQU #300F +.sv_arrays EQU #29AE +.sv_ch_add EQU #29E0 +.sv_close EQU #29D8 +.sv_comma EQU #29C3 +.sv_count EQU #29E7 +.sv_dim EQU #2A48 +.sv_elem_string EQU #2A2C +.sv_loop EQU #29EA +.sv_mult EQU #29FB +.sv_number EQU #2A22 +.sv_ptr EQU #29C0 +.sv_rpt_c EQU #2A12 +.sv_simple_string EQU #29A1 +.sv_slice EQU #2A45 +.sv_slice? EQU #2A49 +.swap_byte EQU #343E +.syntax_z EQU #2530 +.t_expnent EQU #326C +.t_first EQU #3233 +.t_gr_zero EQU #3221 +.t_numeric EQU #3252 +.t_shift EQU #3261 +.t_small EQU #323F +.t_store EQU #3267 +.t_test EQU #325E +.tan EQU #37DA +.tape_msgs EQU #09A1 +.tbl_addrs EQU #32D7 +.tbl_of_ops EQU #2795 +.tbl_priors EQU #27B0 +.temp_ptr1 EQU #0077 +.temp_ptr2 EQU #0078 +.temps EQU #0D4D ; copy the permanent color items to the temporary ones +.temps_1 EQU #0D5B +.temps_2 EQU #0D65 +.test_5_sp EQU #33A9 +.test_char EQU #001C +.test_neg EQU #307C +.test_norm EQU #3155 +.test_room EQU #1F05 +.test_zero EQU #34E9 +.tkn_table EQU #0095 +.to_power EQU #3851 +.truncate EQU #3214 +.two_p_1 EQU #1E8E +.two_param EQU #1E85 +.unstack_z EQU #1FC3 +.use_252 EQU #2495 +.use_zero EQU #1CE6 +.usr_no EQU #34B3 +.usr_range EQU #34D3 +.usr_stack EQU #34E4 +.usr_string EQU #34BC +.v_80_byte EQU #2932 +.v_char EQU #28D4 +.v_each EQU #2900 +.v_end EQU #294B +.v_found_1 EQU #293E +.v_found_2 EQU #293F +.v_get_ptr EQU #2929 +.v_matches EQU #2912 +.v_next EQU #292A +.v_pass EQU #2943 +.v_rport_c EQU #360C +.v_run EQU #28FD +.v_run_or_syn EQU #28EF +.v_spaces EQU #2913 +.v_str_var EQU #28DE +.v_syntax EQU #2934 +.v_test_fn EQU #28E3 +.val_dollar EQU #35DE +.val_fet_1 EQU #1C56 +.val_fet_2 EQU #1C59 +.valid EQU #371C +.var_a_1 EQU #1C22 +.var_a_2 EQU #1C30 +.var_a_3 EQU #1C46 +.vr_cont_1 EQU #07E9 +.vr_cont_2 EQU #07F4 +.vr_cont_3 EQU #0800 +.vr_contrl EQU #07CB +.wait_key1 EQU #15DE +.wait_key EQU #15D4 +.x_large EQU #326D +.x_neg EQU #36B7 +.xis0 EQU #385D +.yneg EQU #37A8 +.zero_rslt EQU #315D +.zeros_4_or_5 EQU #2FFB +.zplus EQU #37A1 +.zx81_name EQU #04AA +; BASIC 128 +x128: +.show_main_menu EQU #259F +.ROM_SWAP EQU #5B00 ; 128K paging subroutine in RAM +;._128_new EQU #0057 + ENDMODULE \ No newline at end of file