<> <> <<>> DIRECTORY Rope USING [ROPE]; Mime: CEDAR DEFINITIONS ~ BEGIN ROPE: TYPE = Rope.ROPE; AssembleOneInstruction: PROC [r: ROPE] RETURNS [bytes: ROPE]; <> <<"JB -2" as input yields "097H 0FEH -- JB -2" as output.>> END. <> <<>> Goal Symbol: SingleInstruction => I | LC | LR | LB | LH | LW | LBD | RRR | QR | RD | XO | XRO I => IInstruction IInstruction => I-format instructions from the Dragon Instruction Set summary plus the J1, J2, J3, and J5 instructions which the assembly coder should consider to be I-format and less the LCm instructions (use LC). LC => LC m: an expression this is actually a macro instruction: it will choose the appropriate instruction LCm, LIB, LIDB, or LIQB depending on the value of the expression ConstantRegisterIndex => an expression in [0..12) | -1 | -2 | 80000000H -1, -2, and FIRST[INT] are translated to the appropriate constant register index. LR => LRInstruction n: AuxOrLocalRegisterIndex LRInstruction => LRn | SRn AuxOrLocalRegisterIndex => an expression IN [0..16) LB => LBInstruction Byte LBInstruction => LB-format instructions from the Dragon Instruction Set summary. Byte => an expression IN [-128..256) LH => LHInstruction Halfword LHInstruction => LH-format instructions from the Dragon Instruction Set summary. Halfword => an expression IN [-32768..65535) LW => LWInstruction Word LWInstruction => LW-format instructions from the Dragon Instruction Set summary. Word => an expression LBD => LBDInstruction comparand: Byte , displacement: Byte LBDInstruction => LBD-format instructions from the Dragon Instruction Set summary. RRR => RRRInstruction c: DestinationReg , a: SourceReg , b: SourceReg RRRInstruction => RRR-format instructions from the Dragon Instruction Set summary. DestinationReg => GeneralReg | Push SourceReg => GeneralReg | PopTop | PopUnder GeneralReg => AUX AuxOrLocalRegisterIndex | LOCAL AuxOrLocalRegisterIndex | CONSTANT ConstantRegisterIndex | Top | Under QR => QRInstruction ca: CASpec , b: SourceReg QRInstruction => QR-format instructions from the Dragon Instruction Set summary. CASpec => TopATop | PushATop | PushA0 | PushA1 RD => RDInstruction s: ShortSourceReg , b: SourceReg , displacement: Byte RDInstruction => RD-format instructions from the Dragon Instruction Set summary. ShortSourceReg => Constant0 | Constant1 | Top | PopTop XO => XOInstruction n: AuxOrLocalRegisterIndex , offset: Byte XOInstruction => LRIn | SRIn XRO => XROInstruction a: SourceReg , b: SourceReg , offset: Byte XROInstruction => XRO-format instructions from the Dragon Instruction Set summary.