3.SAP-2 Computer Architecture
3.SAP-2 Computer Architecture
Computer (SAP-2)
Reference: Malvino . Brown C h a p t e r 11
@Hossain
Comparison between SAP1 & SAP2 Computer
Architecture
SAP1 SAP2
Input block 1 2
Output block 1 2
Flags No Yes
Instructions 4 42
@Hossain
Types of instruction
@Hossain
Data Transfer Instruction
Name Mnemonic
Load LD
Store ST
Move MOV
Exchange XCH
Input IN
Output OUT
Push PUSH
Pop POP
@Hossain
Data Manipulation Instruction
@Hossain
Program control Instruction
Name Mnemonic
Jump Jump
Call CALL
skip SKP
@Hossain
SAP2
Instructions
(42)
@Hossain
Mnemonics and Op-code
@Hossain
Mnemonics and Op-code
Mnemonics Op code Mnemonics Op code
MOV A,B 78H ORA C B1H
MOV A , C 79H ORI byte F6H
MOV B,A 47H OUT byte D3H
MOV B,C 41H RAL 17H
MOV C , A 4FH RAR 1FH
MOV C,B 48H RET C9H
MVI A,byte 3EH STA address 32H
MVI B,byte 06H SUB B 90H
MVI C,byte 0EH SUB C 91H
NOP 00H XRA B A8H
ORA B B0H XRA C A9HH
@Hossain
Memory-Reference
Instructions
@Hossain
LDA
@Hossain
ST
A
@Hossain
MVI
@Hossain
MVI
@Hossain
Problem
@Hossain
Solution Machine Code
Assembly Code
@Hossain
Register
Instructions
@Hossain
MOV
@Hossain
MOV
@Hossain
ADD and SUB
@Hossain
ADD and SUB
@Hossain
INR and DCR
@Hossain
INR and DCR
@Hossain
Problem
@Hossain
Solution Machine Code
Assembly Code
@Hossain
Logic Instructions
@Hossain
CMA
If,
A= 25H or
00100101
Then,
after executing CMA
A=11011010
@Hossain
ANA and
ORA
@Hossain
ANA and
ORA
@Hossain
ANI
@Hossain
ORI
@Hossain
XRI
@Hossain
JUMP and CALL
Instructions
@Hossain
JMP
@Hossain
JMP
@Hossain
JM, JZ, JNZ
@Hossain
@Hossain
@Hossain
CALL and
RET
C ALL 5000H : Call
the subroutine
starting from 5000H
RET : return, Have to
return to the address
next to the address
where CALL 5000H
was stored
CALL is
unconditional
@Hossain
CALL and
RET
When CALL is
executed, the content
of PC is
automatically saved
in memory locations
FFFEH and FFFFH
Infinite Loop?
@Hossain
Problem
@Hossain
Solution
@Hossain
Assembly version
@Hossain
Problem
@Hossain
Solution
@Hossain
Problem
@Hossain
Solution
@Hossain
Other
Instructions
@Hossain
NOP
HL
T
@Hossain
IN
@Hossain
OUT
@Hossain
RAR and RAL
@Hossain
Problem
@Hossain
Solution
@Hossain
Calculation of
Execution Time of
a Program
@Hossain
Problem
@Hossain
Solution
Total Time:
@Hossain
Problem
@Hossain
Solution
Inner
Loop
Tota
l
Time
@Hossain
Discussion
@Hossain