Professional Documents
Culture Documents
SCHOOL OF ENGINEERING
AND ARCHITECTURE
LABORATORY MANUAL
Activity 3
GENERAL ARITHMETIC AND CPU CONTROL INSTRUCTIONS
1. Complete ‘Machine Code’ column of the following program. The program adds
two 8-bit numbers, stored at memory locations 8100H adn 8101H. Results of the
addition is stored at memory location 8102H.
Address Machine Code Mnemonic
8000 3A LD A,(8100H)
8001 00
8002 81
8003 47 LD B,A
8004 3A LD A,(8101H)
8005 01
8006 81
8008 32 LD (8102H),A
8009 02
800A 81
800B 76 HALT
2. Enter the numbers in Table 3-1 into the memory locations, run the program, and
record results in the table. Complete all four tests.
Table 3-1
Test Addend Adder Results (Point Results (Point
nbr. number number 2) (8102H) 4) (8102H)
(8100H) (8101H)
LABORATORY MANUAL
8000 21 LD HL,8100H
8001 00
8002 81
8003 7E LD A,(HL)
8004 23 INC HL
8006 27 DAA
8007 32 LD (8102H),A
8008 02
8009 81
800A 76 HALT
4. Enter numbers in Table 3-1 into the memory locations, run the program, and
record results in the table. Complete all four tests.
8000 21 LD HL,8200H
8001 00
8002 82
8003 7E LD A,(HL)
8004 23 INC HL
8006 00 NOP
8007 32 LD (8202H),A
8008 02
8009 82
800A 76 HALT
6. Enter numbers in Table 3-2 into the memory locations, run the program, and
record results in the table. Complete all four tests.
Table 3-2
Test Minuend Subtrahend Results (Point Results (Point
nbr. (8200H) (8201H) 6) (8202H) 7) (8202H)
LABORATORY MANUAL
3 27H 19H 0EH D8H
8000 3A LD A,(8100H)
8001 00
8002 81
8003 2F CPL
8004 32 LD (8101H),A
8005 01
8006 81
9. Enter numbers in Table 3-3 into the memory location 8100H, run the program,
and record results in the table. Complete all three tests.
Table 3-3
Test Number Results
nbr. (8100H) (Binary nbr)
(8101H)
1 01100101B 65 9BH
2 10011010B 9A 66H
3 01010101B 55 ABH
8000 3A LD A,(8200H)
8001 00
8002 82
8003 ED NEG
8004 44
8005 32 LD (8201H),A
8006 01
8007 82
11.Enter data in Table 3-4 into the memory location 8200H, run the program,
observe content of location 8201H, and record results in the table. Complete all
four tests.
ELECTRONICS ENGINEERING DEPARTMENT ECE3211L: DIGITAL ELECTRONICS 2
MICROPROCESSOR AND MICROCONTROLLER SYSTEMS (LAB)
LABORATORY MANUAL
Table 3-4
Test Data (8200H) Results (8201H)
Nbr.
DEC HEX BINARY DEC HEX BINARY
1 00 00 00000000B 00 0 0
2 01 01 00000001B -01 1 1
3 02 02 00000010B -02 2 2