Assembly Language(1.2.4 c) Flashcards

1
Q

What is assembly language?

A

when a program is executing the processor receives instructions from RAM in a sequential order
these instructions are coded in assembly language
decode unit takes assembly language instruction in binary and decodes them into a valid operation

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

What is Little Man Computer(LMC)?

A

an instruction set designed for educational purposes
contains 11 instructions(mnemonic) to demonstrate important concepts or tracing and writing assembly code

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

ADD

A

add
0001
1

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

SUB

A

subtract
0010
2

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

STA

A

store
0011
3

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

LDA

A

load
0101
5

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

BRA

A

branch always
0110
6

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

BRZ

A

branch if zero
0111
7

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

BRP

A

branch if positive
1000
8

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

INP

A

input
1001 1001
9(1)

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

OUT

A

output
1001 0010
9(2)

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

HLT

A

end program
0000
0

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

DAT

A

data location

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

What is tracing?

A

the process of following the flow of information through each line of program and calculating values or outputs that would occur

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

00 INP
01 STA 05
02 INP
03 ADD 05
04 OUT
05 DAT 00(gets overwritten)

A

takes input from user
stores inputted data in memory location 05
takes a second input from the user
adds value stored in location 05
outputs result to the console

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

INP(LMC and registers)

A

loads data inputted by user dirrectyly into the ACC

17
Q

STA(LMC and registers)

A

sends data from ACC to RAM via MAR and MDR

18
Q

LDA(LMC and registers)

A

reads data from RAM via MAR and MDR into ACC

19
Q

OUT(LMC and registers)

A

send value currently in ACC to the console

20
Q

ADD(LMC and registers)

A

takes data from RAM via MAR and MDR and adds to value currently in ACC

21
Q

SUB(LMC and registers)

A

takes data from RAM via the MAR and MDR and subtracts it from the value currently in the ACC

22
Q

BRA,BRP,BRZ(LMC and registers)

A

may instruct the Program Counter (PC) to change the address of the next instruction, which then gets passed to the MAR

23
Q

Branching

A

there is no multiplication or subtraction so loops of repeated adding and subtracting are needed
there are no while loops so BRA, BRZ and BRP are used

24
Q

Branching BRA

A

indicates that the memory location in the operand should be the next line executed regardless of the value of the ACC

25
Branching BRZ
indicates that the memory location in the operand should be the next line executed if the ACC is currently 0, otherwise continue executing lines in sequence
26
Branching BRP
indicates that the memory location in the operand should be executed if the ACC is not negative, otherwise continue executing lines in sequence