TRSE icon indicating copy to clipboard operation
TRSE copied to clipboard

Target System: CUSTOM, CPU: 65816 - 24-bit long addressing

Open noyen1973 opened this issue 3 years ago • 0 comments

I have this variable set up for reading the mouse X position:

var i: integer;
	MOUSE_PTR_X_POS: integer at $AF0702;// X Position (0 - 639) (Can only read now) Writing will have no effect
	...
begin
	i:=MOUSE_PTR_X_POS;

It generates this code:

	ldy MOUSE_PTR_X_POS+1 ;	LDY $AF0702+1
	lda MOUSE_PTR_X_POS;	LDA $AF072

The LDY instruction can't handle a 24-bit operand address and in some cases an assembler might cut off the bank byte leaving LDY $0702.

noyen1973 avatar Feb 12 '22 20:02 noyen1973