2020-05-06 12:15:56 +10:00
|
|
|
BEGIN,
|
2020-06-28 12:01:56 +10:00
|
|
|
A 0xff LDri, (HL) A LDrr, ( default mask )
|
2020-05-06 12:15:56 +10:00
|
|
|
L1 BSET ( loop2 ) @GET, @PUT,
|
2020-06-28 12:01:56 +10:00
|
|
|
0x20 CPi, JRZ, L4 FWR ( escapechar )
|
2020-05-06 12:15:56 +10:00
|
|
|
( not an escape char, just apply the mask and write )
|
|
|
|
(HL) ANDr, (HL) A LDrr,
|
2020-06-28 12:01:56 +10:00
|
|
|
HL INCd,
|
2020-05-06 12:15:56 +10:00
|
|
|
JR, AGAIN,
|
|
|
|
L4 FSET ( escapechar, adjust by setting (hl) to 0x7f )
|
2020-06-28 12:01:56 +10:00
|
|
|
7 (HL) RES, JR, L1 BWR ( loop2 )
|
2020-05-06 12:15:56 +10:00
|
|
|
L2 FSET ( maybeerror, was it an error? )
|
|
|
|
A ORr, JRZ, L1 BWR ( loop2, not an error )
|
|
|
|
L3 FSET ( error )
|
|
|
|
C A LDrr, ( error code from @GET/@PUT )
|
2020-06-28 12:01:56 +10:00
|
|
|
A 0x1a LDri, ( @ERROR ) 0x28 RST, RET,
|