-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.s
More file actions
115 lines (93 loc) · 2.11 KB
/
Copy pathtest.s
File metadata and controls
115 lines (93 loc) · 2.11 KB
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
;-------------------------------------------------------------
; Simple test of BadAss assembler.
; The main prg incbin's the object files.
; We then copy them to alternate locations and run them.
; Those files are simple relocatable tasklets to test out the assembler.
;-------------------------------------------------------------
!section "ZP",2,size=254,NO_STORE
!section "RAM",$801
!section "Virtual",$1000,size=$1000,NO_STORE
;-------------------------------------------------------------
; Traditional startup code
;-------------------------------------------------------------
!section "code",in="RAM"
!byte $0b,$08,$01,$00,$9e,str(start),$00,$00,$00
start:
sei
lda test0
lda #<space
lda #>space
sta $d020
; copy both functions to spare memory
; $3000
; Object1.bin
lda #<o1+2
sta $2
lda #>o1+2
sta $3
lda #$00
sta $4
lda #$30
sta $5
jsr CopyBlock
; Object2.bin
lda #<o2+2
sta $2
lda #>o2+2
sta $3
lda #$00
sta $4
lda #$31
sta $5
jsr CopyBlock
; call the init of each task
lda #$00
jsr $3000
lda #$00
jsr $3100
;-------------------------------------------------------------
; Stall / mainloop
;-------------------------------------------------------------
again:
lda $d012
cmp #$80
bne again
; call both tasks
lda #$1
jsr $3000
lda #$1
jsr $3100
jsr anotherfunc
jmp again
CopyBlock:
ldy #$00
-
lda ($2),y
sta ($4),y
iny
bne -
rts
;-------------------------------------------------------------
; Storing more ZP data for testing
;-------------------------------------------------------------
!section "variables",in="ZP"
test0: !ds 1
;-------------------------------------------------------------
; Back to code ( testing switching )
;-------------------------------------------------------------
!section "another",in="RAM"
anotherfunc:
rts
!section "Objects",in="RAM"
o1:
!incbin "Object1.bin"
o2:
!incbin "Object2.bin"
;-------------------------------------------------------------
; Virtual tables space testing
;-------------------------------------------------------------
!section "filler",in="Virtual"
space:
!ds 256
space2:
!ds 256