home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C!T ROM 5
/
ctrom5b.zip
/
ctrom5b
/
PROGRAM
/
ASM
/
AS65_107
/
TESTCASE.A65
< prev
next >
Wrap
Text File
|
1994-11-02
|
24KB
|
831 lines
; <:t17,25,41,45:>
; ╔═════════════════════════════════════════════════════════════════════╗
; ║ ║
; ║ TESTCASE.A65 ║
; ║ ║
; ║ AS65 test source. ║
; ║ ║
; ║ Copyright 1994, Frank A. Vorstenbosch ║
; ║ ║
; ╚═════════════════════════════════════════════════════════════════════╝
;
; File created 17-may-94
title "AS65 test source - all instructions used"
; ┌─────────────────────────────────────────────────────────────────────┐
; │ │
; │ Options. │
; │ │
; └─────────────────────────────────────────────────────────────────────┘
; -dERRORS check error handling
; -n disable optimizations
; ┌─────────────────────────────────────────────────────────────────────┐
; │ │
; │ Assembler pseudo instructions. │
; │ │
; └─────────────────────────────────────────────────────────────────────┘
; ───── expressions ─────────────────────────────────────────────────────
data
org 4
bss
org 1634
TEST equ 2+*/2
if ERRORS
TEST equ TEST+1
endif
Constant8 equ -43
Constant16 equ 16383
Constant32 equ 96285725
Absolute equ $fff8
Indirect equ $2000
IndirectWrap equ $1fff
ANOTHER set 3|24&8
ANOTHER set (3|24)&8
ANOTHER set 4*(3>5)
ANOTHER set 4*!3<5
ANOTHER set 15<<4
ANOTHER set ANOTHER+1
ANOTHER = ANOTHER+1 ; shorthand for SET
CHAR equ "a"
DOUBLECHAR equ "xy"
QUADCHAR equ "quad"
if ERRORS
TRIPLE equ "abc"
TOOMUCH equ "abcde"
endif
data
AddressFour dw TEST
dw **5
org $60
ds 14
DirectByte db 123
ZeroPage db $80
align 32
DirectWord dw 12345
align 48
DirectLong dd 123456789
align 79
DirectCode rts
dw 1234%12
dw %1010100101
dw (1+2)%8
dw 1010101%%1010101
bss
Unin_1 db 0
Unin_2 dw 4256
Unin_3 dd 34568957
code
org $200
page
if ERRORS
1
equ 123
psscht
!
endif
; ───── range checking on immediate values ──────────────────────────────
lda #10
lda #100
if ERRORS
lda #1000
lda #10000
lda #100000
lda #1000000
lda #10000000
lda #100000000
lda #1000000000
endif
lda 10
lda 100
lda 1000
lda 10000
if ERRORS
lda 100000
lda 1000000
lda 10000000
lda 100000000
lda 1000000000
endif
page 10 ; keep 10 lines togethre
; ───── align ───────────────────────────────────────────────────────────
align 16
align 32
; ───── code, data, org ─────────────────────────────────────────────────
code
org $300
data
org $180
code
ldx #1
data
Table db 1,2,3
code
lda Table,x
; ───── db, fcb, fcc ────────────────────────────────────────────────────
Message1 db 7,"Error",13,10,0
Message2 fcb 7
fcc "Error"
fcb 13,10,0
; ───── ds, rmb ─────────────────────────────────────────────────────────
ds 10
rmb 10
; ───── dw, fcw, fdb ────────────────────────────────────────────────────
dw 23457
fcw 13462
fdb 6235
; ───── if ... else ... endif ───────────────────────────────────────────
if 5=6
db 0
if 0
db 1
else
db 2
endif
db 3
else
db 4
if 1
db 5
else
db 6
endif
db 7
endif
; ───── list, nolist ────────────────────────────────────────────────────
nolist
; comment not listed
db 10
list
; comment is listed
db 10
; ───── opt, noopt ──────────────────────────────────────────────────────
noopt
opt
; ───── nop ─────────────────────────────────────────────────────────────
nop
nop 3
; ───── struct ──────────────────────────────────────────────────────────
struct ListNode
dw LN_Next
dw LN_Previous
db LN_Type
end struct
; ───── number bases ────────────────────────────────────────────────────
dd 1
dd 10
dd 100
dd 1000
dd $1
dd $10
dd $100
dd $1000
dd %1
dd %10
dd %100
dd %1000
dd @1
dd @10
dd @100
dd @1000
dd 2#1
dd 2#10
dd 2#100
dd 2#1000
dd 3#1
dd 3#10
dd 3#100
dd 3#1000
dd 3#12
dd 4#1
dd 4#10
dd 4#100
dd 4#1000
dd 4#123
dd 5#1
dd 5#10
dd 5#100
dd 5#1000
dd 5#1234
dd 6#1
dd 6#10
dd 6#100
dd 6#1000
dd 6#2345
dd 7#1
dd 7#10
dd 7#100
dd 7#1000
dd 7#3456
dd 8#1
dd 8#10
dd 8#100
dd 8#1000
dd 8#4567
dd 9#1
dd 9#10
dd 9#100
dd 9#1000
dd 9#5678
dd 10#1
dd 10#10
dd 10#100
dd 10#1000
dd 10#6789
dd 11#1
dd 11#10
dd 11#100
dd 11#1000
dd 11#789a
dd 12#1
dd 12#10
dd 12#100
dd 12#1000
dd 12#89ab
dd 13#1
dd 13#10
dd 13#100
dd 13#1000
dd 13#9abc
dd 14#1
dd 14#10
dd 14#100
dd 14#1000
dd 14#abcd
dd 15#1
dd 15#10
dd 15#100
dd 15#1000
dd 15#bcde
dd 16#1
dd 16#10
dd 16#100
dd 16#1000
dd 16#cdef
dd 17#1
dd 17#10
dd 17#100
dd 17#1000
dd 17#defg
dd 18#1
dd 18#10
dd 18#100
dd 18#1000
dd 18#efgh
dd 19#1
dd 19#10
dd 19#100
dd 19#1000
dd 19#fghi
dd 20#1
dd 20#10
dd 20#100
dd 20#1000
dd 20#ghij
dd 21#1
dd 21#10
dd 21#100
dd 21#1000
dd 21#hijk
dd 22#1
dd 22#10
dd 22#100
dd 22#1000
dd 22#ijkl
dd 23#1
dd 23#10
dd 23#100
dd 23#1000
dd 23#jklm
dd 24#1
dd 24#10
dd 24#100
dd 24#1000
dd 24#klmn
dd 25#1
dd 25#10
dd 25#100
dd 25#1000
dd 25#lmno
dd 26#1
dd 26#10
dd 26#100
dd 26#1000
dd 26#mnop
dd 27#1
dd 27#10
dd 27#100
dd 27#1000
dd 27#nopq
dd 28#1
dd 28#10
dd 28#100
dd 28#1000
dd 28#opqr
dd 29#1
dd 29#10
dd 29#100
dd 29#1000
dd 29#pqrs
dd 30#1
dd 30#10
dd 30#100
dd 30#1000
dd 30#qrst
dd 31#1
dd 31#10
dd 31#100
dd 31#1000
dd 31#rstu
dd 32#1
dd 32#10
dd 32#100
dd 32#1000
dd 32#stuv
dd 33#1
dd 33#10
dd 33#100
dd 33#1000
dd 33#tuvw
dd 34#1
dd 34#10
dd 34#100
dd 34#1000
dd 34#uvwx
dd 35#1
dd 35#10
dd 35#100
dd 35#1000
dd 35#vwxy
dd 36#1
dd 36#10
dd 36#100
dd 36#1000
dd 36#wxyz
if ERRORS
dd 37#1
dd 37#10
dd 37#100
dd 37#1000
dd 1#1
dd 1#10
dd 1#100
dd 1#1000
dd 0#1
dd 0#10
dd 0#100
dd 0#1000
endif
; ───── garbage in inactive if-clause ───────────────────────────────────
if 0
!"#$%&'()*+,-./
0123456789:;<=>?
@ABCDEFGHIJKLMNO
PQRSTUVWXYZ[\]^_
`abcdefghijklmno
pqrstuvwxyz{|}~
ÇüéâäàåçêëèïîìÄÅ
ÉæÆôöòûùÿÖÜ¢£¥₧ƒ
áíóúñѪº¿⌐¬½¼¡«»
░▒▓│┤╡╢╖╕╣║╗╝╜╛┐
└┴┬├─┼╞╟╚╔╩╦╠═╬╧
╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀
αßΓπΣσµτΦΘΩδ∞φε∩
≡±≥≤⌠⌡÷≈°∙·√ⁿ²■
endif
; ╔═════════════════════════════════════════════════════════════════════╗
; ║ ║
; ║ Instructions. ║
; ║ ║
; ╚═════════════════════════════════════════════════════════════════════╝
; ┌─────────────────────────────────────────────────────────────────────┐
; │ │
; │ Accumulator and memory instructions. │
; │ │
; └─────────────────────────────────────────────────────────────────────┘
; ───── two-operand instructions ────────────────────────────────────────
Start adc #Constant8
adc ZeroPage
adc Absolute
adc (ZeroPage,x)
adc (ZeroPage),y
adc ZeroPage,x
adc Absolute,x
adc Absolute,y
if __65SC02__
adc (ZeroPage)
endif
and #Constant8
and ZeroPage
and Absolute
and (ZeroPage,x)
and (ZeroPage),y
and ZeroPage,x
and Absolute,x
and Absolute,y
if __65SC02__
and (ZeroPage)
endif
cmp #Constant8
cmp ZeroPage
cmp Absolute
cmp (ZeroPage,x)
cmp (ZeroPage),y
cmp ZeroPage,x
cmp Absolute,x
cmp Absolute,y
if __65SC02__
cmp (ZeroPage)
endif
eor #Constant8
eor ZeroPage
eor Absolute
eor (ZeroPage,x)
eor (ZeroPage),y
eor ZeroPage,x
eor Absolute,x
eor Absolute,y
if __65SC02__
eor (ZeroPage)
endif
lda #Constant8
lda ZeroPage
lda Absolute
lda (ZeroPage,x)
lda (ZeroPage),y
lda ZeroPage,x
lda Absolute,x
lda Absolute,y
if __65SC02__
lda (ZeroPage)
endif
ora #Constant8
ora ZeroPage
ora Absolute
ora (ZeroPage,x)
ora (ZeroPage),y
ora ZeroPage,x
ora Absolute,x
ora Absolute,y
if __65SC02__
ora (ZeroPage)
endif
sbc #Constant8
sbc ZeroPage
sbc Absolute
sbc (ZeroPage,x)
sbc (ZeroPage),y
sbc ZeroPage,x
sbc Absolute,x
sbc Absolute,y
if __65SC02__
sbc (ZeroPage)
endif
bit ZeroPage
bit Absolute
if __65SC02__
bit #Constant8
bit ZeroPage,x
bit Absolute,x
endif
cpx #Constant8
cpx ZeroPage
cpx Absolute
cpy #Constant8
cpy ZeroPage
cpy Absolute
ldx #Constant8
ldx ZeroPage
ldx Absolute
ldx ZeroPage,y
ldx Absolute,y
ldy #Constant8
ldy ZeroPage
ldy Absolute
ldy ZeroPage,x
ldy Absolute,x
; ───── one-operand instructions ────────────────────────────────────────
sta ZeroPage
sta Absolute
sta (ZeroPage,x)
sta (ZeroPage),y
sta ZeroPage,x
sta Absolute,x
sta Absolute,y
sta ZeroPage,y
if __65SC02__
sta (ZeroPage)
endif
stx ZeroPage
stx Absolute
stx ZeroPage,y
sty ZeroPage
sty Absolute
sty ZeroPage,x
if __65SC02__
tsb ZeroPage
tsb Absolute
trb ZeroPage
trb Absolute
stz ZeroPage
stz Absolute
stz ZeroPage,x
stz Absolute,x
clr ZeroPage
clr Absolute
clr ZeroPage,x
clr Absolute,x
endif
asl Absolute
asl ZeroPage
asl a
asl ZeroPage,x
asl Absolute,x
lsr Absolute
lsr ZeroPage
lsr a
lsr ZeroPage,x
lsr Absolute,x
rol Absolute
rol ZeroPage
rol a
rol ZeroPage,x
rol Absolute,x
ror Absolute
ror ZeroPage
ror a
ror ZeroPage,x
ror Absolute,x
if ERRORS
asl #Constant8
asl (ZeroPage,x)
asl (ZeroPage),y
asl Absolute,y
asl ZeroPage,y
asl (ZeroPage)
asl (Indirect)
endif
dec Absolute
dec ZeroPage
dec ZeroPage,x
dec Absolute,x
if __65SC02__
dec a
endif
inc Absolute
inc ZeroPage
inc ZeroPage,x
inc Absolute,x
if __65SC02__
inc a
endif
; ───── implied addressing ──────────────────────────────────────────────
tax
tay
tsx
txa
txs
tya
; ┌─────────────────────────────────────────────────────────────────────┐
; │ │
; │ Index register and stack manipulation instructions. │
; │ │
; └─────────────────────────────────────────────────────────────────────┘
; ───── implied addressing ──────────────────────────────────────────────
dex
dey
inx
iny
pha
php
pla
plp
if __65SC02__
phx
phy
plx
ply
endif
; ┌─────────────────────────────────────────────────────────────────────┐
; │ │
; │ Jump and branch instructions. │
; │ │
; └─────────────────────────────────────────────────────────────────────┘
; ───── jump and jump to subroutine ─────────────────────────────────────
align 256
Target jsr Target
noopt
jmp Target
opt
jmp Target
jmp (Indirect)
if __65SC02__
jmp (IndirectWrap) ; note cycle count
jmp (Indirect,x)
endif
; ───── relative addressing ─────────────────────────────────────────────
bcc Target
bcc Target-$10 ; target address in other page
bcs Target
beq Target
bmi Target
bne Target
bpl Target
bvc Target
bvs Target
if __65SC02__
bra Target
bra Target-$10 ; target address in other page
endif
; ───── implied addressing ──────────────────────────────────────────────
brk
nop
rti
rts
; ┌─────────────────────────────────────────────────────────────────────┐
; │ │
; │ Condition code register manipulation instructions. │
; │ │
; └─────────────────────────────────────────────────────────────────────┘
; ───── implied addressing ──────────────────────────────────────────────
clc
cld
cli
clv
disable
enable
sec
sed
sei
stc
std
sti
end Start
; ───── EOF ─────────────────────────────────────────────────────────────