Added assembler pseudo commands .P4510 and .IFP4510 together with docs and testcase

This commit is contained in:
Sven Oliver Moll
2016-09-07 19:21:24 +02:00
parent 05279f8302
commit ae3f9bbd77
14 changed files with 109 additions and 23 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -5,26 +5,43 @@ BINDIR = ../../bin
#WORKDIR := ../../testwrk
WORKDIR := .
TARGETS = 6502 6502x 65sc02 65c02
#TARGETS += 65816
TARGETS += 4510
TARGETS += huc6280
#TARGETS += m740
BASE_TARGETS = 6502 6502x 65sc02 65c02
BASE_TARGETS += 4510 huc6280
all: $(addprefix $(WORKDIR)/, $(addsuffix -opcodes.bin, $(TARGETS)))
OPCODE_TARGETS = $(BASE_TARGETS)
CPUDETECT_TARGETS = $(BASE_TARGETS)
CPUDETECT_TARGETS += 65816
# default target defined later
all:
# generate opcode targets and expand target list
define opcode
OPCODE_TARGETLIST += $(1)-opcodes.bin
$$(WORKDIR)/$(1)-opcodes.bin: $(1)-opcodes.s
@$$(BINDIR)/cl65 --cpu $(1) -t none -l $$(WORKDIR)/$(1)-opcodes.lst --obj-path $$(WORKDIR) -o $$@ $$<
@diff -q $(1)-opcodes.ref $$@ || (cat $$(WORKDIR)/$(1)-opcodes.lst ; exit 1)
@echo ca65 --cpu $(1) opcodes ok
endef
$(foreach target,$(OPCODE_TARGETS),$(eval $(call opcode,$(target))))
# generate cpudetect targets and expand target list
define cpudetect
CPUDETECT_TARGETLIST += $(1)-cpudetect.bin
$$(WORKDIR)/$(1)-cpudetect.bin: cpudetect.s
@$$(BINDIR)/cl65 --cpu $(1) -t none -l $$(WORKDIR)/$(1)-cpudetect.lst --obj-path $$(WORKDIR) -o $$@ $$<
@diff -q $(1)-cpudetect.ref $$@ || (cat $$(WORKDIR)/$(1)-cpudetect.lst ; exit 1)
@echo ca65 --cpu $(1) cpudetect ok
endef
$(foreach target,$(CPUDETECT_TARGETS),$(eval $(call cpudetect,$(target))))
# now that all targets have been generated, get to the manual ones
all: $(OPCODE_TARGETLIST) $(CPUDETECT_TARGETLIST)
@#
.PHONY: all clean $(addprefix $(WORKDIR)/, $(addsuffix -opcodes.bin, $(TARGETS)))
clean:
rm -f *.o *.bin *.lst
define build
$$(WORKDIR)/$(1)-opcodes.bin: $(1)-opcodes.s
@$$(BINDIR)/cl65 --cpu $(1) -t none -l $$(WORKDIR)/$(1)-opcodes.lst --obj-path $$(WORKDIR) -o $$@ $$<
@diff -q $(1)-opcodes.ref $$@ || (cat $$(WORKDIR)/$(1)-opcodes.lst ; exit 1)
@echo ca65 --cpu $(1) ok
endef
$(foreach target,$(TARGETS),$(eval $(call build,$(target))))
.PHONY: all clean $(OPCODE_TARGETLIST) $(CPUDETECT_TARGETLIST)

View File

@@ -2,6 +2,9 @@
Assembler Testcases
===================
Opcode Tests:
-------------
These testcases are inspired by the ones now removed from test/assembler.
The main purpose is to have each possible opcode generated at least once,
either by an assembly instruction or a ".byte"-placeholder. Typically
@@ -23,7 +26,23 @@ The testcases for 6502, 6502x, 65sc02, 65c02, 4510, and huc6280 have been
put together by Sven Oliver ("SvOlli") Moll, as well as a template for the
m740 instructions set.
Still to do is to find a way to implement a testcase for the 65816
Still to do is to find a way to implement an opcode testcase for the 65816
processor, since it's capable of executing instructions with an 8-bit and
a 16-bit operator alike, only distinguished by one processor flag.
CPU detect Tests
----------------
These tests all assemble the same file "cpudetect.s" which contains several
conditionals for several CPUs, only using every option known to the "--cpu"
commandline switch of ca65/cl65.
Reference (".ref") Files
------------------------
A hint on creating these files: when running the test, it will fail due to
the missing ".ref" file. Review the output of the ".lst" very pedantic, then
copy the ".bin" to the ".ref" file.

Binary file not shown.