-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_programs.a
89 lines (71 loc) · 1.76 KB
/
test_programs.a
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
;==============================================================================
; DEMON - copy(l)eft 2018 http://harald.ist.org/
; tabsize=8
;==============================================================================
;==============================================================================
!zone TEST_PROGRAMS
;==============================================================================
!ifdef TEST_PROGRAM {
.sptr = $fe ;zero page pointer
test_program
;------------------------------------------------------------------------------
.loop LDX #<.string
LDY #>.string
STX .sptr
STY .sptr+1
LDY #0
.next_char LDA (.sptr),Y
BEQ .done
JSR $ffd2 ; BSOUT
INY
BNE .next_char
.done LDX # 0
.loop_x LDY # 0
.loop_y DEY
BNE .loop_y
DEX
BNE .loop_x
JMP .loop
.string !pet petscii_green, "hello, world! ", 0
}
!ifdef TEST_BREAK_POINTS {
;------------------------------------------------------------------------------
.a LDA #$12 ; Jump around a little to see, if our stepper
JMP .b ; places the BRK-breakpoints correctly
NOP
NOP
.b JMP (.vect)
NOP
NOP
.c BEQ .a
BNE .b
NOP
NOP
NOP
BRK
.vect !word .c
;------------------------------------------------------------------------------
}
!ifdef TEST_BRANCHES {
;------------------------------------------------------------------------------
!align $ff, $00 ; Place some BNEs to see, if we calculated the
; target addresses correctly
!for a, 64 { BNE .test }
.test
!for b, 64 { BNE .test }
;------------------------------------------------------------------------------
}
!ifdef TEST_HEXDUMP {
*=$5000
!for a, 256 {
!byte a-1
}
!for a, 256 {
!byte $58
}
!for a, 256 {
!byte 256-a
}
}
;==============================================================================
!eof