forked from jbrandwood/teos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pceas.inc
73 lines (62 loc) · 976 Bytes
/
pceas.inc
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
; --------
; This block defines names for macro
; argument types (\?x).
;
ARG_NONE .equ 0
ARG_REG .equ 1
ARG_IMMED .equ 2
ARG_ABS .equ 3
ARG_ABSOLUTE .equ 3
ARG_INDIRECT .equ 4
ARG_STRING .equ 5
ARG_LABEL .equ 6
;
;
;
vreg macro
lda \1
sta <vdc_reg
.if (\?1 = ARG_IMMED)
st0 \1
.else
sta video_reg
.endif
endm
;
; STW - store a word-sized value at stated memory location
;
stw macro
lda LOW_BYTE \1
sta LOW_BYTE \2
lda HIGH_BYTE \1
sta HIGH_BYTE \2
endm
stb macro
lda \1
sta \2
endm
SPR_ALIGN macro
if (* & 127)
ds 128 - (* & 127) ; 128-byte align the data.
endif
endm
CHR_ALIGN macro
if (* & 31)
ds 32 - (* & 31) ; 32-byte align the data.
endif
endm
WORD_ALIGN macro
if (* & 1)
ds 2 - (* & 1) ; Word Align the data.
endif
endm
LONG_ALIGN macro
if (* & 3)
ds 4 - (* & 3) ; Long Align the data.
endif
endm
PAGE_ALIGN macro
if (* & 255)
ds 256 - (* & 255) ; Page Align the data.
endif
endm