Re: [cc65] ldax macro

From: MagerValp <>
Date: 2004-09-30 13:55:50
>>>>> "UvB" == Ullrich von Bassewitz <> writes:

UvB>         .macro  ldax    arg
UvB>                 .if (.match (.left (1, {arg}), #))
UvB>                     ; immediate mode
UvB>                     lda     #<(.right (.tcount ({arg})-1, {arg}))
UvB>                     ldx     #>(.right (.tcount ({arg})-1, {arg}))
UvB>                 .else
UvB>                     ; assume absolute or zero page
UvB>                     lda     arg
UvB>                     ldx     1+({arg})
UvB>                 .endif
UvB>         .endmacro

UvB> The problem is that (13) is passed to the macro and inserted as
UvB> is into the .left, .right and .tcount commands. These treat
UvB> parens and commas special. The introduction of curly braces to
UvB> terminate token lists is new in the development version. The
UvB> current stable version should work without problems for parens
UvB> (as in your case), but would treat the comma special. So I assume
UvB> you're using the development version from where the paragraph
UvB> above was taken.

Ah, that explains why it's been working fine before. However, with the
new macro, ldax foo (absolute addressing) doesn't work unless you
remove the {} around the arg.

    ___          .     .  .         .       . +  .         .      o   
  _|___|_   +   .  +     .     +         .  Per Olofsson, arkadspelare
    o-o    .      .     .   o         +
     -       +            +    .
To unsubscribe from the list send mail to with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Thu Sep 30 13:55:56 2004

This archive was generated by hypermail 2.1.8 : 2004-09-30 13:56:04 CEST