Re: [cc65] ca65 - offset segment?

From: Ullrich von Bassewitz <uz1musoftware.de>
Date: 2009-09-01 14:35:48
On Tue, Sep 01, 2009 at 02:33:20PM +0200, Christian Krüger wrote:
> comming from the 68k 'Pure'-assembler I find the 'OFFSET'-feature very nice.
> Is there something like this for ca65 or how do I achieve a 'C-structure-mapping'
> to assembler?
>
> Example (as this could look in ca65):
>
> .segment "offset"
> xpos:
> .res 2
> ypos:
> .res 1
> flags:
> .res 1
>
>
> .CODE
>
> ...
> ldy	#flags
> lda	(zpadr),Y	; zpadr is pointer to structure...

Just use a structure:

.struct	foo
	xpos            .word
        ypos            .byte
        flags           .byte
.endstruct

        ldy     #foobar::flags
        lda     (fooptr),y

Regards


        Uz


-- 
Ullrich von Bassewitz                                  uz@musoftware.de
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Tue Sep 1 14:37:31 2009

This archive was generated by hypermail 2.1.8 : 2009-09-01 14:37:33 CEST