Test Suite

The test suite validates the assembler and B compiler across all target platforms. Tests compile, assemble, link, and compare runtime output against expected results.

Running Tests

cd tests
./run_tests.sh z80      # Z80 only (assembler + B language)
./run_tests.sh 8086     # 8086 only
./run_tests.sh 8086exe  # 8086 EXE only
./run_tests.sh 8080     # 8080 only
./run_tests.sh all      # All platforms

Test Structure

tests/
  run_tests.sh            Test runner script
  asm/z80/all_opcodes.s   Z80 full opcode test
  asm/z80/basic.s         Z80 basic instruction test
  asm/z80/data_labels.s   Labels, sections, expressions
  asm/8080/basic.s        8080 instruction test
  asm/8085/basic.s        8085 instruction test
  asm/8086/basic.s        8086 instruction test
  asm/8086/peephole.s     8086 peephole patterns
  b/01_basics.b           Variables, putchar
  b/02_arith.b            Arithmetic operators
  b/03_compare.b          Comparison, logical operators
  b/04_bitwise.b          Bitwise, shift operators
  b/05_control.b          if/else, while, break
  b/06_functions.b        Function calls, params, return
  b/07_arrays.b           Global arrays
  b/08_advanced.b         Many args, nested calls, recursion
  b/09_compound.b         Compound assignment

Results (v2.1 R8)

PlatformAssemblerB LanguageTotal
Z803/39/912/12
80801/19/910/10
80851/11/1
80862/29/911/11
8086exe9/99/9
Total7/736/3643/43