Chapter 28 Low-level Programming Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

Which are the Data movement instructions used in the Processor?

A

LDM #n //Immediate addressing. Load the number n to ACC

LDD <address> //Direct addressing. Load the contents of the location at the given address to ACC

LDI <address> //Indirect addressing. The address to be used is at the given address. Load the contents of this second address to ACC

LDX <address> //Indexed addressing. Form the address from <address>+ the contents of the index register. Copy the contents of this calculated address to ACC

LDR #n //Immediate addressing. Load the number to IX
STO <address> //Immediate addressing. Load the number n to IX

STX <address> //Indexed addressing. Form the address from <address>+ the contents of the index • register. Copy the contents from ACC to this calculated address

STI <address> //Indirect addressing. The address to be used is at the given address. Store the contents of ACC at this second address
</address></address></address></address></address></address></address></address>

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

Which are the Arithmetic operations used in the Processor?

A

ADD <address> //Add the contents of the given address to the ACC

INC //Add 1 to the contents of the register (Ace or IX)

DEC //Subtract 1 from the contents of the register (ACC or IX) </address>

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

Which are the Comparison and jump instructions used in the Processor?

A

JMP <address> //Jump to the given address

CMP <address> //Compare the contents of ACC with the contents of <address>

CMP #n //Compare the contents of ACC with n

JPE <address> //Following a compare instruction,jump to <address> if the compare was True

JPN <address> //Following a compare instruction, jump to <address> if the compare was False </address></address></address></address></address></address></address>

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

Which are the Input and output instructions used in the Processor?

A

IN //Key in a character and store its ASCII value in ACC

OUT //Output to the screen the character whose ASCII value is stored in ACC

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

Which are the Bit manipulation instrcutions used in the Processor?

A

AND #n //Bitwise AND operation of the contents of Ace with the operand

AND <address> //Bitwise AND operation of the contents of ACC with the contents of <address>

XOR #n //Bitwise OR operation of the contents of Ace with the operand

XOR <address> //Bitwise XOR operation of the contents of Ace with the operand

OR #n //Bitwise OR operation of the contents of ACC with the operand

OR <address> //Bitwise OR operation of the contents of ACC with the contents of <address>

LSL #n //Bits in Ace are shifted n places to the left. Zeros are introduced on the right hand end

LSR #n //Bits in Ace are shifted n places to the right. Zeros are introduced on the left hand end
</address></address></address></address></address>

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

Which is the instruction used to return control to the operating system?

A

END //Retrun control to the operating by ending the process

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

What is the structure of an instruction?

A

:

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

What is the structure of assigning data to a label?

A

:

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

What does in the assembly code in this chapter ACC mean?

A

Accumulator

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

What does in the assembly code in this chapter IX mean?

A

Indexed Register

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

What does in the assembly code in this chapter # mean?

A

Immediate addressing

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

What does in the assembly code in this chapter B mean?

A

A binary number

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

When & occurs what does it mean?

A

When & occurs it means that a hexadecimal code is written for example &4A

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

What does in the assembly code in this chapter <address> mean?</address>

A

<address> can be an absolute address or a symbolic address</address>

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

How to assign 34 to A in assembly code?

A

LDM #34

STO A

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

Show an example of adding a value in assembly code?

A

LDD B
ADD A
STO B

17
Q

Show an example of incrementing a value in assembly code?

A

LDD B
INC ACC
STO B

18
Q

Show an example of making a negative value in assembly code?

A

LDD A
XOR #&FF
INC ACC
STO A

19
Q

Show two examples of making an IF statement in assembly code?

A
// first example
LDD A #
 CMP #0 
 JPN ENDIF 
 THEN: LDD B 
 INC ACC 
 STO B 
 ENDIF: ...
// second example
LDD A 
 XOR #&amp;FF 
 INC ACC 
 ADD B 
 CMP #0 
 JPN ELSE 
 THEN: LDM #89 
 OUT 
 JMP ENDIF 
 ELSE: LDM #78 
 OUT 
 ENDIF:...
20
Q

Show an examples of making a REPETITION in assembly code?

A
 LDM #0 
 STO A 
 LOOP: LDM #42 
 OUT 
 LDD A 
 INC ACC 
 STO A 
 CMP #5 
 JPN LOOP
21
Q

Show an examples of making an INPUT in assembly code?

A

IN

STO A

22
Q

Show an examples of making an OUTPUT in assembly code?

A
LDR #-1 
 LOOP: INC IX 
 LDX B 
 OUT 
 CMP #13 
 JPN LOOP
23
Q

Show an examples of inputing A as a longer string in assembly code?

A
LDR #-1 
 LOOP: INC IX 
 IN 
 STX A 
 CMP #13 
 JPN LOOP
24
Q

What kind of address is an absolute address?

A

An absolute address is a numeric address meaning that it can only point to one exact point or address

25
Q

What is a relative address and how does it work?

A

A relative address is an address that is relative to a base address so depending on the base address it can point to an address and when the base address changes so does the point or address to which it points

26
Q

Write or say an example of a code that uses relative addressing.

A
LDM #0 
 STO [BR] + 10 
 LDM #42 
 OUT 
 LDD [BR] + 10 
 INC ACC 
 STO [BR] + 10 
 CMP #5 
 JPN [BR] + 2 
 END 
 0
27
Q

What happens in indirect addressing?

A

In indirect addressing the address to be used is at a given address.