; --------------------------------------------------------------------------- conStrOut_t struc ; (sizeof=0x3, mappedto_1) ; XREF: ABS0:?conStrOut/r len: .db ? ; XREF: conStrOut+10/r str: .dw ? ; XREF: conStrOut/o ; conStrOut+C/r conStrOut_t ends ; --------------------------------------------------------------------------- openFile_t struc ; (sizeof=0x5, mappedto_2) ; XREF: ABS0:?openFile/r aft$p: .dw ? ; XREF: openFile+17/r ; openFile+37/r path: .dw ? ; XREF: openFile+1B/r ; openFile+3B/r mode: .db ? ; XREF: openFile/o ; openFile+F/r ... openFile_t ends ; --------------------------------------------------------------------------- readFile_t struc ; (sizeof=0x6, mappedto_3) ; XREF: ABS0:?readFile/r inAft: .dw ? ; XREF: readFile+11/r inBuf: .dw ? ; XREF: readFile+15/r inCnt: .dw ? ; XREF: readFile/o ; readFile+19/r readFile_t ends ; --------------------------------------------------------------------------- writeFile_t struc ; (sizeof=0x6, mappedto_4) ; XREF: ABS0:?writeFile/r outAft: .dw ? ; XREF: writeFile+11/r outBuf: .dw ? ; XREF: writeFile+15/r outCnt: .dw ? ; XREF: writeFile/o ; writeFile+19/r writeFile_t ends ; --------------------------------------------------------------------------- closeFile_t struc ; (sizeof=0x2, mappedto_5) ; XREF: ABS0:?closeFile/r conn: .dw ? ; XREF: closeFile/o ; closeFile+6/r closeFile_t ends ; --------------------------------------------------------------------------- DEBLANK_t struc ; (sizeof=0x2, mappedto_6) ; XREF: ABS0:?DEBLANK/r arg1w: .dw ? ; XREF: DEBLANK/o ; DEBLANK:loc_3977/r ... DEBLANK_t ends ; --------------------------------------------------------------------------- toupper_t struc ; (sizeof=0x1, mappedto_7) ; XREF: ABS0:?toupper/r arg1b: .db ? ; XREF: toupper+4/r ; toupper+1B/r ... toupper_t ends ; --------------------------------------------------------------------------- fileError_t struc ; (sizeof=0x4, mappedto_8) ; XREF: ABS0:?fileError/r err: .db ? ; XREF: fileError+D/r ; fileError:loc_39EC/r ... len: .db ? ; XREF: fileError+1D/r ; fileError+43/r ... name: .dw ? ; XREF: fileError/o ; fileError+21/r ... fileError_t ends ; --------------------------------------------------------------------------- _3a7a_t struc ; (sizeof=0x4, mappedto_9) ; XREF: ABS0:?sub_3A7A/r buf: .dw ? ; XREF: receive+22/r ; receive+40/r maxCnt: .dw ? ; XREF: receive/o ; receive+26/r _3a7a_t ends ; --------------------------------------------------------------------------- receiveBuf_t struc ; (sizeof=0x4, mappedto_10) ; XREF: ABS0:?receiveBuf/r recvBuf: .dw ? ; XREF: receiveBuf:loc_3B05/r recvMax: .dw ? ; XREF: receiveBuf/o ; receiveBuf+F/r receiveBuf_t ends ; --------------------------------------------------------------------------- _3b28_t struc ; (sizeof=0x4, mappedto_11) ; XREF: ABS0:?sub_3B28/r arg1w: .dw ? ; XREF: sub_3B28:loc_3B61/r ; sub_3B28:loc_3B6E/r arg2w: .dw ? ; XREF: sub_3B28/o ; sub_3B28+4B/r _3b28_t ends ; --------------------------------------------------------------------------- _3c3e_t struc ; (sizeof=0x3, mappedto_12) ; XREF: ABS0:?doCmdLine/r arg1b: .db ? ; XREF: doCmdLine:loc_3E71/r ; doCmdLine:loc_3ECE/r arg2w: .dw ? ; XREF: doCmdLine/o ; doCmdLine+8/r ... _3c3e_t ends ; --------------------------------------------------------------------------- CLOSE_t struc ; (sizeof=0x4, mappedto_13) ; XREF: ABS0:?CLOSE/r conn: .dw ? status$p: .dw ? ; XREF: CLOSE/o CLOSE_t ends ; --------------------------------------------------------------------------- OPEN_t struc ; (sizeof=0xA, mappedto_14) ; XREF: ABS0:?OPEN/r conn$p: .dw ? path$p: .dw ? access: .dw ? echo: .dw ? status$p: .dw ? ; XREF: OPEN/o OPEN_t ends ; --------------------------------------------------------------------------- READ_t struc ; (sizeof=0xA, mappedto_15) ; XREF: ABS0:?READ/r conn: .dw ? buff$p: .dw ? count: .dw ? actual$p: .dw ? status$p: .dw ? ; XREF: READ/o READ_t ends ; --------------------------------------------------------------------------- WRITE_t struc ; (sizeof=0x8, mappedto_16) ; XREF: ABS0:?WRITE/r conn: .dw ? buff$p: .dw ? count: .dw ? status$p: .dw ? ; XREF: WRITE/o WRITE_t ends ; --------------------------------------------------------------------------- ; enum _ISIS, mappedto_17 $OPEN: = 0 $CLOSE: = 1 $DELETE: = 2 $READ: = 3 $WRITE: = 4 $SEEK: = 5 $LOAD: = 6 $RENAME: = 7 $CONSOL: = 8 $EXIT: = 9 ; XREF: EXIT+9/s $ATTRIB: = 0Ah $RESCAN: = 0Bh $ERROR: = 0Ch $WHOCON: = 0Dh $SPATH: = 0Eh $DISKIO: = 44h $ASSGN: = 64h $GETCFG: = 66h $SETFLG: = 67h $CLRFLG: = 68h $TSTFLG: = 69h $WINIO: = 0A8h declare copyright(*) byte data('NET V1.0. (C) Copyright Genesis Microsystems 1983.', CR, LF); main: declare (actual, status) address; declare cmdInBuf(128) byte; declare transferBuf(1006h) byte; call initSerial; call read(1, .cmdInbuf, 128, .actual, .status_1); cmdInBuf(actual) = CR; call conStrOut(length(copyright), .copyright); call doCmdLine(0. .cmdInBuf); end; conStrOut: procedure(len, str); declare len byte, str address; declare status address; call write(0, str, len, .status); end; openFile: procedure(conn$p, path$p, mode) byte; declare (conn$p, path$p) address, mode byte; declare status address; if mode = 5 then call open(conn$p, path$p, READMODE, 0, .status); else if mode = 6 then call open(conn$p, path$p, WRITEMODE, 0, .status); else return 5; if status <> 0 then if status = 0dh then return 1; else if status = 0eh then return 2; else if status = 7 or status = 9 then return 3; else if status = 4 or status = 5 then return 4; else return 5; return 0; end; readFile: procedure(conn, buff$p, cnt) address; declare (conn, buff$p, cnt) address; declare (actual, status) address; call read(conn, buuff$p, cnt, .actual, .status); return actual; end; writeFile: procedure(conn, buff$p, cnt); declare (conn, buff$p, cnt) address; declare (actual, status) address; call write(conn, buuff$p, cnt, .status); end; closeFile: procedure(conn); declare (conn, status) address call close(conn, .status); end; declare notFound(*) byte data('File "', '" was not found.', CR, LF); declare writeProtect(*) byte data('File "', '" was write protected.', CR, LF); declare overflow(*) byte data('Disk or directory overflow while trying to open "', '".', CR, LF); declare illegalFile(*) byte data('Illegal filename -- "', '".', CR, LF); declare otherError(*) byte data('Error while trying trying to open "', '".', CR, LF); declare enterSlave(*) byte data('Entering slave mode. Type (ESC) to exit.', CR, LF); declare syntaxError(*) byte data('Syntax error -- "TO" was not found in the expected place', CR, LF); declare destError(*) byte data('Error -- destination device must be specified', CR, LF); deblank: procedure(str) address; declare str address, ch based str byte; do while ch = ' '; str = str + 1; end return str; end; ; toupper(B arg1b) toupper: procedure(ch) byte; declare ch byte; if 'a' <= ch and ch <= 'z' then return ch + 'A' - 'a'; else return ch; end; fileError: procedure(err, len, name); declare (err, len) byte, name address; if err = 1 then do; call conStrOut(6, .notFound); call constrOut(len, name); call constrOut(18, .notFound(6)); end; else if err = 2 then do; call conStrOut(6, .writeProtect); call constrOut(len, name); call constrOut(24, .writeProtect(6)); end; else if err = 3 then do; call conStrOut(49, .overflow); call constrOut(len, name); call constrOut(4, .overflow(49)); end; else if err = 4 then do; call conStrOut(21, .illegalFile); call constrOut(len, name); call constrOut(4, .illegalFile(21)); end; else do; call conStrOut(28, .otherError); call constrOut(len, name); call constrOut(4, .otherError(28)); end; end; ; =============== S U B R O U T I N E ======================================= ; sub_3A7A(W arg1w, W arg2w) receive: ; CODE XREF: receiveBuf+13↓p ; doCmdLine+45↓p lxi h, ?sub_3A7A.maxCnt+1 mov m, d dcx h mov m, e dcx h mov m, b dcx h mov m, c ; -- end prologue lxi h, unk_5269 mvi m, 2 push h lhld unk_5258 xchg pop h inx h mov m, e inx h mov m, d lxi d, 3 lxi b, unk_5269 call sub_4006 ; sub_4006() lhld ?sub_3A7A.buf push h lhld ?sub_3A7A.maxCnt mov b, h mov c, l lxi d, 100 call sub_403F ; sub_403F() shld unk_5267 mvi a, 0 lxi d, unk_5267 call @P0101 ; sub_40E1() ; hl = [de] - a ora l adi 0FFh sbb a lhld ?sub_3A7A.buf inx h lxi d, unk_5258 push psw call @P0099 ; sub_40D6() ; hl = [de] - [hl] ora l sui 1 sbb a pop b mov c, b ana c rar jnc loc_3AF6 lhld unk_5258 inx h shld unk_5258 lxi h, unk_5269 mvi m, 1 push h lhld unk_5258 xchg pop h inx h mov m, e inx h mov m, d lxi d, 3 lxi b, unk_5269 call sub_4006 ; sub_4006() lhld unk_5267 ret ; --------------------------------------------------------------------------- jmp locret_3AFA ; --------------------------------------------------------------------------- loc_3AF6: ; CODE XREF: receive+53↑j lxi h, 0 ret ; --------------------------------------------------------------------------- locret_3AFA: ; CODE XREF: receive+79↑j ret ; End of function receive ; =============== S U B R O U T I N E ======================================= ; receiveBuf(W arg1w, W arg2w) receiveBuf: ; CODE XREF: receiveFile+6↓p ; sub_3EED+50↓p ... lxi h, ?receiveBuf.recvMax+1 mov m, d dcx h mov m, e dcx h mov m, b dcx h mov m, c ; -- end prologue loc_3B05: ; CODE XREF: receiveBuf:loc_3B24↓j lhld ?receiveBuf.recvBuf mov b, h mov c, l lhld ?receiveBuf.recvMax xchg call receive ; sub_3A7A(W arg1w, W arg2w) shld receiveCnt mvi a, 0 lxi d, receiveCnt call @P0101 ; sub_40E1() ; hl = [de] - a ora l jz loc_3B24 lhld receiveCnt ret ; --------------------------------------------------------------------------- loc_3B24: ; CODE XREF: receiveBuf+22↑j jmp loc_3B05 ; End of function receiveBuf ; --------------------------------------------------------------------------- ret ; =============== S U B R O U T I N E ======================================= ; sub_3B28(W arg1w, W arg2w) sub_3B28: ; CODE XREF: sub_3BCF+1F↓p ; doCmdLine+95↓p ... lxi h, ?sub_3B28.arg2w+1 mov m, d dcx h mov m, e dcx h mov m, b dcx h mov m, c ; -- end prologue loc_3B32: ; CODE XREF: sub_3B28+36↓j lxi b, unk_5276 push b lxi d, 1000 lxi b, 3 call sub_403F ; sub_403F() shld unk_5279 mvi a, 0 lxi d, unk_5279 call @P0101 ; sub_40E1() ; hl = [de] - a ora l adi 0FFh sbb a push psw lda unk_5276 sui 2 sui 1 sbb a pop b mov c, b ana c rar jc loc_3B61 jmp loc_3B32 ; --------------------------------------------------------------------------- loc_3B61: ; CODE XREF: sub_3B28+33↑j lhld ?sub_3B28.arg1w inx h push h lhld unk_525A xchg pop h mov m, e inx h mov m, d loc_3B6E: ; CODE XREF: sub_3B28+9C↓j lhld ?sub_3B28.arg1w mov b, h mov c, l lhld ?sub_3B28.arg2w xchg call sub_4006 ; sub_4006() lxi b, unk_5276 push b lxi d, 0BB8h lxi b, 3 call sub_403F ; sub_403F() shld unk_5279 lda unk_5276 sui 2 sui 1 sbb a push psw lda unk_5276 sui 1 sui 1 sbb a pop b mov c, b ora c lhld unk_525A inx h lxi d, unk_5277 push psw call @P0102 ; sub_40E4() ; hl = [de] - hl ora l sui 1 sbb a pop b mov c, b ana c push psw mvi a, 0 lxi d, unk_5279 call @P0101 ; sub_40E1() ; hl = [de] - a ora l adi 0FFh sbb a pop b mov c, b ana c rar jc loc_3BC7 jmp loc_3B6E ; --------------------------------------------------------------------------- loc_3BC7: ; CODE XREF: sub_3B28+99↑j lhld unk_525A inx h shld unk_525A ret ; End of function sub_3B28 ; =============== S U B R O U T I N E ======================================= ; sub_3BCF() sub_3BCF: ; CODE XREF: sub_3BCF+2E↓j ; doCmdLine+A0↓p ... lhld wrtConn push h lxi d, 1000h lxi b, transferBuf+3 call readFile ; readFile(W inAft, W inBuf, W inCnt) shld unk_527B lxi h, transferBuf mvi m, 7 lhld unk_527B inx h inx h inx h xchg lxi b, transferBuf call sub_3B28 ; sub_3B28(W arg1w, W arg2w) lxi b, 1000h lxi d, unk_527B call @P0100 ; sub_40D9() ; hl = [de] - bc jc loc_3C00 jmp sub_3BCF ; sub_3BCF() ; --------------------------------------------------------------------------- loc_3C00: ; CODE XREF: sub_3BCF+2B↑j lhld wrtConn mov b, h mov c, l call closeFile ; closeFile(W conn) ret ; End of function sub_3BCF ; =============== S U B R O U T I N E ======================================= ; receiveFile() receiveFile: ; CODE XREF: receiveFile+29↓j ; doCmdLine:loc_3CE4↓p ... lxi d, 1003h lxi b, transferBuf call receiveBuf ; receiveBuf(W arg1w, W arg2w) shld transferCnt lhld wrtConn push h lhld transferCnt dcx h dcx h dcx h xchg lxi b, transferBuf+3 call writeFile ; writeFile(W outAft, W outBuf, W outCnt) lxi b, 1003h lxi d, transferCnt call @P0100 ; sub_40D9() ; hl = [de] - bc jc loc_3C35 jmp receiveFile ; receiveFile() ; --------------------------------------------------------------------------- loc_3C35: ; CODE XREF: receiveFile+26↑j lhld wrtConn mov b, h mov c, l call closeFile ; closeFile(W conn) ret ; End of function receiveFile ; =============== S U B R O U T I N E ======================================= ; doCmdLine(B arg1b, W arg2w) doCmdLine: ; CODE XREF: _entry+31↑p lxi h, ?doCmdLine.arg2w+1 mov m, d dcx h mov m, e dcx h mov m, c ; -- end prologue lhld ?doCmdLine.arg2w mov b, h mov c, l call DEBLANK ; DEBLANK(W arg1w) shld ?doCmdLine.arg2w lhld ?doCmdLine.arg2w mov a, m cpi 0Dh jnz loc_3D04 lxi d, aEnteringSlaveM ; "Entering slave mode. Type (ESC) to exi"... mvi c, 2Bh ; '+' call conStrOut ; conStrOut(B len, W str) loc_3C62: ; CODE XREF: doCmdLine:loc_3CFE↓j call CSTS rar jnc loc_3C74 call CI cpi 1Bh jnz loc_3C74 call EXIT ; EXIT() loc_3C74: ; CODE XREF: doCmdLine+28↑j ; doCmdLine+30↑j lxi h, 0 shld unk_5258 shld unk_525A lxi d, 1003h lxi b, transferBuf call receive ; sub_3A7A(W arg1w, W arg2w) shld unk_52AD mvi a, 4 lxi d, unk_52AD call @P0101 ; sub_40E1() ; hl = [de] - a sbb a cma push psw lda transferBuf sui 5 sui 1 sbb a push psw lda transferBuf sui 6 sui 1 sbb a pop b mov c, b ora c pop b mov c, b ana c rar jnc loc_3CFE lxi b, wrtConn push b lhld transferBuf xchg lxi b, transferBuf+3 call openFile ; openFile(W aft$p, W path, B mode) sta wrtOpenErr lda wrtOpenErr cpi 0 jnz loc_3CEA lxi h, transferBuf+1003h mvi m, 8 lxi d, 3 lxi b, transferBuf+1003h call sub_3B28 ; sub_3B28(W arg1w, W arg2w) lda transferBuf cpi 5 jnz loc_3CE4 call sub_3BCF ; sub_3BCF() jmp loc_3CE7 ; --------------------------------------------------------------------------- loc_3CE4: ; CODE XREF: doCmdLine+9D↑j call receiveFile ; receiveFile() loc_3CE7: ; CODE XREF: doCmdLine+A3↑j jmp loc_3CFE ; --------------------------------------------------------------------------- loc_3CEA: ; CODE XREF: doCmdLine+87↑j lxi h, transferBuf+1003h mvi m, 9 lda wrtOpenErr sta unk_5255 lxi d, 4 lxi b, transferBuf+1003h call sub_3B28 ; sub_3B28(W arg1w, W arg2w) loc_3CFE: ; CODE XREF: doCmdLine+6E↑j ; doCmdLine:loc_3CE7↑j jmp loc_3C62 ; --------------------------------------------------------------------------- jmp loc_3EE9 ; --------------------------------------------------------------------------- loc_3D04: ; CODE XREF: doCmdLine+19↑j lxi h, unk_5282 mvi m, 0 inx h mvi m, 0 loc_3D0C: ; CODE XREF: doCmdLine+120↓j lhld ?doCmdLine.arg2w mov a, m sui 20h ; ' ' adi 0FFh sbb a lhld ?doCmdLine.arg2w push psw mov a, m sui 0Dh adi 0FFh sbb a pop b mov c, b ana c push psw lda unk_5282 sui 13h sbb a pop b mov c, b ana c rar jnc loc_3D61 lhld ?doCmdLine.arg2w mov c, m call toupper ; toupper(B arg1b) lhld unk_5282 mvi h, 0 lxi b, unk_5285 dad b mov m, a lda unk_5282 inr a sta unk_5282 lhld ?doCmdLine.arg2w mov a, m cpi 3Ah ; ':' jnz loc_3D57 lda unk_5282 sta unk_5283 loc_3D57: ; CODE XREF: doCmdLine+110↑j lhld ?doCmdLine.arg2w inx h shld ?doCmdLine.arg2w jmp loc_3D0C ; --------------------------------------------------------------------------- loc_3D61: ; CODE XREF: doCmdLine+EF↑j lhld unk_5282 mvi h, 0 lxi b, unk_5285 dad b mvi m, 20h ; ' ' lda unk_5282 inr a sta unk_5282 lhld ?doCmdLine.arg2w mov b, h mov c, l call DEBLANK ; DEBLANK(W arg1w) shld ?doCmdLine.arg2w lhld ?doCmdLine.arg2w mov c, m call toupper ; toupper(B arg1b) sui 54h ; 'T' adi 0FFh sbb a push psw lhld ?doCmdLine.arg2w inx h mov c, m call toupper ; toupper(B arg1b) sui 4Fh ; 'O' adi 0FFh sbb a pop b mov c, b ora c rar jnc loc_3DAA lxi d, aSyntaxErrorToW ; "Syntax error -- \"TO\" was not found in"... mvi c, 3Ah ; ':' call conStrOut ; conStrOut(B len, W str) call EXIT ; EXIT() loc_3DAA: ; CODE XREF: doCmdLine+15E↑j lhld ?doCmdLine.arg2w inx h inx h mov b, h mov c, l call DEBLANK ; DEBLANK(W arg1w) shld ?doCmdLine.arg2w lxi h, nameLen mvi m, 0 loc_3DBC: ; CODE XREF: doCmdLine+1C1↓j lhld ?doCmdLine.arg2w mov a, m sui 20h ; ' ' adi 0FFh sbb a lhld ?doCmdLine.arg2w push psw mov a, m sui 0Dh adi 0FFh sbb a pop b mov c, b ana c push psw lda nameLen sui 13h sbb a pop b mov c, b ana c rar jnc loc_3E02 lhld ?doCmdLine.arg2w mov c, m call toupper ; toupper(B arg1b) lhld nameLen mvi h, 0 lxi b, name dad b mov m, a lhld ?doCmdLine.arg2w inx h shld ?doCmdLine.arg2w lda nameLen inr a sta nameLen jmp loc_3DBC ; --------------------------------------------------------------------------- loc_3E02: ; CODE XREF: doCmdLine+19F↑j lhld nameLen mvi h, 0 lxi b, name dad b mvi m, 20h ; ' ' lda nameLen inr a sta nameLen lxi h, 0 shld unk_525A shld unk_5258 ldax b sui 3Ah ; ':' sui 1 sbb a push psw lda unk_529C sui 3Ah ; ':' sui 1 sbb a pop b mov c, b ana c push psw lda nameLen sui 5 sbb a cma pop b mov c, b ana c rar jnc loc_3E84 lda nameLen cpi 5 jnz loc_3E71 lxi h, unk_5283 lda unk_5282 sub m mov l, a push h lhld unk_5283 mvi h, 0 lxi b, unk_5285 dad b mov b, h mov c, l lxi d, unk_529D pop h loc_3E5E: ; CODE XREF: doCmdLine+225↓j ldax b stax d inx b inx d dcr l jnz loc_3E5E lxi h, unk_5283 lda unk_5282 sub m adi 4 inx h mov m, a loc_3E71: ; CODE XREF: doCmdLine+205↑j lda ?doCmdLine.arg1b rar jnc loc_3E7E call sub_3F61 ; sub_3F61() jmp loc_3E81 ; --------------------------------------------------------------------------- loc_3E7E: ; CODE XREF: doCmdLine+237↑j call sub_3EED ; sub_3EED() loc_3E81: ; CODE XREF: doCmdLine+23D↑j jmp loc_3EE9 ; --------------------------------------------------------------------------- loc_3E84: ; CODE XREF: doCmdLine+1FD↑j lda unk_529A sui 3Ah ; ':' sui 1 sbb a push psw lda nameLen sui 3 sbb a cma pop b mov c, b ana c rar jnc loc_3EE1 lda nameLen cpi 3 jnz loc_3ECE lxi h, unk_5283 lda unk_5282 sub m mov l, a push h lhld unk_5283 mvi h, 0 lxi b, unk_5285 dad b mov b, h mov c, l lxi d, unk_529B pop h loc_3EBB: ; CODE XREF: doCmdLine+282↓j ldax b stax d inx b inx d dcr l jnz loc_3EBB lxi h, unk_5283 lda unk_5282 sub m inr a inr a inx h mov m, a loc_3ECE: ; CODE XREF: doCmdLine+262↑j lda ?doCmdLine.arg1b rar jnc loc_3EDB call sub_3EED ; sub_3EED() jmp loc_3EDE ; --------------------------------------------------------------------------- loc_3EDB: ; CODE XREF: doCmdLine+294↑j call sub_3F61 ; sub_3F61() loc_3EDE: ; CODE XREF: doCmdLine+29A↑j jmp loc_3EE9 ; --------------------------------------------------------------------------- loc_3EE1: ; CODE XREF: doCmdLine+25A↑j lxi d, aErrorDestinati ; "Error -- destination device must be spe"... mvi c, 2Fh ; '/' call conStrOut ; conStrOut(B len, W str) loc_3EE9: ; CODE XREF: doCmdLine+C3↑j ; doCmdLine:loc_3E81↑j ... call EXIT ; EXIT() ret ; End of function doCmdLine ; =============== S U B R O U T I N E ======================================= ; sub_3EED() sub_3EED: ; CODE XREF: doCmdLine:loc_3E7E↑p ; doCmdLine+297↑p lxi b, wrtConn push b mvi e, 6 lxi b, name call openFile ; openFile(W aft$p, W path, B mode) sta wrtOpenErr cpi 0 jz loc_3F13 lhld wrtOpenErr push h lda nameLen dcr a mov c, a lxi d, name call fileError ; fileError(B err, B len, W name) jmp locret_3F60 ; --------------------------------------------------------------------------- loc_3F13: ; CODE XREF: sub_3EED+11↑j lhld unk_5282 lxi d, transferBuf+3 lxi b, unk_5285 loc_3F1C: ; CODE XREF: sub_3EED+34↓j ldax b stax d inx b inx d dcr l jnz loc_3F1C lxi h, transferBuf mvi m, 5 lda unk_5282 adi 3 mov e, a mvi d, 0 lxi b, transferBuf call sub_3B28 ; sub_3B28(W arg1w, W arg2w) lxi d, 1003h lxi b, transferBuf call receiveBuf ; receiveBuf(W arg1w, W arg2w) shld unk_52AD lda transferBuf cpi 8 jnz loc_3F51 call receiveFile ; receiveFile() jmp locret_3F60 ; --------------------------------------------------------------------------- loc_3F51: ; CODE XREF: sub_3EED+5B↑j lhld transferBuf+3 push h lda unk_5282 dcr a mov c, a lxi d, unk_5285 call fileError ; fileError(B err, B len, W name) locret_3F60: ; CODE XREF: sub_3EED+23↑j ; sub_3EED+61↑j ret ; End of function sub_3EED sub_3F61: procedure; if (wrtOpenErr := openFile(.wrtConn, .isisPath, 5)) <> 0 then call fileError(wrtOpenErr, isisPathLen, .lsisPath); else do; call move(nameLen, .name, .transferBuf(3)); transferBuf(0) = 6; call sub_3B28(.transferBuf, nameLen + 3); recvLen = receiveBuf(.transferBuf, 1003h); if transferBuf(0) = 8 then call sub_3BCF; else call fileError(transferBuf(3), nameLen - 1, .name); end; end; retryCnt: .dw 0 ; DATA XREF: sub_403F+1↓w ; waitChar+2↓r ; =============== S U B R O U T I N E ======================================= ; sub_3FD7() initSerial: ; CODE XREF: _entry+3↑p mvi a, 36h ; '6' out 0F3h mvi a, 8 out 0F0h mvi a, 0 out 0F0h mvi a, 0 out 0F5h nop out 0F5h nop out 0F5h mvi a, 40h ; '@' out 0F5h mvi a, 8Eh out 0F5h mvi a, 37h ; '7' out 0F5h ret ; End of function initSerial ; =============== S U B R O U T I N E ======================================= ; sub_3FFA() sub_3FFA: ; CODE XREF: sub_4006+2↓p ; sub_4006+7↓p ... push psw loc_3FFB: ; CODE XREF: sub_3FFA+5↓j in 0F5h ani 1 jz loc_3FFB pop psw out 0F4h ret ; End of function sub_3FFA ; =============== S U B R O U T I N E ======================================= ; sub_4006() sub_4006: ; CODE XREF: receive+1F↑p ; receive+72↑p ... mvi a, 10h call sub_3FFA ; sub_3FFA() mvi a, 2 call sub_3FFA ; sub_3FFA() lxi h, 0 loc_4013: ; CODE XREF: sub_4006+23↓j ldax b inx b call sub_3FFA ; sub_3FFA() cpi 10h jnz loc_4020 call sub_3FFA ; sub_3FFA() loc_4020: ; CODE XREF: sub_4006+14↑j add l mov l, a mov a, h aci 0 mov h, a dcx d mov a, d ora e jnz loc_4013 mvi a, 10h call sub_3FFA ; sub_3FFA() mvi a, 3 call sub_3FFA ; sub_3FFA() mov a, l call sub_3FFA ; sub_3FFA() mov a, h call sub_3FFA ; sub_3FFA() ret ; End of function sub_4006 ; =============== S U B R O U T I N E ======================================= ; sub_403F() sub_403F: ; CODE XREF: receive+2E↑p ; sub_3B28+14↑p ... xchg shld retryCnt pop h xthl push b lxi d, 0 loc_4049: ; CODE XREF: sub_403F+F↓j ; sub_403F+17↓j call waitChar ; sub_40A4() cpi 10h ; wait for 0x10 jnz loc_4049 call waitChar ; sub_40A4() cpi 2 ; followed by a 0x2 jnz loc_4049 loc_4059: ; CODE XREF: sub_403F+46↓j call waitChar ; sub_40A4() cpi 10h jnz loc_4071 call waitChar ; sub_40A4() cpi 10h jz loc_4071 cpi 3 jz loc_4088 jmp loc_409E ; --------------------------------------------------------------------------- loc_4071: ; CODE XREF: sub_403F+1F↑j ; sub_403F+27↑j sta byte_40A3 mov a, b ; check for all done ora c jz loc_409E lda byte_40A3 dcx b mov m, a inx h add e ; update checksum mov e, a mov a, d aci 0 mov d, a jmp loc_4059 ; --------------------------------------------------------------------------- loc_4088: ; CODE XREF: sub_403F+2C↑j call waitChar ; sub_40A4() cmp e ; test checksum jnz loc_409E call waitChar ; sub_40A4() cmp d jnz loc_409E pop h mov a, l ; work out length received sub c mov l, a mov a, h sbb b mov h, a ret ; --------------------------------------------------------------------------- loc_409E: ; CODE XREF: sub_403F+2F↑j ; sub_403F+37↑j ... pop h lxi h, 0 ; didn't get anything sensible ret ; End of function sub_403F ; --------------------------------------------------------------------------- byte_40A3: .db 0 ; DATA XREF: sub_403F:loc_4071↑w ; sub_403F+3A↑r ; =============== S U B R O U T I N E ======================================= ; sub_40A4() waitChar: ; CODE XREF: sub_403F:loc_4049↑p ; sub_403F+12↑p ... push h push b lhld retryCnt shld curRetryCnt loc_40AC: ; CODE XREF: waitChar+1E↓j mvi b, 122 loc_40AE: ; CODE XREF: waitChar+12↓j in 0F5h ani 2 jnz loc_40CD dcr b jnz loc_40AE lhld curRetryCnt dcx h shld curRetryCnt mov a, h ora l jnz loc_40AC pop b pop h pop h pop h lxi h, 0 ret ; --------------------------------------------------------------------------- loc_40CD: ; CODE XREF: waitChar+E↑j in 0F4h pop b pop h ret ; End of function waitChar ; --------------------------------------------------------------------------- curRetryCnt: .dw 0 ; DATA XREF: waitChar+5↑w ; waitChar+15↑r ... @P0098: .db 69h ; i ; hl = [de] - [bc] .db 60h ; ` ; [00000003 BYTES: COLLAPSED FUNCTION @P0099. PRESS CTRL-NUMPAD+ TO EXPAND] ; [00000008 BYTES: COLLAPSED FUNCTION @P0100. PRESS CTRL-NUMPAD+ TO EXPAND] ; [00000003 BYTES: COLLAPSED FUNCTION @P0101. PRESS CTRL-NUMPAD+ TO EXPAND] ; [00000008 BYTES: COLLAPSED FUNCTION @P0102. PRESS CTRL-NUMPAD+ TO EXPAND] ; [00000013 BYTES: COLLAPSED FUNCTION CLOSE. PRESS CTRL-NUMPAD+ TO EXPAND] ; [0000000F BYTES: COLLAPSED FUNCTION EXIT. PRESS CTRL-NUMPAD+ TO EXPAND] ; [00000024 BYTES: COLLAPSED FUNCTION OPEN. PRESS CTRL-NUMPAD+ TO EXPAND] ; [00000024 BYTES: COLLAPSED FUNCTION READ. PRESS CTRL-NUMPAD+ TO EXPAND] ; [0000001F BYTES: COLLAPSED FUNCTION WRITE. PRESS CTRL-NUMPAD+ TO EXPAND] .block 34h ?conStrOut: conStrOut_t ; DATA XREF: _entry↑o ; conStrOut+10↑r ... status: .block 1 ; DATA XREF: conStrOut+16↑o .block 1 ?openFile: openFile_t ; DATA XREF: openFile+17↑r ; openFile+37↑r ... status_0: .block 1 ; DATA XREF: openFile+23↑o ; openFile+43↑o ... .block 1 ?readFile: readFile_t ; DATA XREF: readFile+11↑r ; readFile+15↑r ... inStatus: .block 2 ; DATA XREF: readFile+20↑o ; readFile+26↑r inActual: .block 1 ; DATA XREF: readFile+1D↑o .block 1 ?writeFile: writeFile_t ; DATA XREF: writeFile+11↑r ; writeFile+15↑r ... outStatus: .block 1 ; DATA XREF: writeFile+1E↑o .block 1 ?closeFile: closeFile_t ; DATA XREF: closeFile+6↑r ; closeFile↑o closeStatus: .block 1 ; DATA XREF: closeFile+B↑o .block 1 actual: .block 2 ; DATA XREF: _entry+15↑o ; _entry+1B↑r status_1: .block 1 ; DATA XREF: _entry+12↑o .block 1 cmdInBuf: .block 80h ; DATA XREF: _entry+A↑o ; _entry+1E↑o ... transferBuf: .block 1006h ; DATA XREF: sub_3BCF+10↑o ; sub_3BCF+1C↑o ... unk_5255: .block 1 wrtConn: .block 1 ; DATA XREF: sub_3BCF↑r ; sub_3BCF:loc_3C00↑r ... .block 1 unk_5258: .block 1 ; DATA XREF: receive+10↑r ; receive+44↑o ... .block 1 unk_525A: .block 1 .block 1 ?DEBLANK: DEBLANK_t ; DATA XREF: DEBLANK:loc_3977↑r ; DEBLANK+F↑r ... ?toupper: toupper_t ; DATA XREF: toupper↑o ; toupper+4↑r ... ?fileError: fileError_t ; DATA XREF: fileError+D↑r ; fileError:loc_39EC↑r ... ?sub_3A7A: _3a7a_t ; DATA XREF: receive+22↑r ; receive+40↑r ... unk_5267: .block 1 ; DATA XREF: receive+31↑w ; receive+36↑o ... .block 1 unk_5269: .block 1 ; DATA XREF: receive+A↑o ; receive+1C↑o ... .block 1 .block 1 ?receiveBuf: receiveBuf_t ; DATA XREF: receiveBuf:loc_3B05↑r ; receiveBuf+F↑r ... receiveCnt: .block 1 ; DATA XREF: receiveBuf+16↑w ; receiveBuf+1B↑o ... .block 1 ?sub_3B28: _3b28_t ; DATA XREF: sub_3B28:loc_3B61↑r ; sub_3B28:loc_3B6E↑r ... unk_5276: .block 1 ; DATA XREF: sub_3B28:loc_3B32↑o ; sub_3B28+27↑r ... unk_5277: .block 1 ; DATA XREF: sub_3B28+7A↑o .block 1 unk_5279: .block 1 ; DATA XREF: sub_3B28+17↑w ; sub_3B28+1C↑o ... .block 1 unk_527B: .block 1 ; DATA XREF: sub_3BCF+D↑w ; sub_3BCF+15↑r ... .block 1 transferCnt: .block 1 ; DATA XREF: receiveFile+9↑w ; receiveFile+10↑r ... .block 1 ?doCmdLine: _3c3e_t ; DATA XREF: doCmdLine:loc_3E71↑r ; doCmdLine:loc_3ECE↑r ... unk_5282: .block 1 ; DATA XREF: doCmdLine:loc_3D04↑o ; doCmdLine+E5↑r ... unk_5283: .block 1 ; DATA XREF: doCmdLine+116↑w ; doCmdLine+208↑o ... nameLen: .block 1 ; DATA XREF: doCmdLine+179↑o ; doCmdLine+195↑r ... unk_5285: .block 1 ; DATA XREF: doCmdLine+FE↑o ; doCmdLine+128↑o ... .block 1 .block 1 .block 1 .block 1 .block 1 .block 1 .block 1 .block 1 .block 1 .block 1 .block 1 .block 1 .block 1 .block 1 .block 1 .block 1 .block 1 .block 1 .block 1 name: .block 1 ; DATA XREF: doCmdLine+1AE↑o ; doCmdLine+1C9↑o ... unk_529A: .block 1 unk_529B: .block 1 ; DATA XREF: doCmdLine+279↑o unk_529C: .block 1 unk_529D: .block 1 ; DATA XREF: doCmdLine+21C↑o .block 1 .block 1 .block 1 .block 1 .block 1 .block 1 .block 1 .block 1 .block 1 .block 1 .block 1 .block 1 .block 1 .block 1 .block 1 unk_52AD: .block 1 ; DATA XREF: doCmdLine+48↑w ; doCmdLine+4D↑o ... .block 1 wrtOpenErr: .block 1 ?CLOSE: CLOSE_t ; DATA XREF: CLOSE+A↑o ; CLOSE↑o unk_52B4: .block 1 ; DATA XREF: EXIT↑o ; EXIT+3↑w ... .block 1 ?OPEN: OPEN_t ; DATA XREF: OPEN+1B↑o ; OPEN↑o ?READ: READ_t ; DATA XREF: READ+1B↑o ; READ↑o ?WRITE: WRITE_t ; DATA XREF: WRITE+16↑o ; WRITE↑o ; end of 'ABS0' ; =========================================================================== ; Segment type: Absolute symbols .org 0F800h START0 = 0FFFFFFFFh CI = 0FFFFFFFFh RI = 0FFFFFFFFh CO = 0FFFFFFFFh PO = 0FFFFFFFFh LO = 0FFFFFFFFh CSTS = 0FFFFFFFFh IOCHK = 0FFFFFFFFh IOSET = 0FFFFFFFFh MEMCHECK = 0FFFFFFFFh IODEF = 0FFFFFFFFh IOCDR1 = 0FFFFFFFFh DATE = 0FFFFFFFFh UI = 0FFFFFFFFh UO = 0FFFFFFFFh UPPS = 0FFFFFFFFh VERH = 0FFFFFFFFh IOCCOM = 0FFFFFFFFh IOCDR2 = 0FFFFFFFFh ; end of 'MONITOR' .end