Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; Problem: Assembling short literals
- .align 0x1D
- SET A, label1
- label1: ; If the prior instruction is long, this is 0x1F. Otherwise, it's 0x1E.
- ; Obviously the right option is to make this label 0x1E. But how to make an assembler understand this?
- ; Possible Solution:
- ; During assembly, assume all literals are short literals where applicable, and save expressions. Do not evaluate expressions until pass two.
- ; Pass two should evaluate all expressions. If -1 <= result <= 0x1E, then it can be shortened. Iterate through the label list and subtract one from
- ; every label whose address is greater than $ and use the short literal in the final output.
Advertisement
Add Comment
Please, Sign In to add comment