AY2021-T5
Assignment 6
Question:
For the Unit 6 assignment, hand compile the following two assembly language programs into
machine language that can be loaded into an executed on the Hack computer.
//Program 1 to convert to machine language
// Computes R0 = 2 + 3
@2
D=A
@3
D=D+A
@0
M=D
m
er as
// Program 2 to convert to machine language
co
eH w
// Symbol-less version of the Max.asm program.
o.
@0
D=M rs e
ou urc
@1
D=D-M
@10
o
D;JGT
aC s
@1
vi y re
D=M
@12
0;JMP
ed d
@0
ar stu
D=M
@2
M=D
is
@14
0;JMP
Th
Once you have been able to translate each of the following two programs written in Hack
Assembler into binary machine code, Load your machine language program into the cpu
simulator and execute it.
sh
For your assignment post a description of YOUR process to convert the assembler symbols into
machine language and what you learned in the process. Also include both your assembler
program and corresponding machine language program in your assignment.
This study source was downloaded by 100000831788613 from CourseHero.com on 09-23-2021 05:17:37 GMT -05:00
1
https://www.coursehero.com/file/103147995/Assignment-6pdf/