The A-instruction: symbolic and binary syntax Semantics: Set the A register to value Symbolic syntax: @value Where value is either: a non-negative decimal constant ≤32767 (=215-1) or a symbol referring to such a constant (later) Example: @21 Effect: sets the A register to 21 Binary syntax: Ovvvvvvvvvvvvvvvv For example: @21 (symbolic syntax- assembly code) 0000000000010101 (binary syntax- machine code) Symbolic syntax: dest = comp; jump Binary syntax: 1 1 1 a c1 c2 c3 c4 c5 c6 d1 d2 d3 j1 j2 j3 dest d1 d2 d3 effect: the value is stored in: The value is not stored 1 RAM[A] 10D register 0 1 1 RAM[A] and D register A register 101 1 1 0 comp c1 c2 c3 c4 c5 c6 0 101 010 null 1 -1 1 1 1 1 1 1 1 1 1 0 1 0 M D D 0 0 1 1 0 0 MD A M 1 1 0 0 0 0 A 1 ID 0 0 110 1 AM IA IA IM 1 1 0 0 0 1 AD 0 -D 001111 AMD 1 1 1 A -A -M D+1 1 1 0 0 1 1 01 1 1 1 1 jump A+1 M+1 D-1 1 10 11 1 001110 null A-1 M-1 110010 JGT JEQ D+A D+M D-A D-M 010011 JGE 0 1 1 A-D M-D JLT 100 D&A D&M ONE DIA D❘M 0 1 0 1 0 1 JLE a-0 a-1 JMP j1 j2 j3 A register and RAM[A] A register and D register A register, RAM[A], and D register effect: eno jump 001 if out > jump 0 1 0 if out 0 jump if out 20 jump if out < jump 101 if out 0 jump 110 if out se jump 1 1 1 Unconditional jump Recall the two Assembly Instructions, A and C: The A-instruction Syntax: @value The C-instruction Where value is either: a a non-negative decimal constant or dest comp; jump (both dest and jump are optional) where: aa symbol referring to such a constant (later) comp= Semantics: dest=null, M, D, MD, A, AM, AD, AMD ⚫Sets the A register to value ⚫Side effect: RAM[A] becomes the selected RAM register Example: @21 Effect: Sets the A register to 21 RAM[21] becomes the selected RAM register e, 1, -1, D, A, ID, IA, D, -A, D+1, A+1, D-1, A-1, D+A, D-A, A-D, D&A, DIA M, IM, -M, M+1, M-1, D+M, D-M, M-D, D&M, DIM. M refers to RAM[A] jump null, GT, JEQ, JGE, LT, JNE, JLE, JMP Semantics: Compute the value of comp Stores the result in dest; If the Boolean expression (comp jump 0) is true, jumps to execute the instruction stored in ROM[A]. if (comp jump 0) jump to execute the instruction in ROM[A] Directions: Complete the translation from Assembly to Machine code for the following instructions. parts @1 values parts values @SCREEN //@_ parts @KBD//@ values parts @R5//@ values parts values A=-1 parts values A=D A=M parts values

Systems Architecture
7th Edition
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Stephen D. Burd
Chapter2: Introduction To Systems Architecture
Section: Chapter Questions
Problem 4VE: A problem-solving procedure that requires executing one or more comparison and branch instructions...
Question

please help me  fill out the chart to translate assembly to machine code using the picture for context

The A-instruction: symbolic and binary syntax
Semantics: Set the A register to value
Symbolic syntax:
@value
Where value is either:
a non-negative decimal constant
≤32767 (=215-1) or
a symbol referring to such a constant (later)
Example:
@21
Effect: sets the A register to 21
Binary syntax: Ovvvvvvvvvvvvvvvv
For example: @21
(symbolic syntax-
assembly code)
0000000000010101
(binary syntax-
machine code)
Symbolic syntax:
dest = comp; jump
Binary syntax:
1 1 1 a c1 c2 c3 c4 c5 c6 d1 d2 d3 j1 j2 j3
dest d1 d2 d3 effect: the value is stored in:
The value is not stored
1 RAM[A]
10D register
0 1 1 RAM[A] and D register
A register
101
1 1 0
comp
c1 c2 c3 c4 c5 c6
0
101 010
null
1
-1
1 1 1 1 1 1
1 1 1 0 1 0
M
D
D
0 0 1 1 0 0
MD
A
M
1 1 0 0 0 0
A
1
ID
0 0 110
1
AM
IA
IA
IM
1 1 0 0 0 1
AD
0
-D
001111
AMD
1 1 1
A
-A
-M
D+1
1 1 0 0 1 1
01 1 1 1 1
jump
A+1
M+1
D-1
1 10 11 1
001110
null
A-1
M-1
110010
JGT
JEQ
D+A
D+M
D-A
D-M
010011
JGE
0 1 1
A-D
M-D
JLT
100
D&A
D&M
ONE
DIA
D❘M
0 1 0 1 0 1
JLE
a-0
a-1
JMP
j1 j2 j3
A register and RAM[A]
A register and D register
A register, RAM[A], and D register
effect:
eno jump
001 if out > jump
0 1 0 if out 0 jump
if out 20 jump
if out < jump
101 if out 0 jump
110
if out se jump
1 1 1 Unconditional jump
Recall the two Assembly Instructions, A and C:
The A-instruction
Syntax:
@value
The C-instruction
Where value is either:
a a non-negative decimal constant or
dest comp; jump
(both dest and jump are optional)
where:
aa symbol referring to such a constant (later)
comp=
Semantics:
dest=null, M, D, MD, A, AM, AD, AMD
⚫Sets the A register to value
⚫Side effect: RAM[A] becomes the selected RAM register
Example: @21
Effect:
Sets the A register to 21
RAM[21] becomes the selected RAM register
e, 1, -1, D, A, ID, IA, D, -A, D+1, A+1, D-1, A-1, D+A, D-A, A-D, D&A, DIA
M, IM, -M,
M+1, M-1, D+M, D-M, M-D, D&M, DIM.
M refers to RAM[A]
jump null, GT, JEQ, JGE, LT, JNE, JLE, JMP
Semantics:
Compute the value of comp
Stores the result in dest;
If the Boolean expression (comp jump 0) is true,
jumps to execute the instruction stored in ROM[A].
if (comp jump 0) jump to execute
the instruction in ROM[A]
Transcribed Image Text:The A-instruction: symbolic and binary syntax Semantics: Set the A register to value Symbolic syntax: @value Where value is either: a non-negative decimal constant ≤32767 (=215-1) or a symbol referring to such a constant (later) Example: @21 Effect: sets the A register to 21 Binary syntax: Ovvvvvvvvvvvvvvvv For example: @21 (symbolic syntax- assembly code) 0000000000010101 (binary syntax- machine code) Symbolic syntax: dest = comp; jump Binary syntax: 1 1 1 a c1 c2 c3 c4 c5 c6 d1 d2 d3 j1 j2 j3 dest d1 d2 d3 effect: the value is stored in: The value is not stored 1 RAM[A] 10D register 0 1 1 RAM[A] and D register A register 101 1 1 0 comp c1 c2 c3 c4 c5 c6 0 101 010 null 1 -1 1 1 1 1 1 1 1 1 1 0 1 0 M D D 0 0 1 1 0 0 MD A M 1 1 0 0 0 0 A 1 ID 0 0 110 1 AM IA IA IM 1 1 0 0 0 1 AD 0 -D 001111 AMD 1 1 1 A -A -M D+1 1 1 0 0 1 1 01 1 1 1 1 jump A+1 M+1 D-1 1 10 11 1 001110 null A-1 M-1 110010 JGT JEQ D+A D+M D-A D-M 010011 JGE 0 1 1 A-D M-D JLT 100 D&A D&M ONE DIA D❘M 0 1 0 1 0 1 JLE a-0 a-1 JMP j1 j2 j3 A register and RAM[A] A register and D register A register, RAM[A], and D register effect: eno jump 001 if out > jump 0 1 0 if out 0 jump if out 20 jump if out < jump 101 if out 0 jump 110 if out se jump 1 1 1 Unconditional jump Recall the two Assembly Instructions, A and C: The A-instruction Syntax: @value The C-instruction Where value is either: a a non-negative decimal constant or dest comp; jump (both dest and jump are optional) where: aa symbol referring to such a constant (later) comp= Semantics: dest=null, M, D, MD, A, AM, AD, AMD ⚫Sets the A register to value ⚫Side effect: RAM[A] becomes the selected RAM register Example: @21 Effect: Sets the A register to 21 RAM[21] becomes the selected RAM register e, 1, -1, D, A, ID, IA, D, -A, D+1, A+1, D-1, A-1, D+A, D-A, A-D, D&A, DIA M, IM, -M, M+1, M-1, D+M, D-M, M-D, D&M, DIM. M refers to RAM[A] jump null, GT, JEQ, JGE, LT, JNE, JLE, JMP Semantics: Compute the value of comp Stores the result in dest; If the Boolean expression (comp jump 0) is true, jumps to execute the instruction stored in ROM[A]. if (comp jump 0) jump to execute the instruction in ROM[A]
Directions: Complete the translation from Assembly to Machine code
for the following instructions.
parts
@1
values
parts
values
@SCREEN //@_
parts
@KBD//@
values
parts
@R5//@
values
parts
values
A=-1
parts
values
A=D
A=M
parts
values
Transcribed Image Text:Directions: Complete the translation from Assembly to Machine code for the following instructions. parts @1 values parts values @SCREEN //@_ parts @KBD//@ values parts @R5//@ values parts values A=-1 parts values A=D A=M parts values
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:
9780357392676
Author:
FREUND, Steven
Publisher:
CENGAGE L
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Principles of Information Systems (MindTap Course…
Principles of Information Systems (MindTap Course…
Computer Science
ISBN:
9781285867168
Author:
Ralph Stair, George Reynolds
Publisher:
Cengage Learning