-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathRAMTST.MAC
132 lines (125 loc) · 2.5 KB
/
RAMTST.MAC
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
.TITLE STAR WARS RAM TEST
;
; HARDWARE REV A
;
.ENABL AMA
.ASECT
.RADIX 16
.LIST MEB
.NLIST BYTE
PROG =0A000
.VCTRS <0FFFE>,PROG
.= PROG
;===
RESET: LDS #4FFF
ORCC #10 ;TURN OFF IRQ
;===
CLEAR:
NOP
LDU #TRAMP
LDA #0 ;CLEAR PATTERN
10$: ;---
LDX 0(U)++ ;NEXT BLOCK POINTER
LDB #0 ;SIZE COUNTER
20$: ;---
STA 0(X) ;CLEAR BYTE
LDA 0(X)+ ;TESTIT
BEQ 30$
SWI ;BYTE NOT ZEROED
30$: ;---
DECB
BNE 20$ ;B CLEAR NEXT BYTE
CMPU #TRAMPZ
BLO 10$ ;B NEXT BLOCK
;===
PTRN:
LDU #TRAMP
10$: ;---
LDX 0(U)++ ;BLOCK POINTER
LDY #100 ;BLOCK SIZE
20$: ;---
LDA 0(X) ;START WITH NEXT BYTE
BEQ 25$
SWI ;SHOULD BE ZERO
25$: ;---
LDA #080 ;FLOATING ONE TEST
LSLA ;SETUP CARRY TOO(1,000)
30$: ;---
ROLA ;FORM NEXT TEST
STA 0(X)
TFR A,B
EORB 0(X)
BEQ 40$
SWI ;SHOULD HAVE MATCHED
40$: ;---
BCC 50$ ;?END OF FLOATING ONE?(=1,000)
TSTA
BNE 30$ ;B NOPE, WAS FLOATING ZERO
ADDA #0FF ;YEP, PREPARE FOR FLOATING ZERO
BRA 30$ ;J (1,000),ADDA#0FF,(0,0FF),ROLA,(1,0FE)
50$: ;---
TFR A,B
INCB ;?END OF FLOATING ZERO?(=0,0FF)
BNE 30$ ;B NOT YET, DO NEXT BYTE
LEAX 1(X) ;YEP, DO NEXT BYTE
LEAY -1(Y) ;COUNT EACH BYTE
BNE 20$
CMPU #TRAMPZ
BLO 10$ ;B DO NEXT BLOCK
;===
FINCLR:
LDU #TRAMP
10$: ;---
LDX 0(U)++
LDB #0 ;BLOCK SIZE COUNTER
20$: ;---
INC 0(X) ;WAS LEFT AT #0FF
BEQ 30$ ;TEST AND CLEAR BYTE
SWI
30$: ;---
LDA 0(X)+
BEQ 40$
SWI
40$: ;---
DECB
BNE 20$ ;DO NEXT BYTE
CMPU #TRAMPZ
BLO 10$ ;DO NEXT BLOCK
;===
NOP
JMP RESET
;===
TRAMP:
.WORD 0000,0100,0200,0300 ;VECTOR GENERATOR
.WORD 0400,0500,0600,0700
.WORD 0800,0900,0A00,0B00
.WORD 0C00,0D00,0E00,0F00
;
.WORD 1000,1100,1200,1300 ;VECTOR GENERATOR
.WORD 1400,1500,1600,1700
.WORD 1800,1900,1A00,1B00
.WORD 1C00,1D00,1E00,1F00
;
.WORD 2000,2100,2200,2300 ;VECTOR GENERATOR
.WORD 2400,2500,2600,2700
.WORD 2800,2900,2A00,2B00
.WORD 2C00,2D00,2E00,2F00
;
; .WORD 3000,3100,3200,3300 ;VECTOR GENERATOR (VGROM)
; .WORD 3400,3500,3600,3700
; .WORD 3800,3900,3A00,3B00
; .WORD 3C00,3D00,3E00,3F00
;
.WORD 4800,4900,4A00,4B00 ;PROGRAM RAM
.WORD 4C00,4D00,4E00,4F00
;
.WORD 5000,5100,5200,5300 ;MATH BOX
.WORD 5400,5500,5600,5700
.WORD 5800,5900,5A00,5B00
.WORD 5C00,5D00,5E00,5F00
;
;
TRAMPZ:
;===
.END