Re: [cc65] Renaming imported zeropage variables in ca65

Date view Thread view Subject view

From: Marc 'BlackJack' Rintsch (marc_at_rintsch.de)
Date: 2003-03-12 22:33:51


On Wednesday 12 March 2003 11:57, Ullrich von Bassewitz wrote:

> > Is there any way to declare a label explicitly as zeropage address?
> >
> > I want to rename some imported zeropage labels within the scope of
> > a .proc but the assembler creates absolute adressing.
>
> Which assembler version are you using? Your program works here as it
> should:

I'm using 2.9.0 and I'm feeling a bit silly because it wasn't a problem 
with renaming *within* the .proc but when I assign the variables 
*outside* of a .proc block. Shouldn't try to debug my messy code late 
at night. x-)

Let's try again:

;-----
        .importzp zp1
        foo = zp1
        
.proc
	bar = zp1
.code
        sta foo
	sta bar
.endproc
;-----

assembles to:

;-----
ca65 V2.9.0 - (C) Copyright 1998-2000 Ullrich von Bassewitz
Main file   : test.s
Current file: test.s

000000r 1                       .importzp zp1
000000r 1                       foo = zp1
000000r 1                       
000000r 1               .proc
000000r 1                       bar = zp1
000000r 1               .code
000000r 1  8D rr rr             sta foo
000003r 1  85 rr                sta bar
000005r 1               .endproc
000005r 1               
;-----

Shouldn't both STAs use zp adressing? If I use indirect adressing like 
'STA (foo),y' the assembler emits the expected code.

Ciao,
	Marc 'BlackJack' Rintsch
-- 
"It's too bad she won't live! But then again, who does?"
  -- Gaff in "Blade Runner"

----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo_at_musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.


Date view Thread view Subject view

This archive was generated by hypermail 2.1.3 : 2003-03-12 22:37:25 CET