gnupic: GPASM bug with RES pseudo-op


Previous by date: 30 Jul 2000 01:14:57 -0000 ANNOUNCE: gpsim-0.20.0, Scott Dattalo
Next by date: 30 Jul 2000 01:14:57 -0000 Re: GPASM bug with RES pseudo-op, Scott Dattalo
Previous in thread:
Next in thread: 30 Jul 2000 01:14:57 -0000 Re: GPASM bug with RES pseudo-op, Scott Dattalo

Subject: GPASM bug with RES pseudo-op
From: Eric Smith ####@####.####
Date: 30 Jul 2000 01:14:57 -0000
Message-Id: <20000730011618.7028.qmail@brouhaha.com>

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

Previous by date: 30 Jul 2000 01:14:57 -0000 ANNOUNCE: gpsim-0.20.0, Scott Dattalo
Next by date: 30 Jul 2000 01:14:57 -0000 Re: GPASM bug with RES pseudo-op, Scott Dattalo
Previous in thread:
Next in thread: 30 Jul 2000 01:14:57 -0000 Re: GPASM bug with RES pseudo-op, Scott Dattalo


Powered by ezmlm-browse 0.20.