Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#176 [z80] Hardcoded "#0xNN"-like numbers elimination

closed-accepted
z80 port (10)
5
2012-06-16
2012-03-29
No

There were few hardcoded numbers in "#0xNN" notation in the gen.c
Assemblers other than asxxxx consider them as errors.

Solution: replaced using !immedbyte/!immedword.

Discussion

    • summary: [z80] Hardcoded numbers of "#0xNN" type elimination --> [z80] Hardcoded "#0xNN"-like numbers elimination
     
  •  
    Attachments
  • But I have not idea what to do with commands that can use negative numbers like
    int d = (stack < 127 ? -stack : -127);
    emit2 ("add sp, #%d", d);

    both !immedbyte and !immedword are replaced with 32-bit long number when parameter is negative:
    emit2("add sp, !immedbyte", -15) give us "add sp, #0xFFFFFFF1"
    Is this a bug?

     
    • assigned_to: nobody --> spth
    • status: open --> closed-accepted
     
  • Implemented for all "#0x" in revision #7917.

    Philipp

     
  • Keeping it open for the other #-prefixed stuff.

     
    • status: closed-accepted --> open-accepted
     
  • The !immedword substitution was applied in revision #7919. AFAIk there currently is no mechanism like this for negative numbers.

    Philipp

     
    • status: open-accepted --> closed-accepted