From 0f6cb5b114b0cfe6331dab38c4d19d499b712722 Mon Sep 17 00:00:00 2001 From: Spiro Trikaliotis Date: Sun, 20 Feb 2022 11:20:20 +0100 Subject: [PATCH] Add proper readmes --- test/asm/cpudetect/readme.txt | 15 ++++++++++++++ test/asm/listing/readme.txt | 27 +++++++++++++++++++++++++ test/asm/opcodes/readme.txt | 29 ++++++++++++++++++++++++++ test/asm/readme.txt | 38 +++++------------------------------ 4 files changed, 76 insertions(+), 33 deletions(-) create mode 100644 test/asm/cpudetect/readme.txt create mode 100644 test/asm/listing/readme.txt create mode 100644 test/asm/opcodes/readme.txt diff --git a/test/asm/cpudetect/readme.txt b/test/asm/cpudetect/readme.txt new file mode 100644 index 000000000..6a1adf480 --- /dev/null +++ b/test/asm/cpudetect/readme.txt @@ -0,0 +1,15 @@ +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" +command-line switch of ca65/cl65. + +Reference (".ref") Files +------------------------ + +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. + diff --git a/test/asm/listing/readme.txt b/test/asm/listing/readme.txt new file mode 100644 index 000000000..e43f2008a --- /dev/null +++ b/test/asm/listing/readme.txt @@ -0,0 +1,27 @@ +Overall test: +------------- + +These testcases can be used to test different aspects of the assembler. +The name of a test is everything in the form .s. + +The following reference files can be added: + +- .bin-ref: + This is a reference for the resulting binary. + The binary as binary tested against this file. + If they are not equal, the test fails. + +- .list-ref + This is a reference for the resulting listing output + This file *must* have the first line of the listing removed, as that + contains a ca65 version string, and almost always this will be changed! + + +Note that the resulting .bin file is generated twice: Once with no listing +file, and once with listing file. This way, one can find out if the listing +file generation changes anything with the resulting binary output. + + +TODO: +- add the possibility to test for specific error output that are to be + expected diff --git a/test/asm/opcodes/readme.txt b/test/asm/opcodes/readme.txt new file mode 100644 index 000000000..098dd549a --- /dev/null +++ b/test/asm/opcodes/readme.txt @@ -0,0 +1,29 @@ +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 +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: + +00 00 EA 00 +01 00 EA 00 +02 00 EA 00 +[...] +fe 00 EA 00 +ff 00 EA 00 + +The disassembly is then put in a better readable form by replacing the +leftover dummy opcode parameters with something more recognizable. + +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. Later 6502dtv support was also added. + +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, distinguished by only one processor flag. + + diff --git a/test/asm/readme.txt b/test/asm/readme.txt index 1d135c895..18354bb47 100644 --- a/test/asm/readme.txt +++ b/test/asm/readme.txt @@ -4,44 +4,16 @@ 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 -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: - -00 00 EA 00 -01 00 EA 00 -02 00 EA 00 -[...] -fe 00 EA 00 -ff 00 EA 00 - -The disassembly is then put in a better readable form by replacing the -leftover dummy opcode parameters with something more recognizable. - -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. Later 6502dtv support was also added. - -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, distinguished by only one processor flag. +these go into opcodes/. Refer to opcodes/readme.txt 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" -command-line switch of ca65/cl65. +these go into cpudetect/. Refer to cpudetect/readme.txt -Reference (".ref") Files ------------------------- +Overall tests: +-------------- -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. +These go into listing/. Refer to listing/readme.txt