From 5ba16654a35bd08734ad34bf72d932ccfce1de2d Mon Sep 17 00:00:00 2001 From: Greg King Date: Tue, 17 Nov 2020 15:06:05 -0500 Subject: [PATCH] Refined the hints about making new test reference files. --- test/asm/Makefile | 2 +- test/asm/readme.txt | 17 ++++++++--------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/test/asm/Makefile b/test/asm/Makefile index 0cf65f9ca..e951c2015 100644 --- a/test/asm/Makefile +++ b/test/asm/Makefile @@ -60,7 +60,7 @@ $(foreach cpu,$(OPCODE_CPUS),$(eval $(call OPCODE_template,$(cpu)))) define CPUDETECT_template -$(WORKDIR)/$1-cpudetect.bin: cpudetect.s $(ISEQUAL) +$(WORKDIR)/$1-cpudetect.bin: cpudetect.s $1-cpudetect.ref $(ISEQUAL) $(if $(QUIET),echo asm/$1-cpudetect.bin) $(CA65) -t none --cpu $1 -l $$(@:.bin=.lst) -o $$(@:.bin=.o) $$< $(LD65) -t none -o $$@ $$(@:.bin=.o) none.lib diff --git a/test/asm/readme.txt b/test/asm/readme.txt index a2b1e9a41..0bbadeab9 100644 --- a/test/asm/readme.txt +++ b/test/asm/readme.txt @@ -1,4 +1,3 @@ - Assembler Testcases =================== @@ -7,7 +6,7 @@ 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 +either by an Assembly instruction or a ".byte"-placeholder. Typically generated by disassembling a binary dump that contains data in the form of the pattern that each opcode is stated once in order followed by easy to recognise: @@ -28,21 +27,21 @@ m740 instructions set. 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. +a 16-bit operator alike, distinguished by only one processor flag. -CPU detect Tests +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. +command-line 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. - +Some hints about creating new files: +Make an empty file with the CPU's name prepended to "-cpudetect.ref". Run the +tests; one of them will fail due to a mismatch. Review the output of the +".lst" file pedantically, then copy the ".bin" over the empty ".ref" file.