Hi,
either I don't know how EQUs work or I have found
a bug in the parser of pMARS. So far I cound pin
it down to:
;redcode-tiny
;name test
;assert CORESIZE == 800
v3 EQU 3 * (3 / 2 + 1) + 3
v4 EQU (CORESIZE - v3)
dat.f v3, v4
With the settings for tiny pMARS' parses it to:
dat.f $ 9, $ -9
The value for v3 is correct, but v4 is wrong. It should
be
(800 - 3 * (3 / 2 + 1) + 3) = 800 - 3 * 2 + 3 = 797 = -3
The confusing part is, that in the debug output pMARS
seems to correctly replace the v3 in v4:
After pass 1
Instruction (physical line, instr):
( 11) DAT.f 3*(3/2+1)+3,(800 -3*(3/2+1)+3)
Can somebody, who knows more about pMARS' parser,
please confirm it as a bug? And if it isn't a bug, why does
pMARS evaluate it that way?
By the way I found that problem in the warrior "Borkked"
(Tiny Hill at Koenigstuhl).
Regards,
Jens Gutzeit
