[cc65] Referencing 'Split' Labels

From: Todd Elliott <eyeth1videocam.net.au>
Date: 2004-03-15 23:39:32
Hello.

The following code did not compile correctly under ca65?

	LoadW r0, epsLineBuf+14	; point to start of coordinates.

The LoadW is a macro, meaning that r0 ($02-$03) will contain the address
of epsLineBuf+14.

Problem is, the high byte seems to be wrong; It appears that the +14 is
added to high byte, a no-no.

This code would work most of the time:
	lda	#<epsLineBuf+14
	sta	r0L
	lda	#>epsLineBuf
	sta	r0H

However, if the +14 addition to the label causes an 'overflow' to the high
byte, it still will not compile correctly.

One solution is to put in another label at the right spot in the BSS
segment and use that label instead. That'll compile correctly.

Thanks,
-- 
Todd Elliott
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Mon Mar 15 23:40:25 2004

This archive was generated by hypermail 2.1.8 : 2004-03-15 23:40:31 CET