Answer Final - Exam Microprocessor - ECE341 2022-2023
Answer Final - Exam Microprocessor - ECE341 2022-2023
Page 1 of 4
Q2 (15 points) 2.5 points for each part:
A. Illustrate how 6800 processor differs from basic microprocessor.
Two Accumulators A, B
PC is 16 Bit Register
7 Code registers
16-bit Index Register for Extended Addressing
Page 2 of 4
Q3 (10 points) 5 Points for each Part:
A. Draw flow chart and Write a program starts from (00)16 location, to perform the following task:
-If the number at address 1016 is negative, then store the product of two numbers stored at
addresses 1116, 1216 at address 1316.
- If the number at address 1016 is not negative, then get quotient of dividing the data on
address 1116.over the data stored at 1216, and stores it on address 1316
CLRA
STA
11
LDA
12
BEQ
09
DECA
STA
22
LDA
13
ADD
11
BRA
F1
HLT
B. For the 10 numbers located in location 4016 till 4916, Draw flowchart and Write a program to
count the positive numbers and stores it in address 6116.
10 CLR A
11 STAB
12 61
13 LDAB
14 #10
15 LDX
16 #49
17 LDA X
18 49
19 BPL
1A 05
1B INX
1B DECB
1C BNE
1D 06
1E INC 61
1F BRA
20 F6
Page 3 of 4
Q4 (15 points) 1 point for each part:
In 6800 MPU: Accumulator A has a value of 00001111 Accumulator B has a value of 01010101, Index
Register X has a value of 00110011 01010101
Stack pointer SP has a value of 00100010 10101010
C register has a value of 0
Memory location (0021)16 has a value 01101101. Memory location (0022)16 has a value 00110111
Illustrate the change in registers and memory locations after the execution of each instruction:
No Part result
1. ROLA A=00011111
2. LDAB 0021 B=01101101
3. RORB B= 10101010
4. ASL 0021 (0021)= 00110110
5. LSRB B= 10110110
6. TBA B=A
7. STS 0021 (0021)
(0022)
8. ANDA 0021 (0021)
9. LDX 21 X=
10. EORA 0021 A=
11. BITA 0021 C=0, N=0
12. CMPB 0021 C=0 N=1
13. CBA C=1 N=1
14. TST 0021 C=0 N=1
15. TSTB C=0 , N=0
Page 4 of 4