Chapter 4- Machine Language Flashcards

1
Q

What is the name of the program that translate assembly code to binary code?

A

Assembler

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the 3 options to specify and address in assembly code?

A
  1. Direct accessing: express a specific address or use symbol for that address- LOAD R1,67 // R[1] <- 67
  2. Indirect addressing: address mode to handle pointers. The instruction specifies memory location that holds the required address
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Indirect addressing example: x = foo[j];

Write it in assembly

A

Add R1, foo,j // R1 = foo+j
LOAD R2,R1
STR R2, x

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the hack computer?

A

16 bit machine builds from CPU, two memory modules- instruction memory and dat memory and two memory mapped i/o devices.
It also has two registers: D and A. They ar 16 bit

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the instruction memory?

A

It is a read only memory of size 32k 16 bit words

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What D register is used for?

A

To store data.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What A is used for?

A

Data register and address register. Means as address In the data memory or address in the instruction memory.
For the instruction memory, jump operations always effect a jump to the instruction located In the memory address by A.
Goto 35, first set A to 35 and then just goto command

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is M?

A

Memory access instructions operate on an implicit memory location labeled M.
M always refers to the memory word who’s address is the current value of A.
D =Memory[516] - 1 so first set A = 516 and then D = M - 1;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is @value

A

Store value in A. It is the A instruction

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How many commands to I need when memory location is involved?

A

Two: one for selecting the address and the second is to operate on the memory location of that address.
Because of that there is the A instruction and the C instruction
To compute

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What M stands for?

A

memory[A]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the format of C instruction?

A

111a ….

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How to increment memory[7] and also store it in D?

A

@7

MD=M+1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is a prequisiof a jump?

A

That A register holds the value of the instruction line to jump to.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

If there is a jump we should avoid using

A

Register M because it can get conflicted with the A register that holds the place to jump.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is the location of the base memory of the screen?

A
  1. It has 8k rows
17
Q

How is each screen line represented in the computer and from where?

A
From to left.
Each row has 32 16bit arrays.
Pixel in Row r from the top and column c from the left is:
Mapped to c%16 bit of the array in
RAM[16384 + r*32 + c/16]
18
Q

What is the address of the keyboard and how Does it map?

A

The address is 24576 and each time a key is pressed, the ASCII of the key appears at memory[24576]

19
Q

What is (symbol)?

A

It’s a pseudo command that causes the assembler to assign the label symbol to the memory location in which the next command of the program will be stored. It generated NO machine code