预定/报价
LC-3汇编辅导 | COMPSCI 210 S1 Assignment ONE
阿叶2024-05-15 16:41:56

留学生作业代写do not hesitate to contact me!
WeChat:lovexc60

This assignment is to be done using LC-3 simulator. You can download the JAVA version from Canvas. You can use the simulator to compile and test the program.
Section 1: Running the Simulator [1] (1 mark)

To actually run code, you can use the 4 control buttons at the top of the simulator, or type commands into the command line interface (the command names are the same as the buttons). Note that the PC register is set to x0200, which is the entry point to the operating system by convention. You can set the value in the registers. Example: You can set the value of R2, either by double-clicking it in the Registers section, or via the command set R2 (value). Now, actually run the code by hitting the continue button. You can find more details of operations from [1].
In section 1, you are going to revise the program below. This program will take two input operands and output the AND results of those inputs. You first assemble all the files: ‘lc3os.asm’, ‘data.asm’ and ‘Q0.asm’. Hence, you execute the following commands: load lc3os.obj, load data.obj and load Q0.obj. Click ‘continue’ to run the program. You can see the results from the display at the bottom-left. 1
COMPSCI 210 S2 – Assignment 01
;
; Initialization ;
;
REDO LDR ;
; Test character for end ;
x3000
R6, EMPTY R5, PTR R0, R0, #0 R0, R0, #10
R3, R5, #0 of file
.ORIG LD LD AND ADD OUT
; R6 is the stack pointer
; R5 is pointer to characters
; Print a new line
; R3 gets character
; Test for end of line (ASCII xA) ; If done, quit
; Get the decimal value from ASCII