Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const generalInstruction = (mnemonic, type, ...params) =>
- A.coroutine(function* () {
- yield upperOrLowerStr(mnemonic);
- const args = [];
- if (params.length > 0) {
- yield A.whitespace;
- yield params[0];
- }
- for (let i = 1; i < params.length; i++) {
- yield A.optionalWhitespace;
- yield A.char(',');
- yield A.optionalWhitespace;
- args.push(yield params[i]);
- }
- yield A.optionalWhitespace;
- return T.instruction({
- instruction: type,
- args,
- });
- });
- const litReg = (mnemonic, type) =>
- generalInstruction(
- mnemonic,
- type,
- A.choice([hexLiteral, squareBracketExpr]),
- register
- );
Advertisement
Add Comment
Please, Sign In to add comment