gnupic@linuxhacker.org

gnupic@linuxhacker.org


Subject: GPASM bug with RES pseudo-op
From: Eric Smith
Date: 30 Jul 2000 01:16:18 -0000

The RES pseudo-op in gpasm 0.8.9 doesn't work properly.

If you do something like:

	processor	16c65
	org	20h
foo:	res	1
bar:	res	3
quux:	res	5

	org	0
reset:	movlw	0
	movwf	foo
	movwf	bar
	movwf	quux

gpasm reports error 104 "Can't evaluate expression" on each of the
instructions, and the symbol table only lists reset.

A quick & dirty fix for this is to change one line in opcode.c, in
the function do_res().  There's a line that says:

	state.lst.line.linetype = org;

If that line is changed to:

	state.lst.line.linetype = equ;

then the code above compiles correctly.

The listing then shows a four-byte value for each res line.  I think
it would be better if the listing showed a normal two-byte address in
column 1, but I didn't have time to investigate how to make that happen.
Perhaps a new linetype would be needed.

Cheers,
Eric

gnupic@linuxhacker.org