The eight bit adder took 25 macro arguments because every cell address was
passed in. That was laziness: .tp accepts expressions, so the macro can take
four base addresses and add the offsets itself.
raw_add_bits8 0 8 16 24 ; A0..7 at 0, B0..7 at 8, S0..7 at 16, carry at 24
raw_inc_bits8 0 8 16 ; a0..7 at 0, s0..7 at 8, carry at 16
The bodies are unchanged apart from '%1 + 1' style addresses, so the tapes and
the behaviour must be identical, and they are: add8 still 2550 characters, inc8
still 1514.
Re-verified after the change, on the built in machine:
add8 7 sums (100+50, 128+127, 200+55, 43+199, 255+0, 1+1, 0+0) 7/7
inc8 7 values (0, 1, 5, 127, 200, 253, 254) 7/7
Also committed two verify_*.r8asm drivers so the numbers are reproducible.
14 lines
166 B
Plaintext
14 lines
166 B
Plaintext
%include "asm/lib.r8asm"
|
|
%include "asm/raw_add_bits8.r8asm"
|
|
|
|
raw_add_bits8 0 8 16 24
|
|
|
|
output 16
|
|
output 17
|
|
output 18
|
|
output 19
|
|
output 20
|
|
output 21
|
|
output 22
|
|
output 23
|