]> cloudbase.mooo.com Git - kermit-80.git/blob - cpkfet.ddt
Add AVR-CP/M system (cpxac.asm) and a Makefile
[kermit-80.git] / cpkfet.ddt
1 -a100 ;Begin assembling code at 100
2 0100 LXI H,2FE ;Where to store in memory
3 0103 SHLD 200 ;Keep pointer there
4 0106 MVI E,D ;Get a CR
5 0108 MVI C,4 ;Output to PUNCH {send to HOST}
6 010A CALL 5
7 010D MVI C,3 ;Input from READER {read from HOST}
8 010F CALL 5
9 0112 ANI 7F ;Strip parity bit
10 0114 PUSH PSW ;save a and flags
11 0115 MOV E,A ;move char to e for echo
12 0116 MVI C,2 ;Output to screen
13 0118 CALL 5
14 011B POP PSW ;restore a and flags
15 011C CPI 40 ;Is it our DEC-20 prompt?
16 011E JZ 127 ;Yes, have whole file in memory
17 0121 CALL 17A ;no , store another byte
18 0124 JMP 10D ;read another byte
19 0127 MVI A,1A ;Get a Control-Z {CP/M EOF mark}
20 0129 CALL 17A ;store it in memory
21 012C LXI H,300 ;Get memory pointer
22 012F SHLD 202 ;Store as DMA pointer
23 0132 LDA 201 ;Get 'HI' byte of memory pointer
24 0135 STA 200 ;and store it as 'LO' one
25 0138 XRA A
26 0139 STA 201 ;Zero 'HI' byte {slow *256}
27 013C MVI C,16 ;Make NEW file
28 013E LXI D,5C ;With FCB1
29 0141 CALL 5
30 0144 CALL 15E ;Write 128 bytes {sector}
31 0147 CALL 15E ;Write another sector
32 014A LXI H,FFFF ;Get a 16-bit Minus One
33 014D XCHG ;into DE
34 014E LHLD 200 ;Get 256-byte counter
35 0151 DAD D ;decrement
36 0152 SHLD 200 ;and store back
37 0155 MVI A,2 ;Check if
38 0157 CMP L ; 256-byte counter down to offset
39 0158 JZ 183 ;Yes, wer'e done
40 015B JMP 144 ;Keep writing..
41 015E LHLD 202 ;Get file-pointer
42 0161 XCHG ;into DE
43 0162 MVI C,1A ;Set DMA-address
44 0164 CALL 5
45 0167 MVI C,15 ;Write sector {128 bytes}
46 0169 LXI D,5C ;using FCB1
47 016C CALL 5
48 016F LHLD 202 ;Get file-pointer
49 0172 LXI D,80 ;128-bytes
50 0175 DAD D ;added to file-pointer
51 0176 SHLD 202 ;and save
52 0179 RET ;and return
53 017A LHLD 200 ;Get Memory-pointer
54 017D MOV M,A ;store character
55 017E INX H ;Increment Pointer
56 017F SHLD 200 ;and save
57 0182 RET ;and return
58 0183 MVI C,10 ;CLOSE file
59 0185 LXI D,5C ;using FCB1
60 0188 CALL 5
61 018B JMP 0 ;Force WARM BOOT