-
Notifications
You must be signed in to change notification settings - Fork 0
/
subtfr.src
97 lines (87 loc) · 1.16 KB
/
subtfr.src
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
ORG $2000
ENTRY EQU *
LDD #$3800
STD MAIN,PCR
LDD #$D800
STD SUB,PCR
LDD #$2800
STD BYTE,PCR
BSR TFRS2M
RTS
TFRS2M EQU *
TFRS2M1 LDD SUB,PCR
STD SUBADR,PCR SUBADR=SUB
ADDD #$40
STD SUB,PCR SUB=SUB+$40
LDD BYTE,PCR
CMPD #$40 BYTE<$40?
BLS TFRS2M2 YES->TFRCOUNT=BYTE
LDD #$40 NO->TFRCOUNT=$40
TFRS2M2 STD SUBBYT,PCR SUBBYT=TFRCOUNT
PSHS D
LDD BYTE,PCR
SUBD ,S++
STD BYTE,PCR BYTE=BYTE-TFRCOUNT
BSR HALT
LEAU DATA,PCR
LDX #$FC82
LDB #DATA_E-DATA
BSR CPYMEM
BSR RESTART
BSR WAIT
BSR HALT
LDU #$FCC0
LDX MAIN,PCR
LDB SUBBYT+1,PCR
BSR CPYMEM
LDA $FC80
ORA #$80 READY REQUEST
STA $FC80
BSR RESTART
BSR WAIT
LEAX B,X
STX MAIN,PCR
LDD BYTE,PCR
BNE TFRS2M1
RTS
CPYMEM EQU *
PSHS A,B,X,U
CPYMEM1 PULU A
STA ,X+
DECB
BNE CPYMEM1
PULS A,B,X,U,PC
HALT EQU *
PSHS A
HALT1 LDA $FD05
BMI HALT1
ORCC #$50
LDA #$80
STA $FD05
HALT2 LDA $FD05
BPL HALT2
PULS A,PC
RESTART EQU *
PSHS A
CLRA
STA $FD05
ANDCC #$AF
PULS A,PC
WAIT EQU *
PSHS A
CLRA
WAIT1 DECA
BNE WAIT1
PULS A,PC
MAIN FDB $0000
SUB FDB $0000
BYTE FDB $0000
DATA FCB $3F
FCC /YAMAUCHI/
FCB $91
SUBADR FDB $0000
FDB $D3C0
SUBBYT FDB $0040
FCB $90
DATA_E EQU *
END