1
0
mirror of https://github.com/cc65/cc65.git synced 2024-12-22 12:30:41 +00:00

Some test cases for ca65

This commit is contained in:
Spiro Trikaliotis 2022-06-16 20:57:53 +02:00
parent 5aa75ae81f
commit 48ae6716ad
34 changed files with 87224 additions and 3 deletions

View File

@ -0,0 +1,20 @@
Main file : 001-macro-simple-listing.s
Current file: 001-macro-simple-listing.s
000000r 1 ; 2022-01-17 Spiro Trikaliotis
000000r 1
000000r 1 .macro TESTER
000000r 1 lda #2
000000r 1 .endmacro
000000r 1
000000r 1 test:
000000r 1 A2 00 ldx #0
000002r 1 A9 02 TESTER
000004r 1 A2 0F ldx #15
000006r 1 A9 02 TESTER
000008r 1 E8 inx
000009r 1 A9 02 TESTER
00000Br 1 A9 02 TESTER
00000Dr 1 CA dex
00000Er 1 60 rts
00000Er 1

View File

@ -0,0 +1,16 @@
; 2022-01-17 Spiro Trikaliotis
.macro TESTER
lda #2
.endmacro
test:
ldx #0
TESTER
ldx #15
TESTER
inx
TESTER
TESTER
dex
rts

View File

@ -0,0 +1,20 @@
Main file : 002-macro-param-listing.s
Current file: 002-macro-param-listing.s
000000r 1 ; 2022-01-17 Spiro Trikaliotis
000000r 1
000000r 1 .macro TESTER val
000000r 1 lda #val
000000r 1 .endmacro
000000r 1
000000r 1 test:
000000r 1 A2 00 ldx #0
000002r 1 A9 01 TESTER 1
000004r 1 A2 0F ldx #15
000006r 1 A9 02 TESTER 2
000008r 1 E8 inx
000009r 1 A9 03 TESTER 3
00000Br 1 A9 04 TESTER 4
00000Dr 1 CA dex
00000Er 1 60 rts
00000Er 1

View File

@ -0,0 +1,16 @@
; 2022-01-17 Spiro Trikaliotis
.macro TESTER val
lda #val
.endmacro
test:
ldx #0
TESTER 1
ldx #15
TESTER 2
inx
TESTER 3
TESTER 4
dex
rts

View File

@ -0,0 +1,15 @@
.paramcount = 3
.paramcount = 5
010-paramcount.s:18: Warning: User warning: r1 is blank!
010-paramcount.s:14: Note: Macro was defined here
010-paramcount.s:8: Note: Macro was defined here
.paramcount = 3
.paramcount = 5
010-paramcount.s:19: Warning: User warning: r1 is blank!
010-paramcount.s:14: Note: Macro was defined here
010-paramcount.s:8: Note: Macro was defined here
.paramcount = 1
.paramcount = 5
010-paramcount.s:20: Warning: User warning: r1 is blank!
010-paramcount.s:14: Note: Macro was defined here
010-paramcount.s:8: Note: Macro was defined here

Binary file not shown.

View File

@ -0,0 +1,30 @@
Main file : 020-asciiz.s
Current file: 020-asciiz.s
000000r 1 ; 2022-06-15 Spiro Trikaliotis
000000r 1
000000r 1
000000r 1 ; upper case pseudo-op
000000r 1 00 .ASCIIZ ""
000001r 1 48 65 6C 6C .ASCIIZ "Hello World"
000005r 1 6F 20 57 6F
000009r 1 72 6C 64 00
00000Dr 1 48 65 6C 6C .ASCIIZ "Hello ","World"
000011r 1 6F 20 57 6F
000015r 1 72 6C 64 00
000019r 1 48 65 6C 6C .ASCIIZ "Hello ","World"," ","I"," ","am"," ","testing"
00001Dr 1 6F 20 57 6F
000021r 1 72 6C 64 20
000032r 1
000032r 1 ; lower case pseudo-op
000032r 1 00 .asciiz ""
000033r 1 48 65 6C 6C .asciiz "Hello World"
000037r 1 6F 20 57 6F
00003Br 1 72 6C 64 00
00003Fr 1 48 65 6C 6C .asciiz "Hello ","World"
000043r 1 6F 20 57 6F
000047r 1 72 6C 64 00
00004Br 1 48 65 6C 6C .asciiz "Hello ","World"," ","I"," ","am"," ","testing"
00004Fr 1 6F 20 57 6F
000053r 1 72 6C 64 20
000063r 1

View File

@ -0,0 +1,14 @@
; 2022-06-15 Spiro Trikaliotis
; upper case pseudo-op
.ASCIIZ ""
.ASCIIZ "Hello World"
.ASCIIZ "Hello ","World"
.ASCIIZ "Hello ","World"," ","I"," ","am"," ","testing"
; lower case pseudo-op
.asciiz ""
.asciiz "Hello World"
.asciiz "Hello ","World"
.asciiz "Hello ","World"," ","I"," ","am"," ","testing"

Binary file not shown.

File diff suppressed because it is too large Load Diff

3526
test/asm/listing/100-byte.s Normal file

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

3526
test/asm/listing/101-byt.s Normal file

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

File diff suppressed because it is too large Load Diff

6076
test/asm/listing/102-word.s Normal file

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

6076
test/asm/listing/103-dbyt.s Normal file

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

4874
test/asm/listing/104-dword.s Normal file

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -49,16 +49,24 @@ $(WORKDIR)/$1.bin: $1.s $(ISEQUAL)
$(if $(QUIET),echo asm/$1.bin)
# compile without generating listing
$(CA65) -t none -o $$(@:.bin=.o) $$<
$(CA65) -t none -o $$(@:.bin=.o) $$< > $$(@:.bin=.err) 2>&1
$(LD65) -t none -o $$@ $$(@:.bin=.o) none.lib
ifneq ($(wildcard $1.err-ref),)
$(ISEQUAL) $1.err-ref $$(@:.bin=.err)
endif
ifneq ($(wildcard $1.bin-ref),)
$(ISEQUAL) $1.bin-ref $$@
endif
$(CA65) -t none -l $$(@:.bin=.list.orig) -o $$(@:.bin=.list-o) $$<
$(CA65) -t none -l $$(@:.bin=.list.orig) -o $$(@:.bin=.list-o) $$< > $$(@:.bin=.list-err) 2>&1
$(LD65) -t none -o $$(@:.bin=.list-bin) $$(@:.bin=.list-o) none.lib
ifneq ($(wildcard $1.err-ref),)
$(ISEQUAL) $1.err-ref $$(@:.bin=.list-err)
endif
# check if the result bin is the same as without listing file
$(ISEQUAL) $$@ $$(@:.bin=.list-bin)
@ -66,7 +74,7 @@ ifneq ($(wildcard $1.list-ref),)
# we have a reference file, compare that, too
# remove first line which contains a version number
tail -n +2 $$(@:.bin=.lst.orig) > $$(@:.bin=.lst)
tail -n +2 $$(@:.bin=.list.orig) > $$(@:.bin=.lst)
$(ISEQUAL) $1.list-ref $$(@:.bin=.lst)
endif