; SET24X80.COM ; ; Designed exclusively for the Amstrad ; ; SET24X80 ; SET24X80 ON ; SET24X80 OFF ; 0100 186a jr &016c defb "SET24X80 #90",13,10 defb "Developed by Locomotive Software Ltd.",13,10 defb "Copyright (C) 1985 Amstrad Consumer Electronics PLC",13,10 016c ed730011 ld (&1100),sp 0170 310212 ld sp,&1202 0173 cd5103 call &0351 ;; check version and setup call to firmware for cpm+ 0176 cdd302 call &02d3 0179 dc8101 call c,&0181 017c ed7b0011 ld sp,(&1100) 0180 c9 ret 0181 79 ld a,c 0182 fe03 cp &03 ;; cpm 2.2? 0184 ca1c02 jp z,&021c ;; "This program will not run in this environment" 0187 21a001 ld hl,&01a0 018a cd7902 call &0279 018d 7d ld a,l 018e b7 or a 018f 2007 jr nz,&0198 0191 cd7202 call &0272 0194 2818 jr z,&01ae 0196 2e78 ld l,&78 0198 3e1b ld a,&1b 019a cdc801 call &01c8 019d 7d ld a,l 019e 1828 jr &01c8 01a0 defb "ON" 01a2 ff rst &38 defw &0078 01a5 defb "OFF" 01a8 ff rst &38 defw &0079 01ab ff rst &38 defw &0000 01ae 11b401 ld de,&01b4 01b1 c3d701 jp &01d7 01b4 defb "Must be ON or OFF",13,10,"$" 01c8 e5 push hl 01c9 d5 push de 01ca c5 push bc 01cb f5 push af 01cc 5f ld e,a 01cd 0e06 ld c,&06 ;; C_RAWIO 01cf cd0500 call &0005 ;; BDOS 01d2 f1 pop af 01d3 c1 pop bc 01d4 d1 pop de 01d5 e1 pop hl 01d6 c9 ret 01d7 c5 push bc 01d8 f5 push af 01d9 cd5502 call &0255 01dc cd4b03 call &034b 01df 201d jr nz,&01fe 01e1 110102 ld de,&0201 ;; ignoring rest of line 01e4 cd5502 call &0255 ;; write string to console 01e7 1804 jr &01ed 01e9 79 ld a,c 01ea cd6302 call &0263 01ed cd4603 call &0346 01f0 cd4b03 call &034b 01f3 cdef02 call &02ef 01f6 28f1 jr z,&01e9 01f8 111902 ld de,&0219 ;; new line 01fb cd5502 call &0255 ;; write string to console 01fe f1 pop af 01ff c1 pop bc 0200 c9 ret 0201 defb "Ignoring rest of line: $" 0219: defb 13,10,"$" 021c d5 push de 021d 112502 ld de,&0225 ;; "This program will not run in this environment" 0220 cd5502 call &0255 0223 d1 pop de 0224 c9 ret 0225 defb "This program will not run in this environment",13,10,"$" ;; write string 0255 e5 push hl 0256 d5 push de 0257 c5 push bc 0258 f5 push af 0259 0e09 ld c,&09 ;; A_WRITESTR 025b cd0500 call &0005 ;; BDOS 025e f1 pop af 025f c1 pop bc 0260 d1 pop de 0261 e1 pop hl 0262 c9 ret 0263 e5 push hl 0264 d5 push de 0265 c5 push bc 0266 f5 push af 0267 5f ld e,a 0268 0e02 ld c,&02 ;; C_WRITE 026a cd0500 call &0005 ;; BDOS 026d f1 pop af 026e c1 pop bc 026f d1 pop de 0270 e1 pop hl 0271 c9 ret 0272 cd4b03 call &034b 0275 c4ef02 call nz,&02ef 0278 c9 ret 0279 d5 push de 027a c5 push bc 027b f5 push af 027c cdc302 call &02c3 027f 50 ld d,b 0280 2b dec hl 0281 180d jr &0290 0283 1c inc e 0284 1d dec e 0285 c41103 call nz,&0311 0288 20fa jr nz,&0284 028a 7e ld a,(hl) 028b 23 inc hl 028c 3c inc a 028d 20fb jr nz,&028a 028f 23 inc hl 0290 1e00 ld e,&00 0292 1809 jr &029d 0294 cdb902 call &02b9 0297 20ea jr nz,&0283 0299 cdef02 call &02ef 029c 1c inc e 029d cd4603 call &0346 02a0 23 inc hl 02a1 7e ld a,(hl) 02a2 feff cp &ff 02a4 20ee jr nz,&0294 02a6 1c inc e 02a7 1d dec e 02a8 2806 jr z,&02b0 02aa 78 ld a,b 02ab aa xor d 02ac e62b and &2b 02ae 28d3 jr z,&0283 02b0 23 inc hl 02b1 5e ld e,(hl) 02b2 23 inc hl 02b3 56 ld d,(hl) 02b4 eb ex de,hl 02b5 f1 pop af 02b6 c1 pop bc 02b7 d1 pop de 02b8 c9 ret 02b9 91 sub c 02ba c8 ret z 02bb fee0 cp &e0 02bd c0 ret nz 02be 78 ld a,b 02bf f6fd or &fd 02c1 3c inc a 02c2 c9 ret 02c3 1803 jr &02c8 02c5 cdef02 call &02ef 02c8 cd4603 call &0346 02cb cb68 bit 5,b 02cd c0 ret nz 02ce cb40 bit 0,b 02d0 20f3 jr nz,&02c5 02d2 c9 ret 02d3 e5 push hl 02d4 d5 push de 02d5 c5 push bc 02d6 218000 ld hl,&0080 02d9 7e ld a,(hl) 02da 3c inc a 02db 320412 ld (&1204),a 02de 23 inc hl 02df 220212 ld (&1202),hl 02e2 3d dec a 02e3 85 add a,l 02e4 6f ld l,a 02e5 8c adc a,h 02e6 95 sub l 02e7 67 ld h,a 02e8 361a ld (hl),&1a 02ea 37 scf 02eb c1 pop bc 02ec d1 pop de 02ed e1 pop hl 02ee d0 ret nc 02ef e5 push hl 02f0 d5 push de 02f1 c5 push bc 02f2 f5 push af 02f3 2a0212 ld hl,(&1202) 02f6 4e ld c,(hl) 02f7 eb ex de,hl 02f8 cd3403 call &0334 02fb 79 ld a,c 02fc fe1a cp &1a 02fe 280c jr z,&030c 0300 3a0412 ld a,(&1204) 0303 3d dec a 0304 320412 ld (&1204),a 0307 eb ex de,hl 0308 23 inc hl 0309 220212 ld (&1202),hl 030c f1 pop af 030d c1 pop bc 030e d1 pop de 030f e1 pop hl 0310 c9 ret ... 0211 e5 push hl 0212 d5 push de 0213 c5 push bc 0214 f5 push af 0215 3a0512 ld a,(&1205) 0218 fe1a cp &1a 021a 2a0212 ld hl,(&1202) 021d 280b jr z,&022a 021f 210412 ld hl,&1204 0222 34 inc (hl) 0223 2a0212 ld hl,(&1202) 0226 2b dec hl 0227 220212 ld (&1202),hl 022a 2b dec hl 022b 4e ld c,(hl) 022c cd3403 call &0334 022f f1 pop af 0230 c1 pop bc 0231 d1 pop de 0232 e1 pop hl 0233 c9 ret 0234 cb79 bit 7,c 0236 0601 ld b,&01 0238 2007 jr nz,&0241 023a 0600 ld b,&00 023c 217a03 ld hl,&037a 023f 09 add hl,bc 0240 46 ld b,(hl) 0241 ed430512 ld (&1205),bc 0245 c9 ret 0246 ed4b0512 ld bc,(&1205) 024a c9 ret 024b 3a0612 ld a,(&1206) 024e e620 and &20 0250 c9 ret 0251 0e0c ld c,&0c ;; S_BDOS_VER 0253 cd0500 call &0005 ;; BDOS ;; cpm+? 0256 fe31 cp &31 0258 2808 jr z,&0262 ;; other cpm 025a fe22 cp &22 025c 0e04 ld c,&04 025e c0 ret nz ;; cpm2.2 025f 0e03 ld c,&03 0261 c9 ret ;; get firmware jump for cpm+ 0262 2a0100 ld hl,(&0001) 0265 115700 ld de,&0057 0268 19 add hl,de 0269 227203 ld (&0372),hl ;; calls it 026c cd7403 call &0374 026f 4f ld c,a 0270 c9 ret ;; jp patched for calling firmware on cpm+ 0271 c30000 jp &0000 0274 cd7103 call &0371 defw &00e3 0279 c9 ret 027a 010101 ld bc,&0101 027d 010101 ld bc,&0101 0280 010101 ld bc,&0101 0283 010101 ld bc,&0101 0286 012101 ld bc,&0121 0289 010101 ld bc,&0101 028c 010101 ld bc,&0101 028f 010101 ld bc,&0101 0292 010121 ld bc,&2101 0295 010101 ld bc,&0101 0298 010101 ld bc,&0101 029b 010010 ld bc,&1000 029e 010110 ld bc,&1001 02a1 010101 ld bc,&0101 02a4 010101 ld bc,&0101 02a7 010001 ld bc,&0100 02aa 0c inc c 02ab 0c inc c 02ac 0c inc c 02ad 0c inc c 02ae 0c inc c 02af 0c inc c 02b0 0c inc c 02b1 0c inc c 02b2 0c inc c 02b3 0c inc c 02b4 010101 ld bc,&0101 02b7 010101 ld bc,&0101 02ba 010606 ld bc,&0606 02bd 0606 ld b,&06 02bf 0606 ld b,&06 02c1 02 ld (bc),a 02c2 02 ld (bc),a 02c3 02 ld (bc),a 02c4 02 ld (bc),a 02c5 02 ld (bc),a 02c6 02 ld (bc),a 02c7 02 ld (bc),a 02c8 02 ld (bc),a 02c9 02 ld (bc),a 02ca 02 ld (bc),a 02cb 02 ld (bc),a 02cc 02 ld (bc),a 02cd 02 ld (bc),a 02ce 02 ld (bc),a 02cf 02 ld (bc),a 02d0 02 ld (bc),a 02d1 02 ld (bc),a 02d2 02 ld (bc),a 02d3 02 ld (bc),a 02d4 02 ld (bc),a 02d5 010101 ld bc,&0101 02d8 010101 ld bc,&0101 02db 0606 ld b,&06 02dd 0606 ld b,&06 02df 0606 ld b,&06 02e1 02 ld (bc),a 02e2 02 ld (bc),a 02e3 02 ld (bc),a 02e4 02 ld (bc),a 02e5 02 ld (bc),a 02e6 02 ld (bc),a 02e7 02 ld (bc),a 02e8 02 ld (bc),a 02e9 02 ld (bc),a 02ea 02 ld (bc),a 02eb 02 ld (bc),a 02ec 02 ld (bc),a 02ed 02 ld (bc),a 02ee 02 ld (bc),a 02ef 02 ld (bc),a 02f0 02 ld (bc),a 02f1 02 ld (bc),a 02f2 02 ld (bc),a 02f3 02 ld (bc),a 02f4 02 ld (bc),a 02f5 010101 ld bc,&0101 02f8 01011a ld bc,&1a01 02fb 00 nop