4 ms·
Yes. If basic assembler. No. If you're going to implement an assembler that supports constants and symbols which can be combined into expressions. And expressi
by e19293001 6y ago
Yes. If basic assembler.
No. If you're going to implement an assembler that supports constants and symbols which can be combined into expressions. And expressions can easily be parsed for example[0]:
〈primary expression〉->〈constant〉|〈symbol〉|〈local operand〉|@|
(〈expression〉)|〈unary operator〉〈primary expression〉
〈term〉->〈primary expression〉|〈term〉〈strong operator〉〈primary expression〉
〈expression〉->〈term〉|〈expression〉〈weak operator〉〈term〉
〈unary operator〉-> + | − | ~ | $ | &
〈strong operator〉-> * | / | // | % | << | >> | &
〈weak operator〉-> + | − | | | ^
Your code might be hard to read if you'll not create a parse tree for it.
[0] - http://www.mmix.cs.hm.edu/doc/mmixal.pdf http://www.mmix.cs.hm.edu/doc/mmixal.pdf