[cc65] da65: jsr print / .byte "HELLO"

From: Dan <opendtv1yahoo.com>
Date: 2007-05-25 13:47:42
I made a quick hack to da65 to handle calls of the
form:
jsr imm_print
.byte "HELLO WORLD"
.byte 0
;...code continues...

Maybe it will save someone else the trouble, or the
concept can be implemented in some future version of
da65.

Insert in GetAddrArg(), handler.c:

    if (Label) {
        #define MAX_IMM 1024    // arbitrary
        if (Pass==1 && GetCodeByte(PC)==0x20 &&
!strncmp(Label, "imm_", 4))
        {
            unsigned taddr = PC + 3 ;
            unsigned length;
            for (length=0; length < MAX_IMM; length++)
            {
                if (!GetCodeByte(taddr+length))
                    break;
            }
            if (length < MAX_IMM)
            {
                unsigned i;
                for (i=0; i <= length; i++)
                {
                    if (GetStyleAttr(taddr+i))
                        return Label;
                }
                MarkRange (taddr, taddr+length,
atTextTab);
            }
        }

        return Label;
    } else {



       
____________________________________________________________________________________Choose the right car based on your needs.  Check out Yahoo! Autos new Car Finder tool.
http://autos.yahoo.com/carfinder/
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Fri May 25 13:47:53 2007

This archive was generated by hypermail 2.1.8 : 2007-05-25 13:47:56 CEST