2014/8/15 10: mc80trc2.txt
END=408E
;;; mycpu80 tracer
; 14/8/12 8/15
;
ORG $4004
;
BIN=$0029
BOUT=$0114
SP1=$F7FA
;
4004 21FAF7 LD HL,SP1
4007 118840 LD DE,SPWK
400A 010600 LD BC,$0006
400D EDB0 LDIR
400F 3E09 LD A,09;extra code
4011 CD1401 CALL BOUT
4014 3E10 LD A,10;wfopen
4016 CD1401 CALL BOUT
4019 3EFF LD A,FF
401B D382 OUT (82),A;send ready & mycpu80 reset off
401D 216C40 LD HL,RETADRS
4020 7D LD A,L
4021 CD1401 CALL BOUT
4024 7C LD A,H
4025 CD1401 CALL BOUT
4028 218E40 LD HL,BFTOP
402B 7D LD A,L
402C CD1401 CALL BOUT
402F 7C LD A,H
4030 CD1401 CALL BOUT
4033 218E40 LOOP:LD HL,BFTOP
4036 AF XOR A
4037 47 LD B,A
4038 77 LOOP1:LD (HL),A;baffer clear
4039 23 INC HL
403A 10FC DJNZ LOOP1
403C 218E40 LD HL,BFTOP
403F DB84 LOOP2:IN A,(84)
4041 FEFF CP FF
4043 C26F40 JP NZ,END
4046 DB82 IN A,(82)
4048 B7 OR A
4049 FA3F40 JP M,LOOP2
404C DB80 IN A,(80)
404E 77 LD (HL),A
404F AF XOR A
4050 D383 OUT (83),A;pc0=0
4052 DB82 LOOP3:IN A,(82)
4054 B7 OR A
4055 F25240 JP P,LOOP3
4058 3E01 LD A,01
405A D383 OUT (83),A;pc0=1
405C 23 INC HL
405D 10E0 DJNZ LOOP2
405F 3E09 LD A,09
4061 CD1401 CALL BOUT
4064 3E11 LD A,11;bfsave
4066 CD1401 CALL BOUT
4069 C32900 JP BIN;wait bfsave end
;
406C C33340 RETADRS:JP LOOP
;
406F 3E09 END:LD A,09
4071 CD1401 CALL BOUT
4074 3E12 LD A,12;wfclose
4076 CD1401 CALL BOUT
4079 218840 LD HL,SPWK
407C 11FAF7 LD DE,SP1
407F 010600 LD BC,$0006
4082 EDB0 LDIR
4084 31FAF7 LD SP,SP1
4087 C9 RET
4088 00 SPWK:NOP
4089 00 NOP
408A 00 NOP
408B 00 NOP
408C 00 NOP
408D 00 NOP
408E 00 BFTOP:NOP
;
BFTOP =408E BIN =0029 BOUT =0114
END =406F LOOP =4033 LOOP1 =4038
LOOP2 =403F LOOP3 =4052 RETADRS =406C
SP1 =F7FA SPWK =4088
|