Page 1 of 1

NESASM inefficiency when referencing data by ptr-to-ptr?

Posted: Fri Feb 07, 2014 12:34 pm
by pops
While debugging my implementation of shiru's new famitone library, I noticed that NESASM assembles this:

Code: Select all

	FT_TEMP				= $00	;3 bytes in zeropage used by the library as a scratchpad
	FT_TEMP_PTR			= FT_TEMP		;word
	FT_TEMP_PTR_L		= FT_TEMP_PTR+0
	FT_TEMP_PTR_H		= FT_TEMP_PTR+1

	lda FT_TEMP_PTR_L
	pha
	lda FT_TEMP_PTR_H
	pha
Into this:

Code: Select all

; note lda absolute where lda zp would suffice
	lda $0000
	pha
	lda $0001
	pha
I'm not sure if NESASM is still under development - hopefully someone knows who to forward this to - thanks!

Re: NESASM inefficiency when referencing data by ptr-to-ptr?

Posted: Fri Feb 07, 2014 12:37 pm
by tepples
You have to explicitly specify zero page mode in NESASM.

Re: NESASM inefficiency when referencing data by ptr-to-ptr?

Posted: Fri Feb 07, 2014 1:47 pm
by zzo38
Yes, that is correct, you have to explicitly specify zero-page mode by putting < before the operand. (This is the method I prefer over other assemblers that don't do it that way.)