-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwritedata.asm
71 lines (61 loc) · 1.02 KB
/
writedata.asm
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
.label SETNAM = $FFBD
.label SETFLS = $FFBA
.label OPEN = $FFC0
.label CHKOUT = $FFC9
.label READST = $FFB7
.label CLOSE = $FFC3
.label CLRCHN = $FFCC
.label CHROUT = $FFD2
* = $033C
lda #$07
ldx #<fname
ldy #>fname
jsr SETNAM
lda #$03
ldx #$08
ldy #$03
jsr SETFLS
jsr OPEN
ldx #$03
jsr CHKOUT
lda #<data
sta $02
lda #>data
sta $03
ldy #$00
topofloop:
lda ($02),Y
jsr CHROUT
iny
cpy #$3F
bne topofloop
// close the file
lda #$03
jsr CLOSE
jsr CLRCHN
rts
fname:
// A B C , S , W
.byte 65, 66, 67, 44, 83, 44, 87
data:
.byte 255, 255, 255
.byte 128, 0, 1
.byte 128, 0, 1
.byte 128, 0, 1
.byte 128, 0, 1
.byte 128, 0, 1
.byte 128, 0, 1
.byte 128, 0, 1
.byte 128, 0, 1
.byte 128, 0, 1
.byte 128, 0, 1
.byte 128, 0, 1
.byte 128, 0, 1
.byte 128, 0, 1
.byte 128, 0, 1
.byte 128, 0, 1
.byte 128, 0, 1
.byte 128, 0, 1
.byte 128, 0, 1
.byte 128, 0, 1
.byte 255, 255, 255