Menu

#52 CPY $0006 gets assembled as $C4 $C6 rather than $CC $C6$ C00

1.55.2200
closed-invalid
nobody
None
5
2021-04-25
2020-12-23
No

An instruction such as:
CPY $0006

gets assembled as:

C4C6

rather than
CCC600

I'm aiming for a byte-for-byte identical build from a disassembled binary so this is a bug for me. Is there any way of getting around it (other than .BYTE $CC $C6 $00)?

Discussion

  • Soci/Singular

    Soci/Singular - 2020-12-23
    • status: open --> pending-invalid
     
  • Soci/Singular

    Soci/Singular - 2020-12-23

    For simple numeric arguments leading zeros do not influence the addressing mode used. Instead it depends on the numerical value which with the current settings results in a zero page addressing mode.

    You have two choices to use absolute (data bank) addressing:

    cpy @w$0006        ; force word size operand with @w
    cpy $0006,b        ; use data bank addressing (and not direct page)
    

    The third is using an unspecified direct page so that this address does not fall into its range but that's not applicable for this simple case.

     
  • Robert Hogan

    Robert Hogan - 2020-12-24

    Perfect! Thanks very much for that!

     
  • Soci/Singular

    Soci/Singular - 2021-04-25
    • status: pending-invalid --> closed-invalid
     

Log in to post a comment.

MongoDB Logo MongoDB