From 06610de4e505967f440ae67142502f90e4f04405 Mon Sep 17 00:00:00 2001 From: BayoDev Date: Sat, 8 Nov 2025 19:06:21 +0100 Subject: [PATCH 1/6] Ported disassemblies from external repository --- README.md | 4 - applications/FMT8003.COM.asm | 1574 +++++++++++++++++++++++++ applications/RCX62.COM.asm | 768 ++++++++++++ applications/TERM80.COM.asm | 2160 ++++++++++++++++++++++++++++++++++ 4 files changed, 4502 insertions(+), 4 deletions(-) create mode 100644 applications/FMT8003.COM.asm create mode 100644 applications/RCX62.COM.asm create mode 100644 applications/TERM80.COM.asm diff --git a/README.md b/README.md index 5337b49..b67c0fb 100644 --- a/README.md +++ b/README.md @@ -80,10 +80,6 @@ $ cpmcp -f sanco SANCO8003_CPM_2.2fr.bin "0:*" disk/ $ cpmcp -f sanco SANCO8003_CPM_2.2fr.bin test.bin "0:TEST.COM" ``` -## Other contributions - -- [RetroNewbie/Sanco_8000](https://github.com/RetroNewbie/Sanco_8000/tree/main/CP-M), some disassemblies of the software inside in this floppy. - ## External references - [CP/M BIOS documentation](https://www.seasip.info/Cpm/bios.html). diff --git a/applications/FMT8003.COM.asm b/applications/FMT8003.COM.asm new file mode 100644 index 0000000..50436e2 --- /dev/null +++ b/applications/FMT8003.COM.asm @@ -0,0 +1,1574 @@ +; This is the disassembly of the "FMT8003.COM" program for the Sanco 8003 +; found in the CP/M 2.2 image at this link: +; https://archive.org/details/sanco-8003-cpm-2.2fr.dsqd +; +; By Giulio Venturini (@BayoDev) + + ORG $0100 + + ld sp,$0100 ;[0100] + call OUT_STRING ;[0103] + + DB $0D + DB $0A + DB "iBEX 8003 Formatter Version 1.0" + DB $0D + DB $0A + DB "1024 BYTE/SECTOR" + DB $00 + +DRIVE_SEL_PROMPT: + call OUT_STRING ;[013c] + + DB $0D + DB $0A + DB $0A + DB "INITIALIZE (A-B)? " + DB $00 + + call IN_LINE ;[0155] + ld a,($02d8) ;[0158] Get lenght of input string + or a ;[015b] + jp z,RST_FLOPPY_AND_CPM ;[015c] Exit program if the input string is empty + cp $02 ;[015f] + jr nc,DRIVE_SEL_PROMPT ;[0161] Jump if the input string is > 2 char long + ld a,($02d9) ;[0163] Load first input char + res 5,a ;[0166] Reset 5th bit of the A register + ld ($0198),a ;[0168] Change the next string to display the drive letter + cp $41 ;[016b] Check if input == 'A' + jr c,DRIVE_SEL_PROMPT ;[016d] Jump if the input is < than 'A' (Invalid input) + cp $43 ;[016f] Check if input == 'B' + jr nc,DRIVE_SEL_PROMPT ;[0171] Jump if the input is > than 'B' (Invalid input) + dec a ;[0173] + and $03 ;[0174] + ld (DRIVE_SEL),a ;[0176] Save drive selection in memory + call OUT_STRING ;[0179] + + DB $0D + DB $0A + DB "INSERT NEW DISKETTE DRIVE " + DB $00 ;[0198] This will contain the drive letter + DB $3A + DB $0D + DB $0A + DB "THEN READY,TYPE RETURN" + DB $00 + + call IN_CHAR ;[01b3] + cp $03 ;[01b6] + jp z,RST_FLOPPY_AND_CPM ;[01b8] Jump if input==0x03 (End of text) + cp $0d ;[01bb] + jp nz,DRIVE_SEL_PROMPT ;[01bd] Jump if input!=0x0D (Carriage return) + call OUT_STRING ;[01c0] Print new line + + DB $0D + DB $0A + DB $00 + + xor a ;[01c6] Resets register A + ld (TRACK_CUR),a ;[01c7] Set the current track to $00 + ld a,$08 ;[01ca] + ld ($03e8),a ;[01cc] Set $03e8 to $08 + call ZERO_SEEK ;[01cf] +FORMAT_LOOP: + call L0373 ;[01d2] + call OUT_DISK_TRACE ;[01d5] + call FORMAT_TRACK ;[01d8] + ld a,(DRIVE_SEL) ;[01db] + bit 2,a ;[01de] + jr nz,$01ea ;[01e0] + set 2,a ;[01e2] + ld (DRIVE_SEL),a ;[01e4] Set DRIVE_SEL[2] to 1 if not already + jp FORMAT_LOOP ;[01e7] + res 2,a ;[01ea] Reset 2nd bit of DRIVE_SEL + ld (DRIVE_SEL),a ;[01ec] + ld a,(TRACK_CUR) ;[01ef] + inc a ;[01f2] + ld (TRACK_CUR),a ;[01f3] Increase current track + cp $50 ;[01f6] Check if end of tracks + jp z,START_VERIFY ;[01f8] Jump if end of tracks reached + call MOVE_HEAD ;[01fb] Move head to current track + jp FORMAT_LOOP ;[01fe] + +START_VERIFY: + call OUT_STRING ;[0201] + + DB $0D + DB $0A + DB "VERIFY START" + DB $00 + + ld ix,$040d ;[0213] + ld a,(DRIVE_SEL) ;[0217] + and $03 ;[021a] + ld (ix+$00),a ;[021c] ($040d) = DRIVE_SEL[0:1] + ld (ix+$01),$28 ;[021f] + ld (ix+$02),$10 ;[0223] + ld (ix+$03),$05 ;[0227] + ld (ix+$04),$01 ;[022b] + ld (ix+$05),$03 ;[022f] + call READ_DISK ;[0233] + cp $ff ;[0236] + jp z,VERIFY_ERROR ;[0238] Jump if READ_DISK failed + call OUT_STRING ;[023b] Print confirmation string + + DB $0D + DB $0A + DB "VERIFY COMPLETED" + DB $00 + + jp $0179 ;[0251] Jump back to disk insertion + +VERIFY_ERROR: + push de ;[0254] + call OUT_STRING ;[0255] + + DB $0D + DB $0A + DB $07 + DB "VERIFY ERROR!" + DB $00 + + pop de ;[0269] + push de ;[026A] + call OUT_STRING ;[026B] Print track where the error occurred + + DB $0D + DB $0A + DB "TRACK " + DB $00 + + ld e,d ;[0278] + call OUT_DEC ;[0279] + call OUT_STRING ;[027c] Print side where the error occurred + + DB $0D + DB $0A + DB "SIDE " + DB $00 + + ld a,b ;[0289] + and $04 ;[028a] + rrca ;[028c] + rrca ;[028d] + or $30 ;[028e] + ld e,a ;[0290] + call OUT_CHAR ;[0291] + call OUT_STRING ;[0294] Print sector where the error occurred + + DB $0D + DB $0A + DB "SECTOR " + DB $00 + + pop de ;[02a1] + call OUT_DEC ;[02a2] + jp RST_FLOPPY_AND_CPM ;[02a5] + +; Converts the E register from binary to decimal and then +; prints it +OUT_DEC: + push bc ;[02a8] + push de ;[02a9] + ld a,e ;[02aa] + ld b,$0a ;[02ab] + ld c,$ff ;[02ad] + inc c ;[02af] + sub b ;[02b0] + jr nc,$02af ;[02b1] Subtract $0a from the A register and increment C until A<0 + add b ;[02b3] In the end this is A=A%B and C=A/B + ld b,a ;[02b4] + ld a,c ;[02b5] + or $30 ;[02b6] Binary number to ASCII + ld e,a ;[02b8] + call OUT_CHAR ;[02b9] Print second decimal digit (most significant) + ld a,b ;[02bc] + or $30 ;[02bd] Binary number to ASCII + ld e,a ;[02bf] + call OUT_CHAR ;[02c0] Print first decimal digit + pop de ;[02c3] + pop bc ;[02c4] + ret ;[02c5] + +; Use the bdos call to read from keyboard until RETURN is pressed +IN_LINE: + push af ;[02c6] + push bc ;[02c7] + push de ;[02c8] + push hl ;[02c9] + ld de,$02d7 ;[02ca] + ld c,$0a ;[02cd] + call $0005 ;[02cf] + pop hl ;[02d2] + pop de ;[02d3] + pop bc ;[02d4] + pop af ;[02d5] + ret ;[02d6] + +; Text input buffer used in the IN_LINE function + DB $0a ;[02d7] + DB $b8 ;[02d8] + DB $00 ;[02d9] + DB $00 ;[02da] + DB $00 ;[02db] + DB $00 ;[02dc] + DB $00 ;[02dd] + DB $00 ;[02de] + DB $00 ;[02df] + DB $00 ;[02e0] + DB $00 ;[02e1] + DB $00 ;[02e2] + + call OUT_STRING ;[02e3] + + DB "ERR" + DB $00 + + jr RST_FLOPPY_AND_CPM ;[02ea] + +RST_FLOPPY_AND_CPM: + call ZERO_SEEK ;[02ec] +CPM_RST: + ld c,$00 ;[02ef] + jp $0005 ;[02f1] Issue bdos call for system reset + +ZERO_SEEK: + ld b,$00 ;[02f4] Set "move to track 0" operation + ld a,(DRIVE_SEL) ;[02f6] + ld c,a ;[02f9] Set drive number + call FDC_WRAPPER ;[02fa] Call ROM routine + cp $ff ;[02fd] + ret nz ;[02ff] Return if A!=$FF + call OUT_STRING ;[0300] Print error + + DB $0D + DB $0A + DB "ZERO SEEK ERROR!" + DB $00 + + jp CPM_RST ;[0339] + +; Move head to the track TRACK_CUR +MOVE_HEAD: + ld b,$20 ;[0319] + ld a,(TRACK_CUR) ;[031b] + ld d,a ;[031e] + ld a,(DRIVE_SEL) ;[031f] + ld c,a ;[0322] + call FDC_WRAPPER ;[0323] + cp $ff ;[0326] + ret nz ;[0328] Jump if everything went good + call OUT_STRING ;[0329] Print error and reset CP/M if failed + + DB $0D + DB $0A + DB "SEEK ERROR!" + DB $00 + + jp CPM_RST ;[0370] + +FORMAT_TRACK: + ld b,$f0 ;[033d] B=$f0 (command for format operation) + ld a,(DRIVE_SEL) ;[033f] + ld c,a ;[0342] C = DRIVE_SEL + ld a,(TRACK_CUR) ;[0343] + ld d,a ;[0346] D = TRACK_CUR + or a ;[0347] + jr nz,$0352 ;[0348] Jump if TRUCK_CUR!=0 + bit 2,c ;[034a] + jr nz,$0352 ;[034c] Jump if DRIVE_SEL[2] != 0 + ld a,$01 ;[034e] + jr $0354 ;[0350] + ld a,$03 ;[0352] If DRIVE_SEL[2]==1 -> A=$03 , ELSE -> A=$01 + ld hl,$5000 ;[0354] Address where the + call FDC_WRAPPER ;[0357] Call sanco's FDC routine for "format desired track" + cp $ff ;[035a] + ret nz ;[035c] Return FDC routine didn't fail + call OUT_STRING ;[035d] Otherwise print error + + DB $0D + DB $0A + DB "FORMAT ERROR!" + DB $00 + + jp CPM_RST ;[0370] + +; ??????? +L0373: + ld hl,$5000 ;[0373] + ld e,$01 ;[0376] + ld a,(DRIVE_SEL) ;[0378] Load drive number + and $04 ;[037b] + rrca ;[037d] + rrca ;[037e] + ld b,a ;[037f] byte 2 of DRIVE_SEL becomes byte 0 of B + ld a,(TRACK_CUR) ;[0380] + ld d,a ;[0383] + or a ;[0384] + jr nz,$0392 ;[0385] Jump if TRACK_CUR!=0 + bit 0,b ;[0387] Test DRIVE_SEL[2] + jr nz,$0392 ;[0389] Jump if !=0 (i.e. =1) + ld c,$01 ;[038b] + ld a,$10 ;[038d] Write 16 times with C=$01 + jp $0396 ;[038f] + ld a,$05 ;[0392] + ld c,$03 ;[0394] Write 5 times with C=$03 + ld (hl),d ;[0396] Load TRACK_CUR + inc hl ;[0397] + ld (hl),b ;[0398] Load DRIVE_SEL[2] + inc hl ;[0399] + ld (hl),e ;[039a] Load counter + inc hl ;[039b] + ld (hl),c ;[039c] Load C (depenging on DRIVE_SEL[2] $01 or $03) + inc hl ;[039d] + inc e ;[039e] Increase counter + dec a ;[039f] Decrease limit + jp nz,$0396 ;[03a0] Jump if limit!=0 + ret ;[03a3] + +FDC_WRAPPER: + call $ffa3 ;[03a4] + call $c018 ;[03a7] + call $ffa6 ;[03aa] + ret ;[03ad] + + +OUT_DISK_TRACE: + call OUT_STRING ;[03ae] + +; Print current track + DB "T" + DB $00 + + ld a,(TRACK_CUR) ;[03b3] + ld e,a ;[03b6] + call OUT_DEC ;[03b7] + call OUT_STRING ;[03ba] + +; Print current side + DB $20 + DB "S" + DB $00 + + ld a,(DRIVE_SEL) ;[03c0] + and $04 ;[03c3] + rrca ;[03c5] + rrca ;[03c6] + or $30 ;[03c7] + ld e,a ;[03c9] + call OUT_CHAR ;[03ca] + call OUT_STRING ;[03cd] + + DB $20 ;" " + DB $20 ;" " + DB $20 ;" " + DB $00 + + ld a,($03e8) ;[03d4] + dec a ;[03d7] Decrement line counter + ld ($03e8),a ;[03d8] + ret nz ;[03db] return if line counter != 0 + ld a,$08 ;[03dc] + ld ($03e8),a ;[03de] Set ($03e8) to $08 again + call OUT_STRING ;[03e1] + + DB $0D + DB $0A + DB $00 + + ret + + DB $3A ;[03e8] + +; This funcion keeps printing characters starting from the address where +; the function was called + 1 until it encounters $00 +OUT_STRING: + EX (SP),HL ;[03e9] + ld a, (hl) ;[03ea] + inc hl ;[03eb] + or a ;[03ec] + jr z,$03f5 ;[03ed] + ld e,a ;[03ef] + call OUT_CHAR ;[03f0] + jr $03ea ;[03f3] + ex (sp),hl ;[03f5] + ret ;[03f6] + +; Use the bdos call to print to console the ascii character +; stored in the E register +OUT_CHAR: + push af ;[03f7] + push bc ;[03f8] + push de ;[03f9] + push hl ;[03fa] + ld c,$02 ;[03fb] + call $0005 ;[03fd] + pop hl ;[0400] + pop de ;[0401] + pop bc ;[0402] + pop af ;[0403] + ret ;[0404] + +; Use the bdos call to input an ascii character from the console +; and stores it in register A and L +IN_CHAR: + ld c,$01 ;[0405] + call $0005 ;[0407] + ret ;[040a] + + +TRACK_CUR: + DB 00 ;[040b] +DRIVE_SEL: +; Drive selection(A: 0x00 or B: 0x01)[0:1], Side selection (?) [2] + DB 00 ;[040c] + +; Reference values used in the verification process + DB 00 ;[040d] $XX Drive selection (Same format as DRIVE_SEL) + DB 00 ;[040e] $28 Max number of tracks + DB 00 ;[040f] $10 Sectors/track in side 0 + DB 00 ;[0410] $05 Sectors/track in side 1 + DB 00 ;[0411] $01 Bps shift factor in side 0 (256 byte/sector) + DB 00 ;[0412] $03 Bps shift factor in side 1 (1024 byte/sector) + +READ_DISK: + ld a,(ix+$00) ;[0413] + ld ($04ba),a ;[0416] ($04ba) = selected drive = (DRIVE_SEL[0:1]) + xor a ;[0419] + ld ($04b5),a ;[041a] Set ($04b5) = $00 + call READ_TRACK ;[041d] + or a ;[0420] + ret nz ;[0421] Return if A!=$00 (failed) + ld a,($04ba) ;[0422] + bit 2,a ;[0425] + jr nz,$0431 ;[0427] + set 2,a ;[0429] + ld ($04ba),a ;[042b] + jp $041d ;[042e] + res 2,a ;[0431] + ld ($04ba),a ;[0433] Invert side bit of select drive + ld a,($04b5) ;[0436] + inc a ;[0439] + ld ($04b5),a ;[043a] Increase current track + ld b,a ;[043d] + ld a,(ix+$01) ;[043e] + cp b ;[0441] + jp nz,$041d ;[0442] Jump if current track != number of sectors ($28) + xor a ;[0445] + ret ;[0446] Return A=$00 + +READ_TRACK: + xor a ;[0447] Reset A + ld ($04b6),a ;[0448] Set ($04b6) (i.e. current sector) = $00 + ld a,(ix+$03) ;[044b] + ld ($04b7),a ;[044e] Set ($04b7) (i.e. max sector) = ($0410) = $05 + ld a,(ix+$05) ;[0451] + ld ($04b8),a ;[0454] Set ($04b8) (i.e. bts shift factor) = ($0412) + ld b,$43 ;[0457] ?? + ld a,($04b5) ;[0459] + or a ;[045c] + jp nz,$0474 ;[045d] Jump if ($04b5) (i.e. current track) == $00 + ld a,($04ba) ;[0460] + bit 2,a ;[0463] + jp nz,$0474 ;[0465] Jump if ($04ba)[2]!=0 (Should be == DRIVE_SEL[2] so side select (?)) + ld a,(ix+$02) ;[0468] + ld ($04b7),a ;[046b] Set ($04b7) (i.e. number of sectors) = ($040f) = $10 + ld a,(ix+$04) ;[046e] + ld ($04b8),a ;[0471] Set ($04b8) = ($0411) = bps shift factor = $01 + ld b,$40 ;[0474] Set operation command for sanco's routine (read sector in the HL buffer) + ld a,($04ba) ;[0476] + ld c,a ;[0479] c = drive number = ($04ba) + ld a,($04b5) ;[047a] + ld d,a ;[047d] d = current track = ($04b5) + ld a,($04b6) ;[047e] + ld e,a ;[0481] e = current sector = ($04b6) + ld hl,$04bb ;[0482] hl = read buffer address = $04bb + ld a,($04b8) ;[0485] a = bytes per sector shift factor = ($04b8) + call $ffa3 ;[0488] + call $c018 ;[048b] Use sanco's routine to read sector in the HL buffer + call $ffa6 ;[048e] + or a ;[0491] + jp nz,READ_TRACK_ERR ;[0492] Jump if a!=0 <=> failed sanco's routine + ld a,($04b6) ;[0495] + inc a ;[0498] + ld ($04b6),a ;[0499] Increase ($04b6) = current sector + ld b,a ;[049c] + ld a,($04b7) ;[049d] + cp b ;[04a0] + jp nz,$0474 ;[04a1] Jump if sector!=number of sectors + xor a ;[04a4] A = 0 + ret ;[04a5] return + +READ_TRACK_ERR: + ld a,($04b5) ;[04a6] + ld d,a ;[04a9] d = current track + ld a,($04b6) ;[04aa] + ld e,a ;[04ad] e = current sector + ld a,($04ba) ;[04ae] + ld b,a ;[04b1] b = drive number + ld a,$ff ;[04b2] a = $ff + ret ;[04b4] + +; Used in the verify process + DB $7a ;[04b5] Current track + DB $b3 ;[04b6] Current sector + DB $2f ;[04b7] Number of sectors + DB $ca ;[04b8] Bytes per sector, shift factor + DB $35 ;[04b9] Seems to be unused + DB $29 ;[04ba] Drive number + + +; From now on this is used as a data section used +; to store data from the READ_TRACK routine + + DB $AF + DB $C3 + DB $35 ;'5' + DB $29 ;')' + DB $3A ;':' + DB $D1 + DB $3C ;'<' + DB $CD + DB $3A ;':' + DB $0B + DB $3D ;'=' + DB $C3 + DB $35 ;'5' + DB $29 ;')' + DB $3A ;':' + DB $D1 + DB $3C ;'<' + DB $CD + DB $3A ;':' + DB $0B + DB $B7 + DB $C3 + DB $35 ;'5' + DB $29 ;')' + DB $F6 + DB $37 ;'7' + DB $F5 + DB $3A ;':' + DB $0D + DB $3D ;'=' + DB $B7 + DB $CA + DB $BD + DB $29 ;')' + DB $CD + DB $4F ;'O' + DB $0B + DB $CD + DB $1E + DB $0C + DB $C2 + DB $A5 + DB $29 ;')' + DB $E6 + DB $A0 + DB $C2 + DB $B0 + DB $29 ;')' + DB $CD + DB $08 + DB $0C + DB $CA + DB $B0 + DB $29 ;')' + DB $F1 + DB $9F + DB $C3 + DB $35 ;'5' + DB $29 ;')' + DB $F1 + DB $3F ;'?' + DB $9F + DB $C3 + DB $35 ;'5' + DB $29 ;')' + DB $3A ;':' + DB $0D + DB $3D ;'=' + DB $B7 + DB $C2 + DB $A9 + DB $28 ;'(' + DB $C1 + DB $AF + DB $21 ;'!' + DB $85 + DB $0D + DB $22 ;'"' + DB $2B ;'+' + DB $3D ;'=' + DB $C3 + DB $35 ;'5' + DB $29 ;')' + DB $F6 + DB $37 ;'7' + DB $F5 + DB $CD + DB $17 + DB $2A ;'*' + DB $C2 + DB $BD + DB $29 ;')' + DB $22 ;'"' + DB $2B ;'+' + DB $3D ;'=' + DB $78 ;'x' + DB $B1 + DB $CA + DB $B0 + DB $29 ;')' + DB $C3 + DB $AB + DB $29 ;')' + DB $F6 + DB $37 ;'7' + DB $F5 + DB $CD + DB $17 + DB $2A ;'*' + DB $C2 + DB $BD + DB $29 ;')' + DB $D5 + DB $C5 + DB $7E ;'~' + DB $FE + DB $2C ;',' + DB $C2 + DB $0F + DB $2A ;'*' + DB $23 ;'#' + DB $22 ;'"' + DB $2B ;'+' + DB $3D ;'=' + DB $CD + DB $17 + DB $2A ;'*' + DB $C2 + DB $12 + DB $2A ;'*' + DB $22 ;'"' + DB $2B ;'+' + DB $3D ;'=' + DB $79 ;'y' + DB $C1 + DB $E1 + DB $B9 + DB $C2 + DB $AB + DB $29 ;')' + DB $1A + DB $BE + DB $C2 + DB $AB + DB $29 ;')' + DB $13 + DB $23 ;'#' + DB $0D + DB $C2 + DB $01 + DB $2A ;'*' + DB $C3 + DB $B0 + DB $29 ;')' + DB $CD + DB $BB + DB $04 + DB $E1 + DB $E1 + DB $C3 + DB $BD + DB $29 ;')' + DB $CD + DB $C2 + DB $0B + DB $FE + DB $3C ;'<' + DB $C4 + DB $97 + DB $04 + DB $CD + DB $1D + DB $0B + DB $B7 + DB $C2 + DB $37 ;'7' + DB $2A ;'*' + DB $CD + DB $E4 + DB $0A + DB $CD + DB $1D + DB $0B + DB $FE + DB $26 ;'&' + DB $C2 + DB $37 ;'7' + DB $2A ;'*' + DB $CD + DB $E4 + DB $0A + DB $C3 + DB $1F + DB "**+=+" + DB $11 + DB $00 + DB $00 + DB $23 ;'#' + DB $7E ;'~' + DB $FE + DB $3E ;'>' + DB $C2 + DB $47 ;'G' + DB $2A ;'*' + DB $54 ;'T' + DB $5D ;']' + DB $FE + DB $2C ;',' + DB $C2 + DB $51 ;'Q' + DB $2A ;'*' + DB $7A ;'z' + DB $B3 + DB $C2 + DB $57 ;'W' + DB $2A ;'*' + DB $FE + DB $0D + DB $C2 + DB $3E ;'>' + DB $2A ;'*' + DB $23 ;'#' + DB $E5 + DB $2A ;'*' + DB $2B ;'+' + DB $3D ;'=' + DB $7A ;'z' + DB $B3 + DB $CC + DB $97 + DB $04 + DB $EB + DB $7D ;'}' + DB $93 + DB $4F ;'O' + DB $7C ;'|' + DB $9A + DB $47 ;'G' + DB $E1 + DB $3A ;':' + DB $F6 + DB $3D ;'=' + DB $FE + DB $20 ;' ' + DB $C9 + DB $CD + DB $4F ;'O' + DB $0B + DB $4F ;'O' + DB $C5 + DB $C4 + DB $97 + DB $04 + DB $37 ;'7' + DB $CD + DB $F6 + DB $0C + DB $23 ;'#' + DB $7E ;'~' + DB $F6 + DB $40 ;'@' + DB $77 ;'w' + DB $C1 + DB $E6 + DB $20 ;' ' + DB $CC + DB $D3 + DB $04 + DB $7E ;'~' + DB $E6 + DB $80 + DB $C4 + DB $AF + DB $04 + DB $1F + DB $1F + DB $1F + DB $B6 + DB $77 ;'w' + DB $79 ;'y' + DB $FE + DB $2C ;',' + DB $CA + DB $6E ;'n' + DB $2A ;'*' + DB $C9 + DB $11 + DB $16 + DB $3E ;'>' + DB $01 + DB $00 + DB $4F ;'O' + DB $C3 + DB $A7 + DB $2A ;'*' + DB $0E + DB $00 + DB $11 + DB $66 ;'f' + DB $3E ;'>' + DB $06 + DB $3B ;';' + DB $CD + DB $C2 + DB $0B + DB "*+=+~#" + DB $FE + DB $0D + DB $CA + DB $C4 + DB $2A ;'*' + DB $B9 + DB $CA + DB $C4 + DB $2A ;'*' + DB $04 + DB $05 + DB $CA + DB $AE + DB $2A ;'*' + DB $12 + DB $13 + DB $05 + DB $C3 + DB $AE + DB $2A ;'*' + DB $AF + DB $12 + DB $23 ;'#' + DB $22 ;'"' + DB $2B ;'+' + DB $3D ;'=' + DB $C9 + DB $CD + DB $C2 + DB $0B + DB $FE + DB $28 ;'(' + DB $C2 + DB $97 + DB $04 + DB $CD + DB $23 ;'#' + DB $0B + DB $FE + DB $27 ;''' + DB $C2 + DB $97 + DB $04 + DB $4F ;'O' + DB $CD + DB $A2 + DB $2A ;'*' + DB $CD + DB $30 ;'0' + DB $0B + DB $CD + DB $23 ;'#' + DB $0B + DB $FE + DB $29 ;')' + DB $C4 + DB $97 + DB $04 + DB $C3 + DB $3A ;':' + DB $0B + DB $3E ;'>' + DB $01 + DB $32 ;'2' + DB $14 + DB $3D ;'=' + DB $C3 + DB $3B ;';' + DB $2B ;'+' + DB $AF + DB $32 ;'2' + DB $14 + DB $3D ;'=' + DB $C3 + DB $3B ;';' + DB $2B ;'+' + DB $AF + DB $32 ;'2' + DB $12 + DB $3D ;'=' + DB $C3 + DB $3B ;';' + DB $2B ;'+' + DB $CD + DB $4F ;'O' + DB $0B + DB $C2 + DB $29 ;')' + DB $2B ;'+' + DB $0C + DB $0D + DB $CA + DB $29 ;')' + DB $2B ;'+' + DB $F5 + DB $CD + DB $08 + DB $0C + DB $C4 + DB $1E + DB $0C + DB $C2 + DB $1C + DB $2B ;'+' + DB $7E ;'~' + DB $F6 + DB $40 ;'@' + DB $77 ;'w' + DB $F1 + DB $FE + DB $2C ;',' + DB $C0 + DB $CD + DB $4F ;'O' + DB $0B + DB $C2 + DB $BB + DB $04 + DB $C3 + DB $0E + DB $2B ;'+' + DB $3E ;'>' + DB $01 + DB $32 ;'2' + DB $12 + DB $3D ;'=' + DB $C9 + DB $3E ;'>' + DB $FF + DB $32 ;'2' + DB $13 + DB $3D ;'=' + DB $C3 + DB $3B ;';' + DB $2B ;'+' + DB $AF + DB $32 ;'2' + DB $13 + DB $3D ;'=' + DB $C3 + DB $3A ;':' + DB $0B + DB $3E ;'>' + DB $01 + DB $32 ;'2' + DB $13 + DB $3D ;'=' + DB $C3 + DB $3B ;';' + DB $2B ;'+' + DB $AF + DB $C3 + DB $5F ;'_' + DB $2B ;'+' + DB $3E ;'>' + DB $FF + DB $C3 + DB "_+:r@/o:" + DB $D1 + DB $3C ;'<' + DB $B7 + DB $CA + DB " ;+}2r@2 + DB $0F + DB $3D ;'=' + DB $C3 + DB $3B ;';' + DB $2B ;'+' + DB $3E ;'>' + DB $01 + DB $32 ;'2' + DB $CF + DB $3C ;'<' + DB $C3 + DB $3B ;';' + DB $2B ;'+' + DB $AF + DB $32 ;'2' + DB $CF + DB $3C ;'<' + DB $C3 + DB $3B ;';' + DB $2B ;'+' + DB $3E ;'>' + DB $FF + DB $32 ;'2' + DB $D7 + DB $3C ;'<' + DB $CD + DB $A9 + DB $28 ;'(' + DB $AF + DB $32 ;'2' + DB $D7 + DB $3C ;'<' + DB $7A ;'z' + DB $B7 + DB $C2 + DB $97 + DB $04 + DB $3A ;':' + DB $F6 + DB $3D ;'=' + DB $FE + DB $20 ;' ' + DB $C0 + DB $7B ;'{' + DB $3D ;'=' + DB $F8 + DB $CA + DB $97 + DB $04 + DB $FE + DB $10 + DB $D2 + DB $97 + DB $04 + DB $3C ;'<' + DB $32 ;'2' + DB $D6 + DB $3C ;'<' + DB $AF + DB $67 ;'g' + DB $6B ;'k' + DB $C3 + DB $2E ;'.' + DB $1B + DB $CD + DB $A9 + DB $28 ;'(' + DB $7A ;'z' + DB $B7 + DB $C2 + DB $97 + DB $04 + DB $3A ;':' + DB $D1 + DB $3C ;'<' + DB $B7 + DB $C8 + DB $7B ;'{' + DB $B7 + DB $CA + DB $C3 + DB $2B ;'+' + DB $FE + DB $0A + DB $DC + DB $97 + DB $04 + DB $3A ;':' + DB $F6 + DB $3D ;'=' + DB $FE + DB $20 ;' ' + DB $C2 + DB $C3 + DB $2B ;'+' + DB $7B ;'{' + DB $32 ;'2' + DB $17 + DB $3D ;'=' + DB $CD + DB $25 ;'%' + DB $19 + DB $CD + DB $39 ;'9' + DB $04 + DB $C3 + DB $6A ;'j' + DB $1A + DB $CD + DB $4F ;'O' + DB $0B + DB $C2 + DB $97 + DB $04 + DB $F5 + DB $3A ;':' + DB $CE + DB $3D ;'=' + DB $FE + DB $08 + DB $DA + DB $E0 + DB $2B ;'+' + DB $CD + DB $C7 + DB $04 + DB $3E ;'>' + DB $07 + DB $21 ;'!' + DB $C7 + DB $3D ;'=' + DB $77 ;'w' + DB $23 ;'#' + DB $22 ;'"' + DB $24 ;'$' + DB $3D ;'=' + DB $3A ;':' + DB $D1 + DB $3C ;'<' + DB $B7 + DB $0E + DB $03 + DB $C4 + DB $A3 + DB $1B + DB $F1 + DB $FE + DB $2C ;',' + DB $CA + DB $CC + DB $2B ;'+' + DB $C9 + DB $3A ;':' + DB $11 + DB $3D ;'=' + DB $B7 + DB $C2 + DB $BB + DB $04 + DB $CD + DB $C2 + DB $0B + DB $2A ;'*' + DB $2B ;'+' + DB $3D ;'=' + DB $2B ;'+' + DB $CD + DB $33 ;'3' + DB $4E ;'N' + DB $B7 + DB $CA + DB $13 + DB $2C ;',' + DB $CD + DB $F6 + DB $4E ;'N' + DB $C3 + DB $D9 + DB $04 + DB $3D ;'=' + DB $32 ;'2' + DB $11 + DB "=*+=~#" + DB $22 ;'"' + DB $2B ;'+' + DB $3D ;'=' + DB $FE + DB $21 ;'!' + DB $D2 + DB $17 + DB $2C ;',' + DB $C9 + DB $CD + DB $C2 + DB $0B + DB $FE + DB $28 ;'(' + DB $C2 + DB $97 + DB $04 + DB $CD + DB $23 ;'#' + DB $0B + DB $FE + DB $27 ;''' + DB $C2 + DB $97 + DB $04 + DB $CD + DB $4F ;'O' + DB $0B + DB $C2 + DB $97 + DB $04 + DB $FE + DB $27 ;''' + DB $C2 + DB $97 + DB $04 + DB $CD + DB $23 ;'#' + DB $0B + DB $FE + DB $29 ;')' + DB $C2 + DB $97 + DB $04 + DB $CD + DB $3A ;':' + DB $0B + DB $3A ;':' + DB $D1 + DB $3C ;'<' + DB $B7 + DB $C0 + DB $3A ;':' + DB $CE + DB $3D ;'=' + DB $FE + DB $06 + DB $DA + DB $5A ;'Z' + DB $2C ;',' + DB $3E ;'>' + DB $06 + DB $11 + DB $CF + DB "=!B?G~" + DB $B7 + DB $C2 + DB $AF + DB $04 + DB $1A + DB $77 ;'w' + DB $23 ;'#' + DB $13 + DB $05 + DB $C2 + DB $66 ;'f' + DB $2C ;',' + DB $70 ;'p' + DB $C9 + DB $CD + DB $B6 + DB $2C ;',' + DB $CD + DB $C2 + DB $0B + DB $FE + DB $2F ;'/' + DB $C2 + DB $97 + DB $04 + DB $CD + DB $4F ;'O' + DB $0B + DB $C4 + DB $AE + DB $2C ;',' + DB $FE + DB $2F ;'/' + DB $C2 + DB $97 + DB $04 + DB $CD + DB $3A ;':' + DB $0B + DB $CD + DB $F6 + DB $0C + DB $23 ;'#' + DB $7E ;'~' + DB $E6 + DB $D0 + DB $C2 + DB $AF + DB $04 + DB $E5 + DB $7E ;'~' + DB $F6 + DB $24 ;'$' + DB $77 ;'w' + DB $CD + DB $17 + DB $27 ;''' + DB $E1 + DB $2B ;'+' + DB $22 ;'"' + DB $BF + DB $3D ;'=' + DB $3E ;'>' + DB $03 + DB $32 ;'2' + DB $B6 + DB $3D ;'=' + DB $21 ;'!' + DB $00 + DB $00 + DB $22 ;'"' + DB $B7 + DB $3D ;'=' + DB $C3 + DB $96 + DB $26 ;'&' + DB $F5 + DB $3E ;'>' + DB $01 + DB $32 ;'2' + DB $CE + DB $3D ;'=' + DB $F1 + DB $C9 + DB $3A ;':' + DB $C9 + DB $3D ;'=' + DB $B7 + DB $C8 + DB $C1 + DB $C3 + DB $C1 + DB $04 + DB $11 + DB $80 + DB $00 + DB $CD + DB $4F ;'O' + DB $0B + DB $C2 + DB $E8 + DB $2C ;',' + DB $F5 + DB $B7 + DB $D5 + DB $CD + DB $F6 + DB $0C + DB $CD + DB $F7 + DB $2C ;',' + DB $D1 + DB $7E ;'~' + DB $B2 + DB $77 ;'w' + DB $23 ;'#' + DB $7E ;'~' + DB $E6 + DB $64 ;'d' + DB $C2 + DB $EE + DB $2C ;',' + DB $7E ;'~' + DB $E6 + DB $03 + DB $B3 + DB $77 ;'w' + DB $F1 + DB $FE + DB $2C ;',' + DB $CA + DB $C2 + DB $2C ;',' + DB $C9 + DB $CD + DB $97 + DB $04 + DB $C3 + DB $E2 + DB $2C ;',' + DB $F6 + DB $10 + DB $77 ;'w' + DB $CD + DB $AF + DB $04 + DB $C3 + DB $E1 + DB $2C ;',' + DB $7E ;'~' + DB $FE + DB $40 ;'@' + DB $C8 + DB $FE + DB $C0 + DB $C8 + DB $E6 + DB $40 ;'@' + DB $C8 + DB $7E ;'~' + DB $AF + DB $77 ;'w' + DB $E5 + DB $AF + DB "#w#w#w" + DB $E1 + DB $C9 + DB $CD + DB $4F ;'O' + DB $0B + DB $CD + DB $0F + DB $05 + DB $7E ;'~' + DB $87 + DB $D4 + DB $BB + DB $04 + DB $23 ;'#' + DB $7E ;'~' + DB $FE + DB $10 + DB $CA + DB $25 ;'%' + DB $2D ;'-' + DB $FE + DB $0F + DB $C4 + DB $BB + DB $04 + DB $11 + DB $80 + DB $04 + DB $C3 + DB $C2 + DB $2C ;',' + DB $22 ;'"' + DB $28 ;'(' + DB $3D ;'=' + DB $CD + DB $54 ;'T' + DB $2D ;'-' + DB $3A ;':' + DB $F6 + DB $3D ;'=' + DB $32 ;'2' + DB $16 + DB $3D ;'=' + DB $FE + DB $55 ;'U' + DB $C8 + DB $78 ;'x' + DB $E6 + DB $80 + DB $C2 + DB $A9 + DB $04 + DB $78 ;'x' + DB $F6 + DB $20 ;' ' + DB $32 ;'2' + DB $15 + DB $3D ;'=' + DB $2A ;'*' + DB $28 ;'(' + DB $3D ;'=' + DB $22 ;'"' + DB $24 ;'$' + DB $3D ;'=' + DB $CD + DB $D5 + DB $0D + DB $EB + DB $78 ;'x' + DB $C3 + DB $2E ;'.' + DB $1B + DB $CD + DB $68 ;'h' + DB $20 ;' ' + DB $3A ;':' + DB $A7 + DB $3E ;'>' + DB $B7 + DB $C8 + DB $C3 + DB $C7 + DB $04 + DB $22 ;'"' + DB $28 ;'(' + DB $3D ;'=' + DB $7E ;'~' + DB $F6 + DB $80 + DB $77 ;'w' + DB $7C ;'|' + DB $32 ;'2' + DB $16 + DB $3D ;'=' + DB $CD + DB $54 ;'T' + DB $2D ;'-' + DB $78 ;'x' + DB $E6 + DB $80 + DB $C2 + DB $A9 + DB $04 + DB $2A ;'*' + DB $28 ;'(' + DB $E1 + DB $2C ;',' + DB $7E ;'~' + DB $FE + DB $40 ;'@' + DB $C8 + DB $FE + DB $C0 + DB $C8 + DB $E6 + DB $40 ;'@' + DB $C8 + DB $7E ;'~' + DB $AF + DB $77 ;'w' + DB $E5 + DB $AF + DB "#w#w#w" + DB $E1 + DB $C9 + DB $CD + DB $4F ;'O' + DB $0B + DB $CD + DB $0F + DB $05 + DB $7E ;'~' + DB $87 + DB $D4 + DB $BB + DB $04 + DB $23 ;'#' + DB $7E ;'~' + DB $FE + DB $10 + DB $CA + DB $25 ;'%' + DB $2D ;'-' + DB $FE + DB $0F + DB $C4 + DB $BB + DB $04 + DB $11 + DB $80 + DB $04 + DB $C3 + DB $C2 + DB $2C ;',' + DB $22 ;'"' + DB $28 ;'(' + DB $3D ;'=' + DB $CD + DB $54 ;'T' + DB $2D ;'-' + DB $3A ;':' + DB $F6 + DB $3D ;'=' + DB $32 ;'2' + DB $16 + DB $3D ;'=' + DB $FE + DB $55 ;'U' + DB $C8 diff --git a/applications/RCX62.COM.asm b/applications/RCX62.COM.asm new file mode 100644 index 0000000..85fa851 --- /dev/null +++ b/applications/RCX62.COM.asm @@ -0,0 +1,768 @@ +; This is the disassembly of the "RCX62.COM" program for the Sanco 8003 +; found in the CP/M 2.2 image at this link: +; https://archive.org/details/sanco-8003-cpm-2.2fr.dsqd +; +; By Giulio Venturini (@BayoDev) + + org $0100 + + nop ;[0100] + nop ;[0101] + nop ;[0102] +; JUMP START + jp INIT ;[0103] + +SIO_SETUP_WRAPPER: + jp SIO_SETUP ;[0106] + +SIO_WRITE_WRAPPER: + jp SIO_WRITE ;[0109] + +SIO_READ_WRAPPER: + jp SIO_READ ;[010c] + +INIT: + ld sp,$01ac ;[010f] Setup stack pointer + call SIO_SETUP_WRAPPER ;[0112] Setup SIO + ld hl,($0001) ;[0115] + ld de,$0006 ;[0118] + add hl,de ;[011b] + ld ($01fe),hl ;[011c] ($01fe) = $0006 + call PRINT_NEXT_STR ;[011f] + DB $0d ;[0122] + DB $0a ;[0123] + .ASCII "File exchange program vers 6.0 ,4800 Baud (SED)";[0124] + DB $0d ;[0153] + DB $0a ;[0154] + DB $0a ;[0155] + .ASCII "Ready to receive" ;[0156] + DB $0d ;[0166] + DB $0a ;[0167] + DB $00 ;[0168] + jp RCV_FIRST ;[0169] + +; STACK SPACE START + DB $00 ;[016c] + DB $00 ;[016d] + DB $00 ;[016e] + DB $00 ;[016f] + DB $00 ;[0170] + DB $00 ;[0171] + DB $00 ;[0172] + DB $00 ;[0173] + DB $00 ;[0174] + DB $00 ;[0175] + DB $00 ;[0176] + DB $00 ;[0177] + DB $00 ;[0178] + DB $00 ;[0179] + DB $00 ;[017a] + DB $00 ;[017b] + DB $00 ;[017c] + DB $00 ;[017d] + DB $00 ;[017e] + DB $00 ;[017f] + DB $00 ;[0180] + DB $00 ;[0181] + DB $00 ;[0182] + DB $00 ;[0183] + DB $00 ;[0184] + DB $00 ;[0185] + DB $00 ;[0186] + DB $00 ;[0187] + DB $00 ;[0188] + DB $00 ;[0189] + DB $00 ;[018a] + DB $00 ;[018b] + DB $00 ;[018c] + DB $00 ;[018d] + DB $00 ;[018e] + DB $00 ;[018f] + DB $00 ;[0190] + DB $00 ;[0191] + DB $00 ;[0192] + DB $00 ;[0193] + DB $00 ;[0194] + DB $00 ;[0195] + DB $00 ;[0196] + DB $00 ;[0197] + DB $00 ;[0198] + DB $00 ;[0199] + DB $00 ;[019a] + DB $00 ;[019b] + DB $00 ;[019c] + DB $00 ;[019d] + DB $00 ;[019e] + DB $00 ;[019f] + DB $00 ;[01a0] + DB $00 ;[01a1] + DB $00 ;[01a2] + DB $00 ;[01a3] + DB $00 ;[01a4] + DB $00 ;[01a5] + DB $00 ;[01a6] + DB $00 ;[01a7] + DB $00 ;[01a8] + DB $00 ;[01a9] + DB $00 ;[01aa] + DB $00 ;[01ab] +; STACK SPACE END + +; Data buffer for filename (?) + DB $00 ;[01ac] + DB $00 ;[01ad] + DB $00 ;[01ae] + DB $00 ;[01af] + DB $00 ;[01b0] + DB $00 ;[01b1] + DB $00 ;[01b2] + DB $00 ;[01b3] + DB $00 ;[01b4] + DB $00 ;[01b5] + DB $00 ;[01b6] + DB $00 ;[01b7] + DB $00 ;[01b8] + DB $00 ;[01b9] + DB $00 ;[01ba] + DB $00 ;[01bb] + +; FCB file structure + DB $00 ;[01bc] + DB $00 ;[01bd] + DB $00 ;[01be] + DB $00 ;[01bf] + DB $00 ;[01c0] + DB $00 ;[01c1] + DB $00 ;[01c2] + DB $00 ;[01c3] + DB $00 ;[01c4] + DB $00 ;[01c5] + DB $00 ;[01c6] + DB $00 ;[01c7] + DB $00 ;[01c8] + DB $00 ;[01c9] + DB $00 ;[01ca] + DB $00 ;[01cb] + DB $00 ;[01cc] + DB $00 ;[01cd] + DB $00 ;[01ce] + DB $00 ;[01cf] + DB $00 ;[01d0] + DB $00 ;[01d1] + DB $00 ;[01d2] + DB $00 ;[01d3] + DB $00 ;[01d4] + DB $00 ;[01d5] + DB $00 ;[01d6] + DB $00 ;[01d7] + DB $00 ;[01d8] + DB $00 ;[01d9] + DB $00 ;[01da] + DB $00 ;[01db] + DB $00 ;[01dc] + DB $00 ;[01dd] + DB $00 ;[01de] + +; This routine prints all the characters after the "call" function until it encounters a $00 +; When that happens the call resume execution from after the $00 +PRINT_NEXT_STR: + ex (sp),hl ;[01df] HL will contain the address where the routine was called (+1) + ld a,(hl) ;[01e0] Read the content of HL + inc hl ;[01e1] Increment address + ex (sp),hl ;[01e2] Put the address back on the stack + or a ;[01e3] + ret z ;[01e4] If A=$00 return + call C_WRITE ;[01e5] + jp PRINT_NEXT_STR ;[01e8] + +; Output A to console +C_WRITE: + push af ;[01eb] + push hl ;[01ec] + push bc ;[01ed] + push de ;[01ee] + ld c,$02 ;[01ef] + ld e,a ;[01f1] + call $0005 ;[01f2] + pop de ;[01f5] + pop bc ;[01f6] + pop hl ;[01f7] + pop af ;[01f8] + ret ;[01f9] + +; ??? +L01FA: + push bc ;[01fa] + push de ;[01fb] + push hl ;[01fc] + + call $0000 ;[01fd] This will be modified (INIT) + + pop hl ;[0200] + pop de ;[0201] + pop bc ;[0202] + ret ;[0203] + +;================================ +; FILE SYSCALLS +;================================ + +F_OPEN: + ld c,$0f ;[0204] + jp $0005 ;[0206] + +F_WRITE: + ld c,$15 ;[0209] + jp $0005 ;[020b] + +F_CLOSE: + ld c,$10 ;[020e] + jp $0005 ;[0210] + +F_READ: + ld c,$14 ;[0213] + jp $0005 ;[0215] + +F_MAKE: + ld c,$16 ;[0218] + jp $0005 ;[021a] + +F_DELETE: + ld c,$13 ;[021d] + jp $0005 ;[021f] + +F_RENAME: + ld c,$17 ;[0222] + jp $0005 ;[0224] + +;================================ + +; This routine is used to receive and save to file all the data +; Algorithm: +; 1) 128 blocks of 128 bytes each are read. After a full block is received +; a special character is expected: +; - ($17) a kind of acknowledge +; - ($04) this signal that it was the last block of the file +; If none of these signal is received an error occured +; 2) After the 128 blocks are received (or $04 encountered) the blocks are written to the file with FCB in $005c +; if a block that is being written is followed by $04 the file is closed. Otherwise go to step (3) +; 3) The transmitter will be waiting for the receiver to write everything to the file so +; if 128 blocks were written and the file was not complete an acknowledgment ($06) is sent to the transmitter +; to resume transmission and the algorithm keep reading from step (1) +RCV_SAVE_FILE: + ld b,$80 ;[0227] + ld hl,$1400 ;[0229] Setup pointer to memory buffer +; Read 128 blocks of 128 bytes (unless file is shorter) +READ_BLOCK_LOOP: + push bc ;[022c] + ld b,$80 ;[022d] Setup loop counter +; Read 128 bytes from the SIO into memory starting from $1400 +READ_128_LOOP: + call SIO_READ_WRAPPER ;[022f] Read value from SIO + ld (hl),a ;[0232] Store value in HL + inc hl ;[0233] HL++ + djnz READ_128_LOOP ;[0234] B-- and loop if B!=$00 + call SIO_READ_WRAPPER ;[0236] + ld (hl),a ;[0239] Read value from SIO and store in buffer + inc hl ;[023a] + cp $17 ;[023b] + pop bc ;[023d] + jp z,$0249 ;[023e] Jump if value from SIO is $17 (expected control char) + cp $04 ;[0241] + jp z,$024b ;[0243] Jump if value from SIO is $04 (end of transmission) + jp nz,FILE_TRANSFER_ERROR ;[0246] If neither $17 or $04 error + djnz READ_BLOCK_LOOP ;[0249] + ld b,$80 ;[024b] Reset loop counter for number of blocks + ld hl,$1400 ;[024d] Reset data buffer to start +WRITE_BLOCKS_LOOP: + push bc ;[0250] + ld bc,$0080 ;[0251] + ld de,$0080 ;[0254] + ldir ;[0257] Move 128 bytes from data buffer to $0080 + ld a,(hl) ;[0259] Get control character + cp $17 ;[025a] + jp nz,END_CLOSE_FILE ;[025c] Jump if that was the last block + push hl ;[025f] + push bc ;[0260] + push de ;[0261] + ld de,$005c ;[0262] Load FCB pointer + call F_WRITE ;[0265] Write block to file + pop de ;[0268] + pop bc ;[0269] + pop hl ;[026a] + or a ;[026b] + pop bc ;[026c] + jp nz,FILE_WRITE_ERROR ;[026d] Jump if error in syscall + inc hl ;[0270] HL++ + djnz WRITE_BLOCKS_LOOP ;[0271] Loop until 128 blocks + jp KEEP_RCV ;[0273] 128 blocks written without end of file + +; This routine write the last block to the file and closes it +END_CLOSE_FILE: + pop bc ;[0276] + cp $04 ;[0277] + jp nz,FILE_TRANSFER_ERROR ;[0279] If not end of file char, error + ld de,$005c ;[027c] + call F_WRITE ;[027f] Write last block to file + or a ;[0282] + jp nz,FILE_WRITE_ERROR ;[0283] jump if error in syscall + ld de,$005c ;[0286] + call F_CLOSE ;[0289] Close file + inc a ;[028c] + jp z,CLOSING_ERROR ;[028d] Jump if error in syscall + xor a ;[0290] A=0 + ret ;[0291] + +; This routine is called after 128 blocks of 128 bytes were successfully saved +; to ask the transmitter to resume transmission +KEEP_RCV: + ld a,$06 ;[0292] + call SIO_WRITE_WRAPPER ;[0294] Send acknowledge + jp RCV_SAVE_FILE ;[0297] Start receiving again + + +TRANSMISSION_END: + call PRINT_NEXT_STR ;[029a] + DB $0D ;[029b] + DB $0A ;[029c] + DB $0A ;[029d] + .ASCII "End of transmission" ;[02a0] + DB $0D ;[02b3] + DB $0A ;[02b4] + DB $00 ;[02b5] + jp $0000 ;[02b6] EXIT FROM CP/M + +RCV_FIRST_WRAPPER: + jp RCV_FIRST ;[02b9] + + +RCV_SETUP: + call GET_FILENAME ;[02bc] Read 12 bytes in $01bd (?) (Probably read filename) + cp $03 ;[02bf] + jp nz,FILE_NAME_ERROR ;[02c1] Jump if filename didnt end with $03 (bad data) + ld hl,$01ac ;[02c4] + ld de,$005c ;[02c7] + ld bc,$0010 ;[02ca] + ldir ;[02cd] Setup the FCB for the syscalls with the input filename (in $005c) + ld de,$005c ;[02cf] + call F_OPEN ;[02d2] Open file with FCB in $005c (?) + inc a ;[02d5] + jp nz,START_RCV ;[02d6] Jump if no error in F_OPEN (file already exists) + ld de,$005c ;[02d9] + call F_MAKE ;[02dc] Create file + inc a ;[02df] + jp z,DIR_FULL_ERROR ;[02e0] Jump if error (directory full) +START_RCV: + ld de,$005c ;[02e3] + xor a ;[02e6] + ld hl,$0020 ;[02e7] + add hl,de ;[02ea] HL = $7C + ld (hl),$00 ;[02eb] ($7C) = $00 + ld de,$01bc ;[02ed] + call PRINT_FILENAME ;[02f0] Print filename located at $01bc + ld a,$06 ;[02f3] + call SIO_WRITE_WRAPPER ;[02f5] Write $06 to SIO (Acknowledge) + call RCV_SAVE_FILE ;[02f8] Receive and save file + or a ;[02fb] If routine ended correctly, A should be $00 + jp nz,FILE_ERROR ;[02fc] If A!=$00 error + ld de,$01bc ;[02ff] + call F_DELETE ;[0302] Delete file (?) + ld de,$01ac ;[0305] + call F_RENAME ;[0308] Rename file from $01ac as the file from $01bc + ld a,$20 ;[030b] + call C_WRITE ;[030d] Prints ' ' to CRT + ld a,$2a ;[0310] + call C_WRITE ;[0312] Prints '*' to CRT + ld a,$06 ;[0315] + call SIO_WRITE_WRAPPER ;[0317] Send acknowledge to SIO + jp RCV_FIRST ;[031a] Wait for new file + +; This routine gets 12 bytes from the SIO containing the filename and extension +; followed by 0x03 (end of text) +GET_FILENAME: + ld c,$0c ;[031d] + ld hl,$01bd ;[031f] +; This loop will be executed 12 times +GET_FILENAME_LOOP: + call SIO_READ_WRAPPER ;[0322] Read value from SIO (=A) + and $7f ;[0325] Remove parity (?) (Not needed for ASCII anyway) + cp $03 ;[0327] + jp z,END_FILENAME ;[0329] Check for END OF TEXT (0x03) + ld (hl),a ;[032c] (HL) = A + inc hl ;[032d] HL++ + dec c ;[032e] C-- + jp nz,GET_FILENAME_LOOP ;[032f] Loop if C!=0 + ret ;[0332] +END_FILENAME: + ld de,$01ac ;[0333] + ld hl,$01bc ;[0336] + ld bc,$0009 ;[0339] + ldir ;[033c] Move 9 bytes from $01bc to $01ac + ld hl,$01b5 ;[033e] + ld (hl),$24 ;[0341] ($01b5) = $24 + inc hl ;[0343] + ld (hl),$24 ;[0344] ($01b6) = $24 + inc hl ;[0346] + ld (hl),$24 ;[0347] ($01b7) = $24 + ret ;[0349] + + +;======================= +; ERROR MESSAGES +;======================= + +FILE_NAME_ERROR: + call PRINT_NEXT_STR ;[034a] + DB $0D ;[034d] + DB $0A ;[034e] + .ASCII "File name error" ;[034f] + DB $00 ;[035e] + ld a,$0d ;[035f] + call SIO_WRITE_WRAPPER ;[0361] + jp RCV_FIRST ;[0364] + +DIR_FULL_ERROR: + call PRINT_NEXT_STR ;[0367] + DB $0D ;[036a] + DB $0A ;[036b] + .ASCII "Directory full" ;[036c] + DB $00 ;[037a] + ld a,$0d ;[037b] + call SIO_WRITE_WRAPPER ;[037d] + jp RCV_FIRST ;[0380] + +FILE_TRANSFER_ERROR: + call PRINT_NEXT_STR ;[0383] + DB $0D ;[0386] + DB $0A ;[0387] + .ASCII "File transfer error" ;[0388] + nop ;[039b] + ld a,$0d ;[039c] + call SIO_WRITE_WRAPPER ;[039e] + jp RCV_FIRST ;[03a1] + +FILE_WRITE_ERROR: + call PRINT_NEXT_STR ;[03a4] + DB $0D ;[03a7] + DB $0a ;[03a8] + .ASCII "File write error" ;[03a9] + DB $00 ;[03b9] + ld a,$0d ;[03ba] + call SIO_WRITE_WRAPPER ;[03bc] + jp RCV_FIRST ;[03bf] + +CLOSING_ERROR: + call PRINT_NEXT_STR ;[03c2] + DB $0D ;[03c5] + DB $0A ;[03c6] + .ASCII "Closing error" ;[03c7] + DB $00 ;[03d4] + ld a,$0d ;[03d5] + call SIO_WRITE_WRAPPER ;[03d7] + jp RCV_FIRST ;[03da] + +FILE_ERROR: + call PRINT_NEXT_STR ;[03dd] + DB $0D ;[03e0] + DB $0A ;[03e1] + .ASCII "File error" ;[03e2] + DB $00 ;[03ec] + ld a,$0d ;[03ed] + call SIO_WRITE_WRAPPER ;[03ef] + jp RCV_FIRST ;[03f2] + + +RENAME_ERROR: + call PRINT_NEXT_STR ;[03f5] + DB $0D ;[03f8] + DB $0A ;[03f9] + .ASCII "Rename error" ;[03fa] + DB $00 ;[0406] + ld a,$0d ;[0407] + call SIO_WRITE_WRAPPER ;[0409] + jp RCV_FIRST ;[040c] + +;======================= + +; This routine: +; 1) prints a new line (CR,LF) +; 2) prints 8 bytes starting from (de+1) +; 3) prints '.' +; 4) prints 3 bytes located after the previous 8 bytes +; i.e. prints a filename on the CRT +PRINT_FILENAME: + ld a,$0d ;[040f] + call C_WRITE ;[0411] Print 'Carriage return' to CRT + ld a,$0a ;[0414] + call C_WRITE ;[0416] Print 'Line feed' to CRT + ex de,hl ;[0419] + inc hl ;[041a] + ld b,$08 ;[041b] +.PRINT_NAME: + ld a,(hl) ;[041d] A = (HL) + call C_WRITE ;[041e] Print A to CRT + inc hl ;[0421] HL++ + djnz .PRINT_NAME ;[0422] Decrement B and if B!=$00 jump. (Will jump 8 times) + ld a,$2e ;[0424] + call C_WRITE ;[0426] Print '.' + ld b,$03 ;[0429] +.PRINT_EXT: + ld a,(hl) ;[042b] A = (HL) + call C_WRITE ;[042c] Print A to CRT + inc hl ;[042f] HL++ + djnz .PRINT_EXT ;[0430] B-- and jump if B!=$00 (Will jump 3 times) + ex de,hl ;[0432] + ret ;[0433] + +; This receives the first character of a transmission and act accordingly +RCV_FIRST: + call SIO_READ_WRAPPER ;[0434] Read an input character from the SIO (=A) + cp $18 ;[0437] + jp z,TRANSMISSION_END ;[0439] If A=$18 then end transmission and exit program + cp $11 ;[043c] + jp z,RCV_FIRST_WRAPPER ;[043e] Skip loop if A=$11 + cp $02 ;[0441] + jp z,RCV_SETUP ;[0443] If A=$02 then ready to transmit a file + cp $12 ;[0446] + call z,SIO_SETUP_WRAPPER ;[0448] if A=$12 jump + jp RCV_FIRST ;[044b] + +; Sends to port $b1 data from $0458 to $0460 (SIO SETUP) +SIO_SETUP: + ld c,$b1 ;[044e] Output port + ld b,$09 ;[0450] Number of repetitions + ld hl,SIO_SETUP_COMMANDS ;[0452] Starting address + otir ;[0455] + ret ;[0457] + +SIO_SETUP_COMMANDS: + DB $18 ;[0458] ; Reset channel 0 + DB $04 ;[0459] ; Access WR4 + DB $4c ;[045A] ; Parity Disabled, 2 stop bits (?), 8 bit sync,Data Rate x16 = Clock rate + DB $01 ;[045B] ; Access WR1 + DB $00 ;[045C] ; Disable all interrupts + DB $05 ;[045D] ; Access WR5 + DB $ea ;[045E] ; TX CRC disabled, RTS enabled, CRC-16 disabled, Transmit enabled, Send break disabled, 8 bits/character, dtr enabled + DB $03 ;[045F] ; Access WR3 + DB $c1 ;[0460] ; Receive enabled, the rest disabled, 8 bits/character + +; Write the character stored in the A register to port B of the SIO (Blocks until can transmit) +SIO_WRITE: + push af ;[0461] +.SIO_WRITE_LOOP: + in a,($b1) ;[0462] + and $04 ;[0464] + jp z,.SIO_WRITE_LOOP ;[0466] Loop until SIO is ready to transmit + pop af ;[0469] + out ($b0),a ;[046a] Write A to SIO + ret ;[046c] + +; Receive a character from the SIO and stores it in A (it blocks until there is something available to read) +SIO_READ: + in a,($b1) ;[046d] + and $01 ;[046f] Check if character is available to read + jp z,SIO_READ ;[0471] Loop if not + in a,($b0) ;[0474] Read character from SIO into A + ret ;[0476] + +; From now on this is unused + + ld bc,$0a0d ;[0477] + ld d,d ;[047a] + ld h,l ;[047b] + ld l,(hl) ;[047c] + ld h,c ;[047d] + ld l,l ;[047e] + ld h,l ;[047f] + ld (bc),a ;[0480] + cp $43 ;[0481] + jp nz,$0296 ;[0483] + call $0145 ;[0486] + or $04 ;[0489] + call $0151 ;[048b] + ld a,c ;[048e] + call $0151 ;[048f] + ld a,b ;[0492] + jp $0151 ;[0493] + cp $52 ;[0496] + jp nz,$0518 ;[0498] + call $011d ;[049b] + or $c0 ;[049e] + jp $0151 ;[04a0] + ld hl,($000e) ;[04a3] + push de ;[04a6] + ex de,hl ;[04a7] + ld hl,($000c) ;[04a8] + ld a,e ;[04ab] + sub l ;[04ac] + ld a,d ;[04ad] + sbc h ;[04ae] + jp nc,$02b7 ;[04af] + ld hl,($0013) ;[04b2] + ld sp,hl ;[04b5] + ret ;[04b6] + + pop de ;[04b7] + ld a,(hl) ;[04b8] + inc hl ;[04b9] + ld ($000c),hl ;[04ba] + ret ;[04bd] + + inc a ;[04be] + and $07 ;[04bf] + cp $06 ;[04c1] + jp c,$02c8 ;[04c3] + add $03 ;[04c6] + cp $05 ;[04c8] + jp c,$02cf ;[04ca] + add $02 ;[04cd] + add $41 ;[04cf] + ld c,a ;[04d1] + jp $0015 ;[04d2] + ld b,a ;[04d5] + and $f0 ;[04d6] + rrca ;[04d8] + rrca ;[04d9] + rrca ;[04da] + rrca ;[04db] + add $90 ;[04dc] + daa ;[04de] + adc $40 ;[04df] + daa ;[04e1] + ld c,a ;[04e2] + call $0015 ;[04e3] + ld a,b ;[04e6] + and $0f ;[04e7] + add $90 ;[04e9] + daa ;[04eb] + adc $40 ;[04ec] + daa ;[04ee] + ld c,a ;[04ef] + jp $0015 ;[04f0] + ld b,$04 ;[04f3] + ld c,(hl) ;[04f5] + call $0015 ;[04f6] + inc hl ;[04f9] + dec b ;[04fa] + jp nz,$02f5 ;[04fb] + ld c,$20 ;[04fe] + jp $0015 ;[0500] + ld a,d ;[0503] + and $38 ;[0504] + rrca ;[0506] + rrca ;[0507] + rrca ;[0508] + ret ;[0509] + + call $0303 ;[050a] + add a ;[050d] + ld c,a ;[050e] + ld hl,$0642 ;[050f] + add hl,bc ;[0512] + ld c,(hl) ;[0513] + call $0015 ;[0514] + inc hl ;[0517] + ld c,(hl) ;[0518] + call $0015 ;[0519] + ld c,$20 ;[051c] + call $0015 ;[051e] + jp $0015 ;[0521] + call $0303 ;[0524] + and $06 ;[0527] + cp $06 ;[0529] + jp nz,$02be ;[052b] + ld c,$53 ;[052e] + call $0015 ;[0530] + ld c,$50 ;[0533] + jp $0015 ;[0535] + call $002e ;[0538] + ld hl,($000c) ;[053b] + ld a,h ;[053e] + call $02d5 ;[053f] + ld a,l ;[0542] + call $02d5 ;[0543] + ld c,$20 ;[0546] + call $0015 ;[0548] + call $0015 ;[054b] + ret ;[054e] + + ld hl,$0000 ;[054f] + add hl,sp ;[0552] + ld ($0013),hl ;[0553] + ld a,($0010) ;[0556] + or a ;[0559] + jp z,$0371 ;[055a] + ld hl,$ffff ;[055d] + ld ($000e),hl ;[0560] + inc a ;[0563] + jp nz,$0371 ;[0564] + inc a ;[0567] + ld ($0010),a ;[0568] + ld hl,($000c) ;[056b] + jp $0397 ;[056e] + call $069e ;[0571] + jp nz,$0540 ;[0574] + ld hl,$0010 ;[0577] + ld a,(hl) ;[057a] + or a ;[057b] + jp z,FILE_TRANSFER_ERROR ;[057c] + dec (hl) ;[057f] + jp z,$0540 ;[0580] + ld hl,($000c) ;[0583] + call $06a1 ;[0586] + call $002e ;[0589] + ld c,$20 ;[058c] + call $0015 ;[058e] + call $0015 ;[0591] + call $033b ;[0594] + call $02a3 ;[0597] + ld d,a ;[059a] + ld hl,$0545 ;[059b] + ld bc,$0011 ;[059e] + cp (hl) ;[05a1] + jp z,$04fd ;[05a2] + inc hl ;[05a5] + dec c ;[05a6] + jp nz,$03a1 ;[05a7] + ld c,$0a ;[05aa] + cp (hl) ;[05ac] + jp z,$04e9 ;[05ad] + inc hl ;[05b0] + dec c ;[05b1] + jp nz,$03ac ;[05b2] + ld c,$06 ;[05b5] + cp (hl) ;[05b7] + jp z,$04ce ;[05b8] + inc hl ;[05bb] + dec c ;[05bc] + jp nz,$03b7 ;[05bd] + and $c0 ;[05c0] + cp $40 ;[05c2] + jp z,$04b4 ;[05c4] + cp $80 ;[05c7] + jp z,$04a5 ;[05c9] + ld a,d ;[05cc] + and $c7 ;[05cd] + sub $04 ;[05cf] + jp z,$0496 ;[05d1] + dec a ;[05d4] + jp z,$0490 ;[05d5] + dec a ;[05d8] + jp z,$047c ;[05d9] + ld a,d ;[05dc] + and $c0 ;[05dd] + jp z,$044a ;[05df] + ld a,d ;[05e2] + and $07 ;[05e3] + jp z,$043f ;[05e5] + sub $02 ;[05e8] + jp z,RCV_FIRST ;[05ea] + sub $02 ;[05ed] + jp z,$0429 ;[05ef] + sub $03 ;[05f2] + jp z,$041a ;[05f4] + ld a,d ;[05f7] + and $08 ;[05f8] + jp nz,$050b ;[05fa] + ld a,d ;[05fd] + and $07 ;[05fe] diff --git a/applications/TERM80.COM.asm b/applications/TERM80.COM.asm new file mode 100644 index 0000000..ac7158f --- /dev/null +++ b/applications/TERM80.COM.asm @@ -0,0 +1,2160 @@ +; This is the disassembly of the "TERM80.COM" program for the Sanco 8003 +; found in the CP/M 2.2 image at this link: +; https://archive.org/details/sanco-8003-cpm-2.2fr.dsqd +; +; By Giulio Venturini (@BayoDev) +; +; THIS IS NOT COMPLETE, MANY PARTS OF THE CODE REMAIN UNEXPLAINED AND SOME UNREACHABLE + + + org $0100 + +CPM_ENTRY: + jp ENTRY_POINT ;[0100] + + rst $38 ;[0103] + nop ;[0104] + nop ;[0105] + ld sp,$3239 ;[0106] + jr nc,$013b ;[0109] + jr nc,$013f ;[010b] + ld sp,$2c30 ;[010d] + ld d,e ;[0110] + ld b,c ;[0111] + ld c,(hl) ;[0112] + ld b,e ;[0113] + ld c,a ;[0114] + dec c ;[0115] + + DB $b1 ;[0116] Serial port device number (CONTROL) + DB $01 ;[0117] Bit mask for SIO's RR0 "Receive Character Available" + DB $04 ;[0118] Bit mask for SIO's RR0 "Transmit Buffer Empty" (bit set=empty buffer) + DB $b0 ;[0119] Serial port device number (DATA) + + inc h ;[011a] + ld bc,$0010 ;[011b] + nop ;[011e] + nop ;[011f] + nop ;[0120] + nop ;[0121] + nop ;[0122] + nop ;[0123] + nop ;[0124] + nop ;[0125] + nop ;[0126] + nop ;[0127] + nop ;[0128] + nop ;[0129] + nop ;[012a] + nop ;[012b] + nop ;[012c] + nop ;[012d] + nop ;[012e] + nop ;[012f] + nop ;[0130] + inc h ;[0131] + dec d ;[0132] + ld e,$19 ;[0133] + nop ;[0135] + jr $0138 ;[0136] + rla ;[0138] + ld a,(de) ;[0139] + nop ;[013a] + nop ;[013b] + nop ;[013c] + nop ;[013d] + nop ;[013e] + nop ;[013f] + nop ;[0140] + nop ;[0141] + nop ;[0142] + nop ;[0143] + nop ;[0144] + nop ;[0145] + inc h ;[0146] + nop ;[0147] + nop ;[0148] + nop ;[0149] + nop ;[014a] + nop ;[014b] + nop ;[014c] + nop ;[014d] + nop ;[014e] + nop ;[014f] + nop ;[0150] + nop ;[0151] + nop ;[0152] + nop ;[0153] + nop ;[0154] + nop ;[0155] + nop ;[0156] + nop ;[0157] + nop ;[0158] + nop ;[0159] + nop ;[015a] + nop ;[015b] + nop ;[015c] + nop ;[015d] + nop ;[015e] + nop ;[015f] + + DB $00 ;[0160] Printer echo activation ($00=Disabled,otherwise enabled) + DB $00 ;[0161] + DB $CD ;[0162] + DB $00 ;[0163] + DB $00 ;[0164] + + nop ;[0165] + nop ;[0166] + nop ;[0167] + nop ;[0168] + nop ;[0169] + nop ;[016a] + nop ;[016b] + nop ;[016c] + nop ;[016d] + nop ;[016e] + nop ;[016f] + nop ;[0170] + nop ;[0171] + nop ;[0172] + nop ;[0173] + nop ;[0174] + nop ;[0175] + nop ;[0176] + nop ;[0177] + nop ;[0178] + nop ;[0179] + nop ;[017a] + nop ;[017b] + nop ;[017c] + nop ;[017d] + nop ;[017e] + nop ;[017f] + nop ;[0180] + nop ;[0181] + nop ;[0182] + nop ;[0183] + nop ;[0184] + nop ;[0185] + nop ;[0186] + nop ;[0187] + nop ;[0188] + nop ;[0189] + nop ;[018a] + nop ;[018b] + nop ;[018c] + nop ;[018d] + nop ;[018e] + nop ;[018f] + nop ;[0190] + nop ;[0191] + nop ;[0192] + nop ;[0193] + nop ;[0194] + nop ;[0195] + nop ;[0196] + nop ;[0197] + nop ;[0198] + nop ;[0199] + nop ;[019a] + nop ;[019b] + nop ;[019c] + nop ;[019d] + nop ;[019e] + nop ;[019f] + nop ;[01a0] + nop ;[01a1] + nop ;[01a2] + nop ;[01a3] + nop ;[01a4] + nop ;[01a5] + nop ;[01a6] + nop ;[01a7] + nop ;[01a8] + nop ;[01a9] + nop ;[01aa] + nop ;[01ab] + nop ;[01ac] + nop ;[01ad] + nop ;[01ae] + nop ;[01af] + nop ;[01b0] + nop ;[01b1] + nop ;[01b2] + nop ;[01b3] + nop ;[01b4] + nop ;[01b5] + nop ;[01b6] + nop ;[01b7] + nop ;[01b8] + nop ;[01b9] + nop ;[01ba] + nop ;[01bb] + nop ;[01bc] + nop ;[01bd] + nop ;[01be] + nop ;[01bf] + nop ;[01c0] + nop ;[01c1] + nop ;[01c2] + nop ;[01c3] + nop ;[01c4] + nop ;[01c5] + +; A = {$FF = console device ready, $00 otherwise} +CONSOLE_READY: + jp $01c6 ;[01c6] After SETUP routine jumps to CONST BIOS entry + +; A = console character ; Wait until the character is ready +CONSOLE_INPUT: + jp $01c9 ;[01c9] After SETUP routine jumps to CONIN BIOS entry + +;The character is sent from register C to the console output device. The character is in ASCII, with high-order parity bit set to zero. +CONSOLE_OUTPUT: + jp $01cc ;[01cc] After SETUP routine jumps to CONOUT BIOS entry + +; You return the ready status of the list device used by the DESPOOL program to improve console response during its operation. +; The value 00 is returned in A if the list device is not ready to accept a character and 0FFH if a character can be sent to the printer. +; A 00 value should be returned if LIST status is not implemented. +LIST_STATUS: + jp $01cf ;[01cf] After SETUP routine jumps to WRITE BIOS entry + +ENTRY_POINT: + ld sp,$0820 ;[01d2] + call SETUP_WRAPPER ;[01d5] + jp STARTUP ;[01d8] + + call SERIAL_READY_SIGNAL ;[01db] + call SERIAL_NOT_READY_SIGNAL ;[01de] + call CONSOLE_INPUT ;[01e1] + call $027f ;[01e4] + + cp $04 ;[01e7] + jp z,ENTRY_POINT ;[01e9] + cp $14 ;[01ec] + jp z,STARTUP ;[01ee] + cp $0c ;[01f1] + jp z,$03ba ;[01f3] + cp $17 ;[01f6] + jp z,$03ab ;[01f8] + cp $03 ;[01fb] + jp z,$037a ;[01fd] + cp $01 ;[0200] + jp z,$0961 ;[0202] + cp $0d ;[0205] + jp z,$0898 ;[0207] + jp $01db ;[020a] + +STARTUP: + ld de,INIT_STRING ;[020d] + call C_WRITESTR ;[0210] Write initial string +MAIN_LOOP: + call SERIAL_READY_SIGNAL ;[0213] Setup SIO ready for data + call SERIAL_IN_AVAIL ;[0216] Check if there is a character to read from the SIO + jp nz,GET_INPUT ;[0219] Jump if a character is ready to be read from the SIO + call SERIAL_NOT_READY_SIGNAL ;[021c] Setup SIO not ready for data + call CONSOLE_READY ;[021f] Check TTY status + or a ;[0222] + jp z,MAIN_LOOP ;[0223] Jump if there is no character to read + call CONSOLE_INPUT ;[0226] Get character from TTY + call SERIAL_OUT ;[0229] Send character through serial + jp MAIN_LOOP ;[022c] + +GET_INPUT: + call SERIAL_IN ;[022f] A = serial in + cp $12 ;[0232] + jr nz,PROCESS_ASCII ;[0234] Jump if A!=$12 (DC2) (Could be used to indicate activation of communication) +; Assuming $0161 is not modified elsewhere the first time that $12 is received +; it wont call ACTIVATE_PRINTER, but then it wil for the next 255 times that $12 is received (?) + ld a,($0161) ;[0236] + or a ;[0239] + jr nz,ACTIVATE_PRINTER ;[023a] Jump if ($0161)!=0 + dec a ;[023c] + ld ($0161),a ;[023d] ($0161) = $FF ($0-$1=$FF (?)) + xor a ;[0240] A = $00 + call SERIAL_OUT ;[0241] + jp MAIN_LOOP ;[0244] + +ACTIVATE_PRINTER: + ld a,$01 ;[0247] + ld ($0160),a ;[0249] Activate printer (i.e. ($0160)=$01) + jp MAIN_LOOP ;[024c] + + +; Process the input ascii character (in register A) and prints it in the CRT (and printer if set) +PROCESS_ASCII: + cp $07 ;[024f] + jp c,MAIN_LOOP ;[0251] $00<=A<$07 ==> Not printable + cp $0e ;[0254] + jp c,VALID_ASCII ;[0256] $07<=A<$0e ==> Valid (Cursor controls i.e. tab, line feed, etc.) + cp $1a ;[0259] + jp c,MAIN_LOOP ;[025b] $0e<=A<$1a ==> Not printable +VALID_ASCII: + ld c,a ;[025e] The value of A can only be an ascii between ($07<=A<$0e) U ($A1<=A) + ld a,($0160) ;[025f] + or a ;[0262] + jr nz,LINE_DEVICE_WRITE ;[0263] Jump if ($0160)!=0 (i.e. Jump if printer is enabled) + ld e,c ;[0265] + call C_OUT ;[0266] Output character to CRT + jp MAIN_LOOP ;[0269] + + +; Output character stored in C to the LINE device (printer) and returns to main loop +LINE_DEVICE_WRITE: + ld e,c ;[026c] + ld c,$05 ;[026d] + call SYSCALL ;[026f] + xor a ;[0272] + ld ($0160),a ;[0273] Disable printer again (???) + call SERIAL_OUT ;[0276] + jp MAIN_LOOP ;[0279] + + DB $00 ;[027c] Is set to $10BF by the SETUP routine + DB $00 ;[027d] + DB $00 ;[027e] + ret ;[027f] + + cp $61 ;[0280] + ret c ;[0282] + cp $7b ;[0283] + ret nc ;[0285] + and $5f ;[0286] + ret ;[0288] + + nop ;[0289] + ld c,a ;[028a] + ld a,(hl) ;[028b] + inc hl ;[028c] + cp $24 ;[028d] + jr z,$0299 ;[028f] + cp c ;[0291] + jr z,$0297 ;[0292] + inc hl ;[0294] + jr $028b ;[0295] + ld a,(hl) ;[0297] + ret ;[0298] + + ld a,c ;[0299] + ret ;[029a] + + ld hl,$0147 ;[029b] + ld a,(hl) ;[029e] + inc hl ;[029f] + or a ;[02a0] + jr z,$02a9 ;[02a1] + cp c ;[02a3] + jr z,$02a9 ;[02a4] + inc hl ;[02a6] + jr $029e ;[02a7] + ld a,(hl) ;[02a9] + ld c,a ;[02aa] + xor a ;[02ab] + ld ($027e),a ;[02ac] + ret ;[02af] + +SETUP_WRAPPER: + jp SETUP ;[02b0] + + ld a,($0103) ;[02b3] + or a ;[02b6] + jr nz,$02c1 ;[02b7] + ld de,$0cf3 ;[02b9] + call C_WRITESTR ;[02bc] + jr $02c7 ;[02bf] + ld de,$0cda ;[02c1] + call C_WRITESTR ;[02c4] + ld a,($0104) ;[02c7] + or a ;[02ca] + jr nz,$02d6 ;[02cb] + ld de,$0d23 ;[02cd] + call C_WRITESTR ;[02d0] + jp $0344 ;[02d3] + ld de,$0d0c ;[02d6] + call C_WRITESTR ;[02d9] + jp $0351 ;[02dc] + +SETUP: + ld hl,($0001) ;[02df] + ld de,$0003 ;[02e2] + add hl,de ;[02e5] + ld ($01c7),hl ;[02e6] ($01C7) = ($0001) + $0003 (CONST) + add hl,de ;[02e9] + ld ($01ca),hl ;[02ea] ($01CA) = ($0001) + $0006 (CONIN) + add hl,de ;[02ed] + ld ($01cd),hl ;[02ee] ($01CD) = ($0001) + $0009 (CONOUT) + ld de,$0021 ;[02f1] + add hl,de ;[02f4] + ld ($01d0),hl ;[02f5] ($10D0) = ($0001) + $002A (LISTST) + ld a,$80 ;[02f8] + ld hl,$0003 ;[02fa] + ld (hl),a ;[02fd] ($0003) = $80 (Setting IOBYTE, virtual addressing CONSOLE=TTY, READER=TTY, PUNCH=TTY, LIST=LINE PRINTER DEVICE) + ld hl,$10bf ;[02fe] + ld ($027c),hl ;[0301] ($027C) = $10BF + call L0A9D ;[0304] + ld hl,($0ae7) ;[0307] Load the results from the routine call in HL + ld a,l ;[030a] + cp $ea ;[030b] + jr nz,L0371 ;[030d] if (l.s.b. ($0AE7))!=$EA then jump + ld a,h ;[030f] + cp $49 ;[0310] + jr nz,L0371 ;[0312] if (m.s.b. ($0AE7))!=$49 then jump +SIO_SETUP: + ld a,$18 ;[0314] + out ($b1),a ;[0316] Channel reset + ld a,$05 ;[0318] + out ($b1),a ;[031a] Access SIO register 5 + ld a,$ea ;[031c] + out ($b1),a ;[031e] Transmit enable, 8 bits character, Data terminal ready (DTR=LOW), Request to send (RTS=LOW) + ld a,$03 ;[0320] + out ($b1),a ;[0322] Access SIO register 3 + ld a,$c1 ;[0324] + out ($b1),a ;[0326] Receive enable, 8 bits character + ret ;[0328] + +; Activates Data terminal ready (DTR=LOW) and Request to send (RTS=LOW) +SERIAL_READY_SIGNAL: + ld a,$10 ;[0329] + out ($b1),a ;[032b] Reset Ext/Status Interrupts + ld a,$05 ;[032d] + out ($b1),a ;[032f] Access SIO register 5 + ld a,$ea ;[0331] + out ($b1),a ;[0333] Transmit enable, 8 bits character, Data terminal ready (DTR=LOW), Request to send (RTS=LOW) + ret ;[0335] + +; Deactivates Data terminal ready (DTR=LOW) and Request to send (RTS=LOW) +SERIAL_NOT_READY_SIGNAL: + ld a,$10 ;[0336] + ld ($00b1),a ;[0338] Reset Ext/Status Interrupts + ld a,$05 ;[033b] + out ($b1),a ;[033d] Access SIO register 5 + ld a,$68 ;[033f] + out ($b1),a ;[0341] Transmit enable, 8 bits character + ret ;[0343] + + ld a,$13 ;[0344] + ld ($036d),a ;[0346] + ld a,$11 ;[0349] + ld ($036e),a ;[034b] + jp SETUP ;[034e] + ld a,$13 ;[0351] + ld ($036d),a ;[0353] + ld a,$11 ;[0356] + ld ($036e),a ;[0358] + ld a,$01 ;[035b] + ld ($0104),a ;[035d] + ld a,$10 ;[0360] + ld ($036f),a ;[0362] + ld a,$0d ;[0365] + ld ($0370),a ;[0367] + jp SETUP ;[036a] + + nop ;[036d] + nop ;[036e] + nop ;[036f] + + + DB $00 ;[0370] + +L0371: + jp SIO_SETUP ;[0371] + + ld a,$76 ;[0374] + ld hl,$037a ;[0376] + ld (hl),a ;[0379] + jp $0000 ;[037a] + ld a,($0104) ;[037d] + or a ;[0380] + ret z ;[0381] + call $0725 ;[0382] + ld hl,$04cf ;[0385] + call $048e ;[0388] + call $03a1 ;[038b] + ret ;[038e] + + ld a,($0104) ;[038f] + or a ;[0392] + ret z ;[0393] + call $0725 ;[0394] + ld hl,$04e0 ;[0397] + call $048e ;[039a] + call $03a1 ;[039d] + ret ;[03a0] + + ld b,$03 ;[03a1] + call SERIAL_IN ;[03a3] + djnz $03a3 ;[03a6] + ret ;[03a8] + + and $7f ;[03a9] + call $03cc ;[03ab] + ld de,$0b5e ;[03ae] + call C_WRITESTR ;[03b1] + call $0404 ;[03b4] + jp $05fc ;[03b7] + call $037d ;[03ba] + call $03cc ;[03bd] + ld de,$0b28 ;[03c0] + call C_WRITESTR ;[03c3] + call $0404 ;[03c6] + jp $0529 ;[03c9] + xor a ;[03cc] + ld ($03f7),a ;[03cd] + ld de,$0b43 ;[03d0] + call C_WRITESTR ;[03d3] + call CONSOLE_INPUT ;[03d6] + call $027f ;[03d9] + ld e,a ;[03dc] + call C_OUT ;[03dd] + ld a,e ;[03e0] + cp $4f ;[03e1] + jp nz,$03f8 ;[03e3] + ld hl,$03a9 ;[03e6] + ld de,$0662 ;[03e9] + ld bc,$0002 ;[03ec] + ldir ;[03ef] + ld a,$01 ;[03f1] + ld ($03f7),a ;[03f3] + ret ;[03f6] + + nop ;[03f7] + cp $4e ;[03f8] + jp nz,$03cc ;[03fa] + ld hl,$0000 ;[03fd] + ld ($0662),hl ;[0400] + ret ;[0403] + + ld de,$0b79 ;[0404] + call C_WRITESTR ;[0407] + call CONSOLE_INPUT ;[040a] + call $027f ;[040d] + cp $0d ;[0410] + jp nz,$0419 ;[0412] + xor a ;[0415] + jp $0426 ;[0416] + cp $41 ;[0419] + jp c,$040a ;[041b] + cp $44 ;[041e] + jp nc,$040a ;[0420] + ld e,a ;[0423] + sub $40 ;[0424] + ld ($0756),a ;[0426] + call C_OUT ;[0429] + call $073f ;[042c] + ld de,$0b96 ;[042f] + call C_WRITESTR ;[0432] + ld hl,$0757 ;[0435] + push hl ;[0438] + call CONSOLE_INPUT ;[0439] + call $027f ;[043c] + pop hl ;[043f] + cp $04 ;[0440] + jp z,ENTRY_POINT ;[0442] + cp $2e ;[0445] + jp z,$046e ;[0447] + cp $08 ;[044a] + call z,$047a ;[044c] + cp $7f ;[044f] + call z,$047a ;[0451] + cp $0d ;[0454] + jp z,$0481 ;[0456] + push af ;[0459] + ld e,a ;[045a] + call C_OUT ;[045b] + pop af ;[045e] + cp $08 ;[045f] + jp z,$0438 ;[0461] + cp $7f ;[0464] + jp z,$0438 ;[0466] + ld (hl),a ;[0469] + inc hl ;[046a] + jp $0438 ;[046b] + push af ;[046e] + ld e,a ;[046f] + call C_OUT ;[0470] + pop af ;[0473] + ld hl,$075f ;[0474] + jp $0438 ;[0477] + dec hl ;[047a] + push af ;[047b] + ld a,$20 ;[047c] + ld (hl),a ;[047e] + pop af ;[047f] + ret ;[0480] + + ld hl,$0757 ;[0481] + ld a,(hl) ;[0484] + cp $20 ;[0485] + jp z,$0736 ;[0487] + call $0725 ;[048a] + ret ;[048d] + + ld a,(hl) ;[048e] + call SERIAL_OUT ;[048f] + cp $10 ;[0492] + jr nz,$049b ;[0494] + push hl ;[0496] + call $04b1 ;[0497] + pop hl ;[049a] + ld e,a ;[049b] + call C_OUT ;[049c] + ld a,e ;[049f] + cp $0d ;[04a0] + ret z ;[04a2] + or a ;[04a3] + ret z ;[04a4] + ld bc,$ffff ;[04a5] + dec bc ;[04a8] + ld a,b ;[04a9] + or a ;[04aa] + jr nz,$04a8 ;[04ab] + inc hl ;[04ad] + jp $048e ;[04ae] + ld hl,$04c0 ;[04b1] + ld e,(hl) ;[04b4] + call C_OUT ;[04b5] + inc hl ;[04b8] + ld a,e ;[04b9] + or a ;[04ba] + ld a,$20 ;[04bb] + ret z ;[04bd] + jr $04b4 ;[04be] + ld b,e ;[04c0] + ld d,h ;[04c1] + ld d,d ;[04c2] + ld c,h ;[04c3] + dec l ;[04c4] + ld d,b ;[04c5] + jr nz,$04c8 ;[04c6] + ld d,e ;[04c8] + ld d,b ;[04c9] + ld b,l ;[04ca] + ld b,c ;[04cb] + ld c,e ;[04cc] + ld hl,$1000 ;[04cd] + ld d,e ;[04d0] + ld b,l ;[04d1] + ld d,h ;[04d2] + ld ($303a),a ;[04d3] + inc l ;[04d6] + dec (hl) ;[04d7] + ld a,($2c30) ;[04d8] + add hl,sp ;[04db] + ld a,($0d30) ;[04dc] + nop ;[04df] + djnz $0535 ;[04e0] + ld b,l ;[04e2] + ld d,h ;[04e3] + ld ($313a),a ;[04e4] + inc l ;[04e7] + dec (hl) ;[04e8] + ld a,($0d31) ;[04e9] + nop ;[04ec] + call CONSOLE_READY ;[04ed] + or a ;[04f0] + ret z ;[04f1] + call CONSOLE_INPUT ;[04f2] + call $027f ;[04f5] + ret ;[04f8] + + ld d,h ;[04f9] + ld d,d ;[04fa] + ld b,c ;[04fb] + dec c ;[04fc] + nop ;[04fd] + call $0725 ;[04fe] + ld hl,$04f9 ;[0501] + call $048e ;[0504] + call $04ed ;[0507] + cp $04 ;[050a] + jp z,ENTRY_POINT ;[050c] + call SERIAL_IN_AVAIL ;[050f] + jp z,$0507 ;[0512] + call SERIAL_IN ;[0515] + and $7f ;[0518] + push af ;[051a] + ld e,a ;[051b] + call C_OUT ;[051c] + pop af ;[051f] + cp $05 ;[0520] + jp nz,$0507 ;[0522] + call $03a1 ;[0525] + ret ;[0528] + + call L082A ;[0529] + cp $ff ;[052c] + ld de,$0ba9 ;[052e] + jp z,$0730 ;[0531] + call CONSOLE_INPUT ;[0534] + cp $0d ;[0537] + jr z,$0548 ;[0539] + call SERIAL_OUT ;[053b] + call SERIAL_IN ;[053e] + and $7f ;[0541] + call C_OUT ;[0543] + jr $0534 ;[0546] + call $04ed ;[0548] + cp $13 ;[054b] + jp z,ENTRY_POINT ;[054d] + call SERIAL_IN ;[0550] + and $7f ;[0553] + ld c,a ;[0555] + ld hl,$015b ;[0556] + ld a,(hl) ;[0559] + or a ;[055a] + jr z,$0560 ;[055b] + cp c ;[055d] + jr nz,$0548 ;[055e] + ld a,c ;[0560] + cp $0d ;[0561] + jr nz,$0548 ;[0563] + call $0704 ;[0565] + ld hl,$0080 ;[0568] + ld c,$14 ;[056b] + ld de,$0756 ;[056d] + call SYSCALL ;[0570] + or a ;[0573] + jp nz,$074b ;[0574] + ld hl,$0080 ;[0577] + push hl ;[057a] + ld a,(hl) ;[057b] + ld c,a ;[057c] + push bc ;[057d] + ld a,$ff ;[057e] + ld bc,$ffff ;[0580] + push af ;[0583] + call SERIAL_IN_AVAIL ;[0584] + pop af ;[0587] + jp nz,$0592 ;[0588] + dec bc ;[058b] + jp nz,$0583 ;[058c] + dec a ;[058f] + jr nz,$0580 ;[0590] + call $065f ;[0592] + and $7f ;[0595] + push hl ;[0597] + ld hl,$036d ;[0598] + cp (hl) ;[059b] + pop hl ;[059c] + jp nz,$05b1 ;[059d] + call SERIAL_IN_AVAIL ;[05a0] + jr z,$05a0 ;[05a3] + call $065f ;[05a5] + push hl ;[05a8] + ld hl,$036e ;[05a9] + cp (hl) ;[05ac] + pop hl ;[05ad] + jp nz,$05a0 ;[05ae] + pop bc ;[05b1] + ld hl,$0662 ;[05b2] + ld a,c ;[05b5] + call SERIAL_OUT ;[05b6] + ld a,h ;[05b9] + or a ;[05ba] + jr nz,$05c0 ;[05bb] + ld e,c ;[05bd] + jr $05c2 ;[05be] + ld e,$2e ;[05c0] + call C_OUT ;[05c2] + pop hl ;[05c5] + inc hl ;[05c6] + ld a,l ;[05c7] + or a ;[05c8] + jp z,$05cf ;[05c9] + jp $057a ;[05cc] + ld a,($07bb) ;[05cf] + or a ;[05d2] + jp nz,$05d9 ;[05d3] + jp $0565 ;[05d6] + call $0725 ;[05d9] + ld de,$0c16 ;[05dc] + call C_WRITESTR ;[05df] + xor a ;[05e2] + ld ($07bb),a ;[05e3] + call $038f ;[05e6] + call $0725 ;[05e9] + jp MAIN_LOOP ;[05ec] + ld de,$0ee4 ;[05ef] + call C_WRITESTR ;[05f2] + call $038f ;[05f5] + jp MAIN_LOOP ;[05f8] + ret ;[05fb] + + call $0704 ;[05fc] + call $0725 ;[05ff] + call $086e ;[0602] + call L0833 ;[0605] + cp $ff ;[0608] + call z,$085c ;[060a] + cp $ff ;[060d] + ld de,$0bc0 ;[060f] + jp z,$0730 ;[0612] + ld hl,$0080 ;[0615] + ld ($0701),hl ;[0618] + call CONSOLE_INPUT ;[061b] + call $027f ;[061e] + cp $0d ;[0621] + jr z,$0632 ;[0623] + call SERIAL_OUT ;[0625] + call SERIAL_IN ;[0628] + and $7f ;[062b] + call C_OUT ;[062d] + jr $061b ;[0630] + ld hl,$015b ;[0632] + ld a,(hl) ;[0635] + or a ;[0636] + jr z,$063b ;[0637] + jr $063d ;[0639] + ld a,$0d ;[063b] + call SERIAL_OUT ;[063d] + call $0a7b ;[0640] + cp $ff ;[0643] + jr nz,$0632 ;[0645] + call SERIAL_IN ;[0647] + and $7f ;[064a] + ld hl,($0701) ;[064c] + ld bc,$0001 ;[064f] + call $0a7b ;[0652] + cp $ff ;[0655] + jp nz,$0710 ;[0657] + call $065f ;[065a] + jr $0665 ;[065d] + call SERIAL_IN ;[065f] + nop ;[0662] + nop ;[0663] + ret ;[0664] + + ld (hl),a ;[0665] + ld e,a ;[0666] + ld a,($0662) ;[0667] + or a ;[066a] + jr z,$066f ;[066b] + jr $0671 ;[066d] + ld e,$2e ;[066f] + call C_OUT ;[0671] + inc hl ;[0674] + ld a,l ;[0675] + or a ;[0676] + jp nz,$064f ;[0677] + call $0680 ;[067a] + jp $064c ;[067d] + ld hl,$1144 ;[0680] + ld bc,$0000 ;[0683] + ld a,($0104) ;[0686] + or a ;[0689] + jr z,$0694 ;[068a] + ld a,($036f) ;[068c] + call SERIAL_OUT ;[068f] + jr $0697 ;[0692] + call $0a4c ;[0694] + push bc ;[0697] + ld bc,$0001 ;[0698] + ld de,$2000 ;[069b] + call $0a83 ;[069e] + pop bc ;[06a1] + cp $ff ;[06a2] + jp nz,$06c1 ;[06a4] + ld a,$01 ;[06a7] + ld ($0703),a ;[06a9] + call $065f ;[06ac] + ld (hl),a ;[06af] + push bc ;[06b0] + ld e,a ;[06b1] + call C_OUT ;[06b2] + pop bc ;[06b5] + inc bc ;[06b6] + inc hl ;[06b7] + ld a,c ;[06b8] + cp $0a ;[06b9] + jp z,$0686 ;[06bb] + jp $0697 ;[06be] + push bc ;[06c1] + ld c,$15 ;[06c2] + ld de,$077a ;[06c4] + ld hl,$0080 ;[06c7] + call SYSCALL ;[06ca] + pop bc ;[06cd] + or a ;[06ce] + jp nz,$0730 ;[06cf] + call $0704 ;[06d2] + ld a,($0703) ;[06d5] + or a ;[06d8] + jr z,$06fd ;[06d9] + push bc ;[06db] + ld de,$0080 ;[06dc] + ld hl,$1144 ;[06df] + ldir ;[06e2] + pop bc ;[06e4] + ld hl,$0080 ;[06e5] + add hl,bc ;[06e8] + ld ($0701),hl ;[06e9] + xor a ;[06ec] + ld ($0703),a ;[06ed] + ld a,($0104) ;[06f0] + or a ;[06f3] + jr z,$06fd ;[06f4] + ld a,($0370) ;[06f6] + call SERIAL_OUT ;[06f9] + ret ;[06fc] + + call $0a45 ;[06fd] + ret ;[0700] + + nop ;[0701] + nop ;[0702] + nop ;[0703] + ld b,$80 ;[0704] + ld hl,$0080 ;[0706] + ld a,$20 ;[0709] + ld (hl),a ;[070b] + inc hl ;[070c] + djnz $070b ;[070d] + ret ;[070f] + + call $0680 ;[0710] + call $0865 ;[0713] + call $0853 ;[0716] + call $0874 ;[0719] + ld de,$0be5 ;[071c] + call C_WRITESTR ;[071f] + jp MAIN_LOOP ;[0722] + ld c,$0d ;[0725] + call CONSOLE_OUTPUT ;[0727] + ld c,$0a ;[072a] + call CONSOLE_OUTPUT ;[072c] + ret ;[072f] + + call C_WRITESTR ;[0730] + jp MAIN_LOOP ;[0733] + ld de,$0bd1 ;[0736] + call C_WRITESTR ;[0739] + jp ENTRY_POINT ;[073c] + ld hl,$0757 ;[073f] + ld b,$0b ;[0742] + ld a,$20 ;[0744] + ld (hl),a ;[0746] + inc hl ;[0747] + djnz $0746 ;[0748] + ret ;[074a] + + ld a,$01 ;[074b] + ld ($07bb),a ;[074d] + jp $0577 ;[0750] + jp MAIN_LOOP ;[0753] + nop ;[0756] + jr nz,$0779 ;[0757] + jr nz,$077b ;[0759] + jr nz,$077d ;[075b] + jr nz,$077f ;[075d] + jr nz,$0781 ;[075f] + jr nz,$0763 ;[0761] + + nop ;[0763] + nop ;[0764] + nop ;[0765] + nop ;[0766] + nop ;[0767] + nop ;[0768] + nop ;[0769] + nop ;[076a] + nop ;[076b] + nop ;[076c] + nop ;[076d] + nop ;[076e] + nop ;[076f] + nop ;[0770] + nop ;[0771] + nop ;[0772] + nop ;[0773] + nop ;[0774] + nop ;[0775] + nop ;[0776] + nop ;[0777] + nop ;[0778] + nop ;[0779] + nop ;[077a] + jr nz,$079d ;[077b] + jr nz,$079f ;[077d] + jr nz,$07a1 ;[077f] + jr nz,$07a3 ;[0781] + inc h ;[0783] + inc h ;[0784] + inc h ;[0785] + nop ;[0786] + nop ;[0787] + nop ;[0788] + nop ;[0789] + nop ;[078a] + nop ;[078b] + nop ;[078c] + nop ;[078d] + nop ;[078e] + nop ;[078f] + nop ;[0790] + nop ;[0791] + nop ;[0792] + nop ;[0793] + nop ;[0794] + nop ;[0795] + nop ;[0796] + nop ;[0797] + nop ;[0798] + nop ;[0799] + nop ;[079a] + nop ;[079b] + nop ;[079c] + nop ;[079d] + nop ;[079e] + jr nz,$07c1 ;[079f] + jr nz,$07c3 ;[07a1] + jr nz,$07c5 ;[07a3] + jr nz,$07c7 ;[07a5] + jr nz,$07c9 ;[07a7] + jr nz,$07cb ;[07a9] + nop ;[07ab] + nop ;[07ac] + nop ;[07ad] + nop ;[07ae] + jr nz,$07d1 ;[07af] + jr nz,$07d3 ;[07b1] + jr nz,$07d5 ;[07b3] + jr nz,$07d7 ;[07b5] + jr nz,$07d9 ;[07b7] + jr nz,$07db ;[07b9] + nop ;[07bb] + nop ;[07bc] + nop ;[07bd] + nop ;[07be] + nop ;[07bf] + nop ;[07c0] + nop ;[07c1] + nop ;[07c2] + nop ;[07c3] + nop ;[07c4] + nop ;[07c5] + nop ;[07c6] + nop ;[07c7] + nop ;[07c8] + nop ;[07c9] + nop ;[07ca] + nop ;[07cb] + nop ;[07cc] + nop ;[07cd] + nop ;[07ce] + nop ;[07cf] + nop ;[07d0] + nop ;[07d1] + nop ;[07d2] + nop ;[07d3] + nop ;[07d4] + nop ;[07d5] + nop ;[07d6] + nop ;[07d7] + nop ;[07d8] + nop ;[07d9] + nop ;[07da] + nop ;[07db] + nop ;[07dc] + nop ;[07dd] + nop ;[07de] + nop ;[07df] + nop ;[07e0] + nop ;[07e1] + nop ;[07e2] + nop ;[07e3] + nop ;[07e4] + nop ;[07e5] + nop ;[07e6] + nop ;[07e7] + nop ;[07e8] + nop ;[07e9] + nop ;[07ea] + nop ;[07eb] + nop ;[07ec] + nop ;[07ed] + nop ;[07ee] + nop ;[07ef] + nop ;[07f0] + nop ;[07f1] + nop ;[07f2] + nop ;[07f3] + nop ;[07f4] + nop ;[07f5] + nop ;[07f6] + nop ;[07f7] + nop ;[07f8] + nop ;[07f9] + nop ;[07fa] + nop ;[07fb] + nop ;[07fc] + nop ;[07fd] + nop ;[07fe] + nop ;[07ff] + nop ;[0800] + nop ;[0801] + nop ;[0802] + nop ;[0803] + nop ;[0804] + nop ;[0805] + nop ;[0806] + nop ;[0807] + nop ;[0808] + nop ;[0809] + nop ;[080a] + nop ;[080b] + nop ;[080c] + nop ;[080d] + nop ;[080e] + nop ;[080f] + nop ;[0810] + nop ;[0811] + nop ;[0812] + nop ;[0813] + nop ;[0814] + nop ;[0815] + nop ;[0816] + nop ;[0817] + nop ;[0818] + nop ;[0819] + nop ;[081a] + nop ;[081b] + nop ;[081c] + nop ;[081d] + nop ;[081e] + nop ;[081f] +; STACK space starts from here (GROWS UPWARD) + +SYSCALL: + push hl ;[0820] + push bc ;[0821] + push de ;[0822] + call $0005 ;[0823] + pop de ;[0826] + pop bc ;[0827] + pop hl ;[0828] + ret ;[0829] + +L082A: + ld c,$0f ;[082a] + ld de,$0756 ;[082c] + call SYSCALL ;[082f] + ret ;[0832] + +L0833: + ld hl,$0756 ;[0833] + ld de,$077a ;[0836] + ld bc,$0009 ;[0839] + ldir ;[083c] + ld c,$0f ;[083e] + ld de,$077a ;[0840] + call SYSCALL ;[0843] + ret ;[0846] + +C_OUT: + ld c,$02 ;[0847] + call SYSCALL ;[0849] + ret ;[084c] + +C_WRITESTR: + ld c,$09 ;[084d] + call SYSCALL ;[084f] + ret ;[0852] + +L8053: + ld c,$13 ;[0853] + ld de,$0756 ;[0855] + call SYSCALL ;[0858] + ret ;[085b] + +L085C: + ld c,$16 ;[085c] + ld de,$077a ;[085e] + call SYSCALL ;[0861] + ret ;[0864] + +L0865: + ld c,$10 ;[0865] + ld de,$077a ;[0867] + call SYSCALL ;[086a] + ret ;[086d] + +L086E: + ld c,$0d ;[086e] + call SYSCALL ;[0870] + ret ;[0873] + + ld hl,$077a ;[0874] + ld de,$079e ;[0877] + ld bc,$0010 ;[087a] + ldir ;[087d] + ld hl,$0756 ;[087f] + ld de,$07ae ;[0882] + ld bc,$0010 ;[0885] + ldir ;[0888] + ld c,$17 ;[088a] + ld de,$079e ;[088c] + call SYSCALL ;[088f] + cp $ff ;[0892] + ret nz ;[0894] + jp $0730 ;[0895] + ld de,$0f06 ;[0898] + call C_WRITESTR ;[089b] + call $0903 ;[089e] + ld a,($091b) ;[08a1] + inc a ;[08a4] + ld ($091b),a ;[08a5] + ld hl,($0919) ;[08a8] + ld a,(hl) ;[08ab] + inc hl ;[08ac] + ld ($0919),hl ;[08ad] + or a ;[08b0] + jr nz,$08b5 ;[08b1] + add $30 ;[08b3] + cp $01 ;[08b5] + jr nz,$08bb ;[08b7] + add $30 ;[08b9] + cp $0d ;[08bb] + jr z,$08d0 ;[08bd] + push af ;[08bf] + ld e,a ;[08c0] + call C_OUT ;[08c1] + pop af ;[08c4] + ld a,($091b) ;[08c5] + cp $04 ;[08c8] + jp nc,$08a1 ;[08ca] + jp $089e ;[08cd] + xor a ;[08d0] + ld ($091b),a ;[08d1] + call $08f2 ;[08d4] + inc hl ;[08d7] + inc hl ;[08d8] + inc hl ;[08d9] + ld ($0919),hl ;[08da] + call $08f2 ;[08dd] + dec hl ;[08e0] + dec hl ;[08e1] + ld ($0919),hl ;[08e2] + call $08f2 ;[08e5] + inc hl ;[08e8] + ld ($0919),hl ;[08e9] + call $08f2 ;[08ec] + jp $093c ;[08ef] + call $0903 ;[08f2] + ld hl,($0919) ;[08f5] + ld a,(hl) ;[08f8] + call $11ca ;[08f9] + ld de,$11fe ;[08fc] + call C_WRITESTR ;[08ff] + ret ;[0902] + + ld b,$04 ;[0903] + push hl ;[0905] + push bc ;[0906] + ld hl,($0917) ;[0907] + ld e,(hl) ;[090a] + call C_OUT ;[090b] + inc hl ;[090e] + pop bc ;[090f] + ld ($0917),hl ;[0910] + djnz $0906 ;[0913] + pop hl ;[0915] + ret ;[0916] + + inc e ;[0917] + add hl,bc ;[0918] + inc bc ;[0919] + ld bc,$1b00 ;[091a] + dec a ;[091d] + dec h ;[091e] + inc a ;[091f] + dec de ;[0920] + dec a ;[0921] + daa ;[0922] + inc a ;[0923] + dec de ;[0924] + dec a ;[0925] + add hl,hl ;[0926] + inc a ;[0927] + dec de ;[0928] + dec a ;[0929] + dec hl ;[092a] + ld b,h ;[092b] + dec de ;[092c] + dec a ;[092d] + ld sp,$1b3c ;[092e] + dec a ;[0931] + inc sp ;[0932] + inc a ;[0933] + dec de ;[0934] + dec a ;[0935] + dec (hl) ;[0936] + inc a ;[0937] + dec de ;[0938] + dec a ;[0939] + scf ;[093a] + inc a ;[093b] + ld hl,$0103 ;[093c] + ld ($0919),hl ;[093f] + ld hl,$091c ;[0942] + ld ($0917),hl ;[0945] + call CONSOLE_INPUT ;[0948] + call $027f ;[094b] + cp $0d ;[094e] + jp z,$0960 ;[0950] + cp $0b ;[0953] + jp z,$0960 ;[0955] + cp $0c ;[0958] + jp z,$0960 ;[095a] + jp $093c ;[095d] + nop ;[0960] + ld hl,$0757 ;[0961] + ld a,$3f ;[0964] + ld b,$0c ;[0966] + ld (hl),a ;[0968] + inc hl ;[0969] + dec b ;[096a] + jp nz,$0968 ;[096b] + ld de,$0e99 ;[096e] + call C_WRITESTR ;[0971] + call CONSOLE_INPUT ;[0974] + call $027f ;[0977] + push af ;[097a] + ld e,a ;[097b] + call C_OUT ;[097c] + pop af ;[097f] + ld hl,$0756 ;[0980] + cp $44 ;[0983] + jp nc,ENTRY_POINT ;[0985] + sub $40 ;[0988] + ld (hl),a ;[098a] + ld de,$0e96 ;[098b] + call C_WRITESTR ;[098e] + ld de,$0e96 ;[0991] + call C_WRITESTR ;[0994] + ld de,$0756 ;[0997] + ld c,$11 ;[099a] + call SYSCALL ;[099c] + push af ;[099f] + xor a ;[09a0] + ld ($0960),a ;[09a1] + pop af ;[09a4] + call $09d3 ;[09a5] + ld de,$0080 ;[09a8] + ld c,$1a ;[09ab] + call SYSCALL ;[09ad] + ld de,$0756 ;[09b0] + ld c,$12 ;[09b3] + call SYSCALL ;[09b5] + cp $ff ;[09b8] + jp nz,$09a5 ;[09ba] + ld e,$0d ;[09bd] + call C_OUT ;[09bf] + ld e,$0a ;[09c2] + call C_OUT ;[09c4] + call CONSOLE_INPUT ;[09c7] + xor a ;[09ca] + ld ($0960),a ;[09cb] + jp ENTRY_POINT ;[09ce] + nop ;[09d1] + nop ;[09d2] + ld ($09d1),a ;[09d3] + push af ;[09d6] + ld a,($0960) ;[09d7] + cp $05 ;[09da] + jp nz,$09e9 ;[09dc] + ld de,$0e96 ;[09df] + call C_WRITESTR ;[09e2] + xor a ;[09e5] + ld ($0960),a ;[09e6] + pop af ;[09e9] + ld e,$20 ;[09ea] + call C_OUT ;[09ec] + ld a,($09d1) ;[09ef] + add a ;[09f2] + add a ;[09f3] + add a ;[09f4] + add a ;[09f5] + add a ;[09f6] + ld ($09d1),a ;[09f7] + ld de,($09d1) ;[09fa] + ld hl,$0080 ;[09fe] + add hl,de ;[0a01] + ld a,(hl) ;[0a02] + cp $e5 ;[0a03] + jp z,$0a35 ;[0a05] + push hl ;[0a08] + ld de,$000c ;[0a09] + add hl,de ;[0a0c] + ld a,(hl) ;[0a0d] + or a ;[0a0e] + pop hl ;[0a0f] + jp nz,$0a35 ;[0a10] + inc hl ;[0a13] + ld b,$08 ;[0a14] + call $0a3b ;[0a16] + ld e,$2e ;[0a19] + call C_OUT ;[0a1b] + ld b,$03 ;[0a1e] + call $0a3b ;[0a20] + ld e,$20 ;[0a23] + call C_OUT ;[0a25] + ld e,$3a ;[0a28] + call C_OUT ;[0a2a] + ld a,($0960) ;[0a2d] + inc a ;[0a30] + ld ($0960),a ;[0a31] + ret ;[0a34] + + ld e,$08 ;[0a35] + call C_OUT ;[0a37] + ret ;[0a3a] + + ld e,(hl) ;[0a3b] + call C_OUT ;[0a3c] + inc hl ;[0a3f] + dec b ;[0a40] + jp nz,$0a3b ;[0a41] + ret ;[0a44] + + ld a,($036e) ;[0a45] + call SERIAL_OUT ;[0a48] + ret ;[0a4b] + + push af ;[0a4c] + ld a,($036d) ;[0a4d] + call SERIAL_OUT ;[0a50] + pop af ;[0a53] + ret ;[0a54] + + nop ;[0a55] + push bc ;[0a56] + push de ;[0a57] + push hl ;[0a58] + ld b,$02 ;[0a59] + ld de,$9000 ;[0a5b] + push af ;[0a5e] + push bc ;[0a5f] + rl a ;[0a60] + dec de ;[0a62] + ld a,d ;[0a63] + or a ;[0a64] + jr nz,$0a60 ;[0a65] + pop bc ;[0a67] + pop af ;[0a68] + djnz $0a5b ;[0a69] + dec a ;[0a6b] + jr nz,$0a59 ;[0a6c] + pop hl ;[0a6e] + pop de ;[0a6f] + pop bc ;[0a70] + ret ;[0a71] + + ld b,$06 ;[0a72] + xor a ;[0a74] + call SERIAL_OUT ;[0a75] + djnz $0a74 ;[0a78] + ret ;[0a7a] + + push bc ;[0a7b] + push de ;[0a7c] + ld bc,$ffff ;[0a7d] + ld de,$8000 ;[0a80] + call SERIAL_IN_AVAIL ;[0a83] + jp nz,$0a98 ;[0a86] + dec de ;[0a89] + ld a,d ;[0a8a] + or e ;[0a8b] + jp nz,$0a83 ;[0a8c] + dec bc ;[0a8f] + ld a,b ;[0a90] + or c ;[0a91] + jp nz,$0a8f ;[0a92] + pop de ;[0a95] + pop bc ;[0a96] + ret ;[0a97] + + ld a,$ff ;[0a98] + pop de ;[0a9a] + pop bc ;[0a9b] + ret ;[0a9c] + + +; At the end of the execution in ($0AE7) there will be a 2 byte value representing the sum +; of all of the content of memory starting from $03DA up until the content of the memory is =$24 +; Expected result = $49ea (????) +L0A9D: + ld hl,$0000 ;[0a9d] + ld ($0ae7),hl ;[0aa0] ($0ae7) = $0000 + ld hl,$0d3a ;[0aa3] +L0AA6: + ld a,(hl) ;[0aa6] + cp $24 ;[0aa7] + ret z ;[0aa9] if ($0d3a) == $24 then return + push hl ;[0aaa] + ld hl,($0ae7) ;[0aab] + ld e,a ;[0aae] + ld d,$00 ;[0aaf] + add hl,de ;[0ab1] + ld ($0ae7),hl ;[0ab2] + pop hl ;[0ab5] + inc hl ;[0ab6] + jp L0AA6 ;[0ab7] + + +; Check if there is a character available to read from the SIO, {$00=not available,$01=available} +; Get data from the #port stored at address $0116 and the value stored at address $0117 ($01 (?)) and +; perform an AND operation between them +SERIAL_IN_AVAIL: + push hl ;[0aba] + push bc ;[0abb] + ld hl,$0116 ;[0abc] + ld c,(hl) ;[0abf] + in a,(c) ;[0ac0] + inc hl ;[0ac2] + ld c,(hl) ;[0ac3] + and c ;[0ac4] + pop bc ;[0ac5] + pop hl ;[0ac6] + ret ;[0ac7] + + +; Get input in A register and disable receive +SERIAL_IN: + in a,($b0) ;[0ac8] + push af ;[0aca] + call SERIAL_NOT_READY_SIGNAL ;[0acb] + pop af ;[0ace] + ret ;[0acf] + +; Wait for the SIO's transmit buffer to be empty and then send the value stored in A +SERIAL_OUT: + push hl ;[0ad0] + push bc ;[0ad1] + push af ;[0ad2] +WAIT_EMPTY_TX_BUFFER: + ld hl,$0116 ;[0ad3] + ld c,(hl) ;[0ad6] + in a,(c) ;[0ad7] Read SIO's RR0 + inc hl ;[0ad9] + inc hl ;[0ada] + ld c,(hl) ;[0adb] + and c ;[0adc] + jr z,WAIT_EMPTY_TX_BUFFER ;[0add] Jump if SIO's transmit buffer is not empty + inc hl ;[0adf] + ld c,(hl) ;[0ae0] + pop af ;[0ae1] + out (c),a ;[0ae2] Transmit value of A + pop bc ;[0ae4] + pop hl ;[0ae5] + ret ;[0ae6] + + DB $00 ;[0ae7] + DB $00 ;[0ae8] + + ld a,$12 ;[0ae9] + ld ($0b0d),a ;[0aeb] + ld ($0b0e),a ;[0aee] + ld hl,$0080 ;[0af1] + xor a ;[0af4] + ld e,(hl) ;[0af5] + inc hl ;[0af6] + push hl ;[0af7] + call $0b0f ;[0af8] + ld ($0b0c),a ;[0afb] + pop hl ;[0afe] + ld a,l ;[0aff] + or a ;[0b00] + ld a,($0b0c) ;[0b01] + jr nz,$0af5 ;[0b04] + ld e,$00 ;[0b06] + call $0b0f ;[0b08] + ret ;[0b0b] + + nop ;[0b0c] + nop ;[0b0d] + nop ;[0b0e] + ld b,$08 ;[0b0f] + bit 7,a ;[0b11] + jr z,$0b1c ;[0b13] + ld hl,$0b0d ;[0b15] + xor (hl) ;[0b18] + ld ($0b0e),a ;[0b19] + sla a ;[0b1c] + sla e ;[0b1e] + jr nc,$0b24 ;[0b20] + set 0,a ;[0b22] + dec b ;[0b24] + jr nz,$0b11 ;[0b25] + ret ;[0b27] + + DB $0D ;[0b28] + DB $0A ;[0b29] + DB "EMISSION D'UN FICHIER $" ;[0b2a- + + DB $0D ;[0b43] + DB $0A ;[0b44] + DB "FICHIER ASCII ? (O/N) :$" ;[0b45- + + DB $0D ;[0b53] + DB $0A ;[0b5f] + DB "RECEPTION D'UN FICHIER $" ;[0b60- + + DB $0D ;[0b79] + DB $0A ;[0b7a] + DB "SUR QUEL DISQUE (A B C) ? $" ;[0b7b- + + DB $0D ;[0b96] + DB $0A ;[0b87] + DB "NOM DU FICHIER $" ;[0b98- + + DB $0D ;[0ba9] + DB $0A ;[0baa] + DB "FICHIER INEXISTANT" ;[0bab- + DB $0D ;[0bbd] + DB $0A ;[0bbe] + DB $24 ;[0bbf] + + DB $0D ;[0bc0] + DB $0A ;[0bc1] + DB "DISQUE PLEIN" ;[0bc2- + DB $0D ;[0bce] + DB $0A ;[0bcf] + DB $24 ;[0bd0] + + DB $0D ;[0bd1] + DB $0A ;[0bd2] + DB "MAUVAISE ENTREE" ;[0bd3- + DB $0D ;[0be2] + DB $0A ;[0be3] + DB $24 ;[0be4] + + DB $0D ;[0be5] + DB $0A ;[0be6] + DB "FICHIER RECU ET ECRIT" ;[0be7- + DB $0D ;[0bfc] + DB $0A ;[0bfd] + DB $24 ;[0bfe] + + DB $0D ;[0bff] + DB $0A ;[0c00] + DB "TRANSFERT EN COURS" ;[0c01- + DB $0D ;[0c13] + DB $0A ;[0c14] + DB $24 ;[0c15] + + DB $0D ;[0c16] + DB $0A ;[0c17] + DB "TRANSFERT TERMINE" ;[0c18- + DB $0D ;[0c29] + DB $0A ;[0c2a] + DB $0D ;[0c2b] + DB $0A ;[0c2c] + DB "ATTENDEZ DE SAVOIR SI VOUS AVEZ LA MAIN";[0c2d- + DB $0D ;[0c54] + DB $0A ;[0c55] + DB "A L'APPARITION D'UN 'PROMPT' OU D'UNE '*' ET";[0c56- + DB $0D ;[0c82] + DB $0A ;[0c83] + DB "ENTREZ (SAVE) AU CLAVIER SI C'EST UN NOUVEAU FICHIER";[0c84- + DB $0D ;[0cb8] + DB $0A ;[0cb9] + DB "OU (REPLACE) S'IL EXISTE DEJA" ;[0cba- + DB $0D ;[0cd7] + DB $0A ;[0cd8] + DB $24 ;[0cd9] + + DB $1A ;[0cda] + DB $1B ;[0cdb] + DB "=#%SANCO A SANCO :OUI $" ;[0cdc- + + DB $1A ;[0cf3] + DB $1B ;[0cf4] + DB "=#%SANCO A SANCO :NON $" ;[0cf5- + + DB $1B ;[0d0c] + DB "=#>VIA TRANSPAC :OUI $" ;[0d0d- + + DB $1B ;[0d23] + DB "=#>PAR TRANSPAC :NON $" ;[0d24- + + DB $1B ;[0d3a] + DB "=!! (C) S.F.C.E 10/01/82 POUR SANCO-IBEX";[0d3b- + DB $1B ;[0d63] + DB $48 ;[0d64] + DB $1B ;[0d65] + DB "=(* SANCONET CLUB DES UTILISATEURS SANCO ";[0d66- + DB $1B ;[0d90] + DB $49 ;[0d91] + DB $1B ;[0d92] + DB "=,*CTRL-D RETOUR AU MENU PRINCIPAL";[0d93- + DB $1B ;[0db5] + DB "=.*CTRL-T MISE EN LIAISON" ;[0db6- + DB $1B ;[0dcf] + DB "=0*CTRL-L EMISSION D'UN FICHIER DU DISQUE";[0dd0- + DB $1B ;[0df9] + DB "=2*CTRL-W RECEPTION D'UN FICHIER SUR DISQUE";[0dfa- + DB $1B ;[0e25] + DB "=4*CTRL-A AFFICHAGE DU CATALOGUE DU DISQUE";[0e26- + DB $1B ;[0e50] + DB "=6/VOTRE CHOIX? :$" ;[0e51- + +INIT_STRING: + DB $1A ;[0e63] + DB $0D ;[0e64] + DB $0A ;[0e65] + DB $0A ;[0e66] + DB $0A ;[0e67] + DB "TERM80 VER 1.0 (C) S.F.C.E" ;[0e68- + DB $0D ;[0e80] + DB $0A ;[0e81] + DB $0D ;[0e82] + DB $0A ;[0e83] + DB "LIAISON EN COURS" ;[0e86- + DB $0D ;[0e96] + DB $0A ;[0e97] + DB $24 ;[0e98] + + + DB $1A ;[0e99] + DB $1B ;[0e9A] + DB "=%/AFFICHAGE DE LA DIRECTORY DU DRIVE : $";[0e9b- + DB $0D ;[0ec4] + DB $0A ;[0ec5] + DB "APPUYER SUR LA TOUCHE RETURN $";[0ec6- + DB $0D ;[0ee4] + DB $0A ;[0ee5] + DB "PARASITE OU RUPTURE DE LIGNE " ;[0ee6- + DB $0D ;[0f03] + DB $0A ;[0f04] + DB $24 ;[0f05] + + + DB $1A ;[0f06] + DB $0D ;[0f07] + DB $0A ;[0f08] + DB $0D ;[0f09] + DB $0A ;[0f0a] + DB $09 ;[0f0b] + DB $09 ;[0f0c] + DB "OUI = 1" ;[0f0d- + DB $09 ;[0f14] + DB $09 ;[0f15] + DB $09 ;[0f16] + DB "NON = 0" ;[0f17- + DB $1B ;[0f1e] + DB "=%*SANCO A SANCO : " ;[0f1f- + DB $1B ;[0f37] + DB "='*VIA TRANSPAC : " ;[0f38- + DB $1B ;[0f50] + DB "=)*APPEL AUTOMATIQUE : " ;[0f51- + DB $1B ;[0f69] + DB "=+*SI OUI APPEL DE LA BASE : ";[0f6a- + DB $1B ;[0f96] + DB "=-*pour modifier deplacez le curseur ou return pour sortir";[0f97- + DB $0D ;[0fd1] + DB $0A ;[0fd2] + DB "-----------------------------------------------------------";[0fd3- + DB $0D ;[100e] + DB $0A ;[100f] + DB "partie technique a ne modifier qu'avec l'accord de votre installateur ";[1010- + DB $1B ;[1056] + DB "=1*PORT DE STATUS = " ;[1057- + DB $1B ;[106f] + DB "=3*PORT DE DATA = " ;[1070- + DB $1B ;[1088] + DB "=5*MASQUE D'ENTREE = " ;[1089- + DB $1B ;[10a1] + DB "=7*MASQUE DE SORTIE = " ;[10a2- + DB $1B ;[10ba] + DB "=.!$" ;[10bb- + DB "*" ;[10bf] + + nop ;[10c0] + nop ;[10c1] + nop ;[10c2] + nop ;[10c3] + nop ;[10c4] + nop ;[10c5] + nop ;[10c6] + nop ;[10c7] + nop ;[10c8] + nop ;[10c9] + nop ;[10ca] + nop ;[10cb] + nop ;[10cc] + nop ;[10cd] + nop ;[10ce] + nop ;[10cf] + nop ;[10d0] + nop ;[10d1] + nop ;[10d2] + nop ;[10d3] + nop ;[10d4] + nop ;[10d5] + nop ;[10d6] + nop ;[10d7] + nop ;[10d8] + nop ;[10d9] + nop ;[10da] + nop ;[10db] + nop ;[10dc] + nop ;[10dd] + nop ;[10de] + nop ;[10df] + nop ;[10e0] + nop ;[10e1] + nop ;[10e2] + nop ;[10e3] + nop ;[10e4] + nop ;[10e5] + nop ;[10e6] + nop ;[10e7] + nop ;[10e8] + nop ;[10e9] + nop ;[10ea] + nop ;[10eb] + nop ;[10ec] + nop ;[10ed] + nop ;[10ee] + nop ;[10ef] + nop ;[10f0] + nop ;[10f1] + nop ;[10f2] + nop ;[10f3] + nop ;[10f4] + nop ;[10f5] + nop ;[10f6] + nop ;[10f7] + nop ;[10f8] + nop ;[10f9] + nop ;[10fa] + nop ;[10fb] + nop ;[10fc] + nop ;[10fd] + nop ;[10fe] + nop ;[10ff] + nop ;[1100] + nop ;[1101] + nop ;[1102] + nop ;[1103] + nop ;[1104] + nop ;[1105] + nop ;[1106] + nop ;[1107] + nop ;[1108] + nop ;[1109] + nop ;[110a] + nop ;[110b] + nop ;[110c] + nop ;[110d] + nop ;[110e] + nop ;[110f] + nop ;[1110] + nop ;[1111] + nop ;[1112] + nop ;[1113] + nop ;[1114] + nop ;[1115] + nop ;[1116] + nop ;[1117] + nop ;[1118] + nop ;[1119] + nop ;[111a] + nop ;[111b] + nop ;[111c] + nop ;[111d] + nop ;[111e] + nop ;[111f] + nop ;[1120] + nop ;[1121] + nop ;[1122] + nop ;[1123] + nop ;[1124] + nop ;[1125] + nop ;[1126] + nop ;[1127] + nop ;[1128] + nop ;[1129] + nop ;[112a] + nop ;[112b] + nop ;[112c] + nop ;[112d] + nop ;[112e] + nop ;[112f] + nop ;[1130] + nop ;[1131] + nop ;[1132] + nop ;[1133] + nop ;[1134] + nop ;[1135] + nop ;[1136] + nop ;[1137] + nop ;[1138] + nop ;[1139] + nop ;[113a] + nop ;[113b] + nop ;[113c] + nop ;[113d] + nop ;[113e] + nop ;[113f] + nop ;[1140] + nop ;[1141] + nop ;[1142] + nop ;[1143] + nop ;[1144] + nop ;[1145] + nop ;[1146] + nop ;[1147] + nop ;[1148] + nop ;[1149] + nop ;[114a] + nop ;[114b] + nop ;[114c] + nop ;[114d] + nop ;[114e] + nop ;[114f] + nop ;[1150] + nop ;[1151] + nop ;[1152] + nop ;[1153] + nop ;[1154] + nop ;[1155] + nop ;[1156] + nop ;[1157] + nop ;[1158] + nop ;[1159] + nop ;[115a] + nop ;[115b] + nop ;[115c] + nop ;[115d] + nop ;[115e] + nop ;[115f] + nop ;[1160] + nop ;[1161] + nop ;[1162] + nop ;[1163] + nop ;[1164] + nop ;[1165] + nop ;[1166] + nop ;[1167] + nop ;[1168] + nop ;[1169] + nop ;[116a] + nop ;[116b] + nop ;[116c] + nop ;[116d] + nop ;[116e] + nop ;[116f] + nop ;[1170] + nop ;[1171] + nop ;[1172] + nop ;[1173] + nop ;[1174] + nop ;[1175] + nop ;[1176] + nop ;[1177] + nop ;[1178] + nop ;[1179] + nop ;[117a] + nop ;[117b] + nop ;[117c] + nop ;[117d] + nop ;[117e] + nop ;[117f] + nop ;[1180] + nop ;[1181] + nop ;[1182] + nop ;[1183] + nop ;[1184] + nop ;[1185] + nop ;[1186] + nop ;[1187] + nop ;[1188] + nop ;[1189] + nop ;[118a] + nop ;[118b] + nop ;[118c] + nop ;[118d] + nop ;[118e] + nop ;[118f] + nop ;[1190] + nop ;[1191] + nop ;[1192] + nop ;[1193] + nop ;[1194] + nop ;[1195] + nop ;[1196] + nop ;[1197] + nop ;[1198] + nop ;[1199] + nop ;[119a] + nop ;[119b] + nop ;[119c] + nop ;[119d] + nop ;[119e] + nop ;[119f] + nop ;[11a0] + nop ;[11a1] + nop ;[11a2] + nop ;[11a3] + nop ;[11a4] + nop ;[11a5] + nop ;[11a6] + nop ;[11a7] + nop ;[11a8] + nop ;[11a9] + nop ;[11aa] + nop ;[11ab] + nop ;[11ac] + nop ;[11ad] + nop ;[11ae] + nop ;[11af] + nop ;[11b0] + nop ;[11b1] + nop ;[11b2] + nop ;[11b3] + nop ;[11b4] + nop ;[11b5] + nop ;[11b6] + nop ;[11b7] + nop ;[11b8] + nop ;[11b9] + nop ;[11ba] + nop ;[11bb] + nop ;[11bc] + nop ;[11bd] + nop ;[11be] + nop ;[11bf] + nop ;[11c0] + nop ;[11c1] + nop ;[11c2] + nop ;[11c3] + ld a,$01 ;[11c4] + ld ($11fc),a ;[11c6] + ret ;[11c9] + + push hl ;[11ca] + ld ($11fd),a ;[11cb] + cp $0f ;[11ce] + call c,$11c4 ;[11d0] + xor a ;[11d3] + ld hl,$11fd ;[11d4] + rrd ;[11d7] + and $0f ;[11d9] + add $30 ;[11db] + cp $3a ;[11dd] + jp m,$11e4 ;[11df] + add $07 ;[11e2] + ld ($11ff),a ;[11e4] + ld a,(hl) ;[11e7] + add $37 ;[11e8] + ld ($11fe),a ;[11ea] + ld a,($11fc) ;[11ed] + or a ;[11f0] + jr z,$11fa ;[11f1] + xor a ;[11f3] + ld ($11fe),a ;[11f4] + ld ($11fc),a ;[11f7] + pop hl ;[11fa] + ret ;[11fb] + + nop ;[11fc] + nop ;[11fd] + nop ;[11fe] + nop ;[11ff] + inc h ;[1200] + push hl ;[1201] + ld hl,$11fe ;[1202] + ld a,(hl) ;[1205] + sub $37 ;[1206] + rla ;[1208] + rla ;[1209] + rla ;[120a] + rla ;[120b] + ld (hl),a ;[120c] + inc hl ;[120d] + ld a,(hl) ;[120e] + sub $30 ;[120f] + dec hl ;[1211] + add (hl) ;[1212] + ld ($11fd),a ;[1213] + pop hl ;[1216] + ret ;[1217] + + nop ;[1218] + nop ;[1219] + nop ;[121a] + nop ;[121b] + nop ;[121c] + nop ;[121d] + nop ;[121e] + nop ;[121f] + nop ;[1220] + nop ;[1221] + nop ;[1222] + nop ;[1223] + nop ;[1224] + nop ;[1225] + nop ;[1226] + nop ;[1227] + nop ;[1228] + nop ;[1229] + nop ;[122a] + nop ;[122b] + nop ;[122c] + nop ;[122d] + nop ;[122e] + nop ;[122f] + nop ;[1230] + nop ;[1231] + nop ;[1232] + nop ;[1233] + nop ;[1234] + nop ;[1235] + nop ;[1236] + nop ;[1237] + nop ;[1238] + nop ;[1239] + nop ;[123a] + nop ;[123b] + nop ;[123c] + nop ;[123d] + nop ;[123e] + nop ;[123f] + nop ;[1240] + nop ;[1241] + nop ;[1242] + nop ;[1243] + ld a,$01 ;[1244] + ld ($11fc),a ;[1246] + ret ;[1249] + + push hl ;[124a] + ld ($11fd),a ;[124b] + cp $0f ;[124e] + call c,$11c4 ;[1250] + xor a ;[1253] + ld hl,$11fd ;[1254] + rrd ;[1257] + and $0f ;[1259] + add $30 ;[125b] + cp $3a ;[125d] + jp m,$11e4 ;[125f] + add $07 ;[1262] + ld ($11ff),a ;[1264] + ld a,(hl) ;[1267] + add $37 ;[1268] + ld ($11fe),a ;[126a] + ld a,($11fc) ;[126d] + or a ;[1270] + jr z,$127a ;[1271] + xor a ;[1273] + ld ($11fe),a ;[1274] + ld ($11fc),a ;[1277] + pop hl ;[127a] + ret ;[127b] + + nop ;[127c] + nop ;[127d] + nop ;[127e] + nop ;[127f] From 43ce9005cedcd83bcc5aa1fd6c6ca6af927db463 Mon Sep 17 00:00:00 2001 From: BayoDev Date: Sat, 8 Nov 2025 19:19:51 +0100 Subject: [PATCH 2/6] Applied correct references to relocated files --- applications/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/applications/README.md b/applications/README.md index 90e4ad3..9e9ecb7 100644 --- a/applications/README.md +++ b/applications/README.md @@ -5,14 +5,14 @@ - CONFIG80.COM: configuration of the serial port, **disassembly in progress**; - [COPY8003.COM](COPY8003.COM.asm): disk copy utility; -- [FMT8003.COM](https://github.com/BayoDev/Sanco_8000/blob/main/CP-M/DISASSEMBLY/FMT8003_disassembly.z80): disk format utility; +- [FMT8003.COM](FMT8003.COM.asm): disk format utility; - [FUNK00.COM](FUNK00.COM.asm): keymap configuration; - [PAR8003.COM](PAR8003.COM.asm): configure diskette units; - [REV.COM](REV.COM): delete files; -- [RCX62.COM](https://github.com/BayoDev/Sanco_8000/blob/main/CP-M/DISASSEMBLY/RCX62_disassembly.z80): receive data from serial port; +- [RCX62.COM](RCX62.COM.asm): receive data from serial port; - [SG8003.COM](SG8003.COM.asm): boot sector copier, used to change the boot program - [SLF80037.COM](SLF80037.COM.asm): bootstrap application; -- [TERM80.COM](https://github.com/BayoDev/Sanco_8000/blob/main/CP-M/DISASSEMBLY/TERM80_disassembly.z80): serial terminal; +- [TERM80.COM](TERM80.COM.asm): serial terminal; - [TRX62.COM](TRX62.COM): send data through serial port; ## CP/M system tools and applications From 8d8ffa05d50603edea01081fcd7e6464d0664b2f Mon Sep 17 00:00:00 2001 From: BayoDev Date: Tue, 11 Nov 2025 17:17:45 +0100 Subject: [PATCH 3/6] RCX62.COM assembler-friendly --- applications/RCX62.COM.asm | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/applications/RCX62.COM.asm b/applications/RCX62.COM.asm index 85fa851..928b10a 100644 --- a/applications/RCX62.COM.asm +++ b/applications/RCX62.COM.asm @@ -31,11 +31,11 @@ INIT: call PRINT_NEXT_STR ;[011f] DB $0d ;[0122] DB $0a ;[0123] - .ASCII "File exchange program vers 6.0 ,4800 Baud (SED)";[0124] + DB "File exchange program vers 6.0 ,4800 Baud (SED)";[0124] DB $0d ;[0153] DB $0a ;[0154] DB $0a ;[0155] - .ASCII "Ready to receive" ;[0156] + DB "Ready to receive" ;[0156] DB $0d ;[0166] DB $0a ;[0167] DB $00 ;[0168] @@ -326,7 +326,7 @@ TRANSMISSION_END: DB $0D ;[029b] DB $0A ;[029c] DB $0A ;[029d] - .ASCII "End of transmission" ;[02a0] + DB "End of transmission" ;[02a0] DB $0D ;[02b3] DB $0A ;[02b4] DB $00 ;[02b5] @@ -415,7 +415,7 @@ FILE_NAME_ERROR: call PRINT_NEXT_STR ;[034a] DB $0D ;[034d] DB $0A ;[034e] - .ASCII "File name error" ;[034f] + DB "File name error" ;[034f] DB $00 ;[035e] ld a,$0d ;[035f] call SIO_WRITE_WRAPPER ;[0361] @@ -425,7 +425,7 @@ DIR_FULL_ERROR: call PRINT_NEXT_STR ;[0367] DB $0D ;[036a] DB $0A ;[036b] - .ASCII "Directory full" ;[036c] + DB "Directory full" ;[036c] DB $00 ;[037a] ld a,$0d ;[037b] call SIO_WRITE_WRAPPER ;[037d] @@ -435,7 +435,7 @@ FILE_TRANSFER_ERROR: call PRINT_NEXT_STR ;[0383] DB $0D ;[0386] DB $0A ;[0387] - .ASCII "File transfer error" ;[0388] + DB "File transfer error" ;[0388] nop ;[039b] ld a,$0d ;[039c] call SIO_WRITE_WRAPPER ;[039e] @@ -445,7 +445,7 @@ FILE_WRITE_ERROR: call PRINT_NEXT_STR ;[03a4] DB $0D ;[03a7] DB $0a ;[03a8] - .ASCII "File write error" ;[03a9] + DB "File write error" ;[03a9] DB $00 ;[03b9] ld a,$0d ;[03ba] call SIO_WRITE_WRAPPER ;[03bc] @@ -455,7 +455,7 @@ CLOSING_ERROR: call PRINT_NEXT_STR ;[03c2] DB $0D ;[03c5] DB $0A ;[03c6] - .ASCII "Closing error" ;[03c7] + DB "Closing error" ;[03c7] DB $00 ;[03d4] ld a,$0d ;[03d5] call SIO_WRITE_WRAPPER ;[03d7] @@ -465,7 +465,7 @@ FILE_ERROR: call PRINT_NEXT_STR ;[03dd] DB $0D ;[03e0] DB $0A ;[03e1] - .ASCII "File error" ;[03e2] + DB "File error" ;[03e2] DB $00 ;[03ec] ld a,$0d ;[03ed] call SIO_WRITE_WRAPPER ;[03ef] @@ -476,7 +476,7 @@ RENAME_ERROR: call PRINT_NEXT_STR ;[03f5] DB $0D ;[03f8] DB $0A ;[03f9] - .ASCII "Rename error" ;[03fa] + DB "Rename error" ;[03fa] DB $00 ;[0406] ld a,$0d ;[0407] call SIO_WRITE_WRAPPER ;[0409] @@ -498,19 +498,19 @@ PRINT_FILENAME: ex de,hl ;[0419] inc hl ;[041a] ld b,$08 ;[041b] -.PRINT_NAME: +PRINT_NAME: ld a,(hl) ;[041d] A = (HL) call C_WRITE ;[041e] Print A to CRT inc hl ;[0421] HL++ - djnz .PRINT_NAME ;[0422] Decrement B and if B!=$00 jump. (Will jump 8 times) + djnz PRINT_NAME ;[0422] Decrement B and if B!=$00 jump. (Will jump 8 times) ld a,$2e ;[0424] call C_WRITE ;[0426] Print '.' ld b,$03 ;[0429] -.PRINT_EXT: +PRINT_EXT: ld a,(hl) ;[042b] A = (HL) call C_WRITE ;[042c] Print A to CRT inc hl ;[042f] HL++ - djnz .PRINT_EXT ;[0430] B-- and jump if B!=$00 (Will jump 3 times) + djnz PRINT_EXT ;[0430] B-- and jump if B!=$00 (Will jump 3 times) ex de,hl ;[0432] ret ;[0433] @@ -549,10 +549,10 @@ SIO_SETUP_COMMANDS: ; Write the character stored in the A register to port B of the SIO (Blocks until can transmit) SIO_WRITE: push af ;[0461] -.SIO_WRITE_LOOP: +SIO_WRITE_LOOP: in a,($b1) ;[0462] and $04 ;[0464] - jp z,.SIO_WRITE_LOOP ;[0466] Loop until SIO is ready to transmit + jp z,SIO_WRITE_LOOP ;[0466] Loop until SIO is ready to transmit pop af ;[0469] out ($b0),a ;[046a] Write A to SIO ret ;[046c] From 4aa1fcc8d4b0495ca0fd26ac7ae8b7d7e46e71d6 Mon Sep 17 00:00:00 2001 From: BayoDev Date: Tue, 11 Nov 2025 17:34:24 +0100 Subject: [PATCH 4/6] remove TERM80 --- applications/TERM80.COM.asm | 2160 ----------------------------------- 1 file changed, 2160 deletions(-) delete mode 100644 applications/TERM80.COM.asm diff --git a/applications/TERM80.COM.asm b/applications/TERM80.COM.asm deleted file mode 100644 index ac7158f..0000000 --- a/applications/TERM80.COM.asm +++ /dev/null @@ -1,2160 +0,0 @@ -; This is the disassembly of the "TERM80.COM" program for the Sanco 8003 -; found in the CP/M 2.2 image at this link: -; https://archive.org/details/sanco-8003-cpm-2.2fr.dsqd -; -; By Giulio Venturini (@BayoDev) -; -; THIS IS NOT COMPLETE, MANY PARTS OF THE CODE REMAIN UNEXPLAINED AND SOME UNREACHABLE - - - org $0100 - -CPM_ENTRY: - jp ENTRY_POINT ;[0100] - - rst $38 ;[0103] - nop ;[0104] - nop ;[0105] - ld sp,$3239 ;[0106] - jr nc,$013b ;[0109] - jr nc,$013f ;[010b] - ld sp,$2c30 ;[010d] - ld d,e ;[0110] - ld b,c ;[0111] - ld c,(hl) ;[0112] - ld b,e ;[0113] - ld c,a ;[0114] - dec c ;[0115] - - DB $b1 ;[0116] Serial port device number (CONTROL) - DB $01 ;[0117] Bit mask for SIO's RR0 "Receive Character Available" - DB $04 ;[0118] Bit mask for SIO's RR0 "Transmit Buffer Empty" (bit set=empty buffer) - DB $b0 ;[0119] Serial port device number (DATA) - - inc h ;[011a] - ld bc,$0010 ;[011b] - nop ;[011e] - nop ;[011f] - nop ;[0120] - nop ;[0121] - nop ;[0122] - nop ;[0123] - nop ;[0124] - nop ;[0125] - nop ;[0126] - nop ;[0127] - nop ;[0128] - nop ;[0129] - nop ;[012a] - nop ;[012b] - nop ;[012c] - nop ;[012d] - nop ;[012e] - nop ;[012f] - nop ;[0130] - inc h ;[0131] - dec d ;[0132] - ld e,$19 ;[0133] - nop ;[0135] - jr $0138 ;[0136] - rla ;[0138] - ld a,(de) ;[0139] - nop ;[013a] - nop ;[013b] - nop ;[013c] - nop ;[013d] - nop ;[013e] - nop ;[013f] - nop ;[0140] - nop ;[0141] - nop ;[0142] - nop ;[0143] - nop ;[0144] - nop ;[0145] - inc h ;[0146] - nop ;[0147] - nop ;[0148] - nop ;[0149] - nop ;[014a] - nop ;[014b] - nop ;[014c] - nop ;[014d] - nop ;[014e] - nop ;[014f] - nop ;[0150] - nop ;[0151] - nop ;[0152] - nop ;[0153] - nop ;[0154] - nop ;[0155] - nop ;[0156] - nop ;[0157] - nop ;[0158] - nop ;[0159] - nop ;[015a] - nop ;[015b] - nop ;[015c] - nop ;[015d] - nop ;[015e] - nop ;[015f] - - DB $00 ;[0160] Printer echo activation ($00=Disabled,otherwise enabled) - DB $00 ;[0161] - DB $CD ;[0162] - DB $00 ;[0163] - DB $00 ;[0164] - - nop ;[0165] - nop ;[0166] - nop ;[0167] - nop ;[0168] - nop ;[0169] - nop ;[016a] - nop ;[016b] - nop ;[016c] - nop ;[016d] - nop ;[016e] - nop ;[016f] - nop ;[0170] - nop ;[0171] - nop ;[0172] - nop ;[0173] - nop ;[0174] - nop ;[0175] - nop ;[0176] - nop ;[0177] - nop ;[0178] - nop ;[0179] - nop ;[017a] - nop ;[017b] - nop ;[017c] - nop ;[017d] - nop ;[017e] - nop ;[017f] - nop ;[0180] - nop ;[0181] - nop ;[0182] - nop ;[0183] - nop ;[0184] - nop ;[0185] - nop ;[0186] - nop ;[0187] - nop ;[0188] - nop ;[0189] - nop ;[018a] - nop ;[018b] - nop ;[018c] - nop ;[018d] - nop ;[018e] - nop ;[018f] - nop ;[0190] - nop ;[0191] - nop ;[0192] - nop ;[0193] - nop ;[0194] - nop ;[0195] - nop ;[0196] - nop ;[0197] - nop ;[0198] - nop ;[0199] - nop ;[019a] - nop ;[019b] - nop ;[019c] - nop ;[019d] - nop ;[019e] - nop ;[019f] - nop ;[01a0] - nop ;[01a1] - nop ;[01a2] - nop ;[01a3] - nop ;[01a4] - nop ;[01a5] - nop ;[01a6] - nop ;[01a7] - nop ;[01a8] - nop ;[01a9] - nop ;[01aa] - nop ;[01ab] - nop ;[01ac] - nop ;[01ad] - nop ;[01ae] - nop ;[01af] - nop ;[01b0] - nop ;[01b1] - nop ;[01b2] - nop ;[01b3] - nop ;[01b4] - nop ;[01b5] - nop ;[01b6] - nop ;[01b7] - nop ;[01b8] - nop ;[01b9] - nop ;[01ba] - nop ;[01bb] - nop ;[01bc] - nop ;[01bd] - nop ;[01be] - nop ;[01bf] - nop ;[01c0] - nop ;[01c1] - nop ;[01c2] - nop ;[01c3] - nop ;[01c4] - nop ;[01c5] - -; A = {$FF = console device ready, $00 otherwise} -CONSOLE_READY: - jp $01c6 ;[01c6] After SETUP routine jumps to CONST BIOS entry - -; A = console character ; Wait until the character is ready -CONSOLE_INPUT: - jp $01c9 ;[01c9] After SETUP routine jumps to CONIN BIOS entry - -;The character is sent from register C to the console output device. The character is in ASCII, with high-order parity bit set to zero. -CONSOLE_OUTPUT: - jp $01cc ;[01cc] After SETUP routine jumps to CONOUT BIOS entry - -; You return the ready status of the list device used by the DESPOOL program to improve console response during its operation. -; The value 00 is returned in A if the list device is not ready to accept a character and 0FFH if a character can be sent to the printer. -; A 00 value should be returned if LIST status is not implemented. -LIST_STATUS: - jp $01cf ;[01cf] After SETUP routine jumps to WRITE BIOS entry - -ENTRY_POINT: - ld sp,$0820 ;[01d2] - call SETUP_WRAPPER ;[01d5] - jp STARTUP ;[01d8] - - call SERIAL_READY_SIGNAL ;[01db] - call SERIAL_NOT_READY_SIGNAL ;[01de] - call CONSOLE_INPUT ;[01e1] - call $027f ;[01e4] - - cp $04 ;[01e7] - jp z,ENTRY_POINT ;[01e9] - cp $14 ;[01ec] - jp z,STARTUP ;[01ee] - cp $0c ;[01f1] - jp z,$03ba ;[01f3] - cp $17 ;[01f6] - jp z,$03ab ;[01f8] - cp $03 ;[01fb] - jp z,$037a ;[01fd] - cp $01 ;[0200] - jp z,$0961 ;[0202] - cp $0d ;[0205] - jp z,$0898 ;[0207] - jp $01db ;[020a] - -STARTUP: - ld de,INIT_STRING ;[020d] - call C_WRITESTR ;[0210] Write initial string -MAIN_LOOP: - call SERIAL_READY_SIGNAL ;[0213] Setup SIO ready for data - call SERIAL_IN_AVAIL ;[0216] Check if there is a character to read from the SIO - jp nz,GET_INPUT ;[0219] Jump if a character is ready to be read from the SIO - call SERIAL_NOT_READY_SIGNAL ;[021c] Setup SIO not ready for data - call CONSOLE_READY ;[021f] Check TTY status - or a ;[0222] - jp z,MAIN_LOOP ;[0223] Jump if there is no character to read - call CONSOLE_INPUT ;[0226] Get character from TTY - call SERIAL_OUT ;[0229] Send character through serial - jp MAIN_LOOP ;[022c] - -GET_INPUT: - call SERIAL_IN ;[022f] A = serial in - cp $12 ;[0232] - jr nz,PROCESS_ASCII ;[0234] Jump if A!=$12 (DC2) (Could be used to indicate activation of communication) -; Assuming $0161 is not modified elsewhere the first time that $12 is received -; it wont call ACTIVATE_PRINTER, but then it wil for the next 255 times that $12 is received (?) - ld a,($0161) ;[0236] - or a ;[0239] - jr nz,ACTIVATE_PRINTER ;[023a] Jump if ($0161)!=0 - dec a ;[023c] - ld ($0161),a ;[023d] ($0161) = $FF ($0-$1=$FF (?)) - xor a ;[0240] A = $00 - call SERIAL_OUT ;[0241] - jp MAIN_LOOP ;[0244] - -ACTIVATE_PRINTER: - ld a,$01 ;[0247] - ld ($0160),a ;[0249] Activate printer (i.e. ($0160)=$01) - jp MAIN_LOOP ;[024c] - - -; Process the input ascii character (in register A) and prints it in the CRT (and printer if set) -PROCESS_ASCII: - cp $07 ;[024f] - jp c,MAIN_LOOP ;[0251] $00<=A<$07 ==> Not printable - cp $0e ;[0254] - jp c,VALID_ASCII ;[0256] $07<=A<$0e ==> Valid (Cursor controls i.e. tab, line feed, etc.) - cp $1a ;[0259] - jp c,MAIN_LOOP ;[025b] $0e<=A<$1a ==> Not printable -VALID_ASCII: - ld c,a ;[025e] The value of A can only be an ascii between ($07<=A<$0e) U ($A1<=A) - ld a,($0160) ;[025f] - or a ;[0262] - jr nz,LINE_DEVICE_WRITE ;[0263] Jump if ($0160)!=0 (i.e. Jump if printer is enabled) - ld e,c ;[0265] - call C_OUT ;[0266] Output character to CRT - jp MAIN_LOOP ;[0269] - - -; Output character stored in C to the LINE device (printer) and returns to main loop -LINE_DEVICE_WRITE: - ld e,c ;[026c] - ld c,$05 ;[026d] - call SYSCALL ;[026f] - xor a ;[0272] - ld ($0160),a ;[0273] Disable printer again (???) - call SERIAL_OUT ;[0276] - jp MAIN_LOOP ;[0279] - - DB $00 ;[027c] Is set to $10BF by the SETUP routine - DB $00 ;[027d] - DB $00 ;[027e] - ret ;[027f] - - cp $61 ;[0280] - ret c ;[0282] - cp $7b ;[0283] - ret nc ;[0285] - and $5f ;[0286] - ret ;[0288] - - nop ;[0289] - ld c,a ;[028a] - ld a,(hl) ;[028b] - inc hl ;[028c] - cp $24 ;[028d] - jr z,$0299 ;[028f] - cp c ;[0291] - jr z,$0297 ;[0292] - inc hl ;[0294] - jr $028b ;[0295] - ld a,(hl) ;[0297] - ret ;[0298] - - ld a,c ;[0299] - ret ;[029a] - - ld hl,$0147 ;[029b] - ld a,(hl) ;[029e] - inc hl ;[029f] - or a ;[02a0] - jr z,$02a9 ;[02a1] - cp c ;[02a3] - jr z,$02a9 ;[02a4] - inc hl ;[02a6] - jr $029e ;[02a7] - ld a,(hl) ;[02a9] - ld c,a ;[02aa] - xor a ;[02ab] - ld ($027e),a ;[02ac] - ret ;[02af] - -SETUP_WRAPPER: - jp SETUP ;[02b0] - - ld a,($0103) ;[02b3] - or a ;[02b6] - jr nz,$02c1 ;[02b7] - ld de,$0cf3 ;[02b9] - call C_WRITESTR ;[02bc] - jr $02c7 ;[02bf] - ld de,$0cda ;[02c1] - call C_WRITESTR ;[02c4] - ld a,($0104) ;[02c7] - or a ;[02ca] - jr nz,$02d6 ;[02cb] - ld de,$0d23 ;[02cd] - call C_WRITESTR ;[02d0] - jp $0344 ;[02d3] - ld de,$0d0c ;[02d6] - call C_WRITESTR ;[02d9] - jp $0351 ;[02dc] - -SETUP: - ld hl,($0001) ;[02df] - ld de,$0003 ;[02e2] - add hl,de ;[02e5] - ld ($01c7),hl ;[02e6] ($01C7) = ($0001) + $0003 (CONST) - add hl,de ;[02e9] - ld ($01ca),hl ;[02ea] ($01CA) = ($0001) + $0006 (CONIN) - add hl,de ;[02ed] - ld ($01cd),hl ;[02ee] ($01CD) = ($0001) + $0009 (CONOUT) - ld de,$0021 ;[02f1] - add hl,de ;[02f4] - ld ($01d0),hl ;[02f5] ($10D0) = ($0001) + $002A (LISTST) - ld a,$80 ;[02f8] - ld hl,$0003 ;[02fa] - ld (hl),a ;[02fd] ($0003) = $80 (Setting IOBYTE, virtual addressing CONSOLE=TTY, READER=TTY, PUNCH=TTY, LIST=LINE PRINTER DEVICE) - ld hl,$10bf ;[02fe] - ld ($027c),hl ;[0301] ($027C) = $10BF - call L0A9D ;[0304] - ld hl,($0ae7) ;[0307] Load the results from the routine call in HL - ld a,l ;[030a] - cp $ea ;[030b] - jr nz,L0371 ;[030d] if (l.s.b. ($0AE7))!=$EA then jump - ld a,h ;[030f] - cp $49 ;[0310] - jr nz,L0371 ;[0312] if (m.s.b. ($0AE7))!=$49 then jump -SIO_SETUP: - ld a,$18 ;[0314] - out ($b1),a ;[0316] Channel reset - ld a,$05 ;[0318] - out ($b1),a ;[031a] Access SIO register 5 - ld a,$ea ;[031c] - out ($b1),a ;[031e] Transmit enable, 8 bits character, Data terminal ready (DTR=LOW), Request to send (RTS=LOW) - ld a,$03 ;[0320] - out ($b1),a ;[0322] Access SIO register 3 - ld a,$c1 ;[0324] - out ($b1),a ;[0326] Receive enable, 8 bits character - ret ;[0328] - -; Activates Data terminal ready (DTR=LOW) and Request to send (RTS=LOW) -SERIAL_READY_SIGNAL: - ld a,$10 ;[0329] - out ($b1),a ;[032b] Reset Ext/Status Interrupts - ld a,$05 ;[032d] - out ($b1),a ;[032f] Access SIO register 5 - ld a,$ea ;[0331] - out ($b1),a ;[0333] Transmit enable, 8 bits character, Data terminal ready (DTR=LOW), Request to send (RTS=LOW) - ret ;[0335] - -; Deactivates Data terminal ready (DTR=LOW) and Request to send (RTS=LOW) -SERIAL_NOT_READY_SIGNAL: - ld a,$10 ;[0336] - ld ($00b1),a ;[0338] Reset Ext/Status Interrupts - ld a,$05 ;[033b] - out ($b1),a ;[033d] Access SIO register 5 - ld a,$68 ;[033f] - out ($b1),a ;[0341] Transmit enable, 8 bits character - ret ;[0343] - - ld a,$13 ;[0344] - ld ($036d),a ;[0346] - ld a,$11 ;[0349] - ld ($036e),a ;[034b] - jp SETUP ;[034e] - ld a,$13 ;[0351] - ld ($036d),a ;[0353] - ld a,$11 ;[0356] - ld ($036e),a ;[0358] - ld a,$01 ;[035b] - ld ($0104),a ;[035d] - ld a,$10 ;[0360] - ld ($036f),a ;[0362] - ld a,$0d ;[0365] - ld ($0370),a ;[0367] - jp SETUP ;[036a] - - nop ;[036d] - nop ;[036e] - nop ;[036f] - - - DB $00 ;[0370] - -L0371: - jp SIO_SETUP ;[0371] - - ld a,$76 ;[0374] - ld hl,$037a ;[0376] - ld (hl),a ;[0379] - jp $0000 ;[037a] - ld a,($0104) ;[037d] - or a ;[0380] - ret z ;[0381] - call $0725 ;[0382] - ld hl,$04cf ;[0385] - call $048e ;[0388] - call $03a1 ;[038b] - ret ;[038e] - - ld a,($0104) ;[038f] - or a ;[0392] - ret z ;[0393] - call $0725 ;[0394] - ld hl,$04e0 ;[0397] - call $048e ;[039a] - call $03a1 ;[039d] - ret ;[03a0] - - ld b,$03 ;[03a1] - call SERIAL_IN ;[03a3] - djnz $03a3 ;[03a6] - ret ;[03a8] - - and $7f ;[03a9] - call $03cc ;[03ab] - ld de,$0b5e ;[03ae] - call C_WRITESTR ;[03b1] - call $0404 ;[03b4] - jp $05fc ;[03b7] - call $037d ;[03ba] - call $03cc ;[03bd] - ld de,$0b28 ;[03c0] - call C_WRITESTR ;[03c3] - call $0404 ;[03c6] - jp $0529 ;[03c9] - xor a ;[03cc] - ld ($03f7),a ;[03cd] - ld de,$0b43 ;[03d0] - call C_WRITESTR ;[03d3] - call CONSOLE_INPUT ;[03d6] - call $027f ;[03d9] - ld e,a ;[03dc] - call C_OUT ;[03dd] - ld a,e ;[03e0] - cp $4f ;[03e1] - jp nz,$03f8 ;[03e3] - ld hl,$03a9 ;[03e6] - ld de,$0662 ;[03e9] - ld bc,$0002 ;[03ec] - ldir ;[03ef] - ld a,$01 ;[03f1] - ld ($03f7),a ;[03f3] - ret ;[03f6] - - nop ;[03f7] - cp $4e ;[03f8] - jp nz,$03cc ;[03fa] - ld hl,$0000 ;[03fd] - ld ($0662),hl ;[0400] - ret ;[0403] - - ld de,$0b79 ;[0404] - call C_WRITESTR ;[0407] - call CONSOLE_INPUT ;[040a] - call $027f ;[040d] - cp $0d ;[0410] - jp nz,$0419 ;[0412] - xor a ;[0415] - jp $0426 ;[0416] - cp $41 ;[0419] - jp c,$040a ;[041b] - cp $44 ;[041e] - jp nc,$040a ;[0420] - ld e,a ;[0423] - sub $40 ;[0424] - ld ($0756),a ;[0426] - call C_OUT ;[0429] - call $073f ;[042c] - ld de,$0b96 ;[042f] - call C_WRITESTR ;[0432] - ld hl,$0757 ;[0435] - push hl ;[0438] - call CONSOLE_INPUT ;[0439] - call $027f ;[043c] - pop hl ;[043f] - cp $04 ;[0440] - jp z,ENTRY_POINT ;[0442] - cp $2e ;[0445] - jp z,$046e ;[0447] - cp $08 ;[044a] - call z,$047a ;[044c] - cp $7f ;[044f] - call z,$047a ;[0451] - cp $0d ;[0454] - jp z,$0481 ;[0456] - push af ;[0459] - ld e,a ;[045a] - call C_OUT ;[045b] - pop af ;[045e] - cp $08 ;[045f] - jp z,$0438 ;[0461] - cp $7f ;[0464] - jp z,$0438 ;[0466] - ld (hl),a ;[0469] - inc hl ;[046a] - jp $0438 ;[046b] - push af ;[046e] - ld e,a ;[046f] - call C_OUT ;[0470] - pop af ;[0473] - ld hl,$075f ;[0474] - jp $0438 ;[0477] - dec hl ;[047a] - push af ;[047b] - ld a,$20 ;[047c] - ld (hl),a ;[047e] - pop af ;[047f] - ret ;[0480] - - ld hl,$0757 ;[0481] - ld a,(hl) ;[0484] - cp $20 ;[0485] - jp z,$0736 ;[0487] - call $0725 ;[048a] - ret ;[048d] - - ld a,(hl) ;[048e] - call SERIAL_OUT ;[048f] - cp $10 ;[0492] - jr nz,$049b ;[0494] - push hl ;[0496] - call $04b1 ;[0497] - pop hl ;[049a] - ld e,a ;[049b] - call C_OUT ;[049c] - ld a,e ;[049f] - cp $0d ;[04a0] - ret z ;[04a2] - or a ;[04a3] - ret z ;[04a4] - ld bc,$ffff ;[04a5] - dec bc ;[04a8] - ld a,b ;[04a9] - or a ;[04aa] - jr nz,$04a8 ;[04ab] - inc hl ;[04ad] - jp $048e ;[04ae] - ld hl,$04c0 ;[04b1] - ld e,(hl) ;[04b4] - call C_OUT ;[04b5] - inc hl ;[04b8] - ld a,e ;[04b9] - or a ;[04ba] - ld a,$20 ;[04bb] - ret z ;[04bd] - jr $04b4 ;[04be] - ld b,e ;[04c0] - ld d,h ;[04c1] - ld d,d ;[04c2] - ld c,h ;[04c3] - dec l ;[04c4] - ld d,b ;[04c5] - jr nz,$04c8 ;[04c6] - ld d,e ;[04c8] - ld d,b ;[04c9] - ld b,l ;[04ca] - ld b,c ;[04cb] - ld c,e ;[04cc] - ld hl,$1000 ;[04cd] - ld d,e ;[04d0] - ld b,l ;[04d1] - ld d,h ;[04d2] - ld ($303a),a ;[04d3] - inc l ;[04d6] - dec (hl) ;[04d7] - ld a,($2c30) ;[04d8] - add hl,sp ;[04db] - ld a,($0d30) ;[04dc] - nop ;[04df] - djnz $0535 ;[04e0] - ld b,l ;[04e2] - ld d,h ;[04e3] - ld ($313a),a ;[04e4] - inc l ;[04e7] - dec (hl) ;[04e8] - ld a,($0d31) ;[04e9] - nop ;[04ec] - call CONSOLE_READY ;[04ed] - or a ;[04f0] - ret z ;[04f1] - call CONSOLE_INPUT ;[04f2] - call $027f ;[04f5] - ret ;[04f8] - - ld d,h ;[04f9] - ld d,d ;[04fa] - ld b,c ;[04fb] - dec c ;[04fc] - nop ;[04fd] - call $0725 ;[04fe] - ld hl,$04f9 ;[0501] - call $048e ;[0504] - call $04ed ;[0507] - cp $04 ;[050a] - jp z,ENTRY_POINT ;[050c] - call SERIAL_IN_AVAIL ;[050f] - jp z,$0507 ;[0512] - call SERIAL_IN ;[0515] - and $7f ;[0518] - push af ;[051a] - ld e,a ;[051b] - call C_OUT ;[051c] - pop af ;[051f] - cp $05 ;[0520] - jp nz,$0507 ;[0522] - call $03a1 ;[0525] - ret ;[0528] - - call L082A ;[0529] - cp $ff ;[052c] - ld de,$0ba9 ;[052e] - jp z,$0730 ;[0531] - call CONSOLE_INPUT ;[0534] - cp $0d ;[0537] - jr z,$0548 ;[0539] - call SERIAL_OUT ;[053b] - call SERIAL_IN ;[053e] - and $7f ;[0541] - call C_OUT ;[0543] - jr $0534 ;[0546] - call $04ed ;[0548] - cp $13 ;[054b] - jp z,ENTRY_POINT ;[054d] - call SERIAL_IN ;[0550] - and $7f ;[0553] - ld c,a ;[0555] - ld hl,$015b ;[0556] - ld a,(hl) ;[0559] - or a ;[055a] - jr z,$0560 ;[055b] - cp c ;[055d] - jr nz,$0548 ;[055e] - ld a,c ;[0560] - cp $0d ;[0561] - jr nz,$0548 ;[0563] - call $0704 ;[0565] - ld hl,$0080 ;[0568] - ld c,$14 ;[056b] - ld de,$0756 ;[056d] - call SYSCALL ;[0570] - or a ;[0573] - jp nz,$074b ;[0574] - ld hl,$0080 ;[0577] - push hl ;[057a] - ld a,(hl) ;[057b] - ld c,a ;[057c] - push bc ;[057d] - ld a,$ff ;[057e] - ld bc,$ffff ;[0580] - push af ;[0583] - call SERIAL_IN_AVAIL ;[0584] - pop af ;[0587] - jp nz,$0592 ;[0588] - dec bc ;[058b] - jp nz,$0583 ;[058c] - dec a ;[058f] - jr nz,$0580 ;[0590] - call $065f ;[0592] - and $7f ;[0595] - push hl ;[0597] - ld hl,$036d ;[0598] - cp (hl) ;[059b] - pop hl ;[059c] - jp nz,$05b1 ;[059d] - call SERIAL_IN_AVAIL ;[05a0] - jr z,$05a0 ;[05a3] - call $065f ;[05a5] - push hl ;[05a8] - ld hl,$036e ;[05a9] - cp (hl) ;[05ac] - pop hl ;[05ad] - jp nz,$05a0 ;[05ae] - pop bc ;[05b1] - ld hl,$0662 ;[05b2] - ld a,c ;[05b5] - call SERIAL_OUT ;[05b6] - ld a,h ;[05b9] - or a ;[05ba] - jr nz,$05c0 ;[05bb] - ld e,c ;[05bd] - jr $05c2 ;[05be] - ld e,$2e ;[05c0] - call C_OUT ;[05c2] - pop hl ;[05c5] - inc hl ;[05c6] - ld a,l ;[05c7] - or a ;[05c8] - jp z,$05cf ;[05c9] - jp $057a ;[05cc] - ld a,($07bb) ;[05cf] - or a ;[05d2] - jp nz,$05d9 ;[05d3] - jp $0565 ;[05d6] - call $0725 ;[05d9] - ld de,$0c16 ;[05dc] - call C_WRITESTR ;[05df] - xor a ;[05e2] - ld ($07bb),a ;[05e3] - call $038f ;[05e6] - call $0725 ;[05e9] - jp MAIN_LOOP ;[05ec] - ld de,$0ee4 ;[05ef] - call C_WRITESTR ;[05f2] - call $038f ;[05f5] - jp MAIN_LOOP ;[05f8] - ret ;[05fb] - - call $0704 ;[05fc] - call $0725 ;[05ff] - call $086e ;[0602] - call L0833 ;[0605] - cp $ff ;[0608] - call z,$085c ;[060a] - cp $ff ;[060d] - ld de,$0bc0 ;[060f] - jp z,$0730 ;[0612] - ld hl,$0080 ;[0615] - ld ($0701),hl ;[0618] - call CONSOLE_INPUT ;[061b] - call $027f ;[061e] - cp $0d ;[0621] - jr z,$0632 ;[0623] - call SERIAL_OUT ;[0625] - call SERIAL_IN ;[0628] - and $7f ;[062b] - call C_OUT ;[062d] - jr $061b ;[0630] - ld hl,$015b ;[0632] - ld a,(hl) ;[0635] - or a ;[0636] - jr z,$063b ;[0637] - jr $063d ;[0639] - ld a,$0d ;[063b] - call SERIAL_OUT ;[063d] - call $0a7b ;[0640] - cp $ff ;[0643] - jr nz,$0632 ;[0645] - call SERIAL_IN ;[0647] - and $7f ;[064a] - ld hl,($0701) ;[064c] - ld bc,$0001 ;[064f] - call $0a7b ;[0652] - cp $ff ;[0655] - jp nz,$0710 ;[0657] - call $065f ;[065a] - jr $0665 ;[065d] - call SERIAL_IN ;[065f] - nop ;[0662] - nop ;[0663] - ret ;[0664] - - ld (hl),a ;[0665] - ld e,a ;[0666] - ld a,($0662) ;[0667] - or a ;[066a] - jr z,$066f ;[066b] - jr $0671 ;[066d] - ld e,$2e ;[066f] - call C_OUT ;[0671] - inc hl ;[0674] - ld a,l ;[0675] - or a ;[0676] - jp nz,$064f ;[0677] - call $0680 ;[067a] - jp $064c ;[067d] - ld hl,$1144 ;[0680] - ld bc,$0000 ;[0683] - ld a,($0104) ;[0686] - or a ;[0689] - jr z,$0694 ;[068a] - ld a,($036f) ;[068c] - call SERIAL_OUT ;[068f] - jr $0697 ;[0692] - call $0a4c ;[0694] - push bc ;[0697] - ld bc,$0001 ;[0698] - ld de,$2000 ;[069b] - call $0a83 ;[069e] - pop bc ;[06a1] - cp $ff ;[06a2] - jp nz,$06c1 ;[06a4] - ld a,$01 ;[06a7] - ld ($0703),a ;[06a9] - call $065f ;[06ac] - ld (hl),a ;[06af] - push bc ;[06b0] - ld e,a ;[06b1] - call C_OUT ;[06b2] - pop bc ;[06b5] - inc bc ;[06b6] - inc hl ;[06b7] - ld a,c ;[06b8] - cp $0a ;[06b9] - jp z,$0686 ;[06bb] - jp $0697 ;[06be] - push bc ;[06c1] - ld c,$15 ;[06c2] - ld de,$077a ;[06c4] - ld hl,$0080 ;[06c7] - call SYSCALL ;[06ca] - pop bc ;[06cd] - or a ;[06ce] - jp nz,$0730 ;[06cf] - call $0704 ;[06d2] - ld a,($0703) ;[06d5] - or a ;[06d8] - jr z,$06fd ;[06d9] - push bc ;[06db] - ld de,$0080 ;[06dc] - ld hl,$1144 ;[06df] - ldir ;[06e2] - pop bc ;[06e4] - ld hl,$0080 ;[06e5] - add hl,bc ;[06e8] - ld ($0701),hl ;[06e9] - xor a ;[06ec] - ld ($0703),a ;[06ed] - ld a,($0104) ;[06f0] - or a ;[06f3] - jr z,$06fd ;[06f4] - ld a,($0370) ;[06f6] - call SERIAL_OUT ;[06f9] - ret ;[06fc] - - call $0a45 ;[06fd] - ret ;[0700] - - nop ;[0701] - nop ;[0702] - nop ;[0703] - ld b,$80 ;[0704] - ld hl,$0080 ;[0706] - ld a,$20 ;[0709] - ld (hl),a ;[070b] - inc hl ;[070c] - djnz $070b ;[070d] - ret ;[070f] - - call $0680 ;[0710] - call $0865 ;[0713] - call $0853 ;[0716] - call $0874 ;[0719] - ld de,$0be5 ;[071c] - call C_WRITESTR ;[071f] - jp MAIN_LOOP ;[0722] - ld c,$0d ;[0725] - call CONSOLE_OUTPUT ;[0727] - ld c,$0a ;[072a] - call CONSOLE_OUTPUT ;[072c] - ret ;[072f] - - call C_WRITESTR ;[0730] - jp MAIN_LOOP ;[0733] - ld de,$0bd1 ;[0736] - call C_WRITESTR ;[0739] - jp ENTRY_POINT ;[073c] - ld hl,$0757 ;[073f] - ld b,$0b ;[0742] - ld a,$20 ;[0744] - ld (hl),a ;[0746] - inc hl ;[0747] - djnz $0746 ;[0748] - ret ;[074a] - - ld a,$01 ;[074b] - ld ($07bb),a ;[074d] - jp $0577 ;[0750] - jp MAIN_LOOP ;[0753] - nop ;[0756] - jr nz,$0779 ;[0757] - jr nz,$077b ;[0759] - jr nz,$077d ;[075b] - jr nz,$077f ;[075d] - jr nz,$0781 ;[075f] - jr nz,$0763 ;[0761] - - nop ;[0763] - nop ;[0764] - nop ;[0765] - nop ;[0766] - nop ;[0767] - nop ;[0768] - nop ;[0769] - nop ;[076a] - nop ;[076b] - nop ;[076c] - nop ;[076d] - nop ;[076e] - nop ;[076f] - nop ;[0770] - nop ;[0771] - nop ;[0772] - nop ;[0773] - nop ;[0774] - nop ;[0775] - nop ;[0776] - nop ;[0777] - nop ;[0778] - nop ;[0779] - nop ;[077a] - jr nz,$079d ;[077b] - jr nz,$079f ;[077d] - jr nz,$07a1 ;[077f] - jr nz,$07a3 ;[0781] - inc h ;[0783] - inc h ;[0784] - inc h ;[0785] - nop ;[0786] - nop ;[0787] - nop ;[0788] - nop ;[0789] - nop ;[078a] - nop ;[078b] - nop ;[078c] - nop ;[078d] - nop ;[078e] - nop ;[078f] - nop ;[0790] - nop ;[0791] - nop ;[0792] - nop ;[0793] - nop ;[0794] - nop ;[0795] - nop ;[0796] - nop ;[0797] - nop ;[0798] - nop ;[0799] - nop ;[079a] - nop ;[079b] - nop ;[079c] - nop ;[079d] - nop ;[079e] - jr nz,$07c1 ;[079f] - jr nz,$07c3 ;[07a1] - jr nz,$07c5 ;[07a3] - jr nz,$07c7 ;[07a5] - jr nz,$07c9 ;[07a7] - jr nz,$07cb ;[07a9] - nop ;[07ab] - nop ;[07ac] - nop ;[07ad] - nop ;[07ae] - jr nz,$07d1 ;[07af] - jr nz,$07d3 ;[07b1] - jr nz,$07d5 ;[07b3] - jr nz,$07d7 ;[07b5] - jr nz,$07d9 ;[07b7] - jr nz,$07db ;[07b9] - nop ;[07bb] - nop ;[07bc] - nop ;[07bd] - nop ;[07be] - nop ;[07bf] - nop ;[07c0] - nop ;[07c1] - nop ;[07c2] - nop ;[07c3] - nop ;[07c4] - nop ;[07c5] - nop ;[07c6] - nop ;[07c7] - nop ;[07c8] - nop ;[07c9] - nop ;[07ca] - nop ;[07cb] - nop ;[07cc] - nop ;[07cd] - nop ;[07ce] - nop ;[07cf] - nop ;[07d0] - nop ;[07d1] - nop ;[07d2] - nop ;[07d3] - nop ;[07d4] - nop ;[07d5] - nop ;[07d6] - nop ;[07d7] - nop ;[07d8] - nop ;[07d9] - nop ;[07da] - nop ;[07db] - nop ;[07dc] - nop ;[07dd] - nop ;[07de] - nop ;[07df] - nop ;[07e0] - nop ;[07e1] - nop ;[07e2] - nop ;[07e3] - nop ;[07e4] - nop ;[07e5] - nop ;[07e6] - nop ;[07e7] - nop ;[07e8] - nop ;[07e9] - nop ;[07ea] - nop ;[07eb] - nop ;[07ec] - nop ;[07ed] - nop ;[07ee] - nop ;[07ef] - nop ;[07f0] - nop ;[07f1] - nop ;[07f2] - nop ;[07f3] - nop ;[07f4] - nop ;[07f5] - nop ;[07f6] - nop ;[07f7] - nop ;[07f8] - nop ;[07f9] - nop ;[07fa] - nop ;[07fb] - nop ;[07fc] - nop ;[07fd] - nop ;[07fe] - nop ;[07ff] - nop ;[0800] - nop ;[0801] - nop ;[0802] - nop ;[0803] - nop ;[0804] - nop ;[0805] - nop ;[0806] - nop ;[0807] - nop ;[0808] - nop ;[0809] - nop ;[080a] - nop ;[080b] - nop ;[080c] - nop ;[080d] - nop ;[080e] - nop ;[080f] - nop ;[0810] - nop ;[0811] - nop ;[0812] - nop ;[0813] - nop ;[0814] - nop ;[0815] - nop ;[0816] - nop ;[0817] - nop ;[0818] - nop ;[0819] - nop ;[081a] - nop ;[081b] - nop ;[081c] - nop ;[081d] - nop ;[081e] - nop ;[081f] -; STACK space starts from here (GROWS UPWARD) - -SYSCALL: - push hl ;[0820] - push bc ;[0821] - push de ;[0822] - call $0005 ;[0823] - pop de ;[0826] - pop bc ;[0827] - pop hl ;[0828] - ret ;[0829] - -L082A: - ld c,$0f ;[082a] - ld de,$0756 ;[082c] - call SYSCALL ;[082f] - ret ;[0832] - -L0833: - ld hl,$0756 ;[0833] - ld de,$077a ;[0836] - ld bc,$0009 ;[0839] - ldir ;[083c] - ld c,$0f ;[083e] - ld de,$077a ;[0840] - call SYSCALL ;[0843] - ret ;[0846] - -C_OUT: - ld c,$02 ;[0847] - call SYSCALL ;[0849] - ret ;[084c] - -C_WRITESTR: - ld c,$09 ;[084d] - call SYSCALL ;[084f] - ret ;[0852] - -L8053: - ld c,$13 ;[0853] - ld de,$0756 ;[0855] - call SYSCALL ;[0858] - ret ;[085b] - -L085C: - ld c,$16 ;[085c] - ld de,$077a ;[085e] - call SYSCALL ;[0861] - ret ;[0864] - -L0865: - ld c,$10 ;[0865] - ld de,$077a ;[0867] - call SYSCALL ;[086a] - ret ;[086d] - -L086E: - ld c,$0d ;[086e] - call SYSCALL ;[0870] - ret ;[0873] - - ld hl,$077a ;[0874] - ld de,$079e ;[0877] - ld bc,$0010 ;[087a] - ldir ;[087d] - ld hl,$0756 ;[087f] - ld de,$07ae ;[0882] - ld bc,$0010 ;[0885] - ldir ;[0888] - ld c,$17 ;[088a] - ld de,$079e ;[088c] - call SYSCALL ;[088f] - cp $ff ;[0892] - ret nz ;[0894] - jp $0730 ;[0895] - ld de,$0f06 ;[0898] - call C_WRITESTR ;[089b] - call $0903 ;[089e] - ld a,($091b) ;[08a1] - inc a ;[08a4] - ld ($091b),a ;[08a5] - ld hl,($0919) ;[08a8] - ld a,(hl) ;[08ab] - inc hl ;[08ac] - ld ($0919),hl ;[08ad] - or a ;[08b0] - jr nz,$08b5 ;[08b1] - add $30 ;[08b3] - cp $01 ;[08b5] - jr nz,$08bb ;[08b7] - add $30 ;[08b9] - cp $0d ;[08bb] - jr z,$08d0 ;[08bd] - push af ;[08bf] - ld e,a ;[08c0] - call C_OUT ;[08c1] - pop af ;[08c4] - ld a,($091b) ;[08c5] - cp $04 ;[08c8] - jp nc,$08a1 ;[08ca] - jp $089e ;[08cd] - xor a ;[08d0] - ld ($091b),a ;[08d1] - call $08f2 ;[08d4] - inc hl ;[08d7] - inc hl ;[08d8] - inc hl ;[08d9] - ld ($0919),hl ;[08da] - call $08f2 ;[08dd] - dec hl ;[08e0] - dec hl ;[08e1] - ld ($0919),hl ;[08e2] - call $08f2 ;[08e5] - inc hl ;[08e8] - ld ($0919),hl ;[08e9] - call $08f2 ;[08ec] - jp $093c ;[08ef] - call $0903 ;[08f2] - ld hl,($0919) ;[08f5] - ld a,(hl) ;[08f8] - call $11ca ;[08f9] - ld de,$11fe ;[08fc] - call C_WRITESTR ;[08ff] - ret ;[0902] - - ld b,$04 ;[0903] - push hl ;[0905] - push bc ;[0906] - ld hl,($0917) ;[0907] - ld e,(hl) ;[090a] - call C_OUT ;[090b] - inc hl ;[090e] - pop bc ;[090f] - ld ($0917),hl ;[0910] - djnz $0906 ;[0913] - pop hl ;[0915] - ret ;[0916] - - inc e ;[0917] - add hl,bc ;[0918] - inc bc ;[0919] - ld bc,$1b00 ;[091a] - dec a ;[091d] - dec h ;[091e] - inc a ;[091f] - dec de ;[0920] - dec a ;[0921] - daa ;[0922] - inc a ;[0923] - dec de ;[0924] - dec a ;[0925] - add hl,hl ;[0926] - inc a ;[0927] - dec de ;[0928] - dec a ;[0929] - dec hl ;[092a] - ld b,h ;[092b] - dec de ;[092c] - dec a ;[092d] - ld sp,$1b3c ;[092e] - dec a ;[0931] - inc sp ;[0932] - inc a ;[0933] - dec de ;[0934] - dec a ;[0935] - dec (hl) ;[0936] - inc a ;[0937] - dec de ;[0938] - dec a ;[0939] - scf ;[093a] - inc a ;[093b] - ld hl,$0103 ;[093c] - ld ($0919),hl ;[093f] - ld hl,$091c ;[0942] - ld ($0917),hl ;[0945] - call CONSOLE_INPUT ;[0948] - call $027f ;[094b] - cp $0d ;[094e] - jp z,$0960 ;[0950] - cp $0b ;[0953] - jp z,$0960 ;[0955] - cp $0c ;[0958] - jp z,$0960 ;[095a] - jp $093c ;[095d] - nop ;[0960] - ld hl,$0757 ;[0961] - ld a,$3f ;[0964] - ld b,$0c ;[0966] - ld (hl),a ;[0968] - inc hl ;[0969] - dec b ;[096a] - jp nz,$0968 ;[096b] - ld de,$0e99 ;[096e] - call C_WRITESTR ;[0971] - call CONSOLE_INPUT ;[0974] - call $027f ;[0977] - push af ;[097a] - ld e,a ;[097b] - call C_OUT ;[097c] - pop af ;[097f] - ld hl,$0756 ;[0980] - cp $44 ;[0983] - jp nc,ENTRY_POINT ;[0985] - sub $40 ;[0988] - ld (hl),a ;[098a] - ld de,$0e96 ;[098b] - call C_WRITESTR ;[098e] - ld de,$0e96 ;[0991] - call C_WRITESTR ;[0994] - ld de,$0756 ;[0997] - ld c,$11 ;[099a] - call SYSCALL ;[099c] - push af ;[099f] - xor a ;[09a0] - ld ($0960),a ;[09a1] - pop af ;[09a4] - call $09d3 ;[09a5] - ld de,$0080 ;[09a8] - ld c,$1a ;[09ab] - call SYSCALL ;[09ad] - ld de,$0756 ;[09b0] - ld c,$12 ;[09b3] - call SYSCALL ;[09b5] - cp $ff ;[09b8] - jp nz,$09a5 ;[09ba] - ld e,$0d ;[09bd] - call C_OUT ;[09bf] - ld e,$0a ;[09c2] - call C_OUT ;[09c4] - call CONSOLE_INPUT ;[09c7] - xor a ;[09ca] - ld ($0960),a ;[09cb] - jp ENTRY_POINT ;[09ce] - nop ;[09d1] - nop ;[09d2] - ld ($09d1),a ;[09d3] - push af ;[09d6] - ld a,($0960) ;[09d7] - cp $05 ;[09da] - jp nz,$09e9 ;[09dc] - ld de,$0e96 ;[09df] - call C_WRITESTR ;[09e2] - xor a ;[09e5] - ld ($0960),a ;[09e6] - pop af ;[09e9] - ld e,$20 ;[09ea] - call C_OUT ;[09ec] - ld a,($09d1) ;[09ef] - add a ;[09f2] - add a ;[09f3] - add a ;[09f4] - add a ;[09f5] - add a ;[09f6] - ld ($09d1),a ;[09f7] - ld de,($09d1) ;[09fa] - ld hl,$0080 ;[09fe] - add hl,de ;[0a01] - ld a,(hl) ;[0a02] - cp $e5 ;[0a03] - jp z,$0a35 ;[0a05] - push hl ;[0a08] - ld de,$000c ;[0a09] - add hl,de ;[0a0c] - ld a,(hl) ;[0a0d] - or a ;[0a0e] - pop hl ;[0a0f] - jp nz,$0a35 ;[0a10] - inc hl ;[0a13] - ld b,$08 ;[0a14] - call $0a3b ;[0a16] - ld e,$2e ;[0a19] - call C_OUT ;[0a1b] - ld b,$03 ;[0a1e] - call $0a3b ;[0a20] - ld e,$20 ;[0a23] - call C_OUT ;[0a25] - ld e,$3a ;[0a28] - call C_OUT ;[0a2a] - ld a,($0960) ;[0a2d] - inc a ;[0a30] - ld ($0960),a ;[0a31] - ret ;[0a34] - - ld e,$08 ;[0a35] - call C_OUT ;[0a37] - ret ;[0a3a] - - ld e,(hl) ;[0a3b] - call C_OUT ;[0a3c] - inc hl ;[0a3f] - dec b ;[0a40] - jp nz,$0a3b ;[0a41] - ret ;[0a44] - - ld a,($036e) ;[0a45] - call SERIAL_OUT ;[0a48] - ret ;[0a4b] - - push af ;[0a4c] - ld a,($036d) ;[0a4d] - call SERIAL_OUT ;[0a50] - pop af ;[0a53] - ret ;[0a54] - - nop ;[0a55] - push bc ;[0a56] - push de ;[0a57] - push hl ;[0a58] - ld b,$02 ;[0a59] - ld de,$9000 ;[0a5b] - push af ;[0a5e] - push bc ;[0a5f] - rl a ;[0a60] - dec de ;[0a62] - ld a,d ;[0a63] - or a ;[0a64] - jr nz,$0a60 ;[0a65] - pop bc ;[0a67] - pop af ;[0a68] - djnz $0a5b ;[0a69] - dec a ;[0a6b] - jr nz,$0a59 ;[0a6c] - pop hl ;[0a6e] - pop de ;[0a6f] - pop bc ;[0a70] - ret ;[0a71] - - ld b,$06 ;[0a72] - xor a ;[0a74] - call SERIAL_OUT ;[0a75] - djnz $0a74 ;[0a78] - ret ;[0a7a] - - push bc ;[0a7b] - push de ;[0a7c] - ld bc,$ffff ;[0a7d] - ld de,$8000 ;[0a80] - call SERIAL_IN_AVAIL ;[0a83] - jp nz,$0a98 ;[0a86] - dec de ;[0a89] - ld a,d ;[0a8a] - or e ;[0a8b] - jp nz,$0a83 ;[0a8c] - dec bc ;[0a8f] - ld a,b ;[0a90] - or c ;[0a91] - jp nz,$0a8f ;[0a92] - pop de ;[0a95] - pop bc ;[0a96] - ret ;[0a97] - - ld a,$ff ;[0a98] - pop de ;[0a9a] - pop bc ;[0a9b] - ret ;[0a9c] - - -; At the end of the execution in ($0AE7) there will be a 2 byte value representing the sum -; of all of the content of memory starting from $03DA up until the content of the memory is =$24 -; Expected result = $49ea (????) -L0A9D: - ld hl,$0000 ;[0a9d] - ld ($0ae7),hl ;[0aa0] ($0ae7) = $0000 - ld hl,$0d3a ;[0aa3] -L0AA6: - ld a,(hl) ;[0aa6] - cp $24 ;[0aa7] - ret z ;[0aa9] if ($0d3a) == $24 then return - push hl ;[0aaa] - ld hl,($0ae7) ;[0aab] - ld e,a ;[0aae] - ld d,$00 ;[0aaf] - add hl,de ;[0ab1] - ld ($0ae7),hl ;[0ab2] - pop hl ;[0ab5] - inc hl ;[0ab6] - jp L0AA6 ;[0ab7] - - -; Check if there is a character available to read from the SIO, {$00=not available,$01=available} -; Get data from the #port stored at address $0116 and the value stored at address $0117 ($01 (?)) and -; perform an AND operation between them -SERIAL_IN_AVAIL: - push hl ;[0aba] - push bc ;[0abb] - ld hl,$0116 ;[0abc] - ld c,(hl) ;[0abf] - in a,(c) ;[0ac0] - inc hl ;[0ac2] - ld c,(hl) ;[0ac3] - and c ;[0ac4] - pop bc ;[0ac5] - pop hl ;[0ac6] - ret ;[0ac7] - - -; Get input in A register and disable receive -SERIAL_IN: - in a,($b0) ;[0ac8] - push af ;[0aca] - call SERIAL_NOT_READY_SIGNAL ;[0acb] - pop af ;[0ace] - ret ;[0acf] - -; Wait for the SIO's transmit buffer to be empty and then send the value stored in A -SERIAL_OUT: - push hl ;[0ad0] - push bc ;[0ad1] - push af ;[0ad2] -WAIT_EMPTY_TX_BUFFER: - ld hl,$0116 ;[0ad3] - ld c,(hl) ;[0ad6] - in a,(c) ;[0ad7] Read SIO's RR0 - inc hl ;[0ad9] - inc hl ;[0ada] - ld c,(hl) ;[0adb] - and c ;[0adc] - jr z,WAIT_EMPTY_TX_BUFFER ;[0add] Jump if SIO's transmit buffer is not empty - inc hl ;[0adf] - ld c,(hl) ;[0ae0] - pop af ;[0ae1] - out (c),a ;[0ae2] Transmit value of A - pop bc ;[0ae4] - pop hl ;[0ae5] - ret ;[0ae6] - - DB $00 ;[0ae7] - DB $00 ;[0ae8] - - ld a,$12 ;[0ae9] - ld ($0b0d),a ;[0aeb] - ld ($0b0e),a ;[0aee] - ld hl,$0080 ;[0af1] - xor a ;[0af4] - ld e,(hl) ;[0af5] - inc hl ;[0af6] - push hl ;[0af7] - call $0b0f ;[0af8] - ld ($0b0c),a ;[0afb] - pop hl ;[0afe] - ld a,l ;[0aff] - or a ;[0b00] - ld a,($0b0c) ;[0b01] - jr nz,$0af5 ;[0b04] - ld e,$00 ;[0b06] - call $0b0f ;[0b08] - ret ;[0b0b] - - nop ;[0b0c] - nop ;[0b0d] - nop ;[0b0e] - ld b,$08 ;[0b0f] - bit 7,a ;[0b11] - jr z,$0b1c ;[0b13] - ld hl,$0b0d ;[0b15] - xor (hl) ;[0b18] - ld ($0b0e),a ;[0b19] - sla a ;[0b1c] - sla e ;[0b1e] - jr nc,$0b24 ;[0b20] - set 0,a ;[0b22] - dec b ;[0b24] - jr nz,$0b11 ;[0b25] - ret ;[0b27] - - DB $0D ;[0b28] - DB $0A ;[0b29] - DB "EMISSION D'UN FICHIER $" ;[0b2a- - - DB $0D ;[0b43] - DB $0A ;[0b44] - DB "FICHIER ASCII ? (O/N) :$" ;[0b45- - - DB $0D ;[0b53] - DB $0A ;[0b5f] - DB "RECEPTION D'UN FICHIER $" ;[0b60- - - DB $0D ;[0b79] - DB $0A ;[0b7a] - DB "SUR QUEL DISQUE (A B C) ? $" ;[0b7b- - - DB $0D ;[0b96] - DB $0A ;[0b87] - DB "NOM DU FICHIER $" ;[0b98- - - DB $0D ;[0ba9] - DB $0A ;[0baa] - DB "FICHIER INEXISTANT" ;[0bab- - DB $0D ;[0bbd] - DB $0A ;[0bbe] - DB $24 ;[0bbf] - - DB $0D ;[0bc0] - DB $0A ;[0bc1] - DB "DISQUE PLEIN" ;[0bc2- - DB $0D ;[0bce] - DB $0A ;[0bcf] - DB $24 ;[0bd0] - - DB $0D ;[0bd1] - DB $0A ;[0bd2] - DB "MAUVAISE ENTREE" ;[0bd3- - DB $0D ;[0be2] - DB $0A ;[0be3] - DB $24 ;[0be4] - - DB $0D ;[0be5] - DB $0A ;[0be6] - DB "FICHIER RECU ET ECRIT" ;[0be7- - DB $0D ;[0bfc] - DB $0A ;[0bfd] - DB $24 ;[0bfe] - - DB $0D ;[0bff] - DB $0A ;[0c00] - DB "TRANSFERT EN COURS" ;[0c01- - DB $0D ;[0c13] - DB $0A ;[0c14] - DB $24 ;[0c15] - - DB $0D ;[0c16] - DB $0A ;[0c17] - DB "TRANSFERT TERMINE" ;[0c18- - DB $0D ;[0c29] - DB $0A ;[0c2a] - DB $0D ;[0c2b] - DB $0A ;[0c2c] - DB "ATTENDEZ DE SAVOIR SI VOUS AVEZ LA MAIN";[0c2d- - DB $0D ;[0c54] - DB $0A ;[0c55] - DB "A L'APPARITION D'UN 'PROMPT' OU D'UNE '*' ET";[0c56- - DB $0D ;[0c82] - DB $0A ;[0c83] - DB "ENTREZ (SAVE) AU CLAVIER SI C'EST UN NOUVEAU FICHIER";[0c84- - DB $0D ;[0cb8] - DB $0A ;[0cb9] - DB "OU (REPLACE) S'IL EXISTE DEJA" ;[0cba- - DB $0D ;[0cd7] - DB $0A ;[0cd8] - DB $24 ;[0cd9] - - DB $1A ;[0cda] - DB $1B ;[0cdb] - DB "=#%SANCO A SANCO :OUI $" ;[0cdc- - - DB $1A ;[0cf3] - DB $1B ;[0cf4] - DB "=#%SANCO A SANCO :NON $" ;[0cf5- - - DB $1B ;[0d0c] - DB "=#>VIA TRANSPAC :OUI $" ;[0d0d- - - DB $1B ;[0d23] - DB "=#>PAR TRANSPAC :NON $" ;[0d24- - - DB $1B ;[0d3a] - DB "=!! (C) S.F.C.E 10/01/82 POUR SANCO-IBEX";[0d3b- - DB $1B ;[0d63] - DB $48 ;[0d64] - DB $1B ;[0d65] - DB "=(* SANCONET CLUB DES UTILISATEURS SANCO ";[0d66- - DB $1B ;[0d90] - DB $49 ;[0d91] - DB $1B ;[0d92] - DB "=,*CTRL-D RETOUR AU MENU PRINCIPAL";[0d93- - DB $1B ;[0db5] - DB "=.*CTRL-T MISE EN LIAISON" ;[0db6- - DB $1B ;[0dcf] - DB "=0*CTRL-L EMISSION D'UN FICHIER DU DISQUE";[0dd0- - DB $1B ;[0df9] - DB "=2*CTRL-W RECEPTION D'UN FICHIER SUR DISQUE";[0dfa- - DB $1B ;[0e25] - DB "=4*CTRL-A AFFICHAGE DU CATALOGUE DU DISQUE";[0e26- - DB $1B ;[0e50] - DB "=6/VOTRE CHOIX? :$" ;[0e51- - -INIT_STRING: - DB $1A ;[0e63] - DB $0D ;[0e64] - DB $0A ;[0e65] - DB $0A ;[0e66] - DB $0A ;[0e67] - DB "TERM80 VER 1.0 (C) S.F.C.E" ;[0e68- - DB $0D ;[0e80] - DB $0A ;[0e81] - DB $0D ;[0e82] - DB $0A ;[0e83] - DB "LIAISON EN COURS" ;[0e86- - DB $0D ;[0e96] - DB $0A ;[0e97] - DB $24 ;[0e98] - - - DB $1A ;[0e99] - DB $1B ;[0e9A] - DB "=%/AFFICHAGE DE LA DIRECTORY DU DRIVE : $";[0e9b- - DB $0D ;[0ec4] - DB $0A ;[0ec5] - DB "APPUYER SUR LA TOUCHE RETURN $";[0ec6- - DB $0D ;[0ee4] - DB $0A ;[0ee5] - DB "PARASITE OU RUPTURE DE LIGNE " ;[0ee6- - DB $0D ;[0f03] - DB $0A ;[0f04] - DB $24 ;[0f05] - - - DB $1A ;[0f06] - DB $0D ;[0f07] - DB $0A ;[0f08] - DB $0D ;[0f09] - DB $0A ;[0f0a] - DB $09 ;[0f0b] - DB $09 ;[0f0c] - DB "OUI = 1" ;[0f0d- - DB $09 ;[0f14] - DB $09 ;[0f15] - DB $09 ;[0f16] - DB "NON = 0" ;[0f17- - DB $1B ;[0f1e] - DB "=%*SANCO A SANCO : " ;[0f1f- - DB $1B ;[0f37] - DB "='*VIA TRANSPAC : " ;[0f38- - DB $1B ;[0f50] - DB "=)*APPEL AUTOMATIQUE : " ;[0f51- - DB $1B ;[0f69] - DB "=+*SI OUI APPEL DE LA BASE : ";[0f6a- - DB $1B ;[0f96] - DB "=-*pour modifier deplacez le curseur ou return pour sortir";[0f97- - DB $0D ;[0fd1] - DB $0A ;[0fd2] - DB "-----------------------------------------------------------";[0fd3- - DB $0D ;[100e] - DB $0A ;[100f] - DB "partie technique a ne modifier qu'avec l'accord de votre installateur ";[1010- - DB $1B ;[1056] - DB "=1*PORT DE STATUS = " ;[1057- - DB $1B ;[106f] - DB "=3*PORT DE DATA = " ;[1070- - DB $1B ;[1088] - DB "=5*MASQUE D'ENTREE = " ;[1089- - DB $1B ;[10a1] - DB "=7*MASQUE DE SORTIE = " ;[10a2- - DB $1B ;[10ba] - DB "=.!$" ;[10bb- - DB "*" ;[10bf] - - nop ;[10c0] - nop ;[10c1] - nop ;[10c2] - nop ;[10c3] - nop ;[10c4] - nop ;[10c5] - nop ;[10c6] - nop ;[10c7] - nop ;[10c8] - nop ;[10c9] - nop ;[10ca] - nop ;[10cb] - nop ;[10cc] - nop ;[10cd] - nop ;[10ce] - nop ;[10cf] - nop ;[10d0] - nop ;[10d1] - nop ;[10d2] - nop ;[10d3] - nop ;[10d4] - nop ;[10d5] - nop ;[10d6] - nop ;[10d7] - nop ;[10d8] - nop ;[10d9] - nop ;[10da] - nop ;[10db] - nop ;[10dc] - nop ;[10dd] - nop ;[10de] - nop ;[10df] - nop ;[10e0] - nop ;[10e1] - nop ;[10e2] - nop ;[10e3] - nop ;[10e4] - nop ;[10e5] - nop ;[10e6] - nop ;[10e7] - nop ;[10e8] - nop ;[10e9] - nop ;[10ea] - nop ;[10eb] - nop ;[10ec] - nop ;[10ed] - nop ;[10ee] - nop ;[10ef] - nop ;[10f0] - nop ;[10f1] - nop ;[10f2] - nop ;[10f3] - nop ;[10f4] - nop ;[10f5] - nop ;[10f6] - nop ;[10f7] - nop ;[10f8] - nop ;[10f9] - nop ;[10fa] - nop ;[10fb] - nop ;[10fc] - nop ;[10fd] - nop ;[10fe] - nop ;[10ff] - nop ;[1100] - nop ;[1101] - nop ;[1102] - nop ;[1103] - nop ;[1104] - nop ;[1105] - nop ;[1106] - nop ;[1107] - nop ;[1108] - nop ;[1109] - nop ;[110a] - nop ;[110b] - nop ;[110c] - nop ;[110d] - nop ;[110e] - nop ;[110f] - nop ;[1110] - nop ;[1111] - nop ;[1112] - nop ;[1113] - nop ;[1114] - nop ;[1115] - nop ;[1116] - nop ;[1117] - nop ;[1118] - nop ;[1119] - nop ;[111a] - nop ;[111b] - nop ;[111c] - nop ;[111d] - nop ;[111e] - nop ;[111f] - nop ;[1120] - nop ;[1121] - nop ;[1122] - nop ;[1123] - nop ;[1124] - nop ;[1125] - nop ;[1126] - nop ;[1127] - nop ;[1128] - nop ;[1129] - nop ;[112a] - nop ;[112b] - nop ;[112c] - nop ;[112d] - nop ;[112e] - nop ;[112f] - nop ;[1130] - nop ;[1131] - nop ;[1132] - nop ;[1133] - nop ;[1134] - nop ;[1135] - nop ;[1136] - nop ;[1137] - nop ;[1138] - nop ;[1139] - nop ;[113a] - nop ;[113b] - nop ;[113c] - nop ;[113d] - nop ;[113e] - nop ;[113f] - nop ;[1140] - nop ;[1141] - nop ;[1142] - nop ;[1143] - nop ;[1144] - nop ;[1145] - nop ;[1146] - nop ;[1147] - nop ;[1148] - nop ;[1149] - nop ;[114a] - nop ;[114b] - nop ;[114c] - nop ;[114d] - nop ;[114e] - nop ;[114f] - nop ;[1150] - nop ;[1151] - nop ;[1152] - nop ;[1153] - nop ;[1154] - nop ;[1155] - nop ;[1156] - nop ;[1157] - nop ;[1158] - nop ;[1159] - nop ;[115a] - nop ;[115b] - nop ;[115c] - nop ;[115d] - nop ;[115e] - nop ;[115f] - nop ;[1160] - nop ;[1161] - nop ;[1162] - nop ;[1163] - nop ;[1164] - nop ;[1165] - nop ;[1166] - nop ;[1167] - nop ;[1168] - nop ;[1169] - nop ;[116a] - nop ;[116b] - nop ;[116c] - nop ;[116d] - nop ;[116e] - nop ;[116f] - nop ;[1170] - nop ;[1171] - nop ;[1172] - nop ;[1173] - nop ;[1174] - nop ;[1175] - nop ;[1176] - nop ;[1177] - nop ;[1178] - nop ;[1179] - nop ;[117a] - nop ;[117b] - nop ;[117c] - nop ;[117d] - nop ;[117e] - nop ;[117f] - nop ;[1180] - nop ;[1181] - nop ;[1182] - nop ;[1183] - nop ;[1184] - nop ;[1185] - nop ;[1186] - nop ;[1187] - nop ;[1188] - nop ;[1189] - nop ;[118a] - nop ;[118b] - nop ;[118c] - nop ;[118d] - nop ;[118e] - nop ;[118f] - nop ;[1190] - nop ;[1191] - nop ;[1192] - nop ;[1193] - nop ;[1194] - nop ;[1195] - nop ;[1196] - nop ;[1197] - nop ;[1198] - nop ;[1199] - nop ;[119a] - nop ;[119b] - nop ;[119c] - nop ;[119d] - nop ;[119e] - nop ;[119f] - nop ;[11a0] - nop ;[11a1] - nop ;[11a2] - nop ;[11a3] - nop ;[11a4] - nop ;[11a5] - nop ;[11a6] - nop ;[11a7] - nop ;[11a8] - nop ;[11a9] - nop ;[11aa] - nop ;[11ab] - nop ;[11ac] - nop ;[11ad] - nop ;[11ae] - nop ;[11af] - nop ;[11b0] - nop ;[11b1] - nop ;[11b2] - nop ;[11b3] - nop ;[11b4] - nop ;[11b5] - nop ;[11b6] - nop ;[11b7] - nop ;[11b8] - nop ;[11b9] - nop ;[11ba] - nop ;[11bb] - nop ;[11bc] - nop ;[11bd] - nop ;[11be] - nop ;[11bf] - nop ;[11c0] - nop ;[11c1] - nop ;[11c2] - nop ;[11c3] - ld a,$01 ;[11c4] - ld ($11fc),a ;[11c6] - ret ;[11c9] - - push hl ;[11ca] - ld ($11fd),a ;[11cb] - cp $0f ;[11ce] - call c,$11c4 ;[11d0] - xor a ;[11d3] - ld hl,$11fd ;[11d4] - rrd ;[11d7] - and $0f ;[11d9] - add $30 ;[11db] - cp $3a ;[11dd] - jp m,$11e4 ;[11df] - add $07 ;[11e2] - ld ($11ff),a ;[11e4] - ld a,(hl) ;[11e7] - add $37 ;[11e8] - ld ($11fe),a ;[11ea] - ld a,($11fc) ;[11ed] - or a ;[11f0] - jr z,$11fa ;[11f1] - xor a ;[11f3] - ld ($11fe),a ;[11f4] - ld ($11fc),a ;[11f7] - pop hl ;[11fa] - ret ;[11fb] - - nop ;[11fc] - nop ;[11fd] - nop ;[11fe] - nop ;[11ff] - inc h ;[1200] - push hl ;[1201] - ld hl,$11fe ;[1202] - ld a,(hl) ;[1205] - sub $37 ;[1206] - rla ;[1208] - rla ;[1209] - rla ;[120a] - rla ;[120b] - ld (hl),a ;[120c] - inc hl ;[120d] - ld a,(hl) ;[120e] - sub $30 ;[120f] - dec hl ;[1211] - add (hl) ;[1212] - ld ($11fd),a ;[1213] - pop hl ;[1216] - ret ;[1217] - - nop ;[1218] - nop ;[1219] - nop ;[121a] - nop ;[121b] - nop ;[121c] - nop ;[121d] - nop ;[121e] - nop ;[121f] - nop ;[1220] - nop ;[1221] - nop ;[1222] - nop ;[1223] - nop ;[1224] - nop ;[1225] - nop ;[1226] - nop ;[1227] - nop ;[1228] - nop ;[1229] - nop ;[122a] - nop ;[122b] - nop ;[122c] - nop ;[122d] - nop ;[122e] - nop ;[122f] - nop ;[1230] - nop ;[1231] - nop ;[1232] - nop ;[1233] - nop ;[1234] - nop ;[1235] - nop ;[1236] - nop ;[1237] - nop ;[1238] - nop ;[1239] - nop ;[123a] - nop ;[123b] - nop ;[123c] - nop ;[123d] - nop ;[123e] - nop ;[123f] - nop ;[1240] - nop ;[1241] - nop ;[1242] - nop ;[1243] - ld a,$01 ;[1244] - ld ($11fc),a ;[1246] - ret ;[1249] - - push hl ;[124a] - ld ($11fd),a ;[124b] - cp $0f ;[124e] - call c,$11c4 ;[1250] - xor a ;[1253] - ld hl,$11fd ;[1254] - rrd ;[1257] - and $0f ;[1259] - add $30 ;[125b] - cp $3a ;[125d] - jp m,$11e4 ;[125f] - add $07 ;[1262] - ld ($11ff),a ;[1264] - ld a,(hl) ;[1267] - add $37 ;[1268] - ld ($11fe),a ;[126a] - ld a,($11fc) ;[126d] - or a ;[1270] - jr z,$127a ;[1271] - xor a ;[1273] - ld ($11fe),a ;[1274] - ld ($11fc),a ;[1277] - pop hl ;[127a] - ret ;[127b] - - nop ;[127c] - nop ;[127d] - nop ;[127e] - nop ;[127f] From 460ca0780872e67ab0d26d5f939c4915a55f11a7 Mon Sep 17 00:00:00 2001 From: BayoDev Date: Tue, 11 Nov 2025 17:34:58 +0100 Subject: [PATCH 5/6] Update checksum and FMT8003 assembler friendly --- applications/FMT8003.COM.asm | 138 ++++++++++++++++++++--------------- applications/md5sum.txt | 4 +- 2 files changed, 84 insertions(+), 58 deletions(-) diff --git a/applications/FMT8003.COM.asm b/applications/FMT8003.COM.asm index 50436e2..9d03a4e 100644 --- a/applications/FMT8003.COM.asm +++ b/applications/FMT8003.COM.asm @@ -6,7 +6,8 @@ ORG $0100 - ld sp,$0100 ;[0100] +l0100: + ld sp,l0100 ;[0100] call OUT_STRING ;[0103] DB $0D @@ -27,14 +28,14 @@ DRIVE_SEL_PROMPT: DB $00 call IN_LINE ;[0155] - ld a,($02d8) ;[0158] Get lenght of input string + ld a,(l02d8) ;[0158] Get lenght of input string or a ;[015b] jp z,RST_FLOPPY_AND_CPM ;[015c] Exit program if the input string is empty cp $02 ;[015f] jr nc,DRIVE_SEL_PROMPT ;[0161] Jump if the input string is > 2 char long - ld a,($02d9) ;[0163] Load first input char + ld a,(l02d9) ;[0163] Load first input char res 5,a ;[0166] Reset 5th bit of the A register - ld ($0198),a ;[0168] Change the next string to display the drive letter + ld (l0198),a ;[0168] Change the next string to display the drive letter cp $41 ;[016b] Check if input == 'A' jr c,DRIVE_SEL_PROMPT ;[016d] Jump if the input is < than 'A' (Invalid input) cp $43 ;[016f] Check if input == 'B' @@ -42,11 +43,13 @@ DRIVE_SEL_PROMPT: dec a ;[0173] and $03 ;[0174] ld (DRIVE_SEL),a ;[0176] Save drive selection in memory +l0179: call OUT_STRING ;[0179] DB $0D DB $0A DB "INSERT NEW DISKETTE DRIVE " +l0198: DB $00 ;[0198] This will contain the drive letter DB $3A DB $0D @@ -68,7 +71,7 @@ DRIVE_SEL_PROMPT: xor a ;[01c6] Resets register A ld (TRACK_CUR),a ;[01c7] Set the current track to $00 ld a,$08 ;[01ca] - ld ($03e8),a ;[01cc] Set $03e8 to $08 + ld (l03e8),a ;[01cc] Set l03e8 to $08 call ZERO_SEEK ;[01cf] FORMAT_LOOP: call L0373 ;[01d2] @@ -76,10 +79,11 @@ FORMAT_LOOP: call FORMAT_TRACK ;[01d8] ld a,(DRIVE_SEL) ;[01db] bit 2,a ;[01de] - jr nz,$01ea ;[01e0] + jr nz,l01ea ;[01e0] set 2,a ;[01e2] ld (DRIVE_SEL),a ;[01e4] Set DRIVE_SEL[2] to 1 if not already jp FORMAT_LOOP ;[01e7] +l01ea: res 2,a ;[01ea] Reset 2nd bit of DRIVE_SEL ld (DRIVE_SEL),a ;[01ec] ld a,(TRACK_CUR) ;[01ef] @@ -98,10 +102,10 @@ START_VERIFY: DB "VERIFY START" DB $00 - ld ix,$040d ;[0213] + ld ix,l040d ;[0213] ld a,(DRIVE_SEL) ;[0217] and $03 ;[021a] - ld (ix+$00),a ;[021c] ($040d) = DRIVE_SEL[0:1] + ld (ix+$00),a ;[021c] (l040d) = DRIVE_SEL[0:1] ld (ix+$01),$28 ;[021f] ld (ix+$02),$10 ;[0223] ld (ix+$03),$05 ;[0227] @@ -117,7 +121,7 @@ START_VERIFY: DB "VERIFY COMPLETED" DB $00 - jp $0179 ;[0251] Jump back to disk insertion + jp l0179 ;[0251] Jump back to disk insertion VERIFY_ERROR: push de ;[0254] @@ -173,9 +177,10 @@ OUT_DEC: ld a,e ;[02aa] ld b,$0a ;[02ab] ld c,$ff ;[02ad] +l02af: inc c ;[02af] sub b ;[02b0] - jr nc,$02af ;[02b1] Subtract $0a from the A register and increment C until A<0 + jr nc,l02af ;[02b1] Subtract $0a from the A register and increment C until A<0 add b ;[02b3] In the end this is A=A%B and C=A/B ld b,a ;[02b4] ld a,c ;[02b5] @@ -196,7 +201,7 @@ IN_LINE: push bc ;[02c7] push de ;[02c8] push hl ;[02c9] - ld de,$02d7 ;[02ca] + ld de,l02d7 ;[02ca] ld c,$0a ;[02cd] call $0005 ;[02cf] pop hl ;[02d2] @@ -206,8 +211,11 @@ IN_LINE: ret ;[02d6] ; Text input buffer used in the IN_LINE function +l02d7: DB $0a ;[02d7] +l02d8: DB $b8 ;[02d8] +l02d9: DB $00 ;[02d9] DB $00 ;[02da] DB $00 ;[02db] @@ -274,12 +282,14 @@ FORMAT_TRACK: ld a,(TRACK_CUR) ;[0343] ld d,a ;[0346] D = TRACK_CUR or a ;[0347] - jr nz,$0352 ;[0348] Jump if TRUCK_CUR!=0 + jr nz,l0352 ;[0348] Jump if TRUCK_CUR!=0 bit 2,c ;[034a] - jr nz,$0352 ;[034c] Jump if DRIVE_SEL[2] != 0 + jr nz,l0352 ;[034c] Jump if DRIVE_SEL[2] != 0 ld a,$01 ;[034e] - jr $0354 ;[0350] + jr l0354 ;[0350] +l0352: ld a,$03 ;[0352] If DRIVE_SEL[2]==1 -> A=$03 , ELSE -> A=$01 +l0354: ld hl,$5000 ;[0354] Address where the call FDC_WRAPPER ;[0357] Call sanco's FDC routine for "format desired track" cp $ff ;[035a] @@ -305,14 +315,16 @@ L0373: ld a,(TRACK_CUR) ;[0380] ld d,a ;[0383] or a ;[0384] - jr nz,$0392 ;[0385] Jump if TRACK_CUR!=0 + jr nz,l0392 ;[0385] Jump if TRACK_CUR!=0 bit 0,b ;[0387] Test DRIVE_SEL[2] - jr nz,$0392 ;[0389] Jump if !=0 (i.e. =1) + jr nz,l0392 ;[0389] Jump if !=0 (i.e. =1) ld c,$01 ;[038b] ld a,$10 ;[038d] Write 16 times with C=$01 - jp $0396 ;[038f] + jp l0396 ;[038f] +l0392: ld a,$05 ;[0392] ld c,$03 ;[0394] Write 5 times with C=$03 +l0396: ld (hl),d ;[0396] Load TRACK_CUR inc hl ;[0397] ld (hl),b ;[0398] Load DRIVE_SEL[2] @@ -323,7 +335,7 @@ L0373: inc hl ;[039d] inc e ;[039e] Increase counter dec a ;[039f] Decrease limit - jp nz,$0396 ;[03a0] Jump if limit!=0 + jp nz,l0396 ;[03a0] Jump if limit!=0 ret ;[03a3] FDC_WRAPPER: @@ -364,12 +376,12 @@ OUT_DISK_TRACE: DB $20 ;" " DB $00 - ld a,($03e8) ;[03d4] + ld a,(l03e8) ;[03d4] dec a ;[03d7] Decrement line counter - ld ($03e8),a ;[03d8] + ld (l03e8),a ;[03d8] ret nz ;[03db] return if line counter != 0 ld a,$08 ;[03dc] - ld ($03e8),a ;[03de] Set ($03e8) to $08 again + ld (l03e8),a ;[03de] Set (l03e8) to $08 again call OUT_STRING ;[03e1] DB $0D @@ -378,19 +390,22 @@ OUT_DISK_TRACE: ret +l03e8: DB $3A ;[03e8] ; This funcion keeps printing characters starting from the address where ; the function was called + 1 until it encounters $00 OUT_STRING: EX (SP),HL ;[03e9] +l03ea: ld a, (hl) ;[03ea] inc hl ;[03eb] or a ;[03ec] - jr z,$03f5 ;[03ed] + jr z,l03f5 ;[03ed] ld e,a ;[03ef] call OUT_CHAR ;[03f0] - jr $03ea ;[03f3] + jr l03ea ;[03f3] +l03f5: ex (sp),hl ;[03f5] ret ;[03f6] @@ -424,6 +439,7 @@ DRIVE_SEL: DB 00 ;[040c] ; Reference values used in the verification process +l040d: DB 00 ;[040d] $XX Drive selection (Same format as DRIVE_SEL) DB 00 ;[040e] $28 Max number of tracks DB 00 ;[040f] $10 Sectors/track in side 0 @@ -433,88 +449,96 @@ DRIVE_SEL: READ_DISK: ld a,(ix+$00) ;[0413] - ld ($04ba),a ;[0416] ($04ba) = selected drive = (DRIVE_SEL[0:1]) + ld (l04ba),a ;[0416] (l04ba) = selected drive = (DRIVE_SEL[0:1]) xor a ;[0419] - ld ($04b5),a ;[041a] Set ($04b5) = $00 + ld (l04b5),a ;[041a] Set (l04b5) = $00 +l041d: call READ_TRACK ;[041d] or a ;[0420] ret nz ;[0421] Return if A!=$00 (failed) - ld a,($04ba) ;[0422] + ld a,(l04ba) ;[0422] bit 2,a ;[0425] - jr nz,$0431 ;[0427] + jr nz,l0431 ;[0427] set 2,a ;[0429] - ld ($04ba),a ;[042b] - jp $041d ;[042e] + ld (l04ba),a ;[042b] + jp l041d ;[042e] +l0431: res 2,a ;[0431] - ld ($04ba),a ;[0433] Invert side bit of select drive - ld a,($04b5) ;[0436] + ld (l04ba),a ;[0433] Invert side bit of select drive + ld a,(l04b5) ;[0436] inc a ;[0439] - ld ($04b5),a ;[043a] Increase current track + ld (l04b5),a ;[043a] Increase current track ld b,a ;[043d] ld a,(ix+$01) ;[043e] cp b ;[0441] - jp nz,$041d ;[0442] Jump if current track != number of sectors ($28) + jp nz,l041d ;[0442] Jump if current track != number of sectors ($28) xor a ;[0445] ret ;[0446] Return A=$00 READ_TRACK: xor a ;[0447] Reset A - ld ($04b6),a ;[0448] Set ($04b6) (i.e. current sector) = $00 + ld (l04b6),a ;[0448] Set (l04b6) (i.e. current sector) = $00 ld a,(ix+$03) ;[044b] - ld ($04b7),a ;[044e] Set ($04b7) (i.e. max sector) = ($0410) = $05 + ld (l04b7),a ;[044e] Set (l04b7) (i.e. max sector) = (l0410) = $05 ld a,(ix+$05) ;[0451] - ld ($04b8),a ;[0454] Set ($04b8) (i.e. bts shift factor) = ($0412) + ld (l04b8),a ;[0454] Set (l04b8) (i.e. bts shift factor) = (l0412) ld b,$43 ;[0457] ?? - ld a,($04b5) ;[0459] + ld a,(l04b5) ;[0459] or a ;[045c] - jp nz,$0474 ;[045d] Jump if ($04b5) (i.e. current track) == $00 - ld a,($04ba) ;[0460] + jp nz,l0474 ;[045d] Jump if (l04b5) (i.e. current track) == $00 + ld a,(l04ba) ;[0460] bit 2,a ;[0463] - jp nz,$0474 ;[0465] Jump if ($04ba)[2]!=0 (Should be == DRIVE_SEL[2] so side select (?)) + jp nz,l0474 ;[0465] Jump if (l04ba)[2]!=0 (Should be == DRIVE_SEL[2] so side select (?)) ld a,(ix+$02) ;[0468] - ld ($04b7),a ;[046b] Set ($04b7) (i.e. number of sectors) = ($040f) = $10 + ld (l04b7),a ;[046b] Set (l04b7) (i.e. number of sectors) = (l040f) = $10 ld a,(ix+$04) ;[046e] - ld ($04b8),a ;[0471] Set ($04b8) = ($0411) = bps shift factor = $01 + ld (l04b8),a ;[0471] Set (l04b8) = (l0411) = bps shift factor = $01 +l0474: ld b,$40 ;[0474] Set operation command for sanco's routine (read sector in the HL buffer) - ld a,($04ba) ;[0476] - ld c,a ;[0479] c = drive number = ($04ba) - ld a,($04b5) ;[047a] - ld d,a ;[047d] d = current track = ($04b5) - ld a,($04b6) ;[047e] - ld e,a ;[0481] e = current sector = ($04b6) + ld a,(l04ba) ;[0476] + ld c,a ;[0479] c = drive number = (l04ba) + ld a,(l04b5) ;[047a] + ld d,a ;[047d] d = current track = (l04b5) + ld a,(l04b6) ;[047e] + ld e,a ;[0481] e = current sector = (l04b6) ld hl,$04bb ;[0482] hl = read buffer address = $04bb - ld a,($04b8) ;[0485] a = bytes per sector shift factor = ($04b8) + ld a,(l04b8) ;[0485] a = bytes per sector shift factor = (l04b8) call $ffa3 ;[0488] call $c018 ;[048b] Use sanco's routine to read sector in the HL buffer call $ffa6 ;[048e] or a ;[0491] jp nz,READ_TRACK_ERR ;[0492] Jump if a!=0 <=> failed sanco's routine - ld a,($04b6) ;[0495] + ld a,(l04b6) ;[0495] inc a ;[0498] - ld ($04b6),a ;[0499] Increase ($04b6) = current sector + ld (l04b6),a ;[0499] Increase (l04b6) = current sector ld b,a ;[049c] - ld a,($04b7) ;[049d] + ld a,(l04b7) ;[049d] cp b ;[04a0] - jp nz,$0474 ;[04a1] Jump if sector!=number of sectors + jp nz,l0474 ;[04a1] Jump if sector!=number of sectors xor a ;[04a4] A = 0 ret ;[04a5] return READ_TRACK_ERR: - ld a,($04b5) ;[04a6] + ld a,(l04b5) ;[04a6] ld d,a ;[04a9] d = current track - ld a,($04b6) ;[04aa] + ld a,(l04b6) ;[04aa] ld e,a ;[04ad] e = current sector - ld a,($04ba) ;[04ae] + ld a,(l04ba) ;[04ae] ld b,a ;[04b1] b = drive number ld a,$ff ;[04b2] a = $ff ret ;[04b4] ; Used in the verify process +l04b5: DB $7a ;[04b5] Current track +l04b6: DB $b3 ;[04b6] Current sector +l04b7: DB $2f ;[04b7] Number of sectors +l04b8: DB $ca ;[04b8] Bytes per sector, shift factor DB $35 ;[04b9] Seems to be unused +l04ba: DB $29 ;[04ba] Drive number @@ -989,7 +1013,7 @@ READ_TRACK_ERR: DB $3C ;'<' DB $B7 DB $CA - DB " ;+}2r@2 + DB ";+}2r@2" DB $0F DB $3D ;'=' DB $C3 diff --git a/applications/md5sum.txt b/applications/md5sum.txt index 78d2feb..a8d6aa0 100644 --- a/applications/md5sum.txt +++ b/applications/md5sum.txt @@ -5,4 +5,6 @@ b022bb2d88531e11fd4f6fc4c89f31ed build/SLF80037.relocated 2b5ea330d652f8da9cc47b3038dadbf9 build/COPY8003.COM 8924c5c5c9f22f56f06dc1f913a091a4 build/SG8003.COM -3cec9f3b89fd35aa1cd54a3997902085 build/TRX62.COM \ No newline at end of file +3cec9f3b89fd35aa1cd54a3997902085 build/TRX62.COM +5d16bdc07ffe2845aa900d0fbb5d51d9 build/RCX62.COM.asm +4288fafb9445ed7276a40b9a3c0e81b4 build/FMT8003.COM.asm \ No newline at end of file From 299528d80b20c8820c872953025bdb3dd2677d0c Mon Sep 17 00:00:00 2001 From: BayoDev Date: Tue, 11 Nov 2025 17:37:55 +0100 Subject: [PATCH 6/6] Bring back old link --- applications/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/applications/README.md b/applications/README.md index 9e9ecb7..0b16d18 100644 --- a/applications/README.md +++ b/applications/README.md @@ -12,7 +12,7 @@ - [RCX62.COM](RCX62.COM.asm): receive data from serial port; - [SG8003.COM](SG8003.COM.asm): boot sector copier, used to change the boot program - [SLF80037.COM](SLF80037.COM.asm): bootstrap application; -- [TERM80.COM](TERM80.COM.asm): serial terminal; +- [TERM80.COM]([TERM80.COM.asm](https://github.com/BayoDev/Sanco_8000/blob/main/CP-M/DISASSEMBLY/TERM80_disassembly.z80)): serial terminal; - [TRX62.COM](TRX62.COM): send data through serial port; ## CP/M system tools and applications