-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmodestest.asm
30 lines (27 loc) · 860 Bytes
/
modestest.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
; TODO: move this to a proper unit test
; *=128 ; program offset with a decimal memory address
;*=$0F ; hex memory address
start: ; $0600
nop ; implied
modes: ; $0601
lda #$10 ; immediate literal
lda #7 ; immediate literal, decimal, no padding
lda #09 ; immediate literal, decimal
lda #255 ; immediate literal, decimal
lda $ab ; zero-page
lda $20,x ; zero-page x
ldx $21, y ; zero-page y
lda start ; absolute label
lda start, x ; label x-indexed
lda endlabel, y ; label y-indexed
jmp $1234 ; absolute
lda $3000, x ; absolute x
lda $3001, y ; absolute y
; jmp ($ff00) ; indirect
lda ($32, x) ; indexed indirect
lda ($33), y ; indirect indexed
jmp start
;beq $20 ; BEQ and some other opcodes use relative addressing, which has the same syntax as zero page addressing
; testing label address detection when the label occurs after the current line
endlabel:
nop