Assemble it into binary machine code line by line by hand:.ORIG x3000 LD R0,ASCII LD R1,NEG AGAIN LDI R2,DSR BRzp AGAIN STI R0,DDR ADD R0,R0,#1 ADD R2,R0,R1 BRnp AGAIN HALT ASCII .FILL x0041 NEG .FILL xFFB6 ;x004A DSR .FILL xFE04 DDR .FILL xFE06 .END
时间: 2024-01-19 11:03:09 浏览: 81
BMC - Step-by-Step Guide to Building a CMDB - 130016
Sure, here is the assembly code converted into binary machine code:
```
Address | Machine Code | Assembly Code
x3000 | 0010010000000001 | LD R0, ASCII
x3001 | 0010010000010001 | LD R1, NEG
x3002 | 0010110000100101 | LDI R2, DSR
x3003 | 0000110000100000 | BRzp AGAIN
x3004 | 0011010000110011 | STI R0, DDR
x3005 | 0001000000000001 | ADD R0, R0, #1
x3006 | 0001011000000001 | ADD R2, R0, R1
x3007 | 0001110000100000 | BRnp AGAIN
x3008 | 0000000000100101 | HALT
x3009 | 0000000001000001 | ASCII .FILL x0041
x300A | 1111111111110110 | NEG .FILL xFFB6
x300B | 1111111000000100 | DSR .FILL xFE04
x300C | 1111111000000110 | DDR .FILL xFE06
```
Note that each line of assembly code is converted into a 16-bit binary machine code instruction. The address of each instruction is shown in the first column, followed by the machine code in the second column, and the original assembly code in the third column. The data values (.FILL directives) are simply represented in binary form.
阅读全文