gnupic: Thread: gpasm bug?


[<<] [<] Page 1 of 1 [>] [>>]
Subject: gpasm bug?
From: Vangelis Rokas ####@####.####
Date: 11 Feb 2004 00:28:44 -0000
Message-Id: <Pine.LNX.4.58.0402110150510.13443@localhost>

I try to assemble and link the following source:

	udata
sym	res	1

	code
	lfsr 0, low(sym)
	end

The result from gpdasm is:
00002a:  ee80  dw       0xee80  ;unknown opcode
00002c:  f080  dw       0xf080  ;unknown opcode

In the line 'lfsr 0, low(sym)' if I omit the 'low' I get the correct
result which is:

00002a:  ee00  lfsr     0, 0x80
00002c:  f080

If the low modifier cannot be used with lfsr, then gpasm whould emit an
error, otherwise it shouldn't it emit the second version? (which I think
would be correct, and will save me from digging into SDCC to figure a way
to fix it...

Regards,
Vangelis

Subject: Re: gpasm bug?
From: Craig Franklin ####@####.####
Date: 11 Feb 2004 03:00:44 -0000
Message-Id: <1076466558.1443.31.camel@r2d2>

On Tue, 2004-02-10 at 17:59, Vangelis Rokas wrote:
> I try to assemble and link the following source:
> 
> 	udata
> sym	res	1
> 
> 	code
> 	lfsr 0, low(sym)
> 	end
> 
> The result from gpdasm is:
> 00002a:  ee80  dw       0xee80  ;unknown opcode
> 00002c:  f080  dw       0xf080  ;unknown opcode
> 
> In the line 'lfsr 0, low(sym)' if I omit the 'low' I get the correct
> result which is:
> 
> 00002a:  ee00  lfsr     0, 0x80
> 00002c:  f080
> 
> If the low modifier cannot be used with lfsr, then gpasm whould emit an
> error, otherwise it shouldn't it emit the second version? (which I think
> would be correct, and will save me from digging into SDCC to figure a way
> to fix it...
> 

I don't think the LFSR should have a LOW.  The FSRs on the 18xx devices
are a full 12 bits to accommodate the entire data memory map.  The LOW
operator masks all but the lowest 8 bits. That would make your FSR
limited to the first 256 bytes.

Your source code causes a low relocation to be generated, but prevents
the lfsr relocation.  When gplink follows these directions, the opcode
gets screwed up.  I ran a quick test on mpasm/mplink and it does the
same thing.

To me, it looks like you will need to modify SDCC to output the symbol
name without the LOW.  That LOW is probably a carry over from the 14 bit
PIC target.

> Regards,
> Vangelis
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ####@####.####
> For additional commands, e-mail: ####@####.####
> 

[<<] [<] Page 1 of 1 [>] [>>]


Powered by ezmlm-browse 0.20.