Closed Hawkbat closed 3 years ago
By the way, the reason why this occurs is because of a conflict in the grammar. (Yacc sees the rl
and seems to require making a decision at this point, so it takes the instruction by default.)
Considering there's no way any actual codebase has ever used this keyword (since it never worked), perhaps renaming it is the simplest solution?
This is not the only conflict like this one, so I'd like to know if there's a way to resolve them (= tell yacc to look at more tokens to decide)
The problem is that... there is no way to do that. The instruction takes a number as argument, the keyword can also take a number as argument. It is always going to be ambiguous.
The instruction takes a register as an argument, not a number.
And in case you're thinking what I'm thinking: 6502 has instructions amounting to sla [addr]
, srl [addr]
, rl [addr]
, rr [addr]
, inc [addr]
, and dec [addr]
. Z80 and SM83 do not, and even if they did, there would be brackets.
The instruction takes a register as an argument, not a number.
Woops...
Fixed by 57b734a.
Example:
Result: