Skip to main content
6 events
when toggle format what by license comment
Mar 30, 2020 at 14:44 comment added fadden "Truncating to fit available data size" is assembler-specific. The datasheet recommends, but does not define, assembler behavior. For example, in ca65, LDA #DATA / 256 will work, but LDA #DATA / 16 will not ("range error"). Merlin is aggressive when it comes to truncating expression results, more so than the other popular 65xx cross-assemblers.
Mar 30, 2020 at 13:49 comment added Chromatix @fadden Additionally, as both the OP's example and the above table suggest, immediate operands are in fact truncated to fit the available data size, without generating an error.
Mar 30, 2020 at 11:32 comment added Chromatix @fadden The question was in the context of the 6502 specifically. I referred to the '816 datasheet as it was the one place I knew I could find those "standard" modifiers documented.
Mar 30, 2020 at 4:39 comment added fadden Most assemblers (64tass, ACME, ca65) treat #< and #> as byte-selection operators. Merlin treats them as shift+mod operators. For 8-bit code the effect is the same, but it can surprise you with 16-bit code. Your DATA DIV 256 example might throw an error if you attempted that with a 24-bit constant for an 8-bit immediate instruction.
Mar 30, 2020 at 2:18 history edited Chromatix CC BY-SA 4.0
added 123 characters in body
Mar 30, 2020 at 2:10 history answered Chromatix CC BY-SA 4.0