diff --git a/SP_128.ASM b/SP_128.ASM index fbaaea7..4e0b443 100644 --- a/SP_128.ASM +++ b/SP_128.ASM @@ -54,8 +54,8 @@ ;TASM directives: -; #DEFINE DEFB .BYTE -; #DEFINE DEFW .WORD +; #DEFINE DB .BYTE +; #DEFINE DW .WORD ; #DEFINE DEFM .TEXT ; #DEFINE DEFS .FILL ; #DEFINE END .END @@ -689,7 +689,7 @@ CHAR_SET EQU #3D00 ;[v]..................................................................................................................... SP2000 [v] MACRO CALL_R1 adr RST #28 - DEFW adr + DW adr ENDM DEFINE START_PAUSE #0001 @@ -713,8 +713,8 @@ L0004: DEC BC ; Delay about 0.2s to allow screen switching mechani JP L00C7 ; to the main reset routine. -; L000C: DEFB #00, #00 ; [Spare bytes] -; DEFB #00, #00 ; +; L000C: DB #00, #00 ; [Spare bytes] +; DB #00, #00 ; ; @@ -724,7 +724,7 @@ L0004: DEC BC ; Delay about 0.2s to allow screen switching mechani ; RST #10 - Print A Character ; --------------------------- L0010: RST #28 ; Call corresponding routine in ROM 1. - DEFW PRINT_A_1 ; #0010. + DW PRINT_A_1 ; #0010. RET ; ;[v]..................................................................................................................... SP2000 [v] @@ -741,7 +741,7 @@ RSTx28.part2_3: ; RST #18 - Collect A Character ; ----------------------------- L0018: RST #28 ; Call corresponding routine in ROM 1. - DEFW GET_CHAR ; #0018. + DW GET_CHAR ; #0018. RET ; ;[v]..................................................................................................................... SP2000 [v] @@ -760,7 +760,7 @@ RSTx28.part1_2: ; RST #20 - Collect Next Character ; -------------------------------- L0020: RST #28 ; Call corresponding routine in ROM 1. - DEFW NEXT_CHAR ; #0020. + DW NEXT_CHAR ; #0020. RET ; ;[v]..................................................................................................................... SP2000 [v] @@ -778,7 +778,7 @@ RSTx28.part1_3: ; RST #28 - Call Routine in ROM 1 ; ------------------------------- ; RST 28 calls a routine in ROM 1 (or alternatively a routine in RAM while -; ROM 1 is paged in). Call as follows: RST 28 / DEFW address. +; ROM 1 is paged in). Call as follows: RST 28 / DW address. ;!TODO эт  ЏрЎцЅЄур  р ЇЁЈт  ­  ЊусЊЈ ˆЂ ­ЎЌ. ŒЎІЅт ЌЎІ­Ў сЄЅЋ ть ЌЅ­ЅЅ р ЇЄрЎЁЋЅ­­Ў? ;L0028 RSTx28: EX (SP),HL ; Get the address after the RST #28 into HL, @@ -798,7 +798,7 @@ R30: DEC HL ; (There is no RST #30) RSTx28.part2_2: LD HL,(TARGET) ; #5B58. HL=Retrieve address to call. [There is no NMI code. Credit: Andrew Owen]. JR RSTx28.part2_3 -; L0037: DEFB #00 ; [Spare byte] +; L0037: DB #00 ; [Spare byte] ;[^]..................................................................................................................... SP2000 [^] ; @@ -1081,7 +1081,7 @@ L00C9: LD A,B ; OUT (C),A ; Set AY register 14 to #FF. This will force a communications reset to the keypad if present. JR L0137 ; Jump ahead to continue. -L00FF: DEFB #00 ; [Spare byte] +L00FF: DB #00 ; [Spare byte] ; ==================== @@ -1104,7 +1104,7 @@ L0124: JP L07CA ; RS232 text output routine. L0127: JP L08A3 ; RS232 byte output routine. L012A: JP L08F0 ; COPY (screen dump) routine. L012D: RST #28 ; Call keypad scan routine in ROM 1. - DEFW KP_SCAN-#0100 ; #3B01. [*BUG* - The address jumps into the middle of the keypad decode routine in ROM 1. It + DW KP_SCAN-#0100 ; #3B01. [*BUG* - The address jumps into the middle of the keypad decode routine in ROM 1. It RET ; looks like it is supposed to deal with the keypad and so the most likely ; addresses are #3A42 (read keypad) or #39A0 (scan keypad). At #3C01 in ; ROM 1 is a vector jump command to #39A0 to scan the keypad and this is @@ -1178,7 +1178,7 @@ L0137: LD B,D ; Complete setting up the sound chip registers. LD BC,#00A8 ; There are 21 User Defined Graphics to copy. EX DE,HL ; Swap so destination is #FFFF. RST #28 ; - DEFW MAKE_ROOM+#000C ; Calling this address (LDDR/RET) in the main ROM + DW MAKE_ROOM+#000C ; Calling this address (LDDR/RET) in the main ROM ; cleverly copies the 21 characters to the end of RAM. EX DE,HL ; Transfer DE to HL. @@ -1296,9 +1296,9 @@ L019D: LD HL,CHAR_SET-#0100 ; #3C00. Set HL to where, in theory character zer LD (IY+#31),#02 ; DF_SZ. Set the lower screen size to two rows. RST #28 ; - DEFW CLS ; #0D6B. Clear the screen. + DW CLS ; #0D6B. Clear the screen. RST #28 ; Attempt to display TV tuning test screen. - DEFW TEST_SCREEN ; #3C04. Will return if BREAK is not being pressed. + DW TEST_SCREEN ; #3C04. Will return if BREAK is not being pressed. LD DE,L0561 ; Address of the Sinclair copyright message. CALL L057D ; Display the copyright message. @@ -1395,7 +1395,7 @@ L02BA: BIT 7,(IY+#00) ; Test ERR_NR. L02C1: LD HL,(#5C59) ; ELINE. Point to start of editing area. LD (#5C5D),HL ; Store in CH_ADD. RST #28 ; - DEFW E_LINE_NO ; #19FB. Call E_LINE_NO in ROM 1 to read the line number into editing area. + DW E_LINE_NO ; #19FB. Call E_LINE_NO in ROM 1 to read the line number into editing area. LD A,B ; OR C ; JP NZ,L03F7 ; Jump ahead if there was a line number. @@ -1414,7 +1414,7 @@ L02C1: LD HL,(#5C59) ; ELINE. Point to start of editing area. JR NZ,L02DF ; Jump ahead if no need to clear lower screen. RST #28 ; - DEFW CLS_LOWER ; #0D6E. Clear the lower screen. + DW CLS_LOWER ; #0D6E. Clear the lower screen. L02DF: RES 6,(IY+#02) ; TVFLAG. Signal to clear lower screen. @@ -1515,12 +1515,10 @@ L034E: PUSH AF ; Save the error code. LD HL,#0001 ; [Could have saved 2 bytes by using INC L]. LD (#5C16),HL ; STRMS+#0006. Ensure STRMS-00 specifies the keyboard. - RST #28 ; - DEFW SET_MIN ; #16B0. Clears editing area and areas after it. + CALL_R1 SET_MIN ; #16B0. Clears editing area and areas after it. RES 5,(IY+#37) ; FLAGX. Signal not INPUT mode. [Redundant since all flags were reset earlier] - RST #28 ; - DEFW CLS_LOWER ; #0D6E. Clear lower editing screen. + CALL_R1 CLS_LOWER ; #0D6E. Clear lower editing screen. SET 5,(IY+#02) ; TVFLAG. Signal lower screen requires clearing. POP AF ; Retrieve error code. @@ -1537,8 +1535,7 @@ L034E: PUSH AF ; Save the error code. L037D: ADD A,#07 ; Increase code to point to upper case letters. -L037F: RST #28 ; - DEFW OUT_CODE ; #15EF. Display the character held in the A register. +L037F: CALL_R1 OUT_CODE ; #15EF. Display the character held in the A register. LD A,#20 ; Display a space. RST #10 ; @@ -1569,18 +1566,18 @@ L037F: RST #28 ; L039C: LD DE,ERROR_MSGS ; #1391. Position of the error messages in ROM 1. RST #28 ; A holds the error code. - DEFW PO_MSG ; #0C0A. Call message printing routine. + DW PO_MSG ; #0C0A. Call message printing routine. ;Continue to display the line and statement number L03A2: XOR A ; Select the first message ", " (a 'comma' and a 'space'). LD DE,MESSAGES-1 ; #1536. Message base address in ROM 1. RST #28 ; - DEFW PO_MSG ; Print a comma followed by a space. + DW PO_MSG ; Print a comma followed by a space. LD BC,(#5C45) ; PPC. Fetch current line number. RST #28 ; - DEFW OUT_NUM_1 ; #1A1B. Print the line number. + DW OUT_NUM_1 ; #1A1B. Print the line number. LD A,#3A ; Print ':'. RST #10 ; @@ -1588,10 +1585,10 @@ L03A2: XOR A ; Select the first message ", " (a 'comma' and a 'spac LD C,(IY+#0D) ; SUBPPC. Fetch current statement number. LD B,#00 ; RST #28 ; - DEFW OUT_NUM_1 ; #1A1B. Print the statement number. + DW OUT_NUM_1 ; #1A1B. Print the statement number. RST #28 ; - DEFW CLEAR_SP ; #1097. Clear editing and workspace areas. + DW CLEAR_SP ; #1097. Clear editing and workspace areas. LD A,(#5C3A) ; ERR_NR. Fetch the error code. INC A @@ -1667,15 +1664,15 @@ L040A: CALL L1F20 ; Use Normal RAM Configuration (physical RAM bank 0). LD H,B ; LD L,C ; Transfer edit line number to HL. RST #28 ; - DEFW LINE_ADDR ; #196E. Returns address of the line in HL. + DW LINE_ADDR ; #196E. Returns address of the line in HL. JR NZ,L0429 ; Jump if the line does not exist. ;The line already exists so delete it RST #28 ; - DEFW NEXT_ONE ; #19B8. Find the address of the next line. + DW NEXT_ONE ; #19B8. Find the address of the next line. RST #28 ; - DEFW RECLAIM_2 ; #19E8. Delete the line. + DW RECLAIM_2 ; #19E8. Delete the line. L0429: POP BC ; BC=Length of the BASIC line. LD A,C ; @@ -1709,7 +1706,7 @@ L0442: PUSH BC ; BC=Length of the BASIC line. Stack it. PUSH DE ; Stack it. RST #28 ; - DEFW MAKE_ROOM ; #1655. Insert BC spaces at address HL. + DW MAKE_ROOM ; #1655. Insert BC spaces at address HL. POP HL ; HL=Start address of BASIC program. LD (#5C53),HL ; PROG. Save start address of BASIC program. @@ -1747,58 +1744,58 @@ L046A: POP AF ; Drop item (address of error handler routine). ; ------------------------------ ; Pointers into the new error message table. -L046C: DEFW L048C ; Error report 'a'. - DEFW L0497 ; Error report 'b'. - DEFW L04A6 ; Error report 'c'. - DEFW L04B0 ; Error report 'd'. - DEFW L04C1 ; Error report 'e'. - DEFW L04D4 ; Error report 'f'. - DEFW L04E0 ; Error report 'g'. - DEFW L04E0 ; Error report 'h'. - DEFW L04F3 ; Error report 'i'. - DEFW L0501 ; Error report 'j'. - DEFW L0512 ; Error report 'k'. - DEFW L0523 ; Error report 'l' - DEFW L0531 ; Error report 'm'. - DEFW L0542 ; Error report 'n'. - DEFW L054E ; Error report 'o'. - DEFW L0561 ; Error report 'p'. +L046C: DW L048C ; Error report 'a'. + DW L0497 ; Error report 'b'. + DW L04A6 ; Error report 'c'. + DW L04B0 ; Error report 'd'. + DW L04C1 ; Error report 'e'. + DW L04D4 ; Error report 'f'. + DW L04E0 ; Error report 'g'. + DW L04E0 ; Error report 'h'. + DW L04F3 ; Error report 'i'. + DW L0501 ; Error report 'j'. + DW L0512 ; Error report 'k'. + DW L0523 ; Error report 'l' + DW L0531 ; Error report 'm'. + DW L0542 ; Error report 'n'. + DW L054E ; Error report 'o'. + DW L0561 ; Error report 'p'. ; ----------------------- ; New Error Message Table ; ----------------------- -L048C: DEFM "MERGE erro" ; Report 'a'. - DEFB 'r'+#80 -L0497: DEFM "Wrong file typ" ; Report 'b'. - DEFB 'e'+#80 -L04A6: DEFM "CODE erro" ; Report 'c'. - DEFB 'r'+#80 -L04B0: DEFM "Too many bracket" ; Report 'd'. - DEFB 's'+#80 -L04C1: DEFM "File already exist" ; Report 'e'. - DEFB 's'+#80 -L04D4: DEFM "Invalid nam" ; Report 'f'. - DEFB 'e'+#80 -L04E0: DEFM "File does not exis" ; Report 'g' & 'h'. - DEFB 't'+#80 -L04F3: DEFM "Invalid devic" ; Report 'i'. - DEFB 'e'+#80 -L0501: DEFM "Invalid baud rat" ; Report 'j'. - DEFB 'e'+#80 -L0512: DEFM "Invalid note nam" ; Report 'k'. - DEFB 'e'+#80 -L0523: DEFM "Number too bi" ; Report 'l'. - DEFB 'g'+#80 -L0531: DEFM "Note out of rang" ; Report 'm'. - DEFB 'e'+#80 -L0542: DEFM "Out of rang" ; Report 'n'. - DEFB 'e'+#80 -L054E: DEFM "Too many tied note" ; Report 'o'. - DEFB 's'+#80 -L0561: DEFB #7F ; '(c)'. - DEFM " 1986 Sinclair Research Lt" ; Copyright. [There should have been an error report "p Bad parameterr" here as there was in the Spanish 128, - DEFB 'd'+#80 ; or the error code byte at #232F (ROM 0) should have been #19 for "Q Parameter error"] +L048C: DB "MERGE erro" ; Report 'a'. + DB 'r'+#80 +L0497: DB "Wrong file typ" ; Report 'b'. + DB 'e'+#80 +L04A6: DB "CODE erro" ; Report 'c'. + DB 'r'+#80 +L04B0: DB "Too many bracket" ; Report 'd'. + DB 's'+#80 +L04C1: DB "File already exist" ; Report 'e'. + DB 's'+#80 +L04D4: DB "Invalid nam" ; Report 'f'. + DB 'e'+#80 +L04E0: DB "File does not exis" ; Report 'g' & 'h'. + DB 't'+#80 +L04F3: DB "Invalid devic" ; Report 'i'. + DB 'e'+#80 +L0501: DB "Invalid baud rat" ; Report 'j'. + DB 'e'+#80 +L0512: DB "Invalid note nam" ; Report 'k'. + DB 'e'+#80 +L0523: DB "Number too bi" ; Report 'l'. + DB 'g'+#80 +L0531: DB "Note out of rang" ; Report 'm'. + DB 'e'+#80 +L0542: DB "Out of rang" ; Report 'n'. + DB 'e'+#80 +L054E: DB "Too many tied note" ; Report 'o'. + DB 's'+#80 +L0561: DB #7F ; '(c)'. + DB " 1986 Sinclair Research Lt" ; Copyright. [There should have been an error report "p Bad parameterr" here as there was in the Spanish 128, + DB 'd'+#80 ; or the error code byte at #232F (ROM 0) should have been #19 for "Q Parameter error"] ; ------------- ; Print Message @@ -1830,19 +1827,19 @@ L057D: LD A,(DE) ; Fetch next byte. ; instead of the ZX Printer. ; Used at #01DD (ROM 0). -L0589: DEFW PRINT_OUT ; #09F4 - K channel output routine. - DEFW KEY_INPUT ; #10A8 - K channel input routine. - DEFB 'K' ; #4B - Channel identifier 'K'. - DEFW PRINT_OUT ; #09F4 - S channel output routine. - DEFW REPORT_J ; #15C4 - S channel input routine. - DEFB 'S' ; #53 - Channel identifier 'S'. - DEFW ADD_CHAR ; #0F81 - R channel output routine. - DEFW REPORT_J ; #15C4 - R channel input routine. - DEFB 'R' ; #52 - Channel identifier 'R'. - DEFW POUT ; #5B34 - P Channel output routine. - DEFW PIN ; #5B2F - P Channel input routine. - DEFB 'P' ; #50 - Channel identifier 'P'. - DEFB #80 ; End marker. +L0589: DW PRINT_OUT ; #09F4 - K channel output routine. + DW KEY_INPUT ; #10A8 - K channel input routine. + DB 'K' ; #4B - Channel identifier 'K'. + DW PRINT_OUT ; #09F4 - S channel output routine. + DW REPORT_J ; #15C4 - S channel input routine. + DB 'S' ; #53 - Channel identifier 'S'. + DW ADD_CHAR ; #0F81 - R channel output routine. + DW REPORT_J ; #15C4 - R channel input routine. + DB 'R' ; #52 - Channel identifier 'R'. + DW POUT ; #5B34 - P Channel output routine. + DW PIN ; #5B2F - P Channel input routine. + DB 'P' ; #50 - Channel identifier 'P'. + DB #80 ; End marker. ; ------------------------- ; The 'Initial Stream Data' @@ -1851,13 +1848,13 @@ L0589: DEFW PRINT_OUT ; #09F4 - K channel output routine. ; This table is identical to that in ROM 1 at #15C6. ; Used at #0226 (ROM 0). -L059E: DEFB #01, #00 ; Stream #FD leads to channel 'K'. - DEFB #06, #00 ; Stream #FE leads to channel 'S'. - DEFB #0B, #00 ; Stream #FF leads to channel 'R'. - DEFB #01, #00 ; Stream #00 leads to channel 'K'. - DEFB #01, #00 ; Stream #01 leads to channel 'K'. - DEFB #06, #00 ; Stream #02 leads to channel 'S'. - DEFB #10, #00 ; Stream #03 leads to channel 'P'. +L059E: DB #01, #00 ; Stream #FD leads to channel 'K'. + DB #06, #00 ; Stream #FE leads to channel 'S'. + DB #0B, #00 ; Stream #FF leads to channel 'R'. + DB #01, #00 ; Stream #00 leads to channel 'K'. + DB #01, #00 ; Stream #01 leads to channel 'K'. + DB #06, #00 ; Stream #02 leads to channel 'S'. + DB #10, #00 ; Stream #03 leads to channel 'P'. ; =============================== @@ -1886,7 +1883,7 @@ L05AC: POP HL ; Point to the error byte. ;Handle a standard error code RST #28 ; - DEFW RAMRST ; #5B5D. Call the error handler routine in ROM 1. + DW RAMRST ; #5B5D. Call the error handler routine in ROM 1. ;Handle a new error code @@ -1896,7 +1893,7 @@ L05C8: DEC A ; LD (#5C5F),HL ; X_PTR. Set up the address of the character after the '?' marker. RST #28 ; - DEFW SET_STK ; #16C5. Set the calculator stack. + DW SET_STK ; #16C5. Set the calculator stack. RET ; Return to the error routine. ; ---------------------------- @@ -1914,7 +1911,7 @@ L05D6: LD A,#7F ; Read keyboard row B - SPACE. RET C ; Return if CAPS SHIFT not pressed. CALL L05AC ; Produce an error. - DEFB #14 ; "L Break into program" + DB #14 ; "L Break into program" ; ====================== @@ -1965,7 +1962,7 @@ L0610: JR C,L061B ; Jump if a character was received. JR Z,L0618 ; Jump if a character was not received. L0614: CALL L05AC ; Produce an error "8 End of file". - DEFB #07 ; + DB #07 ; ;A character was not received @@ -1981,7 +1978,7 @@ L061B: CP #0D ; Is it a carriage return? PUSH HL ; RST #28 ; - DEFW ADD_CHAR+4 ; #0F85. Insert the character into the INPUT line. + DW ADD_CHAR+4 ; #0F85. Insert the character into the INPUT line. POP HL ; LD (RETADDR),HL ; #5B5A. Restore the return address. @@ -2022,21 +2019,21 @@ L063D: RET C ; Return if a character was received. ; is 9600, and this is used for any rates specified that are higher than this. L0641: RST #28 ; [Could just do RST #18] - DEFW GET_CHAR ; #0018. + DW GET_CHAR ; #0018. RST #28 ; Get an expression. - DEFW EXPT_EXP ; #1C8C. + DW EXPT_EXP ; #1C8C. BIT 7,(IY+#01) ; FLAGS. JR Z,L0661 ; Jump ahead if syntax checking. RST #28 ; - DEFW STK_FETCH ; #2BF1. Fetch the expression. + DW STK_FETCH ; #2BF1. Fetch the expression. LD A,C ; DEC A ; OR B ; JR Z,L0659 ; Jump ahead if string is 1 character long. CALL L05AC ; Produce error report. - DEFB #24 ; "i Invalid device". + DB #24 ; "i Invalid device". L0659: LD A,(DE) ; Get character. AND #DF ; Convert to upper case. @@ -2049,18 +2046,18 @@ L0661: LD HL,(#5C5D) ; CH_ADD. Next character to be interpreted. JP NZ,L1912 ; Jump if not to produce error report "C Nonsense in BASIC". RST #28 ; Skip past the ';' character. - DEFW NEXT_CHAR ; #0020. [Could just do RST #20] + DW NEXT_CHAR ; #0020. [Could just do RST #20] RST #28 ; Get a numeric expression from the line. - DEFW EXPT_1NUM ; #1C82. + DW EXPT_1NUM ; #1C82. BIT 7,(IY+#01) ; FLAGS. Checking syntax mode? JR Z,L067D ; Jump ahead if so. RST #28 ; Get the result as an integer. - DEFW FIND_INT2 ; #1E99. + DW FIND_INT2 ; #1E99. LD (HD_00),BC ; #5B71. Store the result temporarily for use later. L067D: RST #28 ; [Could just do RST #18] - DEFW GET_CHAR ; #0018. Get the next character in the BASIC line. + DW GET_CHAR ; #0018. Get the next character in the BASIC line. CP #0D ; It should be ENTER. JR Z,L0689 ; Jump ahead if it is. @@ -2074,7 +2071,7 @@ L0689: CALL L18A1 ; Check for end of line. JR NZ,L0698 ; Jump if not, i.e. a numeric value was specified. CALL L05AC ; Produce error report. - DEFB #25 ; "j invalid baud rate" + DB #25 ; "j invalid baud rate" ;Lookup the timing constant to use for the specified baud rate @@ -2112,14 +2109,14 @@ L06AF: EX DE,HL ; HL points to timing value for the baud rate. ; --------------- ; Consists of entries of baud rate value followed by timing constant to use in the RS232 routines. -L06B8: DEFW #0032, #0AA5 ; Baud=50. - DEFW #006E, #04D4 ; Baud=110. - DEFW #012C, #01C3 ; Baud=300. - DEFW #0258, #00E0 ; Baud=600. - DEFW #04B0, #006E ; Baud=1200. - DEFW #0960, #0036 ; Baud=2400. - DEFW #12C0, #0019 ; Baud=4800. - DEFW #2580, #000B ; Baud=9600. +L06B8: DW #0032, #0AA5 ; Baud=50. + DW #006E, #04D4 ; Baud=110. + DW #012C, #01C3 ; Baud=300. + DW #0258, #00E0 ; Baud=600. + DW #04B0, #006E ; Baud=1200. + DW #0960, #0036 ; Baud=2400. + DW #12C0, #0019 ; Baud=4800. + DW #2580, #000B ; Baud=9600. ; ------------------- ; RS232 Input Routine @@ -2132,16 +2129,18 @@ L06D8: JP L08A5 ;[^]..................................................................................................................... SP2000 [^] -;!FIXIT ЂЎт этЎ тЅЏЅрь ­Ѕ ЈсЏЎЋьЇуЅтся Ј сюЄ  ЌЎІ­Ў сЂЎЅЃЎ ЂЎтЊ­уть [v] - LD A,(HL) ; Is the second-character received flag set? - AND A ; i.e. have we already received data? - JR Z,L06E5 ; Jump ahead if not. +; ЂЎт этЎ тЅЏЅрь ­Ѕ ЈсЏЎЋьЇуЅтся Ј сюЄ  ЌЎІ­Ў сЂЎЅЃЎ ЂЎтЊ­уть [v] + ; LD A,(HL) ; Is the second-character received flag set? + ; AND A ; i.e. have we already received data? + ; JR Z,L06E5 ; Jump ahead if not. - LD (HL),#00 ; Otherwise clear the flag - INC HL ; - LD A,(HL) ; and return the data which we received earlier. - SCF ; Set carry flag to indicate success - RET ; + ; LD (HL),#00 ; Otherwise clear the flag + ; INC HL ; + ; LD A,(HL) ; and return the data which we received earlier. + ; SCF ; Set carry flag to indicate success + ; RET ; + + _mInfoBLOCK #06E5-$,0 ;- - - - - - - - - - - - - - - - - - - - - - - - [^] ; ------------------------- @@ -2417,7 +2416,7 @@ L07E0: POP AF ; Retrieve character to print. LD HL,(RETADDR) ; #5B5A. Save RETADDR temporarily. PUSH HL ; RST #28 ; - DEFW PO_T_UDG ; #0B52. Print tokens via call to ROM 1 routine PO-T&UDG. + DW PO_T_UDG ; #0B52. Print tokens via call to ROM 1 routine PO-T&UDG. POP HL ; LD (RETADDR),HL ; #5B5A. Restore the original contents of RETADDR. SCF ; @@ -2688,7 +2687,7 @@ L08C8: LD A,5 ; JR NZ,LPT_PAUSE ; CALL ERR_RST8 ; DB 20 -LPT_END: +;LPT_END: ; IN A,(0FEH) ; RLCA ; JR C,LOOP ; ЎІЈЄ ­ЈЅ BUSY @@ -2725,36 +2724,36 @@ LOOP1: CALL L05D6 ; TEST BREAK SCF ; уст ­ЎЂЊ  C фЋ Ѓ  ЅсЋЈ A ­Ѕ 0 EI RET -; ; ŠЎ­Ѕц ЏрЎЃр ЌЌы ЏрЈ­тЅр  -;!FIXIT ЊусЎЊ ­ЈІЅ тЅЏЅрь ­Ѕ ЈсЏЎЋьЇуЅтся Ї ­ять чЅЌ-­ЈЁуЄь? [v] -L08DA: EX AF,AF' +; ЊусЎЊ ­ЈІЅ тЅЏЅрь ­Ѕ ЈсЏЎЋьЇуЅтся Ї ­ять чЅЌ-­ЈЁуЄь? [v] +; L08DA: EX AF,AF' - OUT (C),A ; Send out a 1 (low level). - JR L08E0 ; Jump ahead to continue with next bit. +; OUT (C),A ; Send out a 1 (low level). +; JR L08E0 ; Jump ahead to continue with next bit. -;Delay the length of a bit -L08E0: DEC HL ; (6) Delay 26*BAUD cycles. - LD A,H ; (4) - OR L ; (4) - JR NZ,L08E0 ; (12) Jump back until delay is completed. +; ;Delay the length of a bit +; L08E0: DEC HL ; (6) Delay 26*BAUD cycles. +; LD A,H ; (4) +; OR L ; (4) +; JR NZ,L08E0 ; (12) Jump back until delay is completed. - NOP ; (4) Fine tune the timing. - NOP ; (4) - NOP ; (4) +; NOP ; (4) Fine tune the timing. +; NOP ; (4) +; NOP ; (4) - POP AF ; Retrieve the data bits to send. - POP BC ; Retrieve the number of bits left to send. - OR A ; Clear carry flag. - RRA ; Shift the next bit to send into the carry flag. - DJNZ L08C8 ; Jump back to send next bit until all bits sent. +; POP AF ; Retrieve the data bits to send. +; POP BC ; Retrieve the number of bits left to send. +; OR A ; Clear carry flag. +; RRA ; Shift the next bit to send into the carry flag. +; DJNZ L08C8 ; Jump back to send next bit until all bits sent. - EI ; Re-enable interrupts. - RET ; Return with carry and zero flags reset. +; EI ; Re-enable interrupts. +; RET ; Return with carry and zero flags reset. ;- - - - - - - - - - - - - - - - - - - - - - - - [^] + _mInfoBLOCK #08F0-$,0 ;[^]..................................................................................................................... SP2000 [^] ; @@ -2901,7 +2900,7 @@ L0961: LD A,(HL) ; Retrieve value. ; A>#00 if pixel is set (actually the value of the bit corresponding to the pixel within the byte). L096D: RST #28 ; Get address of (B,C) pixel into HL and pixel position within byte into A. - DEFW PIXEL_ADDR ; #22AA. + DW PIXEL_ADDR ; #22AA. LD B,A ; B=Pixel position within byte (0-7). INC B ; @@ -2918,15 +2917,15 @@ L0974: RRA ; Shift the mask bit into the required bit position. ; EPSON Printer Control Code Tables ; --------------------------------- -L0979: DEFB #06 ; 6 characters follow. - DEFB #1B, #31 ; ESC '1' - 7/72 inch line spacing. - DEFB #1B, #4C, #00, #03 ; ESC 'L' 0 3 - Double density (768 bytes per row). +L0979: DB #06 ; 6 characters follow. + DB #1B, #31 ; ESC '1' - 7/72 inch line spacing. + DB #1B, #4C, #00, #03 ; ESC 'L' 0 3 - Double density (768 bytes per row). -L0980: DEFB #01 ; 1 character follows. - DEFB #0A ; Line feed. +L0980: DB #01 ; 1 character follows. + DB #0A ; Line feed. -L0982: DEFB #02 ; 2 characters follow. - DEFB #1B, #32 ; ESC '2' - 1/6 inch line spacing. +L0982: DB #02 ; 2 characters follow. + DB #1B, #32 ; ESC '2' - 1/6 inch line spacing. ; ===================== @@ -3024,7 +3023,7 @@ L098D: ADD HL,DE ; Calculate HL=#003C + (#0037 * B). LD C,L ; LD B,H ; BC=Space required (maximum = #01F4). RST #28 ; - DEFW BC_SPACES ; #0030. Make BC bytes of space in the workspace. + DW BC_SPACES ; #0030. Make BC bytes of space in the workspace. DI ; Interrupts get re-enabled by the call mechanism to ROM 1 so disable them again. @@ -3063,7 +3062,7 @@ L09A0: LD BC,#FFC9 ; #-37 (#37 bytes is the size of a play channel string ; to the system variables at #5C3A, call STK_FETCH, disable interrupts, then pop the stacked value back to IY. Credit: Paul Farrow] RST #28 ; Get the details of the string from the stack. - DEFW STK_FETCH ; #2BF1. + DW STK_FETCH ; #2BF1. DI ; Interrupts get re-enabled by the call mechanism to ROM 1 so disable them again. @@ -3159,17 +3158,17 @@ L0A05: LD (IY+#27),#1A ; Set the initial tempo timing value. ; Exit : The calculator stack holds the result. L0A31: RST 28H ; Invoke the floating point calculator. - DEFB #A4 ; stk-ten. = x, 10 - DEFB #01 ; exchange. = 10, x - DEFB #05 ; division. = 10/x - DEFB #34 ; stk-data. = 10/x, 7.33e-6 - DEFB #DF ; - exponent #6F (floating point number 7.33e-6). - DEFB #75 ; - mantissa byte 1 - DEFB #F4 ; - mantissa byte 2 - DEFB #38 ; - mantissa byte 3 - DEFB #75 ; - mantissa byte 4 - DEFB #05 ; division. = (10/x)/7.33e-6 - DEFB #38 ; end-calc. + DB #A4 ; stk-ten. = x, 10 + DB #01 ; exchange. = 10, x + DB #05 ; division. = 10/x + DB #34 ; stk-data. = 10/x, 7.33e-6 + DB #DF ; - exponent #6F (floating point number 7.33e-6). + DB #75 ; - mantissa byte 1 + DB #F4 ; - mantissa byte 2 + DB #38 ; - mantissa byte 3 + DB #75 ; - mantissa byte 4 + DB #05 ; division. = (10/x)/7.33e-6 + DB #38 ; end-calc. RET ; ; -------------- @@ -3305,7 +3304,7 @@ L0AAB: DEC DE ; DE=Smallest channel duration length, i.e. duration u ; ---------------------------- ; Recognised characters in PLAY commands. -L0AB7: DEFM "HZYXWUVMT)(NO!" +L0AB7: DB "HZYXWUVMT)(NO!" ; ------------------ ; Get Play Character @@ -3476,7 +3475,7 @@ L0B5C: CALL L0A3E ; Test for BREAK being pressed. EI ; Re-enable interrupts. CALL L05AC ; Produce error report. [Could have saved 1 byte by using JP #05D6 (ROM 0)] - DEFB #14 ; "L Break into program" + DB #14 ; "L Break into program" L0B69: CALL L0AC5 ; Get the current character from the PLAY string, and advance the position pointer. JP C,L0DA2 ; Jump if at the end of the string. @@ -3707,7 +3706,7 @@ L0C32: CALL L0B1D ; Get following numeric value from the string into BC. PUSH IY ; Save the pointer to the play command data block. RST #28 ; - DEFW STACK_BC ; #2D2B. Place the contents of BC onto the stack. The call restores IY to #5C3A. + DW STACK_BC ; #2D2B. Place the contents of BC onto the stack. The call restores IY to #5C3A. DI ; Interrupts get re-enabled by the call mechanism to ROM 1 so disable them again. POP IY ; Restore IY to point at the play command data block. @@ -3741,7 +3740,7 @@ L0C32: CALL L0B1D ; Get following numeric value from the string into BC. L0C76: DI ; Interrupts get re-enabled by the call mechanism to ROM 1 so disable them again. RST #28 ; - DEFW FP_TO_BC ; #2DA2. Fetch the value on the top of the calculator stack. + DW FP_TO_BC ; #2DA2. Fetch the value on the top of the calculator stack. DI ; Interrupts get re-enabled by the call mechanism to ROM 1 so disable them again. @@ -4124,21 +4123,21 @@ L0DB4: PUSH HL ; Save the address of the duration length within the c ; ----------------------- ; Handler routine jump table for all PLAY commands. -L0DCA: DEFW L0CFB ; Command handler routine for all other characters. - DEFW L0B85 ; '!' command handler routine. - DEFW L0B90 ; 'O' command handler routine. - DEFW L0BA5 ; 'N' command handler routine. - DEFW L0BA6 ; '(' command handler routine. - DEFW L0BC2 ; ')' command handler routine. - DEFW L0C32 ; 'T' command handler routine. - DEFW L0C84 ; 'M' command handler routine. - DEFW L0C95 ; 'V' command handler routine. - DEFW L0CAD ; 'U' command handler routine. - DEFW L0CBA ; 'W' command handler routine. - DEFW L0CCE ; 'X' command handler routine. - DEFW L0CDD ; 'Y' command handler routine. - DEFW L0CEE ; 'Z' command handler routine. - DEFW L0CF6 ; 'H' command handler routine. +L0DCA: DW L0CFB ; Command handler routine for all other characters. + DW L0B85 ; '!' command handler routine. + DW L0B90 ; 'O' command handler routine. + DW L0BA5 ; 'N' command handler routine. + DW L0BA6 ; '(' command handler routine. + DW L0BC2 ; ')' command handler routine. + DW L0C32 ; 'T' command handler routine. + DW L0C84 ; 'M' command handler routine. + DW L0C95 ; 'V' command handler routine. + DW L0CAD ; 'U' command handler routine. + DW L0CBA ; 'W' command handler routine. + DW L0CCE ; 'X' command handler routine. + DW L0CDD ; 'Y' command handler routine. + DW L0CEE ; 'Z' command handler routine. + DW L0CF6 ; 'H' command handler routine. ; ------------------------------ ; Envelope Waveform Lookup Table @@ -4148,14 +4147,14 @@ L0DCA: DEFW L0CFB ; Command handler routine for all other characters. ; filters out the two duplicate waveforms possible from the sound generator and ; allows the order of the waveforms to be arranged in a more logical fashion. -L0DE8: DEFB #00 ; W0 - Single decay then off. (Continue off, attack off, alternate off, hold off) - DEFB #04 ; W1 - Single attack then off. (Continue off, attack on, alternate off, hold off) - DEFB #0B ; W2 - Single decay then hold. (Continue on, attack off, alternate on, hold on) - DEFB #0D ; W3 - Single attack then hold. (Continue on, attack on, alternate off, hold on) - DEFB #08 ; W4 - Repeated decay. (Continue on, attack off, alternate off, hold off) - DEFB #0C ; W5 - Repeated attack. (Continue on, attack on, alternate off, hold off) - DEFB #0E ; W6 - Repeated attack-decay. (Continue on, attack on, alternate on, hold off) - DEFB #0A ; W7 - Repeated decay-attack. (Continue on, attack off, alternate on, hold off) +L0DE8: DB #00 ; W0 - Single decay then off. (Continue off, attack off, alternate off, hold off) + DB #04 ; W1 - Single attack then off. (Continue off, attack on, alternate off, hold off) + DB #0B ; W2 - Single decay then hold. (Continue on, attack off, alternate on, hold on) + DB #0D ; W3 - Single attack then hold. (Continue on, attack on, alternate off, hold on) + DB #08 ; W4 - Repeated decay. (Continue on, attack off, alternate off, hold off) + DB #0C ; W5 - Repeated attack. (Continue on, attack on, alternate off, hold off) + DB #0E ; W6 - Repeated attack-decay. (Continue on, attack on, alternate on, hold off) + DB #0A ; W7 - Repeated decay-attack. (Continue on, attack off, alternate on, hold off) ; -------------------------- ; Identify Command Character @@ -4178,13 +4177,13 @@ L0DF0: LD BC,#000F ; Number of characters + 1 in command table. ; This table contains an entry for each note of the scale, A to G, ; and is the number of semitones above the note C. -L0DF9: DEFB #09 ; 'A' - DEFB #0B ; 'B' - DEFB #00 ; 'C' - DEFB #02 ; 'D' - DEFB #04 ; 'E' - DEFB #05 ; 'F' - DEFB #07 ; 'G' +L0DF9: DB #09 ; 'A' + DB #0B ; 'B' + DB #00 ; 'C' + DB #02 ; 'D' + DB #04 ; 'E' + DB #05 ; 'F' + DB #07 ; 'G' ; ------------------------- ; Find Note Duration Length @@ -4210,19 +4209,19 @@ L0E00: PUSH HL ; Save HL. ; The value of 96d is the lowest common denominator from which all note durations ; can be defined. -L0E0C: DEFB #80 ; Rest [Not used since table is always indexed into with a value of 1 or more] - DEFB #06 ; Semi-quaver (sixteenth note). - DEFB #09 ; Dotted semi-quaver (3/32th note). - DEFB #0C ; Quaver (eighth note). - DEFB #12 ; Dotted quaver (3/16th note). - DEFB #18 ; Crotchet (quarter note). - DEFB #24 ; Dotted crotchet (3/8th note). - DEFB #30 ; Minim (half note). - DEFB #48 ; Dotted minim (3/4th note). - DEFB #60 ; Semi-breve (whole note). - DEFB #04 ; Triplet semi-quaver (1/24th note). - DEFB #08 ; Triplet quaver (1/12th note). - DEFB #10 ; Triplet crochet (1/6th note). +L0E0C: DB #80 ; Rest [Not used since table is always indexed into with a value of 1 or more] + DB #06 ; Semi-quaver (sixteenth note). + DB #09 ; Dotted semi-quaver (3/32th note). + DB #0C ; Quaver (eighth note). + DB #12 ; Dotted quaver (3/16th note). + DB #18 ; Crotchet (quarter note). + DB #24 ; Dotted crotchet (3/8th note). + DB #30 ; Minim (half note). + DB #48 ; Dotted minim (3/4th note). + DB #60 ; Semi-breve (whole note). + DB #04 ; Triplet semi-quaver (1/24th note). + DB #08 ; Triplet quaver (1/12th note). + DB #10 ; Triplet crochet (1/6th note). ; ----------------- ; Is Numeric Digit? @@ -4462,32 +4461,32 @@ L0F09: INC HL ; Point to the next character. L0F12: CALL L0E93 ; Turn off all sound and restore IY. EI ; CALL L05AC ; Produce error report. - DEFB #29 ; "n Out of range" + DB #29 ; "n Out of range" L0F1A: CALL L0E93 ; Turn off all sound and restore IY. EI ; CALL L05AC ; Produce error report. - DEFB #27 ; "l Number too big" + DB #27 ; "l Number too big" L0F22: CALL L0E93 ; Turn off all sound and restore IY. EI ; CALL L05AC ; Produce error report. - DEFB #26 ; "k Invalid note name" + DB #26 ; "k Invalid note name" L0F2A: CALL L0E93 ; Turn off all sound and restore IY. EI ; CALL L05AC ; Produce error report. - DEFB #1F ; "d Too many brackets" + DB #1F ; "d Too many brackets" L0F32: CALL L0E93 ; Turn off all sound and restore IY. EI ; CALL L05AC ; Produce error report. - DEFB #28 ; "m Note out of range" + DB #28 ; "m Note out of range" L0F3A: CALL L0E93 ; Turn off all sound and restore IY. EI ; CALL L05AC ; Produce error report. - DEFB #2A ; "o Too many tied notes" + DB #2A ; "o Too many tied notes" ; ------------------------- ; Play Note on Each Channel @@ -4835,123 +4834,123 @@ L108C: SLA (IY+#21) ; Have all channels been processed? ; for note 117, etc, up to PLAY "O8############G" for note 127. Attempting to access note ; 128 using PLAY "O8#############G" will lead to error report "m Note out of range". -L1096: DEFW #0FBF ; Octave 1, Note 21 - A (27.50 Hz, Ideal=27.50 Hz, Error=-0.01%) C0 - DEFW #0EDC ; Octave 1, Note 22 - A# (29.14 Hz, Ideal=29.16 Hz, Error=-0.08%) - DEFW #0E07 ; Octave 1, Note 23 - B (30.87 Hz, Ideal=30.87 Hz, Error=-0.00%) +L1096: DW #0FBF ; Octave 1, Note 21 - A (27.50 Hz, Ideal=27.50 Hz, Error=-0.01%) C0 + DW #0EDC ; Octave 1, Note 22 - A# (29.14 Hz, Ideal=29.16 Hz, Error=-0.08%) + DW #0E07 ; Octave 1, Note 23 - B (30.87 Hz, Ideal=30.87 Hz, Error=-0.00%) - DEFW #0D3D ; Octave 2, Note 24 - C (32.71 Hz, Ideal=32.70 Hz, Error=+0.01%) C1 - DEFW #0C7F ; Octave 2, Note 25 - C# (34.65 Hz, Ideal=34.65 Hz, Error=-0.00%) - DEFW #0BCC ; Octave 2, Note 26 - D (36.70 Hz, Ideal=36.71 Hz, Error=-0.01%) - DEFW #0B22 ; Octave 2, Note 27 - D# (38.89 Hz, Ideal=38.89 Hz, Error=+0.01%) - DEFW #0A82 ; Octave 2, Note 28 - E (41.20 Hz, Ideal=41.20 Hz, Error=+0.00%) - DEFW #09EB ; Octave 2, Note 29 - F (43.66 Hz, Ideal=43.65 Hz, Error=+0.00%) - DEFW #095D ; Octave 2, Note 30 - F# (46.24 Hz, Ideal=46.25 Hz, Error=-0.02%) - DEFW #08D6 ; Octave 2, Note 31 - G (49.00 Hz, Ideal=49.00 Hz, Error=+0.00%) - DEFW #0857 ; Octave 2, Note 32 - G# (51.92 Hz, Ideal=51.91 Hz, Error=+0.01%) - DEFW #07DF ; Octave 2, Note 33 - A (55.01 Hz, Ideal=55.00 Hz, Error=+0.01%) - DEFW #076E ; Octave 2, Note 34 - A# (58.28 Hz, Ideal=58.33 Hz, Error=-0.08%) - DEFW #0703 ; Octave 2, Note 35 - B (61.75 Hz, Ideal=61.74 Hz, Error=+0.02%) + DW #0D3D ; Octave 2, Note 24 - C (32.71 Hz, Ideal=32.70 Hz, Error=+0.01%) C1 + DW #0C7F ; Octave 2, Note 25 - C# (34.65 Hz, Ideal=34.65 Hz, Error=-0.00%) + DW #0BCC ; Octave 2, Note 26 - D (36.70 Hz, Ideal=36.71 Hz, Error=-0.01%) + DW #0B22 ; Octave 2, Note 27 - D# (38.89 Hz, Ideal=38.89 Hz, Error=+0.01%) + DW #0A82 ; Octave 2, Note 28 - E (41.20 Hz, Ideal=41.20 Hz, Error=+0.00%) + DW #09EB ; Octave 2, Note 29 - F (43.66 Hz, Ideal=43.65 Hz, Error=+0.00%) + DW #095D ; Octave 2, Note 30 - F# (46.24 Hz, Ideal=46.25 Hz, Error=-0.02%) + DW #08D6 ; Octave 2, Note 31 - G (49.00 Hz, Ideal=49.00 Hz, Error=+0.00%) + DW #0857 ; Octave 2, Note 32 - G# (51.92 Hz, Ideal=51.91 Hz, Error=+0.01%) + DW #07DF ; Octave 2, Note 33 - A (55.01 Hz, Ideal=55.00 Hz, Error=+0.01%) + DW #076E ; Octave 2, Note 34 - A# (58.28 Hz, Ideal=58.33 Hz, Error=-0.08%) + DW #0703 ; Octave 2, Note 35 - B (61.75 Hz, Ideal=61.74 Hz, Error=+0.02%) - DEFW #069F ; Octave 3, Note 36 - C ( 65.39 Hz, Ideal= 65.41 Hz, Error=-0.02%) C2 - DEFW #0640 ; Octave 3, Note 37 - C# ( 69.28 Hz, Ideal= 69.30 Hz, Error=-0.04%) - DEFW #05E6 ; Octave 3, Note 38 - D ( 73.40 Hz, Ideal= 73.42 Hz, Error=-0.01%) - DEFW #0591 ; Octave 3, Note 39 - D# ( 77.78 Hz, Ideal= 77.78 Hz, Error=+0.01%) - DEFW #0541 ; Octave 3, Note 40 - E ( 82.41 Hz, Ideal= 82.41 Hz, Error=+0.00%) - DEFW #04F6 ; Octave 3, Note 41 - F ( 87.28 Hz, Ideal= 87.31 Hz, Error=-0.04%) - DEFW #04AE ; Octave 3, Note 42 - F# ( 92.52 Hz, Ideal= 92.50 Hz, Error=+0.02%) - DEFW #046B ; Octave 3, Note 43 - G ( 98.00 Hz, Ideal= 98.00 Hz, Error=+0.00%) - DEFW #042C ; Octave 3, Note 44 - G# (103.78 Hz, Ideal=103.83 Hz, Error=-0.04%) - DEFW #03F0 ; Octave 3, Note 45 - A (109.96 Hz, Ideal=110.00 Hz, Error=-0.04%) - DEFW #03B7 ; Octave 3, Note 46 - A# (116.55 Hz, Ideal=116.65 Hz, Error=-0.08%) - DEFW #0382 ; Octave 3, Note 47 - B (123.43 Hz, Ideal=123.47 Hz, Error=-0.03%) + DW #069F ; Octave 3, Note 36 - C ( 65.39 Hz, Ideal= 65.41 Hz, Error=-0.02%) C2 + DW #0640 ; Octave 3, Note 37 - C# ( 69.28 Hz, Ideal= 69.30 Hz, Error=-0.04%) + DW #05E6 ; Octave 3, Note 38 - D ( 73.40 Hz, Ideal= 73.42 Hz, Error=-0.01%) + DW #0591 ; Octave 3, Note 39 - D# ( 77.78 Hz, Ideal= 77.78 Hz, Error=+0.01%) + DW #0541 ; Octave 3, Note 40 - E ( 82.41 Hz, Ideal= 82.41 Hz, Error=+0.00%) + DW #04F6 ; Octave 3, Note 41 - F ( 87.28 Hz, Ideal= 87.31 Hz, Error=-0.04%) + DW #04AE ; Octave 3, Note 42 - F# ( 92.52 Hz, Ideal= 92.50 Hz, Error=+0.02%) + DW #046B ; Octave 3, Note 43 - G ( 98.00 Hz, Ideal= 98.00 Hz, Error=+0.00%) + DW #042C ; Octave 3, Note 44 - G# (103.78 Hz, Ideal=103.83 Hz, Error=-0.04%) + DW #03F0 ; Octave 3, Note 45 - A (109.96 Hz, Ideal=110.00 Hz, Error=-0.04%) + DW #03B7 ; Octave 3, Note 46 - A# (116.55 Hz, Ideal=116.65 Hz, Error=-0.08%) + DW #0382 ; Octave 3, Note 47 - B (123.43 Hz, Ideal=123.47 Hz, Error=-0.03%) - DEFW #034F ; Octave 4, Note 48 - C (130.86 Hz, Ideal=130.82 Hz, Error=+0.04%) C3 - DEFW #0320 ; Octave 4, Note 49 - C# (138.55 Hz, Ideal=138.60 Hz, Error=-0.04%) - DEFW #02F3 ; Octave 4, Note 50 - D (146.81 Hz, Ideal=146.83 Hz, Error=-0.01%) - DEFW #02C8 ; Octave 4, Note 51 - D# (155.68 Hz, Ideal=155.55 Hz, Error=+0.08%) - DEFW #02A1 ; Octave 4, Note 52 - E (164.70 Hz, Ideal=164.82 Hz, Error=-0.07%) - DEFW #027B ; Octave 4, Note 53 - F (174.55 Hz, Ideal=174.62 Hz, Error=-0.04%) - DEFW #0257 ; Octave 4, Note 54 - F# (185.04 Hz, Ideal=185.00 Hz, Error=+0.02%) - DEFW #0236 ; Octave 4, Note 55 - G (195.83 Hz, Ideal=196.00 Hz, Error=-0.09%) - DEFW #0216 ; Octave 4, Note 56 - G# (207.57 Hz, Ideal=207.65 Hz, Error=-0.04%) - DEFW #01F8 ; Octave 4, Note 57 - A (219.92 Hz, Ideal=220.00 Hz, Error=-0.04%) - DEFW #01DC ; Octave 4, Note 58 - A# (232.86 Hz, Ideal=233.30 Hz, Error=-0.19%) - DEFW #01C1 ; Octave 4, Note 59 - B (246.86 Hz, Ideal=246.94 Hz, Error=-0.03%) + DW #034F ; Octave 4, Note 48 - C (130.86 Hz, Ideal=130.82 Hz, Error=+0.04%) C3 + DW #0320 ; Octave 4, Note 49 - C# (138.55 Hz, Ideal=138.60 Hz, Error=-0.04%) + DW #02F3 ; Octave 4, Note 50 - D (146.81 Hz, Ideal=146.83 Hz, Error=-0.01%) + DW #02C8 ; Octave 4, Note 51 - D# (155.68 Hz, Ideal=155.55 Hz, Error=+0.08%) + DW #02A1 ; Octave 4, Note 52 - E (164.70 Hz, Ideal=164.82 Hz, Error=-0.07%) + DW #027B ; Octave 4, Note 53 - F (174.55 Hz, Ideal=174.62 Hz, Error=-0.04%) + DW #0257 ; Octave 4, Note 54 - F# (185.04 Hz, Ideal=185.00 Hz, Error=+0.02%) + DW #0236 ; Octave 4, Note 55 - G (195.83 Hz, Ideal=196.00 Hz, Error=-0.09%) + DW #0216 ; Octave 4, Note 56 - G# (207.57 Hz, Ideal=207.65 Hz, Error=-0.04%) + DW #01F8 ; Octave 4, Note 57 - A (219.92 Hz, Ideal=220.00 Hz, Error=-0.04%) + DW #01DC ; Octave 4, Note 58 - A# (232.86 Hz, Ideal=233.30 Hz, Error=-0.19%) + DW #01C1 ; Octave 4, Note 59 - B (246.86 Hz, Ideal=246.94 Hz, Error=-0.03%) - DEFW #01A8 ; Octave 5, Note 60 - C (261.42 Hz, Ideal=261.63 Hz, Error=-0.08%) C4 Middle C - DEFW #0190 ; Octave 5, Note 61 - C# (277.10 Hz, Ideal=277.20 Hz, Error=-0.04%) - DEFW #0179 ; Octave 5, Note 62 - D (294.01 Hz, Ideal=293.66 Hz, Error=+0.12%) - DEFW #0164 ; Octave 5, Note 63 - D# (311.35 Hz, Ideal=311.10 Hz, Error=+0.08%) - DEFW #0150 ; Octave 5, Note 64 - E (329.88 Hz, Ideal=329.63 Hz, Error=+0.08%) - DEFW #013D ; Octave 5, Note 65 - F (349.65 Hz, Ideal=349.23 Hz, Error=+0.12%) - DEFW #012C ; Octave 5, Note 66 - F# (369.47 Hz, Ideal=370.00 Hz, Error=-0.14%) - DEFW #011B ; Octave 5, Note 67 - G (391.66 Hz, Ideal=392.00 Hz, Error=-0.09%) - DEFW #010B ; Octave 5, Note 68 - G# (415.13 Hz, Ideal=415.30 Hz, Error=-0.04%) - DEFW #00FC ; Octave 5, Note 69 - A (439.84 Hz, Ideal=440.00 Hz, Error=-0.04%) - DEFW #00EE ; Octave 5, Note 70 - A# (465.72 Hz, Ideal=466.60 Hz, Error=-0.19%) - DEFW #00E0 ; Octave 5, Note 71 - B (494.82 Hz, Ideal=493.88 Hz, Error=+0.19%) + DW #01A8 ; Octave 5, Note 60 - C (261.42 Hz, Ideal=261.63 Hz, Error=-0.08%) C4 Middle C + DW #0190 ; Octave 5, Note 61 - C# (277.10 Hz, Ideal=277.20 Hz, Error=-0.04%) + DW #0179 ; Octave 5, Note 62 - D (294.01 Hz, Ideal=293.66 Hz, Error=+0.12%) + DW #0164 ; Octave 5, Note 63 - D# (311.35 Hz, Ideal=311.10 Hz, Error=+0.08%) + DW #0150 ; Octave 5, Note 64 - E (329.88 Hz, Ideal=329.63 Hz, Error=+0.08%) + DW #013D ; Octave 5, Note 65 - F (349.65 Hz, Ideal=349.23 Hz, Error=+0.12%) + DW #012C ; Octave 5, Note 66 - F# (369.47 Hz, Ideal=370.00 Hz, Error=-0.14%) + DW #011B ; Octave 5, Note 67 - G (391.66 Hz, Ideal=392.00 Hz, Error=-0.09%) + DW #010B ; Octave 5, Note 68 - G# (415.13 Hz, Ideal=415.30 Hz, Error=-0.04%) + DW #00FC ; Octave 5, Note 69 - A (439.84 Hz, Ideal=440.00 Hz, Error=-0.04%) + DW #00EE ; Octave 5, Note 70 - A# (465.72 Hz, Ideal=466.60 Hz, Error=-0.19%) + DW #00E0 ; Octave 5, Note 71 - B (494.82 Hz, Ideal=493.88 Hz, Error=+0.19%) - DEFW #00D4 ; Octave 6, Note 72 - C (522.83 Hz, Ideal=523.26 Hz, Error=-0.08%) C5 - DEFW #00C8 ; Octave 6, Note 73 - C# (554.20 Hz, Ideal=554.40 Hz, Error=-0.04%) - DEFW #00BD ; Octave 6, Note 74 - D (586.46 Hz, Ideal=587.32 Hz, Error=-0.15%) - DEFW #00B2 ; Octave 6, Note 75 - D# (622.70 Hz, Ideal=622.20 Hz, Error=+0.08%) - DEFW #00A8 ; Octave 6, Note 76 - E (659.77 Hz, Ideal=659.26 Hz, Error=+0.08%) - DEFW #009F ; Octave 6, Note 77 - F (697.11 Hz, Ideal=698.46 Hz, Error=-0.19%) - DEFW #0096 ; Octave 6, Note 78 - F# (738.94 Hz, Ideal=740.00 Hz, Error=-0.14%) - DEFW #008D ; Octave 6, Note 79 - G (786.10 Hz, Ideal=784.00 Hz, Error=+0.27%) - DEFW #0085 ; Octave 6, Note 80 - G# (833.39 Hz, Ideal=830.60 Hz, Error=+0.34%) - DEFW #007E ; Octave 6, Note 81 - A (879.69 Hz, Ideal=880.00 Hz, Error=-0.04%) - DEFW #0077 ; Octave 6, Note 82 - A# (931.43 Hz, Ideal=933.20 Hz, Error=-0.19%) - DEFW #0070 ; Octave 6, Note 83 - B (989.65 Hz, Ideal=987.76 Hz, Error=+0.19%) + DW #00D4 ; Octave 6, Note 72 - C (522.83 Hz, Ideal=523.26 Hz, Error=-0.08%) C5 + DW #00C8 ; Octave 6, Note 73 - C# (554.20 Hz, Ideal=554.40 Hz, Error=-0.04%) + DW #00BD ; Octave 6, Note 74 - D (586.46 Hz, Ideal=587.32 Hz, Error=-0.15%) + DW #00B2 ; Octave 6, Note 75 - D# (622.70 Hz, Ideal=622.20 Hz, Error=+0.08%) + DW #00A8 ; Octave 6, Note 76 - E (659.77 Hz, Ideal=659.26 Hz, Error=+0.08%) + DW #009F ; Octave 6, Note 77 - F (697.11 Hz, Ideal=698.46 Hz, Error=-0.19%) + DW #0096 ; Octave 6, Note 78 - F# (738.94 Hz, Ideal=740.00 Hz, Error=-0.14%) + DW #008D ; Octave 6, Note 79 - G (786.10 Hz, Ideal=784.00 Hz, Error=+0.27%) + DW #0085 ; Octave 6, Note 80 - G# (833.39 Hz, Ideal=830.60 Hz, Error=+0.34%) + DW #007E ; Octave 6, Note 81 - A (879.69 Hz, Ideal=880.00 Hz, Error=-0.04%) + DW #0077 ; Octave 6, Note 82 - A# (931.43 Hz, Ideal=933.20 Hz, Error=-0.19%) + DW #0070 ; Octave 6, Note 83 - B (989.65 Hz, Ideal=987.76 Hz, Error=+0.19%) - DEFW #006A ; Octave 7, Note 84 - C (1045.67 Hz, Ideal=1046.52 Hz, Error=-0.08%) C6 - DEFW #0064 ; Octave 7, Note 85 - C# (1108.41 Hz, Ideal=1108.80 Hz, Error=-0.04%) - DEFW #005E ; Octave 7, Note 86 - D (1179.16 Hz, Ideal=1174.64 Hz, Error=+0.38%) - DEFW #0059 ; Octave 7, Note 87 - D# (1245.40 Hz, Ideal=1244.40 Hz, Error=+0.08%) - DEFW #0054 ; Octave 7, Note 88 - E (1319.53 Hz, Ideal=1318.52 Hz, Error=+0.08%) - DEFW #004F ; Octave 7, Note 89 - F (1403.05 Hz, Ideal=1396.92 Hz, Error=+0.44%) - DEFW #004B ; Octave 7, Note 90 - F# (1477.88 Hz, Ideal=1480.00 Hz, Error=-0.14%) - DEFW #0047 ; Octave 7, Note 91 - G (1561.14 Hz, Ideal=1568.00 Hz, Error=-0.44%) - DEFW #0043 ; Octave 7, Note 92 - G# (1654.34 Hz, Ideal=1661.20 Hz, Error=-0.41%) - DEFW #003F ; Octave 7, Note 93 - A (1759.38 Hz, Ideal=1760.00 Hz, Error=-0.04%) - DEFW #003B ; Octave 7, Note 94 - A# (1878.65 Hz, Ideal=1866.40 Hz, Error=+0.66%) - DEFW #0038 ; Octave 7, Note 95 - B (1979.30 Hz, Ideal=1975.52 Hz, Error=+0.19%) + DW #006A ; Octave 7, Note 84 - C (1045.67 Hz, Ideal=1046.52 Hz, Error=-0.08%) C6 + DW #0064 ; Octave 7, Note 85 - C# (1108.41 Hz, Ideal=1108.80 Hz, Error=-0.04%) + DW #005E ; Octave 7, Note 86 - D (1179.16 Hz, Ideal=1174.64 Hz, Error=+0.38%) + DW #0059 ; Octave 7, Note 87 - D# (1245.40 Hz, Ideal=1244.40 Hz, Error=+0.08%) + DW #0054 ; Octave 7, Note 88 - E (1319.53 Hz, Ideal=1318.52 Hz, Error=+0.08%) + DW #004F ; Octave 7, Note 89 - F (1403.05 Hz, Ideal=1396.92 Hz, Error=+0.44%) + DW #004B ; Octave 7, Note 90 - F# (1477.88 Hz, Ideal=1480.00 Hz, Error=-0.14%) + DW #0047 ; Octave 7, Note 91 - G (1561.14 Hz, Ideal=1568.00 Hz, Error=-0.44%) + DW #0043 ; Octave 7, Note 92 - G# (1654.34 Hz, Ideal=1661.20 Hz, Error=-0.41%) + DW #003F ; Octave 7, Note 93 - A (1759.38 Hz, Ideal=1760.00 Hz, Error=-0.04%) + DW #003B ; Octave 7, Note 94 - A# (1878.65 Hz, Ideal=1866.40 Hz, Error=+0.66%) + DW #0038 ; Octave 7, Note 95 - B (1979.30 Hz, Ideal=1975.52 Hz, Error=+0.19%) - DEFW #0035 ; Octave 8, Note 96 - C (2091.33 Hz, Ideal=2093.04 Hz, Error=-0.08%) C7 - DEFW #0032 ; Octave 8, Note 97 - C# (2216.81 Hz, Ideal=2217.60 Hz, Error=-0.04%) - DEFW #002F ; Octave 8, Note 98 - D (2358.31 Hz, Ideal=2349.28 Hz, Error=+0.38%) - DEFW #002D ; Octave 8, Note 99 - D# (2463.13 Hz, Ideal=2488.80 Hz, Error=-1.03%) - DEFW #002A ; Octave 8, Note 100 - E (2639.06 Hz, Ideal=2637.04 Hz, Error=+0.08%) - DEFW #0028 ; Octave 8, Note 101 - F (2771.02 Hz, Ideal=2793.84 Hz, Error=-0.82%) - DEFW #0025 ; Octave 8, Note 102 - F# (2995.69 Hz, Ideal=2960.00 Hz, Error=+1.21%) - DEFW #0023 ; Octave 8, Note 103 - G (3166.88 Hz, Ideal=3136.00 Hz, Error=+0.98%) - DEFW #0021 ; Octave 8, Note 104 - G# (3358.81 Hz, Ideal=3322.40 Hz, Error=+1.10%) - DEFW #001F ; Octave 8, Note 105 - A (3575.50 Hz, Ideal=3520.00 Hz, Error=+1.58%) - DEFW #001E ; Octave 8, Note 106 - A# (3694.69 Hz, Ideal=3732.80 Hz, Error=-1.02%) - DEFW #001C ; Octave 8, Note 107 - B (3958.59 Hz, Ideal=3951.04 Hz, Error=+0.19%) + DW #0035 ; Octave 8, Note 96 - C (2091.33 Hz, Ideal=2093.04 Hz, Error=-0.08%) C7 + DW #0032 ; Octave 8, Note 97 - C# (2216.81 Hz, Ideal=2217.60 Hz, Error=-0.04%) + DW #002F ; Octave 8, Note 98 - D (2358.31 Hz, Ideal=2349.28 Hz, Error=+0.38%) + DW #002D ; Octave 8, Note 99 - D# (2463.13 Hz, Ideal=2488.80 Hz, Error=-1.03%) + DW #002A ; Octave 8, Note 100 - E (2639.06 Hz, Ideal=2637.04 Hz, Error=+0.08%) + DW #0028 ; Octave 8, Note 101 - F (2771.02 Hz, Ideal=2793.84 Hz, Error=-0.82%) + DW #0025 ; Octave 8, Note 102 - F# (2995.69 Hz, Ideal=2960.00 Hz, Error=+1.21%) + DW #0023 ; Octave 8, Note 103 - G (3166.88 Hz, Ideal=3136.00 Hz, Error=+0.98%) + DW #0021 ; Octave 8, Note 104 - G# (3358.81 Hz, Ideal=3322.40 Hz, Error=+1.10%) + DW #001F ; Octave 8, Note 105 - A (3575.50 Hz, Ideal=3520.00 Hz, Error=+1.58%) + DW #001E ; Octave 8, Note 106 - A# (3694.69 Hz, Ideal=3732.80 Hz, Error=-1.02%) + DW #001C ; Octave 8, Note 107 - B (3958.59 Hz, Ideal=3951.04 Hz, Error=+0.19%) - DEFW #001A ; Octave 9, Note 108 - C (4263.10 Hz, Ideal=4186.08 Hz, Error=+1.84%) C8 - DEFW #0019 ; Octave 9, Note 109 - C# (4433.63 Hz, Ideal=4435.20 Hz, Error=-0.04%) - DEFW #0018 ; Octave 9, Note 110 - D (4618.36 Hz, Ideal=4698.56 Hz, Error=-1.71%) - DEFW #0016 ; Octave 9, Note 111 - D# (5038.21 Hz, Ideal=4977.60 Hz, Error=+1.22%) - DEFW #0015 ; Octave 9, Note 112 - E (5278.13 Hz, Ideal=5274.08 Hz, Error=+0.08%) - DEFW #0014 ; Octave 9, Note 113 - F (5542.03 Hz, Ideal=5587.68 Hz, Error=-0.82%) - DEFW #0013 ; Octave 9, Note 114 - F# (5833.72 Hz, Ideal=5920.00 Hz, Error=-1.46%) - DEFW #0012 ; Octave 9, Note 115 - G (6157.81 Hz, Ideal=6272.00 Hz, Error=-1.82%) - DEFW #0011 ; Octave 9, Note 116 - G# (6520.04 Hz, Ideal=6644.80 Hz, Error=-1.88%) - DEFW #0010 ; Octave 9, Note 117 - A (6927.54 Hz, Ideal=7040.00 Hz, Error=-1.60%) - DEFW #000F ; Octave 9, Note 118 - A# (7389.38 Hz, Ideal=7465.60 Hz, Error=-1.02%) - DEFW #000E ; Octave 9, Note 119 - B (7917.19 Hz, Ideal=7902.08 Hz, Error=+0.19%) + DW #001A ; Octave 9, Note 108 - C (4263.10 Hz, Ideal=4186.08 Hz, Error=+1.84%) C8 + DW #0019 ; Octave 9, Note 109 - C# (4433.63 Hz, Ideal=4435.20 Hz, Error=-0.04%) + DW #0018 ; Octave 9, Note 110 - D (4618.36 Hz, Ideal=4698.56 Hz, Error=-1.71%) + DW #0016 ; Octave 9, Note 111 - D# (5038.21 Hz, Ideal=4977.60 Hz, Error=+1.22%) + DW #0015 ; Octave 9, Note 112 - E (5278.13 Hz, Ideal=5274.08 Hz, Error=+0.08%) + DW #0014 ; Octave 9, Note 113 - F (5542.03 Hz, Ideal=5587.68 Hz, Error=-0.82%) + DW #0013 ; Octave 9, Note 114 - F# (5833.72 Hz, Ideal=5920.00 Hz, Error=-1.46%) + DW #0012 ; Octave 9, Note 115 - G (6157.81 Hz, Ideal=6272.00 Hz, Error=-1.82%) + DW #0011 ; Octave 9, Note 116 - G# (6520.04 Hz, Ideal=6644.80 Hz, Error=-1.88%) + DW #0010 ; Octave 9, Note 117 - A (6927.54 Hz, Ideal=7040.00 Hz, Error=-1.60%) + DW #000F ; Octave 9, Note 118 - A# (7389.38 Hz, Ideal=7465.60 Hz, Error=-1.02%) + DW #000E ; Octave 9, Note 119 - B (7917.19 Hz, Ideal=7902.08 Hz, Error=+0.19%) - DEFW #000D ; Octave 10, Note 120 - C ( 8526.20 Hz, Ideal= 8372.16 Hz, Error=+1.84%) C9 - DEFW #000C ; Octave 10, Note 121 - C# ( 9236.72 Hz, Ideal= 8870.40 Hz, Error=+4.13%) - DEFW #000C ; Octave 10, Note 122 - D ( 9236.72 Hz, Ideal= 9397.12 Hz, Error=-1.71%) - DEFW #000B ; Octave 10, Note 123 - D# (10076.42 Hz, Ideal= 9955.20 Hz, Error=+1.22%) - DEFW #000B ; Octave 10, Note 124 - E (10076.42 Hz, Ideal=10548.16 Hz, Error=-4.47%) - DEFW #000A ; Octave 10, Note 125 - F (11084.06 Hz, Ideal=11175.36 Hz, Error=-0.82%) - DEFW #0009 ; Octave 10, Note 126 - F# (12315.63 Hz, Ideal=11840.00 Hz, Error=+4.02%) - DEFW #0009 ; Octave 10, Note 127 - G (12315.63 Hz, Ideal=12544.00 Hz, Error=-1.82%) - DEFW #0008 ; Octave 10, Note 128 - G# (13855.08 Hz, Ideal=13289.60 Hz, Error=+4.26%) + DW #000D ; Octave 10, Note 120 - C ( 8526.20 Hz, Ideal= 8372.16 Hz, Error=+1.84%) C9 + DW #000C ; Octave 10, Note 121 - C# ( 9236.72 Hz, Ideal= 8870.40 Hz, Error=+4.13%) + DW #000C ; Octave 10, Note 122 - D ( 9236.72 Hz, Ideal= 9397.12 Hz, Error=-1.71%) + DW #000B ; Octave 10, Note 123 - D# (10076.42 Hz, Ideal= 9955.20 Hz, Error=+1.22%) + DW #000B ; Octave 10, Note 124 - E (10076.42 Hz, Ideal=10548.16 Hz, Error=-4.47%) + DW #000A ; Octave 10, Note 125 - F (11084.06 Hz, Ideal=11175.36 Hz, Error=-0.82%) + DW #0009 ; Octave 10, Note 126 - F# (12315.63 Hz, Ideal=11840.00 Hz, Error=+4.02%) + DW #0009 ; Octave 10, Note 127 - G (12315.63 Hz, Ideal=12544.00 Hz, Error=-1.82%) + DW #0008 ; Octave 10, Note 128 - G# (13855.08 Hz, Ideal=13289.60 Hz, Error=+4.26%) ; ------------------------- ; Play Note on MIDI Channel @@ -5131,7 +5130,7 @@ L1205: LD HL,FLAGS3 ; #5B66. JP L13BE ; Jump ahead to handle RAM disk command. L1219: CALL L05AC ; Produce error report. - DEFB #0B ; "C Nonsense in BASIC" + DB #0B ; "C Nonsense in BASIC" ; ------------------------- ; RAM Disk Command Handling @@ -5205,7 +5204,7 @@ L124E: PUSH IX ; IX points to file header. JR C,L1284 ; Only file types 0, 1 and 2 are OK. L1280: CALL L05AC ; Produce error report. - DEFB #1D ; "b Wrong file type" + DB #1D ; "b Wrong file type" L1284: LD A,(FLAGS3) ; #5B66. BIT 6,A ; Is it a MERGE program/array operation? @@ -5223,7 +5222,7 @@ L1290: LD A,(FLAGS3) ; #5B66. ;Cannot merge CODE/SCREEN$ CALL L05AC ; Produce error report. - DEFB #1C ; "a MERGE error" + DB #1C ; "a MERGE error" ; ------------------------ ; RAM Disk VERIFY! Routine @@ -5241,7 +5240,7 @@ L129B: LD HL,(SC_0B) ; #5B7B. Length requested. ;File was smaller than requested CALL L05AC ; Produce error report. - DEFB #1E ; "c CODE error" + DB #1E ; "c CODE error" L12AE: LD HL,(SC_0D) ; #5B7D. Fetch start address. LD A,H ; @@ -5272,7 +5271,7 @@ L12C5: LD BC,(HD_0B) ; #5B72. File length. PUSH BC ; Save the length. INC BC ; Increment for terminator #80 (added later). RST #28 ; - DEFW BC_SPACES ; #0030. Create room in the workspace for the file. + DW BC_SPACES ; #0030. Create room in the workspace for the file. LD (HL),#80 ; Insert terminator. EX DE,HL ; HL=Start address. @@ -5282,7 +5281,7 @@ L12C5: LD BC,(HD_0B) ; #5B72. File length. POP HL ; Retrieve start address. RST #28 ; - DEFW ME_CONTRL+#18; #08CE. Delegate actual merge handling to ROM 1. + DW ME_CONTRL+#18; #08CE. Delegate actual merge handling to ROM 1. RET ; ; ---------------------- @@ -5319,7 +5318,7 @@ L12F6: LD DE,#0005 ; LD B,H ; LD C,L ; Space required in BC. RST #28 ; - DEFW TEST_ROOM ; #1F05. Will automatically produce error '4' if out of memory. + DW TEST_ROOM ; #1F05. Will automatically produce error '4' if out of memory. ;Test file type @@ -5347,7 +5346,7 @@ L1303: AND A ; Test file type. INC BC ; INC BC ; Allow for variable header. RST #28 ; - DEFW RECLAIM_2 ; #19E8. Delete old array. + DW RECLAIM_2 ; #19E8. Delete old array. ;Insert new array entry into variables area @@ -5361,7 +5360,7 @@ L1315: LD HL,(#5C59) ; E_LINE. LD A,(SC_0F) ; #5B7F. Get array name. PUSH AF ; Save array name. RST #28 ; - DEFW MAKE_ROOM ; #1655. Create room for new array. + DW MAKE_ROOM ; #1655. Create room for new array. INC HL POP AF ; LD (HL),A ; Store array name. @@ -5385,12 +5384,12 @@ L1335: LD HL,FLAGS3 ; #5B66. LD HL,(#5C59) ; E_LINE. Address of end of program area. DEC HL ; Point before terminator. RST #28 ; - DEFW RECLAIM ; #19E5. Delete current BASIC program. + DW RECLAIM ; #19E5. Delete current BASIC program. LD BC,(HD_0B) ; #5B72. Fetch file length. LD HL,(#5C53) ; PROG. Address of start of BASIC program. RST #28 ; - DEFW MAKE_ROOM ; #1655. Create room for the file. + DW MAKE_ROOM ; #1655. Create room for the file. INC HL ; Allow for terminator. LD BC,(HD_0F) ; #5B76. Length of variables. @@ -5440,13 +5439,13 @@ L137E: LD A,D ; ; Returns in BC. L1385: RST #28 ; Expect an expression on the BASIC line. - DEFW EXPT_EXP ; #1C8C. + DW EXPT_EXP ; #1C8C. BIT 7,(IY+#01) ; Return early if syntax checking. RET Z ; PUSH AF ; Get the item off the calculator stack RST #28 ; - DEFW STK_FETCH ; #2BF1. + DW STK_FETCH ; #2BF1. POP AF ; RET ; @@ -5490,7 +5489,7 @@ L13AD: LD (HL),A ; Fill it with 10 spaces. RET ; L13BA: CALL L05AC ; Produce error report. - DEFB #21 ; "f Invalid name" + DB #21 ; "f Invalid name" ; ------------------------------------ ; Cassette / RAM Disk Command Handling @@ -5500,7 +5499,7 @@ L13BA: CALL L05AC ; Produce error report. ; This code is very similar to that in ROM 1 at #0605. L13BE: RST 28H - DEFW EXPT_EXP ; #1C8C. Pass the parameters of the 'name' to the calculator stack. + DW EXPT_EXP ; #1C8C. Pass the parameters of the 'name' to the calculator stack. BIT 7,(IY+#01) ; JR Z,L1407 ; Jump ahead if checking syntax. @@ -5514,7 +5513,7 @@ L13BE: RST 28H ; 17 bytes for the header of the requested file, and 17 bytes for the files tested from tape. L13D2: RST #28 ; - DEFW BC_SPACES ; #0030. Create space in workspace. + DW BC_SPACES ; #0030. Create space in workspace. PUSH DE ; Get start of the created space into IX. POP IX ; @@ -5528,7 +5527,7 @@ L13DC: LD (DE),A ; Set all characters to spaces. LD (IX+#01),#FF ; Indicate a null name. RST #28 ; The parameters of the name are fetched. - DEFW STK_FETCH ; #2BF1. + DW STK_FETCH ; #2BF1. LD HL,#FFF6 ; = -10. DEC BC ; @@ -5541,7 +5540,7 @@ L13DC: LD (DE),A ; Set all characters to spaces. JR NZ,L13F9 ; Jump ahead if not since LOAD, MERGE and VERIFY can have null filenames. CALL L05AC ; Produce error report. - DEFB #0E ; "F Invalid file name" + DB #0E ; "F Invalid file name" ;Continue to handle the name of the program. @@ -5575,7 +5574,7 @@ L1407: RST #18 ; Get character from BASIC line. RST #20 ; Get next character from BASIC line. RST #28 ; - DEFW LOOK_VARS ; #28B2. Look in the variables area for the array. + DW LOOK_VARS ; #28B2. Look in the variables area for the array. JR NC,L142F ; Jump if handling an existing array. LD HL,#0000 ; Signal 'using a new array'. @@ -5589,7 +5588,7 @@ L1425: LD A,(#5C74) ; T_ADDR. JR Z,L1444 ; SAVE or VERIFY a new array. CALL L05AC ; Produce error report. - DEFB #01 ; "2 Variable not found" + DB #01 ; "2 Variable not found" ;Continue with the handling of an existing array @@ -5668,7 +5667,7 @@ L1482: CP #AF ; Is the present code the token 'CODE'? RST #20 ; Advance pointer into BASIC line. RST #28 ; - DEFW PR_ST_END ; #2048. + DW PR_ST_END ; #2048. JR NZ,L14A0 ; Jump forward if the statement has not finished LD A,(#5C74) ; T_ADDR_lo. @@ -5676,13 +5675,13 @@ L1482: CP #AF ; Is the present code the token 'CODE'? JP Z,L1219 ; Jump if so to produce "C Nonsense in BASIC". RST #28 ; - DEFW USE_ZERO ; #1CE6. Put a zero on the calculator stack - for the 'start'. + DW USE_ZERO ; #1CE6. Put a zero on the calculator stack - for the 'start'. JR L14AF ; Jump forward. ;Look for a 'starting address' L14A0: RST #28 ; - DEFW EXPT_1NUM ; #1C82. Fetch the first number. + DW EXPT_1NUM ; #1C82. Fetch the first number. RST #18 ; CP ',' ; #2C. Is the present character a ','? JR Z,L14B4 ; Jump if it is - the number was a 'starting address' @@ -5692,24 +5691,24 @@ L14A0: RST #28 ; JP Z,L1219 ; Jump if so to produce "C Nonsense in BASIC". L14AF: RST #28 ; - DEFW USE_ZERO ; #1CE6. Put a zero on the calculator stack - for the 'length'. + DW USE_ZERO ; #1CE6. Put a zero on the calculator stack - for the 'length'. JR L14B8 ; Jump forward. ;Fetch the 'length' as it was specified L14B4: RST #20 ; Advance to next character. RST #28 ; - DEFW EXPT_1NUM ; #1C82. Fetch the 'length'. + DW EXPT_1NUM ; #1C82. Fetch the 'length'. ;The parameters are now stored in the header area of the work space L14B8: CALL L18A1 ; But move on to the next statement now if checking syntax. RST #28 ; - DEFW FIND_INT2 ; #1E99. Compress the 'length' into BC. + DW FIND_INT2 ; #1E99. Compress the 'length' into BC. LD (IX+#0B),C ; Store the length of the CODE block. LD (IX+#0C),B ; RST #28 ; - DEFW FIND_INT2 ; #1E99. Compress the 'starting address' into BC. + DW FIND_INT2 ; #1E99. Compress the 'starting address' into BC. LD (IX+#0D),C ; Store the start address of the CODE block. LD (IX+#0E),B ; LD H,B ; Transfer start address pointer to HL. @@ -5740,10 +5739,10 @@ L14E2: LD A,(#5C74) ; T_ADDR_lo. Only allow 'SAVE name LINE number'. RST #20 ; Advance pointer into BASIC line. RST #28 ; Get LINE number onto calculator stack - DEFW EXPT_1NUM ; #1C82. Pass the number to the calculator stack. + DW EXPT_1NUM ; #1C82. Pass the number to the calculator stack. CALL L18A1 ; Move on to the next statement if checking syntax. RST #28 ; Retrieve LINE number from calculator stack - DEFW FIND_INT2 ; #1E99. Compress the 'line number' into BC. + DW FIND_INT2 ; #1E99. Compress the 'line number' into BC. LD (IX+#0D),C ; Store the LINE number. LD (IX+#0E),B ; @@ -5780,7 +5779,7 @@ L1519: LD A,(FLAGS3) ; #5B66. JR NZ,L152B ; Jump ahead if not. RST #28 ; - DEFW SA_CONTROL ; #0970. Run the save routine in ROM 1. + DW SA_CONTROL ; #0970. Run the save routine in ROM 1. RET ; ;In the case of a LOAD, VERIFY or MERGE command the first seventeen bytes of the 'header area' @@ -5788,7 +5787,7 @@ L1519: LD A,(FLAGS3) ; #5B66. ;and it is now time to fetch a 'header' from the tape. L152B: RST #28 ; - DEFW SA_ALL+#0007 ; #0761. Run the load/merge/verify routine in ROM 1. + DW SA_ALL+#0007 ; #0761. Run the load/merge/verify routine in ROM 1. RET ; @@ -6327,233 +6326,233 @@ L16D6: LD A,E ; A=Character that was shifted out. ; Similar in construction to the table in ROM 1 at #1A48. ; [No instruction fetch at #1708 hence ZX Interface 1 will not be paged in by this ROM. Credit: Paul Farrow]. -L16DC: DEFB #B1 ; DEF FN -> #178D (ROM 0) - DEFB #C9 ; CAT -> #17A6 (ROM 0) - DEFB #BC ; FORMAT -> #179A (ROM 0) - DEFB #BE ; MOVE -> #179D (ROM 0) - DEFB #C3 ; ERASE -> #17A3 (ROM 0) - DEFB #AF ; OPEN # -> #1790 (ROM 0) - DEFB #B4 ; CLOSE # -> #1796 (ROM 0) - DEFB #93 ; MERGE -> #1776 (ROM 0) - DEFB #91 ; VERIFY -> #1775 (ROM 0) - DEFB #92 ; BEEP -> #1777 (ROM 0) - DEFB #95 ; CIRCLE -> #177B (ROM 0) - DEFB #98 ; INK -> #177F (ROM 0) - DEFB #98 ; PAPER -> #1780 (ROM 0) - DEFB #98 ; FLASH -> #1781 (ROM 0) - DEFB #98 ; BRIGHT -> #1782 (ROM 0) - DEFB #98 ; INVERSE -> #1783 (ROM 0) - DEFB #98 ; OVER -> #1784 (ROM 0) - DEFB #98 ; OUT -> #1785 (ROM 0) - DEFB #7F ; LPRINT -> #176D (ROM 0) - DEFB #81 ; LLIST -> #1770 (ROM 0) - DEFB #2E ; STOP -> #171E (ROM 0) - DEFB #6C ; READ -> #175D (ROM 0) - DEFB #6E ; DATA -> #1760 (ROM 0) - DEFB #70 ; RESTORE -> #1763 (ROM 0) - DEFB #48 ; NEW -> #173C (ROM 0) - DEFB #94 ; BORDER -> #1789 (ROM 0) - DEFB #56 ; CONTINUE -> #174C (ROM 0) - DEFB #3F ; DIM -> #1736 (ROM 0) - DEFB #41 ; REM -> #1739 (ROM 0) - DEFB #2B ; FOR -> #1724 (ROM 0) - DEFB #17 ; GO TO -> #1711 (ROM 0) - DEFB #1F ; GO SUB -> #171A (ROM 0) - DEFB #37 ; INPUT -> #1733 (ROM 0) - DEFB #77 ; LOAD -> #1774 (ROM 0) - DEFB #44 ; LIST -> #1742 (ROM 0) - DEFB #0F ; LET -> #170E (ROM 0) - DEFB #59 ; PAUSE -> #1759 (ROM 0) - DEFB #2B ; NEXT -> #172C (ROM 0) - DEFB #43 ; POKE -> #1745 (ROM 0) - DEFB #2D ; PRINT -> #1730 (ROM 0) - DEFB #51 ; PLOT -> #1755 (ROM 0) - DEFB #3A ; RUN -> #173F (ROM 0) - DEFB #6D ; SAVE -> #1773 (ROM 0) - DEFB #42 ; RANDOMIZE -> #1749 (ROM 0) - DEFB #0D ; IF -> #1715 (ROM 0) - DEFB #49 ; CLS -> #1752 (ROM 0) - DEFB #5C ; DRAW -> #1766 (ROM 0) - DEFB #44 ; CLEAR -> #174F (ROM 0) - DEFB #15 ; RETURN -> #1721 (ROM 0) - DEFB #5D ; COPY -> #176A (ROM 0) +L16DC: DB #B1 ; DEF FN -> #178D (ROM 0) + DB #C9 ; CAT -> #17A6 (ROM 0) + DB #BC ; FORMAT -> #179A (ROM 0) + DB #BE ; MOVE -> #179D (ROM 0) + DB #C3 ; ERASE -> #17A3 (ROM 0) + DB #AF ; OPEN # -> #1790 (ROM 0) + DB #B4 ; CLOSE # -> #1796 (ROM 0) + DB #93 ; MERGE -> #1776 (ROM 0) + DB #91 ; VERIFY -> #1775 (ROM 0) + DB #92 ; BEEP -> #1777 (ROM 0) + DB #95 ; CIRCLE -> #177B (ROM 0) + DB #98 ; INK -> #177F (ROM 0) + DB #98 ; PAPER -> #1780 (ROM 0) + DB #98 ; FLASH -> #1781 (ROM 0) + DB #98 ; BRIGHT -> #1782 (ROM 0) + DB #98 ; INVERSE -> #1783 (ROM 0) + DB #98 ; OVER -> #1784 (ROM 0) + DB #98 ; OUT -> #1785 (ROM 0) + DB #7F ; LPRINT -> #176D (ROM 0) + DB #81 ; LLIST -> #1770 (ROM 0) + DB #2E ; STOP -> #171E (ROM 0) + DB #6C ; READ -> #175D (ROM 0) + DB #6E ; DATA -> #1760 (ROM 0) + DB #70 ; RESTORE -> #1763 (ROM 0) + DB #48 ; NEW -> #173C (ROM 0) + DB #94 ; BORDER -> #1789 (ROM 0) + DB #56 ; CONTINUE -> #174C (ROM 0) + DB #3F ; DIM -> #1736 (ROM 0) + DB #41 ; REM -> #1739 (ROM 0) + DB #2B ; FOR -> #1724 (ROM 0) + DB #17 ; GO TO -> #1711 (ROM 0) + DB #1F ; GO SUB -> #171A (ROM 0) + DB #37 ; INPUT -> #1733 (ROM 0) + DB #77 ; LOAD -> #1774 (ROM 0) + DB #44 ; LIST -> #1742 (ROM 0) + DB #0F ; LET -> #170E (ROM 0) + DB #59 ; PAUSE -> #1759 (ROM 0) + DB #2B ; NEXT -> #172C (ROM 0) + DB #43 ; POKE -> #1745 (ROM 0) + DB #2D ; PRINT -> #1730 (ROM 0) + DB #51 ; PLOT -> #1755 (ROM 0) + DB #3A ; RUN -> #173F (ROM 0) + DB #6D ; SAVE -> #1773 (ROM 0) + DB #42 ; RANDOMIZE -> #1749 (ROM 0) + DB #0D ; IF -> #1715 (ROM 0) + DB #49 ; CLS -> #1752 (ROM 0) + DB #5C ; DRAW -> #1766 (ROM 0) + DB #44 ; CLEAR -> #174F (ROM 0) + DB #15 ; RETURN -> #1721 (ROM 0) + DB #5D ; COPY -> #176A (ROM 0) ; -------------------------- ; The Syntax Parameter Table ; -------------------------- ; Similar to the parameter table in ROM 1 at #1A7A. -L170E: DEFB #01 ; CLASS-01 LET - DEFB '=' ; #3D. '=' - DEFB #02 ; CLASS-02 +L170E: DB #01 ; CLASS-01 LET + DB '=' ; #3D. '=' + DB #02 ; CLASS-02 -L1711: DEFB #06 ; CLASS-06 GO TO - DEFB #00 ; CLASS-00 - DEFW GO_TO ; #1E67. GO TO routine in ROM 1. +L1711: DB #06 ; CLASS-06 GO TO + DB #00 ; CLASS-00 + DW GO_TO ; #1E67. GO TO routine in ROM 1. -L1715: DEFB #06 ; CLASS-06 IF - DEFB #CB ; 'THEN' - DEFB #0E ; CLASS-0E - DEFW L1967 ; New IF routine in ROM 0. +L1715: DB #06 ; CLASS-06 IF + DB #CB ; 'THEN' + DB #0E ; CLASS-0E + DW L1967 ; New IF routine in ROM 0. -L171A: DEFB #06 ; CLASS-06 GO SUB - DEFB #0C ; CLASS-0C - DEFW L1A53 ; New GO SUB routine in ROM 0. +L171A: DB #06 ; CLASS-06 GO SUB + DB #0C ; CLASS-0C + DW L1A53 ; New GO SUB routine in ROM 0. -L171E: DEFB #00 ; CLASS-00 STOP - DEFW STOP ; #1CEE. STOP routine in ROM 1. +L171E: DB #00 ; CLASS-00 STOP + DW STOP ; #1CEE. STOP routine in ROM 1. -L1721: DEFB #0C ; CLASS-0C RETURN - DEFW L1A6F ; New RETURN routine in ROM 0. +L1721: DB #0C ; CLASS-0C RETURN + DW L1A6F ; New RETURN routine in ROM 0. -L1724: DEFB #04 ; CLASS-04 FOR - DEFB '=' ; #3D. '=' - DEFB #06 ; CLASS-06 - DEFB #CC ; 'TO' - DEFB #06 ; CLASS-06 - DEFB #0E ; CLASS-0E - DEFW L1981 ; New FOR routine in ROM 0. +L1724: DB #04 ; CLASS-04 FOR + DB '=' ; #3D. '=' + DB #06 ; CLASS-06 + DB #CC ; 'TO' + DB #06 ; CLASS-06 + DB #0E ; CLASS-0E + DW L1981 ; New FOR routine in ROM 0. -L172C: DEFB #04 ; CLASS-04 NEXT - DEFB #00 ; CLASS-00 - DEFW NEXT ; #1DAB. NEXT routine in ROM 1. +L172C: DB #04 ; CLASS-04 NEXT + DB #00 ; CLASS-00 + DW NEXT ; #1DAB. NEXT routine in ROM 1. -L1730: DEFB #0E ; CLASS-0E PRINT - DEFW L2178 ; New PRINT routine in ROM 0. +L1730: DB #0E ; CLASS-0E PRINT + DW L2178 ; New PRINT routine in ROM 0. -L1733: DEFB #0E ; CLASS-0E INPUT - DEFW L218C ; New INPUT routine in ROM 0. +L1733: DB #0E ; CLASS-0E INPUT + DW L218C ; New INPUT routine in ROM 0. -L1736: DEFB #0E ; CLASS-0E DIM - DEFW L21D5 ; New DIM routine in ROM 0. +L1736: DB #0E ; CLASS-0E DIM + DW L21D5 ; New DIM routine in ROM 0. -L1739: DEFB #0E ; CLASS-0E REM - DEFW L1862 ; New REM routine in ROM 0. +L1739: DB #0E ; CLASS-0E REM + DW L1862 ; New REM routine in ROM 0. -L173C: DEFB #0C ; CLASS-0C NEW - DEFW L21AA ; New NEW routine in ROM 0. +L173C: DB #0C ; CLASS-0C NEW + DW L21AA ; New NEW routine in ROM 0. -L173F: DEFB #0D ; CLASS-0D RUN - DEFW L1A02 ; New RUN routine in ROM 0. +L173F: DB #0D ; CLASS-0D RUN + DW L1A02 ; New RUN routine in ROM 0. -L1742: DEFB #0E ; CLASS-0E LIST - DEFW L1B75 ; New LIST routine in ROM 0. +L1742: DB #0E ; CLASS-0E LIST + DW L1B75 ; New LIST routine in ROM 0. -L1745: DEFB #08 ; CLASS-08 POKE - DEFB #00 ; CLASS-00 - DEFW POKE ; #1E80. POKE routine in ROM 1. +L1745: DB #08 ; CLASS-08 POKE + DB #00 ; CLASS-00 + DW POKE ; #1E80. POKE routine in ROM 1. -L1749: DEFB #03 ; CLASS-03 RANDOMIZE - DEFW RANDOMIZE ; #1E4F. RANDOMIZE routine in ROM 1. +L1749: DB #03 ; CLASS-03 RANDOMIZE + DW RANDOMIZE ; #1E4F. RANDOMIZE routine in ROM 1. -L174C: DEFB #00 ; CLASS-00 CONTINUE - DEFW CONTINUE ; #1E5F. CONTINUE routine in ROM 1. +L174C: DB #00 ; CLASS-00 CONTINUE + DW CONTINUE ; #1E5F. CONTINUE routine in ROM 1. -L174F: DEFB #0D ; CLASS-0D CLEAR - DEFW L1A0D ; New CLEAR routine in ROM 0. +L174F: DB #0D ; CLASS-0D CLEAR + DW L1A0D ; New CLEAR routine in ROM 0. -L1752: DEFB #00 ; CLASS-00 CLS - DEFW CLS ; #0D6B. CLS routine in ROM 1. +L1752: DB #00 ; CLASS-00 CLS + DW CLS ; #0D6B. CLS routine in ROM 1. -L1755: DEFB #09 ; CLASS-09 PLOT - DEFB #00 ; CLASS-00 - DEFW PLOT ; #22DC. PLOT routine in ROM 1 +L1755: DB #09 ; CLASS-09 PLOT + DB #00 ; CLASS-00 + DW PLOT ; #22DC. PLOT routine in ROM 1 -L1759: DEFB #06 ; CLASS-06 PAUSE - DEFB #00 ; CLASS-00 - DEFW PAUSE ; #1F3A. PAUSE routine in ROM 1. +L1759: DB #06 ; CLASS-06 PAUSE + DB #00 ; CLASS-00 + DW PAUSE ; #1F3A. PAUSE routine in ROM 1. -L175D: DEFB #0E ; CLASS-0E READ - DEFW L19AB ; New READ routine in ROM 0. +L175D: DB #0E ; CLASS-0E READ + DW L19AB ; New READ routine in ROM 0. -L1760: DEFB #0E ; CLASS-0E DATA - DEFW L19EB ; New DATA routine in ROM 0. +L1760: DB #0E ; CLASS-0E DATA + DW L19EB ; New DATA routine in ROM 0. -L1763: DEFB #03 ; CLASS-03 RESTORE - DEFW RESTORE ; #1E42. RESTORE routine in ROM 1. +L1763: DB #03 ; CLASS-03 RESTORE + DW RESTORE ; #1E42. RESTORE routine in ROM 1. -L1766: DEFB #09 ; CLASS-09 DRAW - DEFB #0E ; CLASS-0E - DEFW L21BE ; New DRAW routine in ROM 0. +L1766: DB #09 ; CLASS-09 DRAW + DB #0E ; CLASS-0E + DW L21BE ; New DRAW routine in ROM 0. -L176A: DEFB #0C ; CLASS-0C COPY - DEFW L21A7 ; New COPY routine in ROM 0. +L176A: DB #0C ; CLASS-0C COPY + DW L21A7 ; New COPY routine in ROM 0. -L176D: DEFB #0E ; CLASS-0E LPRINT - DEFW L2174 ; New LPRINT routine in ROM 0. +L176D: DB #0E ; CLASS-0E LPRINT + DW L2174 ; New LPRINT routine in ROM 0. -L1770: DEFB #0E ; CLASS-0E LLIST - DEFW L1B71 ; New LLIST routine in ROM 0. +L1770: DB #0E ; CLASS-0E LLIST + DW L1B71 ; New LLIST routine in ROM 0. -L1773: DEFB #0B ; CLASS-0B SAVE +L1773: DB #0B ; CLASS-0B SAVE -L1774: DEFB #0B ; CLASS-0B LOAD +L1774: DB #0B ; CLASS-0B LOAD -L1775: DEFB #0B ; CLASS-0B VERIFY +L1775: DB #0B ; CLASS-0B VERIFY -L1776: DEFB #0B ; CLASS-0B MERGE +L1776: DB #0B ; CLASS-0B MERGE -L1777: DEFB #08 ; CLASS-08 BEEP - DEFB #00 ; CLASS-00 - DEFW BEEP ; #03F8. BEEP routine in ROM 1. +L1777: DB #08 ; CLASS-08 BEEP + DB #00 ; CLASS-00 + DW BEEP ; #03F8. BEEP routine in ROM 1. -L177B: DEFB #09 ; CLASS-09 CIRCLE - DEFB #0E ; CLASS-0E - DEFW L21AE ; New CIRCLE routine in ROM 0. +L177B: DB #09 ; CLASS-09 CIRCLE + DB #0E ; CLASS-0E + DW L21AE ; New CIRCLE routine in ROM 0. -L177F: DEFB #07 ; CLASS-07 INK +L177F: DB #07 ; CLASS-07 INK -L1780: DEFB #07 ; CLASS-07 PAPER +L1780: DB #07 ; CLASS-07 PAPER -L1781: DEFB #07 ; CLASS-07 FLASH +L1781: DB #07 ; CLASS-07 FLASH -L1782: DEFB #07 ; CLASS-07 BRIGHT +L1782: DB #07 ; CLASS-07 BRIGHT -L1783: DEFB #07 ; CLASS-07 INVERSE +L1783: DB #07 ; CLASS-07 INVERSE -L1784: DEFB #07 ; CLASS-07 OVER +L1784: DB #07 ; CLASS-07 OVER -L1785: DEFB #08 ; CLASS-08 OUT - DEFB #00 ; CLASS-00 - DEFW COUT ; #1E7A. OUT routine in ROM 1. +L1785: DB #08 ; CLASS-08 OUT + DB #00 ; CLASS-00 + DW COUT ; #1E7A. OUT routine in ROM 1. -L1789: DEFB #06 ; CLASS-06 BORDER - DEFB #00 ; CLASS-00 - DEFW BORDER ; #2294. BORDER routine in ROM 1. +L1789: DB #06 ; CLASS-06 BORDER + DB #00 ; CLASS-00 + DW BORDER ; #2294. BORDER routine in ROM 1. -L178D: DEFB #0E ; CLASS-0E DEF FN - DEFW L1A8C ; New DEF FN routine in ROM 0. +L178D: DB #0E ; CLASS-0E DEF FN + DW L1A8C ; New DEF FN routine in ROM 0. -L1790: DEFB #06 ; CLASS-06 OPEN # - DEFB ',' ; #2C. ',' - DEFB #0A ; CLASS-0A - DEFB #00 ; CLASS-00 - DEFW OPEN ; #1736. OPEN # routine in ROM 1. +L1790: DB #06 ; CLASS-06 OPEN # + DB ',' ; #2C. ',' + DB #0A ; CLASS-0A + DB #00 ; CLASS-00 + DW OPEN ; #1736. OPEN # routine in ROM 1. -L1796: DEFB #06 ; CLASS-06 CLOSE # - DEFB #00 ; CLASS-00 - DEFW CLOSE ; #16E5. CLOSE # routine in ROM 1. +L1796: DB #06 ; CLASS-06 CLOSE # + DB #00 ; CLASS-00 + DW CLOSE ; #16E5. CLOSE # routine in ROM 1. -L179A: DEFB #0E ; CLASS-0E FORMAT - DEFW L0641 ; FORMAT routine in ROM 0. +L179A: DB #0E ; CLASS-0E FORMAT + DW L0641 ; FORMAT routine in ROM 0. -L179D: DEFB #0A ; CLASS-0A MOVE - DEFB ',' ; #2C. ',' - DEFB #0A ; CLASS-0A - DEFB #0C ; CLASS-0C - DEFW L1AF0 ; Just execute a RET. +L179D: DB #0A ; CLASS-0A MOVE + DB ',' ; #2C. ',' + DB #0A ; CLASS-0A + DB #0C ; CLASS-0C + DW L1AF0 ; Just execute a RET. -L17A3: DEFB #0E ; CLASS-0E ERASE - DEFW L1C0C ; New ERASE routine in ROM 0. +L17A3: DB #0E ; CLASS-0E ERASE + DW L1C0C ; New ERASE routine in ROM 0. -L17A6: DEFB #0E ; CLASS-0E CAT - DEFW L1BE5 ; New CAT routine in ROM 0. +L17A6: DB #0E ; CLASS-0E CAT + DW L1BE5 ; New CAT routine in ROM 0. -L17A9: DEFB #0C ; CLASS-0C SPECTRUM - DEFW L1B2B ; SPECTRUM routine in ROM 0. +L17A9: DB #0C ; CLASS-0C SPECTRUM + DW L1B2B ; SPECTRUM routine in ROM 0. -L17AC: DEFB #0E ; CLASS-0E PLAY - DEFW L2317 ; PLAY routine in ROM 0. +L17AC: DB #0E ; CLASS-0E PLAY + DW L2317 ; PLAY routine in ROM 0. ; (From Logan & O'Hara's 48K ROM disassembly): ; The requirements for the different command classes are as follows: @@ -6584,7 +6583,7 @@ L17AC: DEFB #0E ; CLASS-0E PLAY L17AF: RES 7,(IY+#01) ; FLAGS. Signal 'syntax checking'. RST #28 ; - DEFW E_LINE_NO ; #19FB. CH-ADD is made to point to the first code after any line number + DW E_LINE_NO ; #19FB. CH-ADD is made to point to the first code after any line number XOR A ; LD (#5C47),A ; SUBPPC. Set to #00. DEC A ; @@ -6599,7 +6598,7 @@ L17AF: RES 7,(IY+#01) ; FLAGS. Signal 'syntax checking'. L17C0: RST #20 ; Advance CH-ADD along the line. L17C1: RST #28 ; - DEFW SET_WORK ; #16BF. The work space is cleared. + DW SET_WORK ; #16BF. The work space is cleared. INC (IY+#0D) ; SUBPPC. Increase SUBPPC on each passage around the loop. JP M,L1912 ; Only '127' statements are allowed in a single line. Jump to report "C Nonsense in BASIC". @@ -6691,7 +6690,7 @@ L1821: CALL L05D6 ; Check for BREAK JR C,L182A ; Jump if pressed. CALL L05AC ; Produce error report. - DEFB #14 ; "L Break into program" + DB #14 ; "L Break into program" L182A: BIT 7,(IY+#0A) ; NSPPC - statement number in line to be jumped to JP NZ,L18A8 ; Jump forward if there is not a 'jump' to be made. @@ -6725,7 +6724,7 @@ L1838: LD HL,#FFFE ; A line in the editing area is considered as line '-2 ; This code is similar to that in ROM 1 at 1B9E. L184C: RST #28 ; - DEFW LINE_ADDR ; #196E. The starting address of the line, or the 'first line after' is found. + DW LINE_ADDR ; #196E. The starting address of the line, or the 'first line after' is found. LD A,(#5C44) ; NSPPC. Collect the statement number. JR Z,L1870 ; Jump forward if the required line was found. @@ -6739,7 +6738,7 @@ L184C: RST #28 ; JR Z,L1870 ; Jump forward with valid addresses; otherwise signal the error 'OK'. CALL L05AC ; Produce error report. - DEFB #FF ; "0 OK" + DB #FF ; "0 OK" ; ----------- ; REM Routine @@ -6811,11 +6810,11 @@ L1882: LD (#5C55),HL ; NXTLIN. Set NXTLIN for use once the current line has INC D ; For later statements the 'starting address' has to be found. RST #28 ; - DEFW EACH_STMT ; #198B. + DW EACH_STMT ; #198B. JR Z,L18A8 ; Jump forward unless the statement does not exist. L189D: CALL L05AC ; Produce error report. - DEFB #16 ; "N Statement lost" + DB #16 ; "N Statement lost" ; -------------------------- ; The 'CHECK-END' Subroutine @@ -6851,21 +6850,21 @@ L18A8: RST #18 ; Fetch the present character. ; The 'Command Class' Table ; ------------------------- -L18B5: DEFB L18D9-$ ; CLASS-00 -> L18D9 = #24 - DEFB L18F9-$ ; CLASS-01 -> L18F9 = #43 - DEFB L18FD-$ ; CLASS-02 -> L18FD = #46 - DEFB L18D6-$ ; CLASS-03 -> L18D6 = #1E - DEFB L1905-$ ; CLASS-04 -> L1905 = #4C - DEFB L18DA-$ ; CLASS-05 -> L18DA = #20 - DEFB L190E-$ ; CLASS-06 -> L190E = #53 - DEFB L191A-$ ; CLASS-07 -> L191A = #5E - DEFB L190A-$ ; CLASS-08 -> L190A = #4D - DEFB L1944-$ ; CLASS-09 -> L1944 = #86 - DEFB L1916-$ ; CLASS-0A -> L1916 = #57 - DEFB L1948-$ ; CLASS-0B -> L1948 = #88 - DEFB L18C7-$ ; CLASS-0C -> L18C7 = #06 - DEFB L18C4-$ ; CLASS-0D -> L18C4 = #02 - DEFB L18C8-$ ; CLASS-0E -> L18C8 = #05 +L18B5: DB L18D9-$ ; CLASS-00 -> L18D9 = #24 + DB L18F9-$ ; CLASS-01 -> L18F9 = #43 + DB L18FD-$ ; CLASS-02 -> L18FD = #46 + DB L18D6-$ ; CLASS-03 -> L18D6 = #1E + DB L1905-$ ; CLASS-04 -> L1905 = #4C + DB L18DA-$ ; CLASS-05 -> L18DA = #20 + DB L190E-$ ; CLASS-06 -> L190E = #53 + DB L191A-$ ; CLASS-07 -> L191A = #5E + DB L190A-$ ; CLASS-08 -> L190A = #4D + DB L1944-$ ; CLASS-09 -> L1944 = #86 + DB L1916-$ ; CLASS-0A -> L1916 = #57 + DB L1948-$ ; CLASS-0B -> L1948 = #88 + DB L18C7-$ ; CLASS-0C -> L18C7 = #06 + DB L18C4-$ ; CLASS-0D -> L18C4 = #02 + DB L18C8-$ ; CLASS-0E -> L18C8 = #05 ; ----------------------------------- ; The 'Command Classes - 0C, 0D & 0E' @@ -6873,7 +6872,7 @@ L18B5: DEFB L18D9-$ ; CLASS-00 -> L18D9 = #24 ; For commands of class-0D a numeric expression must follow. L18C4: RST #28 ; Code 0D enters here. - DEFW FETCH_NUM ; #1CDE. + DW FETCH_NUM ; #1CDE. ;The commands of class-0C must not have any operands. e.g. SPECTRUM. @@ -6907,7 +6906,7 @@ L18C8: POP BC ; Code 0E enters here. ; The commands of class-03 may, or may not, be followed by a number. e.g. RUN & RUN 200. L18D6: RST #28 ; Code 03 enters here. - DEFW FETCH_NUM ; #1CDE. A number is fetched but zero is used in cases of default. + DW FETCH_NUM ; #1CDE. A number is fetched but zero is used in cases of default. ;The commands of class-00 must not have any operands. e.g. COPY & CONTINUE. @@ -6947,7 +6946,7 @@ L18F8: RET ; Simply make a return. ; Command class 01 is concerned with the identification of the variable in a LET, READ or INPUT statement. L18F9: RST #28 ; Delegate handling to ROM 1. - DEFW CLASS_01 ; #1C1F. + DW CLASS_01 ; #1C1F. RET ; ; ------------------------ @@ -6957,7 +6956,7 @@ L18F9: RST #28 ; Delegate handling to ROM 1. L18FD: POP BC ; Code 02 enters here. Delegate handling to ROM 1. RST #28 ; - DEFW VAL_FET_1 ; #1C56. "... used by LET, READ and INPUT statements to + DW VAL_FET_1 ; #1C56. "... used by LET, READ and INPUT statements to ; first evaluate and then assign values to the ; previously designated variable" (Logan/O'Hara) CALL L18A1 ; Move on to the next statement if checking syntax @@ -6969,7 +6968,7 @@ L18FD: POP BC ; Code 02 enters here. Delegate handling to ROM 1. ; The command class 04 entry point is used by FOR & NEXT statements. L1905: RST #28 ; Code 04 enters here. Delegate handling to ROM 1. - DEFW CLASS_04 ; #1C6C. + DW CLASS_04 ; #1C6C. RET ; ; ------------------------ @@ -6980,7 +6979,7 @@ L1905: RST #28 ; Code 04 enters here. Delegate handling to ROM 1. L1909: RST #20 ; [Redundant byte] L190A: RST #28 ; Delegate handling to ROM 1. - DEFW EXPT_2NUM ; #1C7A. + DW EXPT_2NUM ; #1C7A. RET ; ; ------------------------ @@ -6989,7 +6988,7 @@ L190A: RST #28 ; Delegate handling to ROM 1. ; Command class 06 allows for a single numeric expression to be evaluated. L190E: RST #28 ; Code 06 enters here. Delegate handling to ROM 1. - DEFW EXPT_1NUM ; #1C82. + DW EXPT_1NUM ; #1C82. RET ; ; ---------------------------- @@ -6997,7 +6996,7 @@ L190E: RST #28 ; Code 06 enters here. Delegate handling to ROM 1. ; ---------------------------- L1912: CALL L05AC ; Produce error report. [Could have saved 4 bytes by using the identical routine at #1219 (ROM 0) instead] - DEFB #0B ; "C Nonsense in BASIC" + DB #0B ; "C Nonsense in BASIC" ; ------------------------ ; The 'Command Class - 0A' @@ -7005,7 +7004,7 @@ L1912: CALL L05AC ; Produce error report. [Could have saved 4 bytes by u ; Command class 0A allows for a single string expression to be evaluated. L1916: RST #28 ; Code 0A enters here. Delegate handling to ROM 1. - DEFW EXPT_EXP ; #1C8C. + DW EXPT_EXP ; #1C8C. RET ; ; ------------------------ @@ -7019,13 +7018,13 @@ L191A: BIT 7,(IY+#01) ; The syntax/run flag is read. JR Z,L1927 ; Jump ahead if syntax checking. RST #28 ; Only during a 'run' call TEMPS to ensure the temporary - DEFW TEMPS ; #0D4D. colours are the main screen colours. + DW TEMPS ; #0D4D. colours are the main screen colours. L1927: POP AF ; Drop the return address. LD A,(#5C74) ; T_ADDR. SUB (L177F & #00FF)+#28 ; Reduce to range #D9-#DE which are the token codes for INK to OVER. RST #28 ; - DEFW CO_TEMP_4 ; #21FC. Change the temporary colours as directed by the BASIC statement. + DW CO_TEMP_4 ; #21FC. Change the temporary colours as directed by the BASIC statement. CALL L18A1 ; Move on to the next statement if checking syntax. LD HL,(#5C8F) ; ATTR_T. Now the temporary colour @@ -7050,7 +7049,7 @@ L1927: POP AF ; Drop the return address. ; of 'FLASH 8; BRIGHT 8; PAPER 8;' that are set up before any embedded colour items are considered. L1944: RST #28 ; Code 09 enters here. Delegate handling to ROM 1. - DEFW CLASS_09 ; #1CBE. + DW CLASS_09 ; #1CBE. RET ; ------------------------ @@ -7095,7 +7094,7 @@ L196E: LD HL,(#5C65) ; STKEND. ADD HL,DE ; The present 'last value' is deleted. LD (#5C65),HL ; STKEND. HL point to the first byte of the value. RST #28 ; - DEFW TEST_ZERO ; #34E9. Is the value zero? + DW TEST_ZERO ; #34E9. Is the value zero? JP C,L1863 ; If the value was 'FALSE' jump to the next line. L197E: JP L17C1 ; But if 'TRUE' jump to the next statement (after the THEN). @@ -7134,7 +7133,7 @@ L198E: CALL L18A1 ; Move on to the next statement if checking syntax. ;These values now have to be manipulated. Delegate handling to ROM 1. L19A6: RST #28 ; - DEFW F_REORDER ; #1D16. + DW F_REORDER ; #1D16. RET ; ; ------------ @@ -7158,11 +7157,11 @@ L19AB: CALL L18F9 ; Indirectly call CLASS_01 in ROM 1 to consider whethe LD E,#E4 ; The search is for 'DATA'. RST #28 ; - DEFW LOOK_PROG ; #1D86. + DW LOOK_PROG ; #1D86. JR NC,L19CB ; Jump forward if the search is successful. CALL L05AC ; Produce error report. - DEFB #0D ; "E Out of Data" + DB #0D ; "E Out of Data" ; Pick up a value from the DATA list. @@ -7170,7 +7169,7 @@ L19CB: INC HL ; Advance the pointer along the DATA list. LD (#5C5D),HL ; CH_ADD. LD A,(HL) ; RST #28 ; - DEFW VAL_FET_1 ; #1C56. Fetch the value and assign it to the variable. + DW VAL_FET_1 ; #1C56. Fetch the value and assign it to the variable. RST #18 ; LD (#5C57),HL ; DATADD. @@ -7200,7 +7199,7 @@ L19EB: BIT 7,(IY+#01) ; Jump forward unless checking syntax. ;A loop is now entered to deal with each expression in the DATA statement. L19F1: RST #28 ; - DEFW SCANNING ; #24FB. Scan the next expression. + DW SCANNING ; #24FB. Scan the next expression. CP ',' ; #2C. Check for the correct separator ','. CALL NZ,L18A1 ; but move on to the next statement if not matched. RST #20 ; Whilst there are still expressions to be checked @@ -7214,7 +7213,7 @@ L19FC: LD A,#E4 ; It is a 'DATA' statement that is to be passed-by. ;depending on the type of statement that is being 'passed-by'. L19FE: RST #28 ; - DEFW PASS_BY ; #1E39. Delegate handling to ROM 1. + DW PASS_BY ; #1E39. Delegate handling to ROM 1. RET ; ----------- @@ -7224,11 +7223,11 @@ L19FE: RST #28 ; ; The operations of 'RESTORE 0' and 'CLEAR 0' are then performed before a return is made. L1A02: RST #28 - DEFW GO_TO ; #1E67. + DW GO_TO ; #1E67. LD BC,#0000 ; Now perform a 'RESTORE 0'. RST #28 - DEFW REST_RUN ; #1E45. + DW REST_RUN ; #1E45. JR L1A10 ; Exit via the CLEAR command routine. ; ------------- @@ -7239,7 +7238,7 @@ L1A02: RST #28 ; thereby having the effect of also clearing the GO SUB stack. L1A0D: RST #28 ; - DEFW FIND_INT2 ; #1E99. Fetch the operand - using zero by default. + DW FIND_INT2 ; #1E99. Fetch the operand - using zero by default. L1A10: LD A,B ; Jump forward if the operand is OR C ; other than zero. When called @@ -7252,9 +7251,9 @@ L1A18: PUSH BC ; BC = Address to clear to. Save it. LD HL,(#5C59) ; E LINE. DEC HL ; RST #28 ; Delete the variables area. - DEFW RECLAIM ; #19E5. + DW RECLAIM ; #19E5. RST #28 ; Clear the screen - DEFW CLS ; #0D6B. + DW CLS ; #0D6B. ;The value in the BC register pair which will be used as RAMTOP is tested to ensure it ;is neither too low nor too high. @@ -7272,7 +7271,7 @@ L1A18: PUSH BC ; BC = Address to clear to. Save it. JR NC,L1A3F ; Jump forward if acceptable. L1A3B: CALL L05AC ; Produce error report. - DEFB #15 ; "M Ramtop no good" + DB #15 ; "M Ramtop no good" L1A3F: LD (#5CB2),DE ; RAMTOP. POP DE ; Retrieve interpreter return address from stack @@ -7312,11 +7311,11 @@ L1A53: POP DE ; Save the return address. PUSH DE ; Stack the return address. RST #28 ; - DEFW GO_TO ; #1E67. Now set NEWPPC & NSPPC to the required values. + DW GO_TO ; #1E67. Now set NEWPPC & NSPPC to the required values. LD BC,#0014 ; But before making the jump make a test for room. RST #28 ; - DEFW TEST_ROOM ; #1F05. Will automatically produce error '4' if out of memory. + DW TEST_ROOM ; #1F05. Will automatically produce error '4' if out of memory. RET ; -------------- @@ -7345,7 +7344,7 @@ L1A86: PUSH DE ; Replace the end marker and PUSH HL ; the 'error address'. CALL L05AC ; Produce error report. - DEFB #06 ; "7 RETURN without GO SUB" + DB #06 ; "7 RETURN without GO SUB" ; -------------- ; DEF FN Routine @@ -7364,7 +7363,7 @@ L1A8C: BIT 7,(IY+#01) L1A97: SET 6,(IY+#01) ; Signal 'a numeric variable'. RST #28 ; - DEFW ALPHA ; #2C8D. Check that the present code is a letter. + DW ALPHA ; #2C8D. Check that the present code is a letter. JR NC,L1AB6 ; Jump forward if not. RST #20 ; Fetch the next character. @@ -7384,7 +7383,7 @@ L1AAA: CP '(' ; #28. A '(' must follow the variable's name. ;A loop is now entered to deal with each parameter in turn. L1AB3: RST #28 ; - DEFW ALPHA ; #2C8D. + DW ALPHA ; #2C8D. L1AB6: JP NC,L1912 ; The present code must be a letter. @@ -7399,7 +7398,7 @@ L1AB6: JP NC,L1912 ; The present code must be a letter. L1AC1: EX DE,HL ; Move the pointer to the last character of the name to HL. LD BC,#0006 ; Now make six locations after that last character. RST #28 ; - DEFW MAKE_ROOM ; #1655. + DW MAKE_ROOM ; #1655. INC HL ; INC HL ; LD (HL),#0E ; Enter a 'number marker' into the first of the new locations. @@ -7422,7 +7421,7 @@ L1AD3: CP ')' ; #29. Check that the ')' does exist. LD A,(#5C3B) ; FLAGS. PUSH AF ; Save the nature (numeric or string) of the variable RST #28 ; - DEFW SCANNING ; #24FB. Now consider the definition as an expression. + DW SCANNING ; #24FB. Now consider the definition as an expression. POP AF ; Fetch the nature of the variable. XOR (IY+#01) ; FLAGS. Check that it is of the same type @@ -7453,12 +7452,12 @@ L1AF0: RET ; Simply return. ; CALL L1F20 ; Use Normal RAM Configuration (physical RAM bank 0). ; RST #28 ; -; DEFW SET_MIN ; #16B0. Clear out editing area. +; DW SET_MIN ; #16B0. Clear out editing area. ; LD HL,(#5C59) ; E_LINE. ; LD BC,#0003 ; Create 3 bytes of space for the LOAD "" command. ; RST #28 ; -; DEFW MAKE_ROOM ; #1655. +; DW MAKE_ROOM ; #1655. ; LD HL,L1B6E ; Address of command bytes for LOAD "". ; LD DE,(#5C59) ; E_LINE. @@ -7475,11 +7474,13 @@ L1AFD: COM_LN: PUSH DE PUSH BC CALL_R1 SET_MIN + LD HL,(E_LINE) POP BC PUSH BC PUSH HL CALL_R1 MAKE_ROOM + POP DE POP BC POP HL @@ -7499,12 +7500,12 @@ COM_LN: PUSH DE L1B14: CALL L1F20 ; Use Normal RAM Configuration (physical RAM bank 0). RST #28 ; - DEFW SET_MIN ; #16B0. Clear out editing area. + DW SET_MIN ; #16B0. Clear out editing area. LD HL,(#5C59) ; E_LINE. LD BC,#0001 ; Create 1 byte of space. RST #28 ; - DEFW MAKE_ROOM ; #1655. + DW MAKE_ROOM ; #1655. LD HL,(#5C59) ; E_LINE. LD (HL),#E1 ; Copy LLIST into the line editing area. @@ -7550,7 +7551,7 @@ L1B2B: CALL L1B53 ; Overwrite 'P' channel data to use the ZX Printer. LD A,#20 ; Force 48K mode. LD (BANK_M),A ; #5B5C. - JP SWAP_ROM ; #5B00. Swap to ROM 1 and return via a RST #08 / DEFB #FF. + JP SWAP_ROM ; #5B00. Swap to ROM 1 and return via a RST #08 / DB #FF. ; ====================== @@ -7560,7 +7561,6 @@ L1B2B: CALL L1B53 ; Overwrite 'P' channel data to use the ZX Printer. ; --------------------------- ; Main Menu - 48 BASIC Option ; --------------------------- - L1B47: LD HL,#0000 ; Stack a #0000 address to return to. PUSH HL ; @@ -7590,8 +7590,7 @@ L1B53: LD HL,(#5C4F) ; CHANS. ; LOAD "" Command Bytes ; --------------------- ; Used by the Tape Loader routine. - -L1B6E: DEFB #EF, #22, #22 ; LOAD "" +L1B6E: DB #EF, #22, #22 ; LOAD "" ; ======================================================= @@ -7613,20 +7612,20 @@ L1B75: LD A,#02 ; Main screen channel. L1B77: LD (IY+#02),#00 ; TV_FLAG. Signal 'an ordinary listing in the main part of the screen'. RST #28 ; - DEFW SYNTAX_Z ; #2530. + DW SYNTAX_Z ; #2530. JR Z,L1B83 ; Do not open the channel if checking syntax. RST #28 ; - DEFW CHAN_OPEN ; #1601. Open the channel. + DW CHAN_OPEN ; #1601. Open the channel. L1B83: RST #28 ; - DEFW GET_CHAR ; #0018. [Could just do RST #18] + DW GET_CHAR ; #0018. [Could just do RST #18] RST #28 ; - DEFW STR_ALTER ; #2070. See if the stream is to be changed. + DW STR_ALTER ; #2070. See if the stream is to be changed. JR C,L1BA3 ; Jump forward if unchanged. RST #28 - DEFW GET_CHAR ; #0018. Get current character. + DW GET_CHAR ; #0018. Get current character. CP #3B ; Is it a ';'? JR Z,L1B96 ; Jump if it is. @@ -7634,23 +7633,23 @@ L1B83: RST #28 ; JR NZ,L1B9E ; Jump if it is not. L1B96: RST #28 ; - DEFW NEXT_CHAR ; #0020. Get the next character. + DW NEXT_CHAR ; #0020. Get the next character. CALL L190E ; Indirectly call EXPT-1NUM in ROM 1 to check that ; a numeric expression follows, e.g. LIST #5,20. JR L1BA6 ; Jump forward with it. L1B9E: RST #28 ; - DEFW USE_ZERO ; #1CE6. Otherwise use zero and + DW USE_ZERO ; #1CE6. Otherwise use zero and JR L1BA6 ; jump forward. ;Come here if the stream was unaltered. L1BA3: RST #28 ; - DEFW FETCH_NUM ; #1CDE. Fetch any line or use zero if none supplied. + DW FETCH_NUM ; #1CDE. Fetch any line or use zero if none supplied. L1BA6: CALL L18A1 ; If checking the syntax of the edit-line move on to the next statement. RST #28 ; - DEFW LIST_5+3 ; #1825. Delegate handling to ROM 1. + DW LIST_5+3 ; #1825. Delegate handling to ROM 1. RET ; ---------------------- @@ -7688,17 +7687,17 @@ L1BAD: LD (OLDSP),SP ; #5B81. Save SP. ; ------------ L1BE5: RST #28 ; Get the current character. - DEFW GET_CHAR ; #0018. [Could just do RST #18 here] + DW GET_CHAR ; #0018. [Could just do RST #18 here] CP '!' ; #21. Is it '!'? JP NZ,L1912 ; Jump to "C Nonsense in BASIC" if not. RST #28 ; Get the next character. - DEFW NEXT_CHAR ; #0020. [Could just do RST #20 here] + DW NEXT_CHAR ; #0020. [Could just do RST #20 here] CALL L18A1 ; Check for end of statement. LD A,#02 ; Select main screen. RST #28 ; - DEFW CHAN_OPEN ; #1601. + DW CHAN_OPEN ; #1601. LD (OLDSP),SP ; #5B81. Store SP. LD SP,TSTACK ; #5BFF. Use temporary stack. @@ -7716,7 +7715,7 @@ L1BE5: RST #28 ; Get the current character. ; -------------- L1C0C: RST #28 ; Get character from BASIC line. - DEFW GET_CHAR ; #0018. + DW GET_CHAR ; #0018. CP '!' ; #21. Is it '!'? JP NZ,L1912 ; Jump to "C Nonsense in BASIC" if not. @@ -7822,12 +7821,12 @@ L1C64: PUSH HL ; Save BC and HL. ; Physical RAM Bank Mapping Table ; ------------------------------- -L1C81: DEFB #01 ; Logical bank #00. - DEFB #03 ; Logical bank #01. - DEFB #04 ; Logical bank #02. - DEFB #06 ; Logical bank #03. - DEFB #07 ; Logical bank #04. - DEFB #00 ; Logical bank #05. +L1C81: DB #01 ; Logical bank #00. + DB #03 ; Logical bank #01. + DB #04 ; Logical bank #02. + DB #06 ; Logical bank #03. + DB #07 ; Logical bank #04. + DB #00 ; Logical bank #05. ; ================================== @@ -7870,7 +7869,7 @@ L1C97: CALL L1D12 ; Find entry in RAM disk area, returning IX pointing t JR Z,L1CA0 ; Jump ahead if does not exist. CALL L05AC ; Produce error report. - DEFB #20 ; "e File already exists" + DB #20 ; "e File already exists" L1CA0: PUSH IX ; LD BC,#3FEC ; 16384-20 (maximum size of RAM disk catalogue). @@ -7950,7 +7949,7 @@ L1D0A: ADD HL,DE ; JR C,L1D03 ; Jump back to store free space if space left. L1D0E: CALL L05AC ; Produce error report. - DEFB 03 ; "4 Out of memory" + DB 03 ; "4 Out of memory" ; --------------------------------- ; Find Catalogue Entry for Filename @@ -7993,7 +7992,7 @@ L1D35: CALL L1D12 ; Find entry in RAM disk area, returning IX pointing t JR NZ,L1D3E ; Jump ahead if it exists. CALL L05AC ; Produce error report. - DEFB #23 ; "h File does not exist" + DB #23 ; "h File does not exist" L1D3E: LD A,(IX+#0A) ; Take the current start address (bank + location) LD (IX+#10),A ; and store it as the current working address. @@ -8469,7 +8468,7 @@ L1F5F: CALL L1D12 ; Find entry in RAM disk area, returning IX pointing t JR NZ,L1F68 ; Jump ahead if it was found. [Could have saved 3 bytes by using JP Z,#1D3E (ROM 0)] CALL L05AC ; Produce error report. - DEFB #23 ; "h File does not exist" + DB #23 ; "h File does not exist" L1F68: LD L,(IX+#0D) ; AHL=Length of file. LD H,(IX+#0E) ; @@ -8778,11 +8777,11 @@ L2111: PUSH HL ; HL points to current catalogue entry. ; Print Catalogue Filename Data ; ----------------------------- -L2121: DEFB #00, #00, #00, #00, #00 ; Lowest theoretical filename. - DEFB #00, #00, #00, #00, #00 +L2121: DB #00, #00, #00, #00, #00 ; Lowest theoretical filename. + DB #00, #00, #00, #00, #00 -L212B: DEFB #FF, #FF, #FF, #FF, #FF ; Highest theoretical filename. - DEFB #FF, #FF, #FF, #FF, #FF +L212B: DB #FF, #FF, #FF, #FF, #FF ; Highest theoretical filename. + DB #FF, #FF, #FF, #FF, #FF ; ---------------------------- ; Print Single Catalogue Entry @@ -8813,7 +8812,7 @@ L2152: LD A,(HL) ; Print each character of the filename. PUSH HL ; PUSH BC ; RST #28 ; - DEFW PRINT_A_1 ; #0010. + DW PRINT_A_1 ; #0010. POP BC ; POP HL ; INC HL ; @@ -8821,10 +8820,10 @@ L2152: LD A,(HL) ; Print each character of the filename. LD A,#0D ; Print a newline character. RST #28 ; - DEFW PRINT_A_1 ; #0010. + DW PRINT_A_1 ; #0010. RST #28 ; - DEFW TEMPS ; #0D4D. Copy permanent colours to temporary colours. + DW TEMPS ; #0D4D. Copy permanent colours to temporary colours. LD HL,(OLDSP) ; #5B81. LD (OLDSP),SP ; #5B81. Save original stack. @@ -8855,16 +8854,16 @@ L2174: LD A,#03 ; Printer channel. L2178: LD A,#02 ; Main screen channel. L217A: RST #28 ; - DEFW SYNTAX_Z ; #2530. + DW SYNTAX_Z ; #2530. JR Z,L2182 ; Jump forward if syntax is being checked. RST #28 ; - DEFW CHAN_OPEN ; #1601. + DW CHAN_OPEN ; #1601. L2182: RST #28 ; - DEFW TEMPS ; #0D4D. + DW TEMPS ; #0D4D. RST #28 ; - DEFW PRINT_2 ; #1FDF. Delegate handling to ROM 1. + DW PRINT_2 ; #1FDF. Delegate handling to ROM 1. CALL L18A1 ; "C Nonsense in BASIC" during syntax checking if not ; at end of line or statement. RET ; @@ -8877,14 +8876,14 @@ L2182: RST #28 ; ; INPUT statement and these items are printed in the lower part of the display. L218C: RST #28 ; - DEFW SYNTAX_Z ; #2530. + DW SYNTAX_Z ; #2530. JR Z,L2199 ; Jump forward if syntax is being checked. LD A,#01 ; Open channel 'K'. RST #28 ; - DEFW CHAN_OPEN ; #1601. + DW CHAN_OPEN ; #1601. RST #28 ; Clear the lower part of the display. - DEFW CLS_LOWER ; #0D6E. [*BUG* - This call will re-select channel 'S' and so should have been called prior to opening + DW CLS_LOWER ; #0D6E. [*BUG* - This call will re-select channel 'S' and so should have been called prior to opening ; channel 'K'. It is a direct copy of the code that appears in the standard Spectrum ROM (and ROM 1). It is ; debatable whether it is better to reproduce the bug so as to ensure that the INPUT routine operates the same ; in 128K mode as it does in 48K mode. Credit: Geoff Wearmouth] @@ -8892,10 +8891,10 @@ L218C: RST #28 ; L2199: LD (IY+#02),#01 ; TV_FLAG. Signal that the lower screen is being handled. [Not a bug as has been reported elsewhere. The confusion seems to have ; arisen due to the incorrect system variable being originally mentioned in the Spectrum ROM Disassembly by Logan and O'Hara] RST #28 ; - DEFW IN_ITEM_1 ; #20C1. Call the subroutine to deal with the INPUT items. + DW IN_ITEM_1 ; #20C1. Call the subroutine to deal with the INPUT items. CALL L18A1 ; Move on to the next statement if checking syntax. RST #28 ; - DEFW INPUT_1+#000A ; #20A0. Delegate handling to ROM 1. + DW INPUT_1+#000A ; #20A0. Delegate handling to ROM 1. RET ; ; ------------ @@ -8925,10 +8924,10 @@ L21AE: RST #18 ; Get character from BASIC line. RST #20 ; Advance pointer into BASIC line. RST #28 ; Get parameter. - DEFW EXPT_1NUM ; #1C82. Radius to calculator stack. + DW EXPT_1NUM ; #1C82. Radius to calculator stack. CALL L18A1 ; Move to consider next statement if checking syntax. RST #28 ; - DEFW CIRCLE+#000D ; #232D. Delegate handling to ROM 1. + DW CIRCLE+#000D ; #232D. Delegate handling to ROM 1. RET ; ; ------------ @@ -8946,15 +8945,15 @@ L21BE: RST #18 ; Get current character. CALL L18A1 ; Error C during syntax checking if not at end of line/statement. RST #28 ; - DEFW LINE_DRAW ; #2477. Delegate handling to ROM 1. + DW LINE_DRAW ; #2477. Delegate handling to ROM 1. RET ; L21CA: RST #20 ; Get the next character. RST #28 ; - DEFW EXPT_1NUM ; #1C82. Angle to calculator stack. + DW EXPT_1NUM ; #1C82. Angle to calculator stack. CALL L18A1 ; Error C during syntax checking if not at end of line/statement. RST #28 ; - DEFW DR_3_PRMS+#0007 ; #2394. Delegate handling to ROM 1. + DW DR_3_PRMS+#0007 ; #2394. Delegate handling to ROM 1. RET ; ; ----------- @@ -8967,22 +8966,22 @@ L21CA: RST #20 ; Get the next character. ; if it is a numeric array, or to 'spaces' if it is an array of strings. L21D5: RST #28 ; Search to see if the array already exists. - DEFW LOOK_VARS ; #28B2. + DW LOOK_VARS ; #28B2. JR NZ,L21EB ; Jump if array variable not found. RST #28 - DEFW SYNTAX_Z ; #2530. + DW SYNTAX_Z ; #2530. JR NZ,L21E7 ; Jump ahead during syntax checking. RES 6,C ; Test the syntax for string arrays as if they were numeric. RST #28 ; - DEFW STK_VAR ; #2996. Check the syntax of the parenthesised expression. + DW STK_VAR ; #2996. Check the syntax of the parenthesised expression. CALL L18A1 ; Error when checking syntax unless at end of line/statement. ;An 'existing array' is reclaimed. L21E7: RST #28 ; - DEFW D_RUN ; #2C15. Delegate handling to ROM 1. + DW D_RUN ; #2C15. Delegate handling to ROM 1. RET ; ; ---------------------------------- @@ -8990,7 +8989,7 @@ L21E7: RST #28 ; ; ---------------------------------- L21EB: CALL L05AC ; Produce error report. - DEFB #0B ; "C Nonsense in BASIC" + DB #0B ; "C Nonsense in BASIC" ; -------------------- ; Clear Screen Routine @@ -9001,7 +9000,7 @@ L21EF: BIT 0,(IY+#30) ; FLAGS2. Is the screen clear? RET Z ; Return if it is. RST #28 ; - DEFW CL_ALL ; #0DAF. Otherwise clear the whole display. + DW CL_ALL ; #0DAF. Otherwise clear the whole display. RET ; ; --------------------------- @@ -9020,7 +9019,7 @@ L21F8: LD HL,#FFFE ; A line in the editing area is considered as line '-2 CALL L228E ; Point to start of the BASIC command line. RST #28 ; - DEFW SCANNING ; #24FB. Evaluate the command line. + DW SCANNING ; #24FB. Evaluate the command line. BIT 6,(IY+#01) ; Is it a numeric value? JR Z,L223A ; Jump to produce an error if a string result. @@ -9037,7 +9036,7 @@ L21F8: LD HL,#FFFE ; A line in the editing area is considered as line '-2 LD (SYNRET),HL ; #5B8B. RST #28 ; - DEFW SCANNING ; #24FB. Evaluate the command line. + DW SCANNING ; #24FB. Evaluate the command line. BIT 6,(IY+#01) ; Is it a numeric value? JR Z,L223A ; Jump to produce an error if a string result. @@ -9050,14 +9049,14 @@ L21F8: LD HL,#FFFE ; A line in the editing area is considered as line '-2 JP L223E ; [Could have saved 1 byte by using a JR instruction] L223A: CALL L05AC ; Produce error report. - DEFB #19 ; "Q Parameter error" + DB #19 ; "Q Parameter error" L223E: LD A,#0D ; Make it appear that 'Enter' has been pressed. CALL L226F ; Process key press. LD BC,#0001 ; RST #28 ; - DEFW BC_SPACES ; #0030. Create a byte in the workspace. + DW BC_SPACES ; #0030. Create a byte in the workspace. LD (#5C5B),HL ; K_CUR. Address of the cursor. PUSH HL ; Save it. @@ -9067,15 +9066,15 @@ L223E: LD A,#0D ; Make it appear that 'Enter' has been pressed. LD A,#FF ; Channel 'R', the workspace. RST #28 ; - DEFW CHAN_OPEN ; #1601. + DW CHAN_OPEN ; #1601. RST 28H - DEFW PRINT_FP ; #2DE3. Print a floating point number to the workspace. + DW PRINT_FP ; #2DE3. Print a floating point number to the workspace. POP HL ; Get the current channel information address. RST #28 ; - DEFW CHAN_FLAG ; #1615. Set appropriate flags back for the old channel. + DW CHAN_FLAG ; #1615. Set appropriate flags back for the old channel. POP DE ; DE=Address of the old cursor position. @@ -9109,7 +9108,7 @@ L226F: PUSH HL ; Save registers. PUSH AF ; LD A,#02 ; Main screen RST #28 ; - DEFW CHAN_OPEN ; #1601. + DW CHAN_OPEN ; #1601. POP AF ; CALL L2669 ; Process key press. @@ -9190,12 +9189,12 @@ L22B9: OR #FF ; Reset zero flag to indicate not an operator. ; Operator Tokens Table ; --------------------- -L22BD: DEFB #2B, #2D, #2A ; '+', '-', '*' - DEFB #2F, #5E, #3D ; '/', '^', '=' - DEFB #3E, #3C, #C7 ; '>', '<', '<=' - DEFB #C8, #C9, #C5 ; '>=', '<>', 'OR' - DEFB #C6 ; 'AND' - DEFB #00 ; End marker. +L22BD: DB #2B, #2D, #2A ; '+', '-', '*' + DB #2F, #5E, #3D ; '/', '^', '=' + DB #3E, #3C, #C7 ; '>', '<', '<=' + DB #C8, #C9, #C5 ; '>=', '<>', 'OR' + DB #C6 ; 'AND' + DB #00 ; End marker. ; ---------------------- ; Is Function Character? @@ -9287,7 +9286,7 @@ L2317: LD B,#00 ; String index. L231A: PUSH BC ; RST #28 ; Get string expression. - DEFW EXPT_EXP + DW EXPT_EXP POP BC ; INC B ; CP ',' ; #2C. A ',' indicates another string. @@ -9301,7 +9300,7 @@ L2327: LD A,B ; Check the index. JR C,L2330 ; CALL L05AC ; Produce error report. - DEFB #2B ; "p (c) 1986 Sinclair Research Ltd" [*BUG* - This should be "Parameter error". The Spanish 128 + DB #2B ; "p (c) 1986 Sinclair Research Ltd" [*BUG* - This should be "Parameter error". The Spanish 128 ; produces "p Bad parameter" but to save memory perhaps the UK 128 was intended to use the existing ; "Q Parameter error" and the change of the error code byte here was overlooked. In that case it would ; have had a value of #19. Note that generation of this error when using the main screen editor will @@ -9310,6 +9309,64 @@ L2327: LD A,B ; Check the index. L2330: CALL L18A1 ; Ensure end-of-statement or end-of-line. JP L0985 ; Continue with PLAY code. +;ллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллл; +;ллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллл; +;ллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллл; + + + + + +; ------------------------------ +; Main Menu - Tape Loader Option +; ------------------------------ +LOAD_TAPE: LD HL,TapeLoaderTxt; "Tape Loader" text from main menu. + CALL L385A ; Clear screen and print "Tape Loader" in the banner line. + LD HL,#5C3C ; TVFLAG. + SET 0,(HL) ; Signal using lower screen area. + LD DE,.InfoTxt ; Point to message "To cancel - press BREAK twice". + CALL L057D ; Print the text. + ; + RES 0,(HL) ; Signal using main screen area. + SET 6,(HL) ; [This bit is unused in the 48K Spectrum and only ever set in 128K mode via the Tape Loader option. + ; It is never subsequently tested or reset. It may have been the intention to use this to indicate that + ; the screen requires clearing after loading to remove the "Tape Loader" banner and the lower screen + ; message "To cancel - press BREAK twice"] + LD BC,#0000 ; + CALL L372B ; Perform 'Print AT 0,0;'. + ;JP L1AF1 ; Run the tape loader. +; --------------- +; Run Tape Loader +; --------------- +;L1AF1: +; Used by Main Menu - Tape Loader option. + LD HL,#EC0E ; Fetch mode. + LD (HL),#FF ; Set Tape Loader mode. + CALL L1F20 ; Use Normal RAM Configuration (physical RAM bank 0). + ; + CALL_R1 SET_MIN ; #16B0. Clear out editing area. + ; + LD HL,(#5C59) ; E_LINE. + LD BC,#0003 ; Create 3 bytes of space for the LOAD "" command. + CALL_R1 MAKE_ROOM ; #1655. + ; + LD HL,L1B6E ; Address of command bytes for LOAD "". + LD DE,(#5C59) ; E_LINE. + LD BC,#0003 ; + LDIR ; Copy LOAD "" into the line editing area. + + CALL L026B ; Parse and execute the BASIC line. + ; [Will not return here but will exit via the error handler routine] +; ---------------- +; Tape Loader Text +; ---------------- +.InfoTxt: DB #16,#01,#00; AT 1,0; + DB #10,#00 ; INK 0; + DB #11,#07 ; PAPER 7; + DB #13,#00 ; BRIGHT 1; + DC "To cancel - press BREAK twice" +;ААААААААААААААААААААААААААААААААААААААААААААААААААААААААААААААААААААААААААААААААААААААААААААААААААААААА; + ; ======================== ; UNUSED ROUTINES - PART 1 @@ -9323,12 +9380,13 @@ L2330: CALL L18A1 ; Ensure end-of-statement or end-of-line. ; Return to Editor ; ---------------- ; [Never called by this ROM] - + IFUSED L2336 L2336: LD HL,TSTACK ; #5BFF. LD (OLDSP),HL ; #5B81. CALL L1F45 ; Use Workspace RAM configuration (physical RAM bank 7). JP L25CB ; Jump ahead to the Editor. + ENDIF ; ------------------------ ; BC=HL-DE, Swap HL and DE @@ -9337,7 +9395,7 @@ L2336: LD HL,TSTACK ; #5BFF. ; DE=HL, HL=DE. ; ; [Never called by this ROM] - + IFUSED L2342 L2342: AND A ; SBC HL,DE ; LD B,H ; @@ -9345,6 +9403,7 @@ L2342: AND A ; ADD HL,DE ; EX DE,HL ; HL=DE, DE=HL. RET ; + ENDIF ; ---------------------- ; Create Room for 1 Byte @@ -9352,7 +9411,7 @@ L2342: AND A ; ; Creates a single byte in the workspace, or automatically produces an error '4' if not. ; ; [Never called by this ROM] - + IFUSED L234A L234A: LD BC,#0001 ; Request 1 byte. PUSH HL ; PUSH DE ; @@ -9360,8 +9419,9 @@ L234A: LD BC,#0001 ; Request 1 byte. POP DE ; handler in ROM 0 to be called. If MAKE_ROOM were called directly and POP HL ; and out of memory condition detected then the ROM 1 error handler would RST #28 ; be called instead. - DEFW MAKE_ROOM ; #1655. The memory check passed so safely make the room. + DW MAKE_ROOM ; #1655. The memory check passed so safely make the room. RET + ENDIF ; ------------------ ; Room for BC Bytes? @@ -9373,7 +9433,7 @@ L234A: LD BC,#0001 ; Request 1 byte. ; Exit : Returns if the room requested is available else an error '4' is produced. ; ; [Called by the routine at #234A (ROM 0), which is itself never called by this ROM] - + IFUSED L2358 L2358: LD HL,(#5C65) ; STKEND. ADD HL,BC ; Would adding the specified number of bytes overflow the RAM area? JR C,L2368 ; Jump to produce an error if so. @@ -9385,29 +9445,28 @@ L2358: LD HL,(#5C65) ; STKEND. SBC HL,SP ; If the stack is lower in memory, would there still be enough room? RET C ; Return if there would. - L2368: LD (IY+#00),#03 ; Signal error "4 Out of Memory". JP L0321 ; Jump to error handler routine. + ENDIF ; --------- ; HL = A*32 ; --------- ; [Called by routines at #2383 (ROM 0) and #23B8 (ROM 0), which are themselves never called by this ROM] - + IFUSED L236F L236F: ADD A,A ; A*2. ADD A,A ; A*4. Then multiply by 8 in following routine. - ; -------- ; HL = A*8 ; -------- ; [Called by the routine at #23E1 (ROM 0), which ultimately is itself never called by this ROM] - L2371: LD L,A ; LD H,#00 ; ADD HL,HL ; A*2. ADD HL,HL ; A*4. ADD HL,HL ; A*8. RET ; Return HL=A*8. + ENDIF ; ------------------------- ; Find Amount of Free Space @@ -9415,13 +9474,14 @@ L2371: LD L,A ; ; Exit: Carry flag set if no more space, else HL holds the amount of free space. ; ; [Never called by this ROM] - + IFUSED L2378 L2378: LD HL,#0000 ; ADD HL,SP ; HL=SP. LD DE,(#5C65) ; STKEND. OR A ; SBC HL,DE ; Effectively SP-STKEND, i.e. the amount of available space. RET ; + ENDIF ; ----------------------- ; Print Screen Buffer Row @@ -9430,7 +9490,7 @@ L2378: LD HL,#0000 ; ; Entry: A=Row number. ; ; [Never called by this ROM] - + IFUSED L2384 L2384: RES 0,(IY-#39) ; KSTATE+1. Signal do not invert attribute value. [IY+#3B on the Spanish 128] CALL L236F ; HL=A*32. Number of bytes prior to the requested row. @@ -9469,6 +9529,7 @@ L2384: RES 0,(IY-#39) ; KSTATE+1. Signal do not invert attribute value. [IY+ POP HL ; HL=Offset to requested row to print. LD B,#20 ; 32 columns. JP L23E1 ; Print one row to the display file. + ENDIF ; --------------------------- ; Blank Screen Buffer Content @@ -9478,7 +9539,7 @@ L2384: RES 0,(IY-#39) ; KSTATE+1. Signal do not invert attribute value. [IY+ ; BC=Number of bytes to set. ; ; [Never called by this ROM] - + IFUSED L23B8 L23B8: LD D,#FF ; The character to set the screen buffer contents to. CALL L236F ; HL=A*32. Offset to the specified row. LD A,D ; @@ -9491,12 +9552,13 @@ L23B8: LD D,#FF ; The character to set the screen buffer contents to. DEC BC ; LDIR ; Repeat for all remaining bytes required. RET ; + ENDIF ; ----------------------------------- ; Print Screen Buffer to Display File ; ----------------------------------- ; [Never called by this ROM] - + IFUSED L23CB L23CB: CALL L2488 ; Set attributes file from screen buffer. LD DE,#4000 ; DE=First third of display file. @@ -9521,7 +9583,6 @@ L23CB: CALL L2488 ; Set attributes file from screen buffer. ; B=Number of characters to print. ; ; [Used by routine at #23CB (ROM 0) and called by the routine at #2383 (ROM 0), both of which are themselves never called by this ROM] - L23E1: LD A,(HL) ; Fetch the character. PUSH HL ; Save string pointer. PUSH DE ; Save display file address. @@ -9530,9 +9591,10 @@ L23E1: LD A,(HL) ; Fetch the character. SUB #FE ; Reduce range to #00-#01. JR L2422 ; Jump ahead to show symbol. + ENDIF ;Comes here if character code if below #FE - + IFUSED L23EC L23EC: CP #20 ; Is it a control character? JR NC,L23F7 ; Jump ahead if not. @@ -9542,7 +9604,9 @@ L23EC: CP #20 ; Is it a control character? AND A ; Clear the carry flag to indicate no need to switch back to RAM bank 7. EX AF,AF' ; Save the flag. JR L242B ; Jump ahead to display the symbol. + ENDIF + IFUSED L23F7 L23F7: CP #80 ; Is it a graphic character or UDG? JR NC,L2409 ; Jump ahead if so. @@ -9555,19 +9619,19 @@ L23F7: CP #80 ; Is it a graphic character or UDG? CALL #FF28 ; Copy character into display file (via RAM Routine). ; Can't use routine at #242C (ROM 0) since it does not perform a simple return. JR L2450 ; Continue with next character. + ENDIF ;Comes here if a graphic character or UDG - + IFUSED L2409 L2409: CP #90 ; Is it a graphic character? JR NC,L2411 ; Jump ahead if not. - ;Comes here if a graphic character - SUB #7F ; Reduce range to #01-#10. JR L2422 ; Jump ahead to display the symbol. + ENDIF ;Comes here if a UDG - + IFUSED L2411 L2411: SUB #90 ; Reduce range to #00-#6D. CALL L2371 ; HL=A*8. @@ -9578,18 +9642,17 @@ L2411: SUB #90 ; Reduce range to #00-#6D. LD DE,(#5C7B) ; UDG. Fetch address of UDGs. SCF ; Set carry flag to indicate need to switch back to RAM bank 7. JR L2429 ; Jump ahead to locate character bit pattern and display the symbol. + ENDIF ;Come here if (HL) was #FE or #FF, or with a graphic character. ;At this point A=#00 if (HL) was #FE indicating a bug symbol, or #01 if (HL) was #FF indicating a null, ;or A=#01-#10 if a graphic character. - + IFUSED L2422 L2422: LD DE,L252F ; Start address of the graphic character bitmap table. CALL L2371 ; HL=A*8 -> #0000 or #0008. AND A ; Clear carry flag to indicate no need to switch back to RAM bank 7. - L2429: EX AF,AF' ; Save switch bank indication flag. ADD HL,DE ; Point to the symbol bit pattern data. - L242B: POP DE ; Fetch display file address. Drop through into routine below. ; ------------------------------------ @@ -9605,7 +9668,6 @@ L242B: POP DE ; Fetch display file address. Drop through into routin ; DE=Display file address. ; ; [Called by a routine that is itself never called by this ROM] - L242C: LD C,D ; Save D. LD A,(HL) ; @@ -9649,16 +9711,15 @@ L242C: LD C,D ; Save D. LD D,C ; Restore D. <<< Last byte copied to RAM >>> ; When the above routine is used in ROM, it drops through to here. - L244C: EX AF,AF' ; Need to switch back to RAM bank 7? CALL C,L1F45 ; If so then switch to use Workspace RAM configuration (physical RAM bank 7). - L2450: POP HL ; Fetch address of string data. INC HL ; Move to next character. INC DE ; Advance to next display file column. DJNZ L23E1 ; Repeat for all requested characters. RET ; + ENDIF ; --------------------------------- ; Toggle ROMs 1 <<< RAM Routine >>> @@ -9669,7 +9730,7 @@ L2450: POP HL ; Fetch address of string data. ; Entry: A'= Current paging configuration. ; ; [Called by a routine that is itself never called by this ROM] - + IFUSED L2456 L2456: PUSH BC ; Save BC DI ; Disable interrupts whilst paging. @@ -9680,6 +9741,7 @@ L2456: PUSH BC ; Save BC OUT (C),A ; Perform paging. EI ; Re-enable interrupts. EX AF,AF' ; Save the new configuration in A'. <<< Last byte copied to RAM >>> + ENDIF ; --------------------------------- ; Toggle ROMs 2 <<< RAM Routine >>> @@ -9691,7 +9753,7 @@ L2456: PUSH BC ; Save BC ; Entry: A'= Current paging configuration. ; ; [Called by a routine that is itself never called by this ROM] - + IFUSED L2464 L2464: EX AF,AF' ; Retrieve current paging configuration. DI ; Disable interrupts whilst paging. LD C,#FD ; Restore Paging I/O port number. @@ -9701,6 +9763,7 @@ L2464: EX AF,AF' ; Retrieve current paging configuration. POP BC ; Restore BC. RET ; <<< Last byte copied to RAM >>> + ENDIF ; ----------------------------------------- ; Construct 'Copy Character' Routine in RAM @@ -9714,7 +9777,7 @@ L2464: EX AF,AF' ; Retrieve current paging configuration. ; Copy #2464-#246E (ROM 0) to #FF56-#FF60 (11 bytes). ; ; [Never called by this ROM] - + IFUSED L246F L246F: LD HL,L2456 ; Point to the 'page in other ROM' routine. LD DE,#FF28 ; Destination RAM address. LD BC,#000E ; @@ -9729,6 +9792,7 @@ L246F: LD HL,L2456 ; Point to the 'page in other ROM' routine. LD C,#0B ; LDIR ; Copy the routine. RET ; + ENDIF ; -------------------------------------- ; Set Attributes File from Screen Buffer @@ -9737,7 +9801,7 @@ L246F: LD HL,L2456 ; Point to the 'page in other ROM' routine. ; control codes and changing the attributes file contents correspondingly. ; ; [Called by the routine at #23CB (ROM 0), which is itself never called by this ROM] - + IFUSED L2488 L2488: RES 0,(IY-#39) ; KSTATE+1. Signal do not invert attribute value. [Spanish 128 uses IY-#3B] LD DE,#5800 ; The start of the attributes file. @@ -9753,11 +9817,8 @@ L2488: RES 0,(IY-#39) ; KSTATE+1. Signal do not invert attribute value. [Spa ; HL=Address within screen buffer. ; BC=Number of characters. ; DE=Address within attributes file. - L249B: EX AF,AF' ; Save the colour byte. - ;The main loop returns here on each iteration - L249C: PUSH BC ; Save the number of characters. LD A,(HL) ; Fetch a character from the buffer. @@ -9769,9 +9830,10 @@ L249C: PUSH BC ; Save the number of characters. INC HL ; Point to next screen buffer position. INC DE ; Point to next attributes file position. JR L2507 ; Jump ahead to handle the next character. + ENDIF ;Not a blank character - + IFUSED L24AA L24AA: EX AF,AF' ; Get the colour byte. LD (DE),A ; Store it in the attributes file. INC DE ; Point to the next attributes file position. @@ -9797,7 +9859,9 @@ L24AA: EX AF,AF' ; Get the colour byte. EX AF,AF' ; Get the colour byte. AND #F8 ; Mask off the ink bits. JR L2505 ; Jump ahead to store the new attribute value and then to handle the next character. + ENDIF + IFUSED L24C2 L24C2: CP #11 ; Is the string character PAPER? JR NZ,L24D1 ; Jump ahead if not. @@ -9812,7 +9876,9 @@ L24C2: CP #11 ; Is the string character PAPER? EX AF,AF' ; Get the colour byte. AND #C7 ; Mask off the paper bits. JR L2505 ; Jump ahead to store the new attribute value and then to handle the next character. + ENDIF + IFUSED L24D1 L24D1: CP #12 ; Is the string character FLASH? JR NZ,L24DE ; Jump ahead if not. @@ -9825,7 +9891,9 @@ L24D1: CP #12 ; Is the string character FLASH? EX AF,AF' ; Get the colour byte. AND #7F ; Mask off the flash bit. JR L2505 ; Jump ahead to store the new attribute value and then to handle the next character. + ENDIF + IFUSED L24DE L24DE: CP #13 ; Is the string character BRIGHT? JR NZ,L24EC ; Jump ahead if not. @@ -9839,7 +9907,9 @@ L24DE: CP #13 ; Is the string character BRIGHT? EX AF,AF' ; Get the colour byte. AND #BF ; Mask off the bright bit. JR L2505 ; Jump ahead to store the new attribute value and then to handle the next character. + ENDIF + IFUSED L24EC L24EC: CP #14 ; Is the string character INVERSE? INC HL ; Point to the next screen buffer position. JR NZ,L2507 ; Jump ahead if not to handle the next character. @@ -9858,7 +9928,6 @@ L24EC: CP #14 ; Is the string character INVERSE? EX AF,AF' ; Get the colour byte. CALL L2513 ; Swap ink and paper in the colour byte. - L2505: OR C ; Combine the old and new colour values. EX AF,AF' ; Save the new colour byte. @@ -9871,6 +9940,7 @@ L2507: POP BC ; Fetch the number of characters. EX AF,AF' ; Get colour byte. LD (#5C8F),A ; ATTR_T. Make it the new temporary colour. RET ; + ENDIF ; --------------------------------- ; Swap Ink and Paper Attribute Bits @@ -9879,7 +9949,7 @@ L2507: POP BC ; Fetch the number of characters. ; Exit : A=Attribute byte value with paper and ink bits swapped. ; ; [Called by the routine at #2488 (ROM 0), which is itself never called by this ROM] - + IFUSED L2513 L2513: LD B,A ; Save the original colour byte. AND #C0 ; Keep only the flash and bright bits. @@ -9899,35 +9969,39 @@ L2513: LD B,A ; Save the original colour byte. AND #07 ; Keep only the ink bits. OR C ; Add with the paper, flash and bright bits. RET ; + ENDIF ; -------------- ; Character Data ; -------------- - ;Graphic control code indicator - -L2527: DEFB #00 ; 0 0 0 0 0 0 0 0 - DEFB #3C ; 0 0 1 1 1 1 0 0 XXXX - DEFB #62 ; 0 1 1 0 0 0 1 0 XX X - DEFB #60 ; 0 1 1 0 0 0 0 0 XX - DEFB #6E ; 0 1 1 0 1 1 1 0 XX XXX - DEFB #62 ; 0 1 1 0 0 0 1 0 XX X - DEFB #3E ; 0 0 1 1 1 1 1 0 XXXX - DEFB #00 ; 0 0 0 0 0 0 0 0 + IFUSED L2527 +L2527: DB #00 ; 0 0 0 0 0 0 0 0 + DB #3C ; 0 0 1 1 1 1 0 0 XXXX + DB #62 ; 0 1 1 0 0 0 1 0 XX X + DB #60 ; 0 1 1 0 0 0 0 0 XX + DB #6E ; 0 1 1 0 1 1 1 0 XX XXX + DB #62 ; 0 1 1 0 0 0 1 0 XX X + DB #3E ; 0 0 1 1 1 1 1 0 XXXX + DB #00 ; 0 0 0 0 0 0 0 0 + ENDIF ;Error marker - -L252F: DEFB #00 ; 0 0 0 0 0 0 0 0 - DEFB #6C ; 0 1 1 0 1 1 0 0 XX XX - DEFB #10 ; 0 0 0 1 0 0 0 0 X - DEFB #54 ; 0 1 0 1 0 1 0 0 X X X - DEFB #BA ; 1 0 1 1 1 0 1 0 X XXX X - DEFB #38 ; 0 0 1 1 1 0 0 0 XXX - DEFB #54 ; 0 1 0 1 0 1 0 0 X X X - DEFB #82 ; 1 0 0 0 0 0 1 0 X X - + IFUSED L252F +L252F: DB #00 ; 0 0 0 0 0 0 0 0 + DB #6C ; 0 1 1 0 1 1 0 0 XX XX + DB #10 ; 0 0 0 1 0 0 0 0 X + DB #54 ; 0 1 0 1 0 1 0 0 X X X + DB #BA ; 1 0 1 1 1 0 1 0 X XXX X + DB #38 ; 0 0 1 1 1 0 0 0 XXX + DB #54 ; 0 1 0 1 0 1 0 0 X X X + DB #82 ; 1 0 0 0 0 0 1 0 X X + ENDIF ; <<< End of Unused ROM Routines >>> - + _mInfoBLOCK #2537-$,0 +;ллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллл; +;ллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллл; +;ллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллл; ; ================= ; KEY ACTION TABLES @@ -9944,64 +10018,64 @@ L252F: DEFB #00 ; 0 0 0 0 0 0 0 0 ; instead the first 16 keywords have been used. Additionally the entries for DELETE ; and ENTER should probably come in the first six entries for efficiency reasons.] -L2537: DEFB #15 ; Number of table entries. - DEFB #0B ; Key code: Cursor up. - DEFW L2A94 ; CURSOR-UP handler routine. - DEFB #0A ; Key code: Cursor Down. - DEFW L2AB5 ; CURSOR-DOWN handler routine. - DEFB #08 ; Key code: Cursor Left. - DEFW L2AD7 ; CURSOR-LEFT handler routine. - DEFB #09 ; Key code: Cursor Right. - DEFW L2AE3 ; CURSOR-RIGHT handler routine. - DEFB #AD ; Key code: Extend Mode + P. - DEFW L2A4F ; TEN-ROWS-UP handler routine. - DEFB #AC ; Key code: Symbol Shift + I. - DEFW L2A25 ; TEN-ROWS-DOWN handler routine. - DEFB #AF ; Key code: Extend Mode + I. - DEFW L29D4 ; WORD-LEFT handler routine. - DEFB #AE ; Key code: Extend Mode + Shift + J. - DEFW L29E1 ; WORD-RIGHT handler routine. - DEFB #A6 ; Key code: Extend Mode + N, or Graph + W. - DEFW L2983 ; TOP-OF-PROGRAM handler routine. - DEFB #A5 ; Key code: Extend Mode + T, or Graph + V. - DEFW L29AB ; END-OF-PROGRAM handler routine. - DEFB #A8 ; Key code: Extend Mode Symbol Shift + 2, or Graph Y. - DEFW L2A87 ; START-OF-LINE handler routine. - DEFB #A7 ; Key code: Extend Mode + M, or Graph + X. - DEFW L2A7A ; END-OF-LINE handler routine. - DEFB #AA ; Key code: Extend Mode + Shift + K. - DEFW L291B ; DELETE-RIGHT handler routine. - DEFB #0C ; Key code: Delete. - DEFW L292B ; DELETE handler routine. - DEFB #B3 ; Key code: Extend Mode + W. - DEFW L3017 ; DELETE-WORD-RIGHT handler routine. - DEFB #B4 ; Key code: Extend Mode + E. - DEFW L2FBC ; DELETE-WORD-LEFT handler routine. - DEFB #B0 ; Key code: Extend Mode + J. - DEFW L3072 ; DELETE-TO-END-OF-LINE handler routine. - DEFB #B1 ; Key code: Extend Mode + K. - DEFW L303E ; DELETE-TO-START-OF-LINE handler routine. - DEFB #0D ; Key code: Enter. - DEFW L2944 ; ENTER handler routine. - DEFB #A9 ; Key code: Extend Mode + Symbol Shift + 8, or Graph + Z. - DEFW L269B ; TOGGLE handler routine. - DEFB #07 ; Key code: Edit. - DEFW L2704 ; MENU handler routine. +L2537: DB #15 ; Number of table entries. + DB #0B ; Key code: Cursor up. + DW L2A94 ; CURSOR-UP handler routine. + DB #0A ; Key code: Cursor Down. + DW L2AB5 ; CURSOR-DOWN handler routine. + DB #08 ; Key code: Cursor Left. + DW L2AD7 ; CURSOR-LEFT handler routine. + DB #09 ; Key code: Cursor Right. + DW L2AE3 ; CURSOR-RIGHT handler routine. + DB #AD ; Key code: Extend Mode + P. + DW L2A4F ; TEN-ROWS-UP handler routine. + DB #AC ; Key code: Symbol Shift + I. + DW L2A25 ; TEN-ROWS-DOWN handler routine. + DB #AF ; Key code: Extend Mode + I. + DW L29D4 ; WORD-LEFT handler routine. + DB #AE ; Key code: Extend Mode + Shift + J. + DW L29E1 ; WORD-RIGHT handler routine. + DB #A6 ; Key code: Extend Mode + N, or Graph + W. + DW L2983 ; TOP-OF-PROGRAM handler routine. + DB #A5 ; Key code: Extend Mode + T, or Graph + V. + DW L29AB ; END-OF-PROGRAM handler routine. + DB #A8 ; Key code: Extend Mode Symbol Shift + 2, or Graph Y. + DW L2A87 ; START-OF-LINE handler routine. + DB #A7 ; Key code: Extend Mode + M, or Graph + X. + DW L2A7A ; END-OF-LINE handler routine. + DB #AA ; Key code: Extend Mode + Shift + K. + DW L291B ; DELETE-RIGHT handler routine. + DB #0C ; Key code: Delete. + DW L292B ; DELETE handler routine. + DB #B3 ; Key code: Extend Mode + W. + DW L3017 ; DELETE-WORD-RIGHT handler routine. + DB #B4 ; Key code: Extend Mode + E. + DW L2FBC ; DELETE-WORD-LEFT handler routine. + DB #B0 ; Key code: Extend Mode + J. + DW L3072 ; DELETE-TO-END-OF-LINE handler routine. + DB #B1 ; Key code: Extend Mode + K. + DW L303E ; DELETE-TO-START-OF-LINE handler routine. + DB #0D ; Key code: Enter. + DW L2944 ; ENTER handler routine. + DB #A9 ; Key code: Extend Mode + Symbol Shift + 8, or Graph + Z. + DW L269B ; TOGGLE handler routine. + DB #07 ; Key code: Edit. + DW L2704 ; MENU handler routine. ; ---------------------- ; Menu Keys Action Table ; ---------------------- ; Each menu key code maps to the appropriate handling routine. -L2577: DEFB #04 ; Number of entries. - DEFB #0B ; Key code: Cursor up. - DEFW L272E ; MENU-UP handler routine. - DEFB #0A ; Key code: Cursor down. - DEFW L2731 ; MENU-DOWN handler routine. - DEFB #07 ; Key code: Edit. - DEFW L2717 ; MENU-SELECT handler routine. - DEFB #0D ; Key code: Enter. - DEFW L2717 ; MENU-SELECT handler routine. +L2577: DB #04 ; Number of entries. + DB #0B ; Key code: Cursor up. + DW L272E ; MENU-UP handler routine. + DB #0A ; Key code: Cursor down. + DW L2731 ; MENU-DOWN handler routine. + DB #07 ; Key code: Edit. + DW L2717 ; MENU-SELECT handler routine. + DB #0D ; Key code: Enter. + DW L2717 ; MENU-SELECT handler routine. ; ====================== @@ -10039,13 +10113,14 @@ L259F: LD HL,TSTACK ; #5BFF. LD A,#02 ; Select main screen. RST #28 ; - DEFW CHAN_OPEN ; #1601. + DW CHAN_OPEN ; #1601. ;[v]..................................................................................................................... SP2000 [v] ;L25AD: LD HL,L2744 ; Jump table for Main Menu. L25AD: LD HL,M_COM ; Jump table for Main Menu. ;[^]..................................................................................................................... SP2000 [^] LD (#F6EA),HL ; Store current menu jump table address. - LD HL,L2754 ; The Main Menu text. + ;LD HL,L2754 ; The Main Menu text. + LD HL,M_TST ; The Main Menu text. LD (#F6EC),HL ; Store current menu text table address. PUSH HL ; Store address of menu on stack. @@ -10080,7 +10155,7 @@ L25CB: LD IX,#FD6C ; Point IX at editing settings information. LD A,#02 ; RST #28 ; - DEFW CHAN_OPEN ; #1601. Select main screen. + DW CHAN_OPEN ; #1601. Select main screen. CALL L3668 ; Reset 'L' mode. LD HL,#5C3B ; FLAGS. @@ -10152,9 +10227,9 @@ L262A: LD HL,(#EC08) ; Fetch line number of last edited line. L262D: CALL L1F20 ; Use Normal RAM Configuration (physical RAM bank 0). RST #28 ; Find address of line number held in HL, or the next line if it does not exist. - DEFW LINE_ADDR ; #196E. Return address in HL. + DW LINE_ADDR ; #196E. Return address in HL. RST #28 ; Find line number for specified address, and return in DE. - DEFW LINE_NO ; #1695. Fetch the line number for the line found. + DW LINE_NO ; #1695. Fetch the line number for the line found. CALL L1F45 ; Use Workspace RAM configuration (physical RAM bank 7). @@ -10338,7 +10413,7 @@ L26EC: PUSH IX ; LD HL,#0C80 ; Duration. L26F4: RST #28 ; - DEFW BEEPER ; #03B5. Produce a tone. + DW BEEPER ; #03B5. Produce a tone. POP IX ; RET ; @@ -10439,51 +10514,47 @@ L2742: SCF ; ; --------- ; Main Menu ; --------- +; _mInfoBLOCK #2754-$,0 ; Jump table for the main 128K menu, referenced at #25AD (ROM 0). -;!FIXIT ЂЎЇЌЎІ­Ў, чтЎ т ЁЋЈц  ­Ѕ ЈсЏЎЋьЇуЅтся уІЅ -L2744: DEFB #05 ; Number of entries. - DEFB #00 - ;DEFW L2831 ; Tape Loader option handler. - DEFW #2831 ; Tape Loader option handler. - DEFB #01 - DEFW L286C ; 128 BASIC option handler. - DEFB #02 - DEFW L2885 ; Calculator option handler. - DEFB #03 - DEFW L1B47 ; 48 BASIC option handler. - DEFB #04 - DEFW L2816 ; Tape Tester option handler. +; L2744: DB #05 ; Number of entries. +; DB #00 +; DW L2831 ; Tape Loader option handler. +; DB #01 +; DW L286C ; 128 BASIC option handler. +; DB #02 +; DW L2885 ; Calculator option handler. +; DB #03 +; DW L1B47 ; 48 BASIC option handler. +; DB #04 +; DW L2816 ; Tape Tester option handler. ;[v]..................................................................................................................... SP2000 [v] ; Text for the main 128K menu -; L2754: DEFB #06 ; Number of entries. -; DEFM "128 " ; Menu title. -; DEFB #FF -; L275E: DEFM "Tape Loade" -; DEFB 'r'+#80 -; L2769: DEFM "128 BASI" -; DEFB 'C'+#80 -; L2772: DEFM "Calculato" -; DEFB 'r'+#80 -; DEFM "48 BASI" -; DEFB 'C'+#80 -; L2784: DEFM "Tape Teste" -; DEFB 'r'+#80 +; L2754: DB #06 ; Number of entries. +; DB "128 " ; Menu title. +; DB #FF +; L275E: DC "Tape Loader" +; L2769: DC "128 BASIC" +; L2772: DC "Calculator" +; DC "48 BASIC" +; L2784: DC "Tape Tester" +; DB #A0 ; End marker. -; DEFB ' '+#80 ; #A0. End marker. - -; DC - every last character of a string will have bit 7 set ; Text for the main 128K menu -L2754: -M_TST: DB 7 ; Number of entries. - DB 'Sprinter',#FF ; Menu title. - DC 'TR-DOS' -BISD: DC 'Hardware' -B128: DC '128 BASIC' -BCALC: DC 'Calculator' - DC '48 BASIC' -BSERV: DC 'Options' - DC ' ' ; #20A0. End marker. +M_TST: DB 8 ; Number of entries. + DB 'Sprinter',#FF ; Menu title. + ; + DC 'TR-DOS' +B128: DC '128 BASIC' + DC '48 BASIC' +BCALC: DC 'Calculator' +BISD: DC 'Hardware' +BSERV: DC 'Options' +TapeLoaderTxt: DC "Tape Loader" + DB #A0 ; End marker. +; DC - every last character of a string will have bit 7 set + + _mInfoBLOCK #2790-$,0 ;[^]..................................................................................................................... SP2000 [^] ; --------- ; Edit Menu @@ -10491,35 +10562,29 @@ BSERV: DC 'Options' ; Jump table for the Edit menu -L2790: DEFB #05 ; Number of entries. - DEFB #00 - DEFW L2742 ; (Return to) 128 BASIC option handler. - DEFB #01 - DEFW L2851 ; Renumber option handler. - DEFB #02 - DEFW L2811 ; Screen option handler. - DEFB #03 - DEFW L2862 ; Print option handler. - DEFB #04 - DEFW L281C ; Exit option handler. +L2790: DB #05 ; Number of entries. + DB #00 + DW L2742 ; (Return to) 128 BASIC option handler. + DB #01 + DW L2851 ; Renumber option handler. + DB #02 + DW L2811 ; Screen option handler. + DB #03 + DW L2862 ; Print option handler. + DB #04 + DW L281C ; Exit option handler. ; Text for the Edit menu -L27A0: DEFB #06 ; Number of entries. - DEFM "Options " - DEFB #FF - DEFM "128 BASI" - DEFB 'C'+#80 - DEFM "Renumbe" - DEFB 'r'+#80 - DEFM "Scree" - DEFB 'n'+#80 - DEFM "Prin" - DEFB 't'+#80 - DEFM "Exi" - DEFB 't'+#80 - - DEFB ' '+#80 ; #A0. End marker. +L27A0: DB #06 ; Number of entries. + DB "Options " + DB #FF + DC "128 BASIC" + DC "Renumber" + DC "Screen" + DC "Print" + DC "Exit" + DB #A0 ; End marker. ; --------------- ; Calculator Menu @@ -10527,55 +10592,54 @@ L27A0: DEFB #06 ; Number of entries. ; Jump table for the Calculator menu -L27CB: DEFB #02 ; Number of entries. - DEFB #00 - DEFW L2742 ; (Return to) Calculator option handler. - DEFB #01 - DEFW L281C ; Exit option handler. +L27CB: DB #02 ; Number of entries. + DB #00 + DW L2742 ; (Return to) Calculator option handler. + DB #01 + DW L281C ; Exit option handler. ; Text for the Calculator menu -L27D2: DEFB 03 ; Number of entries. - DEFM "Options " - DEFB #FF - DEFM "Calculato" - DEFB 'r'+#80 - DEFM "Exi" - DEFB 't'+#80 - - DEFB ' '+#80 ; #A0. End marker. +L27D2: DB 03 ; Number of entries. + DB "Options " + DB #FF + DC "Calculator" + DC "Exit" + DB #A0 ; End marker. ; ---------------- ; Tape Loader Text ; ---------------- ;[v]..................................................................................................................... SP2000 [v] -;!TODO р ЇЎЁр ться -; L27EB: DEFB #16, #01, #00 ; AT 1,0; -; DEFB #10, #00 ; INK 0; -; DEFB #11, #07 ; PAPER 7; -; DEFB #13, #00 ; BRIGHT 1; -; DEFM "To cancel " +; L27EB: DB #16, #01, #00 ; AT 1,0; +; DB #10, #00 ; INK 0; +; DB #11, #07 ; PAPER 7; +; DB #13, #00 ; BRIGHT 1; +; DC "To cancel - press BREAK twice" L27EB: -M_COM: BYTE 6,0 - WORD TRDOS - BYTE 1 - WORD HARDWARE - BYTE 2 - WORD L286C - BYTE 3 - WORD L2885 - BYTE 4 - WORD L1B47 - BYTE 5 - WORD SERVICE +M_COM: BYTE (.Size - 1)/3 + BYTE 0 + WORD TRDOS + BYTE 1 + WORD L286C ; basic 128 + BYTE 2 + WORD L1B47 ; Basic 48 + BYTE 3 + WORD L2885 ; Calculator + BYTE 4 + WORD HARDWARE + BYTE 5 + WORD SERVICE ; Options + BYTE 6 + WORD LOAD_TAPE ; Tape loader + ; +.Size EQU $-M_COM -;!FIXIT ­Ѕ­уІ­ыЉ хЂЎст - DEFM "- press BREAK twic" - DEFB 'e'+#80 + + _mInfoBLOCK #2811-$,0 ;[^]..................................................................................................................... SP2000 [^] ; - _mInfoBLOCK #2811-$,0 ; ===================== ; Menu Handler Routines ; ===================== @@ -10641,35 +10705,35 @@ L2831: ED_COM: BYTE 10 ; Number of entries. ; BYTE #0B ; Key code: Cursor up. - DEFW L272E ; MENU-UP handler routine. + DW L272E ; MENU-UP handler routine. ; BYTE #0A ; Key code: Cursor down - DEFW L2731 ; MENU-DOWN handler routine. + DW L2731 ; MENU-DOWN handler routine. ; BYTE #0D ; Key code: Enter. - DEFW L2717 ; MENU-SELECT handler routine. + DW L2717 ; MENU-SELECT handler routine. ; BYTE '8' ; ­  сЈ­ЊЋЅр-ЄІЎЉстЈЊЅ Ђ­ЈЇ - DEFW L2731 ; MENU-DOWN handler routine. + DW L2731 ; MENU-DOWN handler routine. ; BYTE '9' ; ­  сЈ­ЊЋЅр-ЄІЎЉстЈЊЅ ЂЂЅрх - DEFW L272E ; MENU-UP handler routine. + DW L272E ; MENU-UP handler routine. ; ; BYTE '0' ; ­  сЈ­ЊЋЅр-ЄІЎЉстЈЊЅ enter - DEFW L2717 ; MENU-SELECT handler routine. + DW L2717 ; MENU-SELECT handler routine. ; BYTE '6' ; ­  сЈ­ЊЋЅр-ЄІЎЉстЈЊЅ ЂЋЅЂЎ Page Up - DEFW LEFT_E ; MENU-PageUp + DW LEFT_E ; MENU-PageUp ; BYTE #08 ; Key code: Cursor left - DEFW LEFT ; MENU-PageUp + DW LEFT ; MENU-PageUp ; BYTE '7' ; [x] ЁыЋЎ 7 - DEFW RIGHT_E ; MENU-PageDown + DW RIGHT_E ; MENU-PageDown ; BYTE #09 ; Key code: Cursor right - DEFW RIGHT ; MENU-PageDown + DW RIGHT ; MENU-PageDown ; DB #1A ; ЏрЎстЎ стЅрЅть эту стрЎчЊу, ­Ѕ ­уІ­  ;[^]..................................................................................................................... SP2000 [^] @@ -10695,7 +10759,6 @@ L2851: CALL L3888 ; Run the renumber routine. L2862: CALL L1B14 ; Perform an LLIST. ;Edit Menu - Renumber option joins here - L2865: LD HL,#EC0D ; Editor flags. BIT 6,(HL) ; Using lower editing screen? JR NZ,L2874 ; Jump ahead if so. @@ -10705,7 +10768,6 @@ L286C: LD HL,#5C3C ; TVFLAG. CALL L3848 ; Clear screen and print the "128 BASIC" banner line. ;Edit Menu - Screen option joins here - L2874: LD HL,#EC0D ; Editor flags. RES 5,(HL) ; Signal not to process the BASIC line. RES 4,(HL) ; Signal return to main menu. @@ -10780,13 +10842,13 @@ L28C7: LD B,#00 ; Top row of editing area. ; Main screen editing cursor settings. ; Gets copied to #F6EE. -L28D1: DEFB #06 ; Number of bytes in table. - DEFB #00 ; #F6EE = Cursor position - row 0. - DEFB #00 ; #F6EF = Cursor position - column 0. - DEFB #00 ; #F6F0 = Cursor position - column 0 preferred. - DEFB #04 ; #F6F1 = Top row before scrolling up. - DEFB #10 ; #F6F2 = Bottom row before scrolling down. - DEFB #14 ; #F6F3 = Number of rows in the editing area. +L28D1: DB #06 ; Number of bytes in table. + DB #00 ; #F6EE = Cursor position - row 0. + DB #00 ; #F6EF = Cursor position - column 0. + DB #00 ; #F6F0 = Cursor position - column 0 preferred. + DB #04 ; #F6F1 = Top row before scrolling up. + DB #10 ; #F6F2 = Bottom row before scrolling down. + DB #14 ; #F6F3 = Number of rows in the editing area. ; --------------------------------- ; Lower Screen Good Cursor Settings @@ -10794,13 +10856,13 @@ L28D1: DEFB #06 ; Number of bytes in table. ; Lower screen editing cursor settings. ; Gets copied to #F6EE. -L28D8: DEFB #06 ; Number of bytes in table. - DEFB #00 ; #F6EE = Cursor position - row 0. - DEFB #00 ; #F6EF = Cursor position - column 0. - DEFB #00 ; #F6F0 = Cursor position - column 0 preferred. - DEFB #00 ; #F6F1 = Top row before scrolling up. - DEFB #01 ; #F6F2 = Bottom row before scrolling down. - DEFB #01 ; #F6F3 = Number of rows in the editing area. +L28D8: DB #06 ; Number of bytes in table. + DB #00 ; #F6EE = Cursor position - row 0. + DB #00 ; #F6EF = Cursor position - column 0. + DB #00 ; #F6F0 = Cursor position - column 0 preferred. + DB #00 ; #F6F1 = Top row before scrolling up. + DB #01 ; #F6F2 = Bottom row before scrolling down. + DB #01 ; #F6F3 = Number of rows in the editing area. ; ---------------------------------------- ; Initialise Lower Screen Editing Settings @@ -10991,9 +11053,9 @@ L2983: LD A,(#EC0E) ; Fetch mode. CALL L1F20 ; Use Normal RAM Configuration (physical RAM bank 0). RST #28 ; Find address of line number 0, or the next line if it does not exist. - DEFW LINE_ADDR ; #196E. Return address in HL. + DW LINE_ADDR ; #196E. Return address in HL. RST #28 ; Find line number for specified address, and return in DE. - DEFW LINE_NO ; #1695. DE=Address of first line in the BASIC program. + DW LINE_NO ; #1695. DE=Address of first line in the BASIC program. CALL L1F45 ; Use Workspace RAM configuration (physical RAM bank 7). @@ -11030,12 +11092,12 @@ L29AB: LD A,(#EC0E) ; Fetch mode. CALL L1F20 ; Use Normal RAM Configuration (physical RAM bank 0). RST #28 ; Find address of line number 9999, or the previous line if it does not exist. - DEFW LINE_ADDR ; #196E. Return address in HL. + DW LINE_ADDR ; #196E. Return address in HL. EX DE,HL ; DE=Address of last line number. RST #28 ; Find line number for specified address, and return in DE. - DEFW LINE_NO ; #1695. DE=Address of last line in the BASIC program. + DW LINE_NO ; #1695. DE=Address of last line in the BASIC program. CALL L1F45 ; Use Workspace RAM configuration (physical RAM bank 7). @@ -12196,13 +12258,13 @@ L2D79: LD (HL),C ; Save the next character position row to examine. ; ------------------------------- ; Jump to one of three handling routines when fetching the next character from the BASIC line to insert. -L2D85: DEFB #03 ; Number of table entries. - DEFB #02 ; On first row of the BASIC line. - DEFW L2DAC ; - DEFB #04 ; Using lower screen and only first row of the BASIC line visible. - DEFW L2DE9 ; - DEFB #01 ; First row of the BASIC line off top of screen. - DEFW L2D8F ; +L2D85: DB #03 ; Number of table entries. + DB #02 ; On first row of the BASIC line. + DW L2DAC ; + DB #04 ; Using lower screen and only first row of the BASIC line visible. + DW L2DE9 ; + DB #01 ; First row of the BASIC line off top of screen. + DW L2D8F ; ; ------------------------------------------------------------------------------------- ; Fetch Character from the Current Row of the BASIC Line in the Screen Line Edit Buffer @@ -12375,16 +12437,16 @@ L2E0E: LD A,#1F ; Column 31. ; ----------------------- ; Copied to #EC15-#EC16. -L2E1B: DEFB #01 ; Number of bytes to copy. - DEFB #14 ; Number of editing rows (20 for upper screen). +L2E1B: DB #01 ; Number of bytes to copy. + DB #14 ; Number of editing rows (20 for upper screen). ; ----------------------- ; Lower Screen Rows Table ; ----------------------- ; Copied to #EC15-#EC16. -L2E1D: DEFB #01 ; Number of bytes to copy. - DEFB #01 ; Number of editing rows (1 for lower screen). +L2E1D: DB #01 ; Number of bytes to copy. + DB #01 ; Number of editing rows (1 for lower screen). ; -------------------- ; Reset to Main Screen @@ -12500,8 +12562,7 @@ L2E78: INC B ; Advance to the column after the editable position. ; B =Column number. ; Exit : A =Character at specified column. ; -; [Not used by the ROM] - +;!FIXIT [Not used by the ROM] L2E7B: LD H,#00 ; LD L,B ; HL=Column number. ADD HL,DE ; HL=Address in edit buffer of the specified column. @@ -12645,40 +12706,40 @@ L2EEC: POP DE ; Restore registers. ; Empty Edit Buffer Row Data ; -------------------------- -L2EEF: DEFB #00 ; 32 null column markers, i.e. none of the columns are editable. - DEFB #00 - DEFB #00 - DEFB #00 - DEFB #00 - DEFB #00 - DEFB #00 - DEFB #00 - DEFB #00 - DEFB #00 - DEFB #00 - DEFB #00 - DEFB #00 - DEFB #00 - DEFB #00 - DEFB #00 - DEFB #00 - DEFB #00 - DEFB #00 - DEFB #00 - DEFB #00 - DEFB #00 - DEFB #00 - DEFB #00 - DEFB #00 - DEFB #00 - DEFB #00 - DEFB #00 - DEFB #00 - DEFB #00 - DEFB #00 - DEFB #00 +L2EEF: DB #00 ; 32 null column markers, i.e. none of the columns are editable. + DB #00 + DB #00 + DB #00 + DB #00 + DB #00 + DB #00 + DB #00 + DB #00 + DB #00 + DB #00 + DB #00 + DB #00 + DB #00 + DB #00 + DB #00 + DB #00 + DB #00 + DB #00 + DB #00 + DB #00 + DB #00 + DB #00 + DB #00 + DB #00 + DB #00 + DB #00 + DB #00 + DB #00 + DB #00 + DB #00 + DB #00 - DEFB #09 ; Flags: + DB #09 ; Flags: ; Bit 0: 1=The first row of the BASIC line. ; Bit 1: 0=Does not span onto another row. ; Bit 2: 0=Not used (always 0). @@ -12687,7 +12748,7 @@ L2EEF: DEFB #00 ; 32 null column markers, i.e. none of the columns are ; Bit 5: 0=Not used (always 0). ; Bit 6: 0=Not used (always 0). ; Bit 7: 0=Not used (always 0). - DEFW #0000 ; There is no BASIC line number associated with this edit row. + DW #0000 ; There is no BASIC line number associated with this edit row. ; ------------------------------------------------------------------- ; Delete a Character from a BASIC Line in the Screen Line Edit Buffer @@ -13208,9 +13269,7 @@ L30C3: EX DE,HL ; Transfer address to DE. ; Entry: B=Column number. ; C=Row number. ; Exit : HL=Address of specified position. - -; [Not used by the ROM] - +;!FIXIT [Not used by the ROM] L30C6: PUSH DE ; CALL L30B4 ; DE=Start address in Screen Line Edit Buffer of the row specified in C. LD H,#00 ; @@ -13228,10 +13287,10 @@ L30C6: PUSH DE ; ; is never used. Therefore the table need only be 1 byte long, in which case it would be more efficient for the routine at #30D6 (ROM 0) to simply set the byte ; at #F6F5 directly. -L30D0: DEFB #05 ; Number of bytes in table. - DEFB #00 ; #F6F5 = Number of rows held in the Below-Screen Line Edit Buffer. - DEFW #0000 ; #F6F6/7. [*BUG* - These two bytes should not be here and the table should only contain 3 bytes. Credit: Paul Farrow] - DEFW #F6F8 ; #F6F8/9 = Points to next location within the Below-Screen Line Edit Buffer. +L30D0: DB #05 ; Number of bytes in table. + DB #00 ; #F6F5 = Number of rows held in the Below-Screen Line Edit Buffer. + DW #0000 ; #F6F6/7. [*BUG* - These two bytes should not be here and the table should only contain 3 bytes. Credit: Paul Farrow] + DW #F6F8 ; #F6F8/9 = Points to next location within the Below-Screen Line Edit Buffer. ; ------------------------------------------ ; Set Below-Screen Line Edit Buffer Settings @@ -13586,9 +13645,9 @@ L321B: POP DE ; Restore registers. ; is never used. Therefore the table need only be 1 byte long, in which case it would be more efficient for the routine at #3222 (ROM 0) to simply ; set the byte at #F9DB directly. -L321E: DEFB #03 ; Number of bytes in table. - DEFB #00 ; #F9DB = Number of rows held in the Above-Screen Line Edit Buffer. - DEFW #F9DE ; #F9DC/D = Points to next available location within the Above-Screen Line Edit Buffer. +L321E: DB #03 ; Number of bytes in table. + DB #00 ; #F9DB = Number of rows held in the Above-Screen Line Edit Buffer. + DW #F9DE ; #F9DC/D = Points to next available location within the Above-Screen Line Edit Buffer. ; ------------------------------------------ ; Set Above-Screen Line Edit Buffer Settings @@ -13786,23 +13845,23 @@ L32B7: LD HL,#F9DE ; Point to the start of the Above-Screen Line Edit Buf ; BASIC Line Character Action Handler Jump Table ; ---------------------------------------------- -L32BD: DEFB #08 ; Number of table entries. - DEFB #0D ; Code: Enter. - DEFW L35CC ; Address of the 'Enter' action handler routine. - DEFB #01 ; Code: NULL. - DEFW L35DA ; Null remaining columns of an edit buffer row. - DEFB #12 ; Code: FLASH. - DEFW L335A ; Fetch next de-tokenized character from the BASIC line within the program area. - DEFB #13 ; Code: BRIGHT. - DEFW L335A ; Fetch next de-tokenized character from the BASIC line within the program area. - DEFB #14 ; Code: INVERSE. - DEFW L335A ; Fetch next de-tokenized character from the BASIC line within the program area. - DEFB #15 ; Code: OVER. - DEFW L335A ; Fetch next de-tokenized character from the BASIC line within the program area. - DEFB #10 ; Code: INK. - DEFW L335A ; Fetch next de-tokenized character from the BASIC line within the program area. - DEFB #11 ; Code: PAPER. - DEFW L335A ; Fetch next de-tokenized character from the BASIC line within the program area. +L32BD: DB #08 ; Number of table entries. + DB #0D ; Code: Enter. + DW L35CC ; Address of the 'Enter' action handler routine. + DB #01 ; Code: NULL. + DW L35DA ; Null remaining columns of an edit buffer row. + DB #12 ; Code: FLASH. + DW L335A ; Fetch next de-tokenized character from the BASIC line within the program area. + DB #13 ; Code: BRIGHT. + DW L335A ; Fetch next de-tokenized character from the BASIC line within the program area. + DB #14 ; Code: INVERSE. + DW L335A ; Fetch next de-tokenized character from the BASIC line within the program area. + DB #15 ; Code: OVER. + DW L335A ; Fetch next de-tokenized character from the BASIC line within the program area. + DB #10 ; Code: INK. + DW L335A ; Fetch next de-tokenized character from the BASIC line within the program area. + DB #11 ; Code: PAPER. + DW L335A ; Fetch next de-tokenized character from the BASIC line within the program area. ; ------------------------------------------------------------------------ ; Copy a BASIC Line into the Above-Screen or Below-Screen Line Edit Buffer @@ -13991,15 +14050,15 @@ L335A: CALL L3517 ; Fetch the next de-tokenized character from the BASIC ; Copies Insert Keyword Representation Into Keyword Construction Buffer routine into physical RAM bank 7, and resets pointers to indicate ; that there is no BASIC line currently being de-tokenized. -L335F: LD HL,#0000 ; Signal no line number of command. - LD (#FC9F),HL ; Signal no further character to fetch from the BASIC line within the program area. - LD (#FCA1),HL ; Signal no further character to fetch from the Keyword Construction Buffer. +L335F: LD HL,#0000 ; Signal no line number of command. + LD (#FC9F),HL ; Signal no further character to fetch from the BASIC line within the program area. + LD (#FCA1),HL ; Signal no further character to fetch from the Keyword Construction Buffer. - LD HL,L3374 ; Source for Insert Keyword Representation Into Keyword Construction Buffer routine. - LD DE,#FCAE ; Destination for Insert Keyword Representation Into Keyword Construction Buffer routine. - LD BC,#00BC ; - LDIR ; Copy the routine to RAM bank 7 at address #FCAE. - RET ; + LD HL,RAM_Routines ; Source for Insert Keyword Representation Into Keyword Construction Buffer routine. + LD DE,#FCAE ; Destination for Insert Keyword Representation Into Keyword Construction Buffer routine. + LD BC,RAM_Routines.Size + LDIR ; Copy the routine to RAM bank 7 at address #FCAE. + RET ; ; ---------------------------------------------------------------------------------- ; Insert Keyword Representation into Keyword Construction Buffer <<< RAM Routine >>> @@ -14016,7 +14075,7 @@ L335F: LD HL,#0000 ; Signal no line number of command. ; DE=Insertion address within Keyword Construction Buffer. ; ; Copied to physical RAM bank 7 at #FCAE-#FCFC by subroutine at #335F (ROM 0). - +RAM_Routines: L3374: DI ; Disable interrupts whilst paging. LD BC,#7FFD ; @@ -14143,7 +14202,6 @@ L33D9: LD A,(HL) ; Fetch a character of the keyword. ; A=Character code. ; ; Copied to RAM at #FD2E-#FD69 by routine at #335F (ROM 0). - L33F4: DI ; Disable interrupts whilst paging. LD BC,#7FFD ; LD D,#17 ; Select ROM 1, SCREEN 0, RAM bank 7. @@ -14202,7 +14260,7 @@ L3426: LD A,B ; Fetch the character code of the matching token (#00 OUT (C),D ; EI ; Re-enable interrupts. RET ; <<< Last byte copied to RAM >>> - +RAM_Routines.Size EQU $-RAM_Routines ; --------------------------------------------------------------------- ; Create Next Line Number Representation in Keyword Construction Buffer ; --------------------------------------------------------------------- @@ -14635,29 +14693,29 @@ L3591: SCF ; ; The following strings are terminated by having bit 7 set, referenced at #356D (ROM 0) and #3F87 (ROM 0). ; The table consists of the new 128K mode keywords and mis-spelled keywords. -L3594: DEFM "SPECTRU" - DEFB 'M'+#80 -L359C: DEFM "PLA" - DEFB 'Y'+#80 - DEFM "GOT" - DEFB 'O'+#80 - DEFM "GOSU" - DEFB 'B'+#80 - DEFM "DEFF" - DEFB 'N'+#80 - DEFM "OPEN" - DEFB '#'+#80 - DEFM "CLOSE" - DEFB '#'+#80 +L3594: DB "SPECTRU" + DB 'M'+#80 +L359C: DB "PLA" + DB 'Y'+#80 + DB "GOT" + DB 'O'+#80 + DB "GOSU" + DB 'B'+#80 + DB "DEFF" + DB 'N'+#80 + DB "OPEN" + DB '#'+#80 + DB "CLOSE" + DB '#'+#80 ; -------------------- ; Indentation Settings ; -------------------- ; Copied to #FD6A-#FD6B. -L35B9: DEFB #02 ; Number of bytes in table. - DEFB #01 ; Flag never subsequently used. Possibly intended to indicate the start of a new BASIC line and hence whether indentation required. - DEFB #05 ; Number of characters to indent by. +L35B9: DB #02 ; Number of bytes in table. + DB #01 ; Flag never subsequently used. Possibly intended to indicate the start of a new BASIC line and hence whether indentation required. + DB #05 ; Number of characters to indent by. ; ------------------------ ; Set Indentation Settings @@ -14945,7 +15003,7 @@ L36A2: POP HL ; Restore contents of HL. RET ; L36A4: RST #28 ; - DEFW KEY_M_CL ; #10DB. Handle CAPS LOCK code and 'mode' codes via ROM 1. + DW KEY_M_CL ; #10DB. Handle CAPS LOCK code and 'mode' codes via ROM 1. RET ; @@ -15061,7 +15119,7 @@ L3719: PUSH AF ; Save registers. LD B,H ; Coordinates to BC. LD C,L ; RST #28 ; - DEFW PLOT_SUB+4 ; #22E9. Plot pixel + DW PLOT_SUB+4 ; #22E9. Plot pixel POP BC ; Restore registers. POP DE ; @@ -15152,7 +15210,7 @@ L3769: PUSH BC ; B holds number of row to store. PUSH DE ; DE=End of destination address. RST #28 ; - DEFW CL_ADDR ; #0E9B. HL=Display file address of row B. + DW CL_ADDR ; #0E9B. HL=Display file address of row B. LD BC,#0007 ; Menu always starts at column 7. ADD HL,BC ; HL=Address of attribute byte at column 7. POP DE ; @@ -15207,7 +15265,7 @@ L378E: EX AF,AF' ; Save copy direction flag. PUSH BC ; B=0. C=Number of columns. PUSH DE ; DE=Destination address. RST #28 ; - DEFW CL_ATTR ; #0E88. HL=Address of attribute byte. + DW CL_ATTR ; #0E88. HL=Address of attribute byte. EX DE,HL ; DE=Address of attribute byte. POP DE ; POP BC ; @@ -15306,46 +15364,46 @@ L37E3: LD (HL),A ; Set the attributes for all columns. ; Menu Title Colours Table ; ------------------------ -L37EC: DEFB #16, #07, #07 ; AT 7,7; - DEFB #15, #00 ; OVER 0; - DEFB #14, #00 ; INVERSE 0; - DEFB #10, #07 ; INK 7; - DEFB #11, 00 ; PAPER 0; - DEFB #13, #01 ; BRIGHT 1; - DEFB #FF ; +L37EC: DB #16, #07, #07 ; AT 7,7; + DB #15, #00 ; OVER 0; + DB #14, #00 ; INVERSE 0; + DB #10, #07 ; INK 7; + DB #11, 00 ; PAPER 0; + DB #13, #01 ; BRIGHT 1; + DB #FF ; ; ---------------------- ; Menu Title Space Table ; ---------------------- -L37FA: DEFB #11, #00 ; PAPER 0; - DEFB ' ' ; - DEFB #11, #07 ; PAPER 7; - DEFB #10, #00 ; INK 0; - DEFB #FF ; +L37FA: DB #11, #00 ; PAPER 0; + DB ' ' ; + DB #11, #07 ; PAPER 7; + DB #10, #00 ; INK 0; + DB #FF ; ; ----------------------------- ; Menu Sinclair Stripes Bitmaps ; ----------------------------- ; Bit-patterns for the Sinclair stripes used on the menus. -L3802: DEFB #01 ; 0 0 0 0 0 0 0 1 X - DEFB #03 ; 0 0 0 0 0 0 1 1 XX - DEFB #07 ; 0 0 0 0 0 1 1 1 XXX - DEFB #0F ; 0 0 0 0 1 1 1 1 XXXX - DEFB #1F ; 0 0 0 1 1 1 1 1 XXXXX - DEFB #3F ; 0 0 1 1 1 1 1 1 XXXXXX - DEFB #7F ; 0 1 1 1 1 1 1 1 XXXXXXX - DEFB #FF ; 1 1 1 1 1 1 1 1 XXXXXXXX +L3802: DB #01 ; 0 0 0 0 0 0 0 1 X + DB #03 ; 0 0 0 0 0 0 1 1 XX + DB #07 ; 0 0 0 0 0 1 1 1 XXX + DB #0F ; 0 0 0 0 1 1 1 1 XXXX + DB #1F ; 0 0 0 1 1 1 1 1 XXXXX + DB #3F ; 0 0 1 1 1 1 1 1 XXXXXX + DB #7F ; 0 1 1 1 1 1 1 1 XXXXXXX + DB #FF ; 1 1 1 1 1 1 1 1 XXXXXXXX - DEFB #FE ; 1 1 1 1 1 1 1 0 XXXXXXX - DEFB #FC ; 1 1 1 1 1 1 0 0 XXXXXX - DEFB #F8 ; 1 1 1 1 1 0 0 0 XXXXX - DEFB #F0 ; 1 1 1 1 0 0 0 0 XXXX - DEFB #E0 ; 1 1 1 0 0 0 0 0 XXX - DEFB #C0 ; 1 1 0 0 0 0 0 0 XX - DEFB #80 ; 1 0 0 0 0 0 0 0 X - DEFB #00 ; 0 0 0 0 0 0 0 0 + DB #FE ; 1 1 1 1 1 1 1 0 XXXXXXX + DB #FC ; 1 1 1 1 1 1 0 0 XXXXXX + DB #F8 ; 1 1 1 1 1 0 0 0 XXXXX + DB #F0 ; 1 1 1 1 0 0 0 0 XXXX + DB #E0 ; 1 1 1 0 0 0 0 0 XXX + DB #C0 ; 1 1 0 0 0 0 0 0 XX + DB #80 ; 1 0 0 0 0 0 0 0 X + DB #00 ; 0 0 0 0 0 0 0 0 ; --------------------- ; Sinclair Strip 'Text' @@ -15353,12 +15411,12 @@ L3802: DEFB #01 ; 0 0 0 0 0 0 0 1 X ; CHARS points to RAM at #5A98, and characters ' ' and '!' redefined ; as the Sinclair strips using the bit patterns above. -L3812: DEFB #10, #02, ' ' ; INK 2; - DEFB #11, #06, '!' ; PAPER 6; - DEFB #10, #04, ' ' ; INK 4; - DEFB #11, #05, '!' ; PAPER 5; - DEFB #10, #00, ' ' ; INK 0; - DEFB #FF ; +L3812: DB #10, #02, ' ' ; INK 2; + DB #11, #06, '!' ; PAPER 6; + DB #10, #04, ' ' ; INK 4; + DB #11, #05, '!' ; PAPER 5; + DB #10, #00, ' ' ; INK 0; + DB #FF ; ; -------------------------------------- ; Print the Sinclair stripes on the menu @@ -15477,7 +15535,7 @@ L3888: CALL L1F20 ; Use Normal RAM Configuration (physical RAM bank 0). LD HL,(RNSTEP) ; #5B96. Fetch the line number increment for Renumber. RST #28 ; - DEFW HL_MULT_DE ; #30A9. HL=HL*DE in ROM 1. HL=Number of lines * Line increment = New last line number. + DW HL_MULT_DE ; #30A9. HL=HL*DE in ROM 1. HL=Number of lines * Line increment = New last line number. ; [*BUG* - If there are more than 6553 lines then an arithmetic overflow will occur and hence ; the test below to check if line 9999 would be exceeded will fail. The carry flag will be set ; upon such an overflow and simply needs to be tested. The bug can be resolved by following the @@ -15496,7 +15554,7 @@ L3888: CALL L1F20 ; Use Normal RAM Configuration (physical RAM bank 0). LD HL,(#5C53) ; PROG. HL=Address of first BASIC line. L38AA: RST #28 ; Find the address of the next BASIC line from the - DEFW NEXT_ONE ; #19B8. location pointed to by HL, returning it in DE. + DW NEXT_ONE ; #19B8. location pointed to by HL, returning it in DE. INC HL ; Advance past the line number bytes to point INC HL ; at the line length bytes. @@ -15508,7 +15566,7 @@ L38AA: RST #28 ; Find the address of the next BASIC line from the L38B8: LD A,(HL) ; Get a character from the BASIC line. RST #28 ; Advance past a floating point number, if present. - DEFW NUMBER ; #18B6. + DW NUMBER ; #18B6. CP #0D ; Is the character an 'ENTER'? JR Z,L38C5 ; Jump if so to examine the next line. @@ -15539,7 +15597,7 @@ L38DD: PUSH BC ; BC=Count of number of lines left to update. LD HL,(RNSTEP) ; #5B96. HL=Renumber line increment. RST #28 ; Calculate new line number offset, i.e. Line increment * Line index. - DEFW HL_MULT_DE ; #30A9. HL=HL*DE in ROM 1. + DW HL_MULT_DE ; #30A9. HL=HL*DE in ROM 1. LD DE,(RNFIRST) ; #5B94. The initial line number when renumbering. ADD HL,DE ; HL=The new line number for the current line. EX DE,HL ; DE=The new line number for the current line. @@ -15577,13 +15635,13 @@ L38DD: PUSH BC ; BC=Count of number of lines left to update. ; A list of all tokens that maybe followed by a line number and hence ; require consideration. -L3907: DEFB #CA ; 'LINE'. - DEFB #F0 ; 'LIST'. - DEFB #E1 ; 'LLIST'. - DEFB #EC ; 'GO TO'. - DEFB #ED ; 'GO SUB'. - DEFB #E5 ; 'RESTORE'. - DEFB #F7 ; 'RUN'. +L3907: DB #CA ; 'LINE'. + DB #F0 ; 'LIST'. + DB #E1 ; 'LLIST'. + DB #EC ; 'GO TO'. + DB #ED ; 'GO SUB'. + DB #E5 ; 'RESTORE'. + DB #F7 ; 'RUN'. ; ----------------------------------------------- ; Parse a Line Renumbering Line Number References @@ -15619,7 +15677,7 @@ L391F: LD A,(HL) ; Fetch the next character. JR Z,L393F ; Jump ahead if so to parse the next character. RST #28 ; - DEFW NUMERIC ; #2D1B. Is the character a numeric digit? + DW NUMERIC ; #2D1B. Is the character a numeric digit? JR NC,L393F ; Jump if a numeric digit to parse the next character. CP '.' ; #2E. Is it a decimal point? @@ -15652,7 +15710,7 @@ L3943: LD (HD_00),BC ; #5B71. Note the number of digits in the old line num PUSH HL ; Save the address of the current character. RST #28 ; - DEFW NUMBER ; #18B6. Advance past internal floating point representation, if present. + DW NUMBER ; #18B6. Advance past internal floating point representation, if present. CALL L3A36 ; Skip over any spaces. @@ -15669,9 +15727,9 @@ L3943: LD (HD_00),BC ; #5B71. Note the number of digits in the old line num L3957: INC HL ; Point to the next character. RST #28 ; - DEFW STACK_NUM ; #33B4. Move floating point number to the calculator stack. + DW STACK_NUM ; #33B4. Move floating point number to the calculator stack. RST #28 ; - DEFW FP_TO_BC ; #2DA2. Fetch the number line to BC. [*BUG* - This should test the carry flag to check whether + DW FP_TO_BC ; #2DA2. Fetch the number line to BC. [*BUG* - This should test the carry flag to check whether ; the number was too large to be transferred to BC. If so then the line number should be set to 9999, ; as per the instructions at #396A (ROM 0). As a result, the call the LINE_ADDR below can result in a crash. ; The bug can be resolved using a JR C,#396A (ROM 0) instruction. Credit: Ian Collier (+3), Andrew Owen (128)] @@ -15679,7 +15737,7 @@ L3957: INC HL ; Point to the next character. LD L,C ; Transfer the number line to HL. RST #28 ; Find the address of the line number specified by HL. - DEFW LINE_ADDR ; #196E. HL=Address of the BASIC line, or the next one if it does not exist. + DW LINE_ADDR ; #196E. HL=Address of the BASIC line, or the next one if it does not exist. JR Z,L396F ; Jump if the line exists. LD A,(HL) ; Has the end of the BASIC program been reached? @@ -15698,7 +15756,7 @@ L396F: LD (HD_0F+1),HL ; #5B77. Store the address of the referenced line. CALL L3A0B ; DE=Count of the number of BASIC lines up to the referenced line. LD HL,(RNSTEP) ; #5B96. Fetch the line number increment. RST #28 ; - DEFW HL_MULT_DE ; #30A9. HL=HL*DE in ROM 1. HL=Number of lines * Line increment = New referenced line number. + DW HL_MULT_DE ; #30A9. HL=HL*DE in ROM 1. HL=Number of lines * Line increment = New referenced line number. ; [An overflow could occur here and would not be detected. The code at #3898 (ROM 0) ; should have trapped that such an overflow would occur and hence there would have been ; no possibility of it occurring here.] @@ -15752,7 +15810,7 @@ L3980: LD DE,HD_0B+1 ; #5B73. Temporary buffer to generate ASCII representa POP DE ; DE=Number of non-'0' characters in the line number string. POP HL ; HL=Start address of line number reference. RST #28 ; - DEFW MAKE_ROOM ; #1655. Create the space for the extra line number digits. + DW MAKE_ROOM ; #1655. Create the space for the extra line number digits. JR L39CF ; Jump ahead to update the number digits. ;No room available to insert extra line number digits @@ -15778,7 +15836,7 @@ L39C5: DEC BC ; BC=Number of digits in the old line number reference LD HL,(HD_11+1) ; #5B79. Fetch the start address of the old line number representation within the BASIC line. RST #28 ; - DEFW RECLAIM_2 ; #19E8. Discard the redundant bytes. + DW RECLAIM_2 ; #19E8. Discard the redundant bytes. ;The appropriate amount of space now exists in the BASIC line so update the line number value @@ -15795,7 +15853,7 @@ L39CF: LD DE,(HD_11+1) ; #5B79. Fetch the start address of the old line numbe PUSH HL ; RST #28 ; - DEFW STACK_BC ; #2D2B. Put the line number on the calculator stack, returning HL pointing to it. + DW STACK_BC ; #2D2B. Put the line number on the calculator stack, returning HL pointing to it. ; [*BUG* - This stacks the new line number so that the floating point representation can be copied. ; However, the number is not actually removed from the calculator stack. Therefore the ; amount of free memory reduces by 5 bytes as each line with a line number reference is renumbered. @@ -15853,7 +15911,7 @@ L3A0B: LD HL,(#5C53) ; PROG. Fetch the start of the BASIC program L3A1D: PUSH BC ; Save the line number count. RST #28 ; Find the address of the next BASIC line from the - DEFW NEXT_ONE ; #19B8. location pointed to by HL, returning it in DE. + DW NEXT_ONE ; #19B8. location pointed to by HL, returning it in DE. LD HL,(HD_0F+1) ; #5B77. Fetch the start of the variables area, AND A ; i.e. end of the BASIC program. @@ -15960,30 +16018,30 @@ L3A61: ADD HL,BC ; Add the negative value. ; ------------------------------------ ; Copied to #FD6C-#FD73. -L3A6D: DEFB #08 ; Number of bytes in table. - DEFB #00 ; #FD6C. [Setting never used] - DEFB #00 ; #FD6D = Rows above the editing area. - DEFB #14 ; #FD6E. [Setting never used] - DEFB #00 ; #FD6F. [Setting never used] - DEFB #00 ; #FD70. [Setting never used] - DEFB #00 ; #FD71. [Setting never used] - DEFB #0F ; #FD72 = Cursor attribute colour (blue paper, white ink). - DEFB #00 ; #FD73 = Stored cursor position screen attribute colour (None = black paper, black ink). +L3A6D: DB #08 ; Number of bytes in table. + DB #00 ; #FD6C. [Setting never used] + DB #00 ; #FD6D = Rows above the editing area. + DB #14 ; #FD6E. [Setting never used] + DB #00 ; #FD6F. [Setting never used] + DB #00 ; #FD70. [Setting never used] + DB #00 ; #FD71. [Setting never used] + DB #0F ; #FD72 = Cursor attribute colour (blue paper, white ink). + DB #00 ; #FD73 = Stored cursor position screen attribute colour (None = black paper, black ink). ; ----------------------------------- ; Initial Main Screen Cursor Settings ; ----------------------------------- ; Copied to #FD6C-#FD73. -L3A76: DEFB #08 ; Number of bytes in table. - DEFB #00 ; #FD6C. [Setting never used] - DEFB #16 ; #FD6D = Rows above the editing area. - DEFB #01 ; #FD6E. [Setting never used] - DEFB #00 ; #FD6F. [Setting never used] - DEFB #00 ; #FD70. [Setting never used] - DEFB #00 ; #FD71. [Setting never used] - DEFB #0F ; #FD72 = Cursor attribute colour (blue paper, white ink). - DEFB #00 ; #FD73 = Stored cursor position screen attribute colour (None = black paper, black ink). +L3A76: DB #08 ; Number of bytes in table. + DB #00 ; #FD6C. [Setting never used] + DB #16 ; #FD6D = Rows above the editing area. + DB #01 ; #FD6E. [Setting never used] + DB #00 ; #FD6F. [Setting never used] + DB #00 ; #FD70. [Setting never used] + DB #00 ; #FD71. [Setting never used] + DB #0F ; #FD72 = Cursor attribute colour (blue paper, white ink). + DB #00 ; #FD73 = Stored cursor position screen attribute colour (None = black paper, black ink). ; -------------------------------------- ; Set Main Screen Editing Cursor Details @@ -16007,7 +16065,9 @@ L3A88: LD HL,L3A76 ; Initial values table for the main screen cursor sett L3A8B: LD DE,#FD6C ; DE=Cursor settings in workspace. JP L3FBA ; Jump to copy the settings. - +;ллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллл; +;ллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллл; +;ллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллл; ; ======================== ; UNUSED ROUTINES - PART 2 ; ======================== @@ -16018,13 +16078,14 @@ L3A8B: LD DE,#FD6C ; DE=Cursor settings in workspace. ; This routine prints to the current channel the contents of register A and then the contents of register D. ; ; [Never called by ROM]. - L3A91: RST #10 ; Print character held in A. LD A,D ; RST #10 ; Print character held in D. SCF ; RET ; - +;ллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллл; +;ллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллл; +;ллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллл; ; ======================== ; EDITOR ROUTINES - PART 5 @@ -16129,7 +16190,7 @@ L3AD6: PUSH BC ; B=Inverted row number, C=Number of rows left to shif LD C,H ; Store the direction flag. RST #28 ; - DEFW CL_ADDR ; #0E9B. HL=Destination display file address, for the row number specified by 24-B. + DW CL_ADDR ; #0E9B. HL=Destination display file address, for the row number specified by 24-B. EX DE,HL ; DE=Destination display file address. XOR A ; @@ -16143,7 +16204,7 @@ L3AE3: DEC B ; Move to the next row (note that B is inverted, i.e. L3AE4: PUSH DE ; DE=Destination display file address. RST #28 ; - DEFW CL_ADDR ; #0E9B. HL=Source display file address, for the row number held in B. + DW CL_ADDR ; #0E9B. HL=Source display file address, for the row number held in B. POP DE ; DE=Destination display file address. ;Copy one row of the display file @@ -16171,12 +16232,12 @@ L3AEE: PUSH BC ; PUSH DE ; DE=Address of next destination row in the display file. RST #28 ; HL=Address of next source row in the display file. - DEFW CL_ATTR ; #0E88. DE=Address of corresponding attribute cell. + DW CL_ATTR ; #0E88. DE=Address of corresponding attribute cell. EX DE,HL ; HL=Address of corresponding source attribute cell. EX (SP),HL ; Store source attribute cell on the stack, and fetch the next destination row in the display file in HL. RST #28 ; HL=Address of next destination row in the display file. - DEFW CL_ATTR ; #0E88. DE=Address of corresponding destination attribute cell. + DW CL_ATTR ; #0E88. DE=Address of corresponding destination attribute cell. EX DE,HL ; HL=Address of corresponding destination attribute cell. EX (SP),HL ; Store destination attribute cell on the stack, and fetch the source attribute cell in HL. POP DE ; DE=Destination attribute cell. @@ -16247,7 +16308,7 @@ L3B42: CP #90 ; Is it a single character or UDG? JR NC,L3B55 ; Jump if it is a UDG. RST #28 ; Print the character. - DEFW PRINT_A_1 ; #0010. + DW PRINT_A_1 ; #0010. L3B49: INC HL ; DJNZ L3B3C ; Repeat for all column positions. @@ -16283,7 +16344,7 @@ L3B5E: CALL L3BB8 ; Exchange 48 and 128 editing colour items. L3B68: PUSH BC ; B=Row number. C=Row to clear. RST #28 ; - DEFW CL_ADDR ; #0E9B. Find display file address. + DW CL_ADDR ; #0E9B. Find display file address. LD C,#08 ; 8 lines in the row. @@ -16304,7 +16365,7 @@ L3B72: LD (HL),A ; Blank the row. LD B,#20 ; 32 columns. PUSH BC ; RST #28 ; - DEFW CL_ATTR ; #0E88. Find attribute address. + DW CL_ATTR ; #0E88. Find attribute address. EX DE,HL POP BC ; BC=32 columns. @@ -16625,9 +16686,9 @@ LRT1: POP HL SCF RET -;***** MENU for SERVICE !!! ***** +;***** MENU for Options !!! ***** SERVICE: - CALL L3857 ; print 'Service' + CALL L3857 ; print 'Options' CALL PROG1 ; set flags & RET_SP LD DE,TST2 ; ЊЎЌ ­Є­ я срЎЊ  LD BC,LEN2-2 ; ЄЋЈ­  @@ -16635,22 +16696,26 @@ SERVICE: L3BFE EQU #3BFE ;[^]..................................................................................................................... SP2000 [^] -;!FIXIT этЎт ЊусЎЊ ЊЎЄ  ­Ѕ ­уІЅ­, ЏЎхЎЄу. - - - - - - - - - - - - - - - - - - - - - - - - - - - [v] - LD A,#68 ; Flash 0, Bright 1, paper cyan, Ink 0 = Bright cyan. - LD (HL),A ; Show the cyan marker. - JR L3BFE ; Go back and count a new set of samples. -;Half second delay then clear key press flag. This is called upon entry and exit of the Tape Tester. -L3C56: EI ; Re-enable interrupts. - LD B,#19 ; Count 25 interrupts. -L3C59: HALT ; Wait for half a second. - DJNZ L3C59 ; +; этЎт ЊусЎЊ ЊЎЄ  ­Ѕ ­уІЅ­, ЏЎхЎЄу. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - [v] +; LD A,#68 ; Flash 0, Bright 1, paper cyan, Ink 0 = Bright cyan. +; LD (HL),A ; Show the cyan marker. +; JR L3BFE ; Go back and count a new set of samples. - LD HL,#5C3B ; FLAGS. - RES 5,(HL) ; Signal no key press - SCF ; Setting the carry flag here serves no purpose. - RET ; +; ;Half second delay then clear key press flag. This is called upon entry and exit of the Tape Tester. +; L3C56: EI ; Re-enable interrupts. +; LD B,#19 ; Count 25 interrupts. + +; L3C59: HALT ; Wait for half a second. +; DJNZ L3C59 ; + +; LD HL,#5C3B ; FLAGS. +; RES 5,(HL) ; Signal no key press +; SCF ; Setting the carry flag here serves no purpose. +; RET ; + + _mInfoBLOCK #3C63-$,0 ;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -[^] ; ======================== @@ -16696,7 +16761,6 @@ L3C59: HALT ; Wait for half a second. ; be displayed at. ;Entry point - A syntax error was detected so the error marker must be located - _mInfoBLOCK #3C63-$,0 L3C63: LD A,#01 ; Signal to locate the error marker. JR L3C69 ; Jump forward. @@ -16730,7 +16794,7 @@ L3C69: LD (#FD8A),A ; Store the 'locate error marker' flag. CALL L1F20 ; Use Normal RAM Configuration (physical RAM bank 0). RST #28 ; - DEFW SET_MIN ; #16B0. Clear the editing areas. + DW SET_MIN ; #16B0. Clear the editing areas. CALL L1F45 ; Use Workspace RAM configuration (physical RAM bank 7). LD A,#00 ; [Could have saved 1 byte by using XOR A, or 2 bytes by clearing this above] @@ -17578,7 +17642,7 @@ L3F47: PUSH AF ; Save the character to insert and the carry flag rese POP DE ; automatically producing error '4' if not. POP HL ; RST #28 ; BC=Number of bytes. HL=Address location before the position. - DEFW POINTERS ; #1664. Update all system variables due to the insertion. Exit with DE pointing to old STKEND position, BC with number of bytes 'shifted'. + DW POINTERS ; #1664. Update all system variables due to the insertion. Exit with DE pointing to old STKEND position, BC with number of bytes 'shifted'. LD HL,(#5C65) ; STKEND. Fetch the start of the spare memory. EX DE,HL ; DE=Address of spare memory. HL=Address of character in the BASIC line. LDDR ; Shift up all affected bytes to make the room for the new character. @@ -17699,8 +17763,7 @@ L3FBC: LD A,(HL) ; Fetch the byte from the source ; ------------------------------------- ; Exit: Carry flag set if character was numeric and A holding value. ; -; [Never called by this ROM] - +;!FIXIT [Never called by this ROM] L3FC3: CP '0' ; #30. Test against '0'. CCF ; RET NC ; Return with carry flag reset if not numeric character. @@ -17773,24 +17836,24 @@ L3FEE: JP (HL) ; Jump to the action handler routine. ; ===================== ; [Provided by Andrew Owen] -L3FEF: DEFB #00 - DEFM "MB" ; Martin Brennan. - DEFB #00 - DEFM "SB" ; Steve Berry. - DEFB #00 - DEFM "AC" ; Andrew Cummins. - DEFB #00 - DEFM "RG" ; Rupert Goodwins. - DEFB #00 - DEFM "KM" ; Kevin Males. - DEFB #00 +L3FEF: DB #00 + DB "MB" ; Martin Brennan. + DB #00 + DB "SB" ; Steve Berry. + DB #00 + DB "AC" ; Andrew Cummins. + DB #00 + DB "RG" ; Rupert Goodwins. + DB #00 + DB "KM" ; Kevin Males. + DB #00 ; ================= ; END OF ROM MARKER ; ================= -L3FFF: DEFB #01 ; +L3FFF: DB #01 ; ; _mInfoBLOCK #4000-$,#FF @@ -18721,4 +18784,4 @@ E_LINE EQU #5C59 ; 2 IY+#1F Address of command being typed in. ; ; Side A=Component Side, Side B=Underside. ; n/u = Not used. - +; \ No newline at end of file diff --git a/SP__48.ASM b/SP__48.ASM index 2a4926f..24ef118 100644 --- a/SP__48.ASM +++ b/SP__48.ASM @@ -1945,9 +1945,9 @@ NEW_TAP2: POP BC ; ;DI .no_556: EXX + PUSH HL PUSH BC PUSH DE - PUSH HL CALL NEW_TAP ; EX AF,AF' ; AF ------------------v @@ -1959,9 +1959,9 @@ NEW_TAP2: POP BC .save_HL: LD (SYS_PAGE.TAP_RAM_POINT),HL .no_save_HL: EXX OUT (C),B - POP HL POP DE -.exit: POP BC + POP BC +.exit: POP HL EXX RET ; @@ -1993,9 +1993,9 @@ NEW_TAP2: POP BC IN A,(SLOT2) OUT (C),H CP #FF - JR Z,.exit LD H,A SET 5,C + JR Z,.exit LD L,1 ; Ќ рЊЅр ЁЋЎЊ  ЏрЎЏусЊ/чтЅ­ЈЅ - 0/1 EXX ; ЏрЎЂЅряЅЌ тЈЏ ЁЋЎЊ  Ј трЅЁуЅЌыЉ ЁЋЎЊ