]> cloudbase.mooo.com Git - kermit-80.git/blame - cpkfet.ddt
Bugfix in outmdm (output buffer flush)
[kermit-80.git] / cpkfet.ddt
CommitLineData
c25f6a44
L
1-a100 ;Begin assembling code at 100
20100 LXI H,2FE ;Where to store in memory
30103 SHLD 200 ;Keep pointer there
40106 MVI E,D ;Get a CR
50108 MVI C,4 ;Output to PUNCH {send to HOST}
6010A CALL 5
7010D MVI C,3 ;Input from READER {read from HOST}
8010F CALL 5
90112 ANI 7F ;Strip parity bit
100114 PUSH PSW ;save a and flags
110115 MOV E,A ;move char to e for echo
120116 MVI C,2 ;Output to screen
130118 CALL 5
14011B POP PSW ;restore a and flags
15011C CPI 40 ;Is it our DEC-20 prompt?
16011E JZ 127 ;Yes, have whole file in memory
170121 CALL 17A ;no , store another byte
180124 JMP 10D ;read another byte
190127 MVI A,1A ;Get a Control-Z {CP/M EOF mark}
200129 CALL 17A ;store it in memory
21012C LXI H,300 ;Get memory pointer
22012F SHLD 202 ;Store as DMA pointer
230132 LDA 201 ;Get 'HI' byte of memory pointer
240135 STA 200 ;and store it as 'LO' one
250138 XRA A
260139 STA 201 ;Zero 'HI' byte {slow *256}
27013C MVI C,16 ;Make NEW file
28013E LXI D,5C ;With FCB1
290141 CALL 5
300144 CALL 15E ;Write 128 bytes {sector}
310147 CALL 15E ;Write another sector
32014A LXI H,FFFF ;Get a 16-bit Minus One
33014D XCHG ;into DE
34014E LHLD 200 ;Get 256-byte counter
350151 DAD D ;decrement
360152 SHLD 200 ;and store back
370155 MVI A,2 ;Check if
380157 CMP L ; 256-byte counter down to offset
390158 JZ 183 ;Yes, wer'e done
40015B JMP 144 ;Keep writing..
41015E LHLD 202 ;Get file-pointer
420161 XCHG ;into DE
430162 MVI C,1A ;Set DMA-address
440164 CALL 5
450167 MVI C,15 ;Write sector {128 bytes}
460169 LXI D,5C ;using FCB1
47016C CALL 5
48016F LHLD 202 ;Get file-pointer
490172 LXI D,80 ;128-bytes
500175 DAD D ;added to file-pointer
510176 SHLD 202 ;and save
520179 RET ;and return
53017A LHLD 200 ;Get Memory-pointer
54017D MOV M,A ;store character
55017E INX H ;Increment Pointer
56017F SHLD 200 ;and save
570182 RET ;and return
580183 MVI C,10 ;CLOSE file
590185 LXI D,5C ;using FCB1
600188 CALL 5
61018B JMP 0 ;Force WARM BOOT