Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Standard view
Full view
of .
Look up keyword
Like this
7Activity
P. 1
SAP 3 ARCHITECTURE

SAP 3 ARCHITECTURE

Ratings:

5.0

(1)
|Views: 620|Likes:
Published by esquivelazzej
DOWLOAD HERE: http://adf.ly/aJVg0
======
CENG03, COMPUTER SYSTEM ARCHITECTURE, SAP3, programming model, arithmetic instructions, carry flag instructions. add instructions. adc instructions, add with carry, sub instructions, sbb instructions, subtract with borrow, increments, decrements, rotate, rotate all left, ral, rotate all right, rar, rotate left with carry, rlc, rotate right with carry, rac, multiply and divide by 2, carry flag, sign flag, zero flag, examples, esquivelazzej ----- credits to Engr. J. R.
DOWLOAD HERE: http://adf.ly/aJVg0
======
CENG03, COMPUTER SYSTEM ARCHITECTURE, SAP3, programming model, arithmetic instructions, carry flag instructions. add instructions. adc instructions, add with carry, sub instructions, sbb instructions, subtract with borrow, increments, decrements, rotate, rotate all left, ral, rotate all right, rar, rotate left with carry, rlc, rotate right with carry, rac, multiply and divide by 2, carry flag, sign flag, zero flag, examples, esquivelazzej ----- credits to Engr. J. R.

More info:

Categories:Types, School Work
Published by: esquivelazzej on Feb 19, 2013
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
See more
See less

12/28/2013

 
CENG03. COMPUTERSYSTEM ARCHITECTURE. SAP 3. esquivelazzej
SAP 3
SAP3 instruction set includes all the SAP 2 instructionsplus new instructions.
SAP 3 Programming ModelNote
: The additional CPU registers, D, E, H and L areused for more efficient data processing.The F register stores flag bits: S (sign flag), Z(zero flag) and others.
 ADVANTAGE OF MORE CPU REGISTERS
1.
 
Programs can run faster2.
 
Simplifies program writing
 ARITHMETIC INSTRUCTIONSNote:
CY = CARRY if operation is ADDCY = CARRY if operation is SUB
Note:
The 8-bit sum S
7
……S
0
is stored in theaccumulator. The CY is stored in a special FFcalled CARRY FLAG.
Note:
The CY flag acts like the next higher bit of theaccumulator, i.e. CY = AB
 CARRY FLAG INSTRUCTIONSNote:
There are two instructions that can be used tocontrol the carry flag.1.
 
STC
- SET CARRY 
-
 
will set the CY flag if it is not sete.g. if CY=0, STC produces CY=12.
 
CMC
- COMPLEMENT THE CARRY 
-
 
complements the value of CY 
 ADD INSTRUCTIONS
ADD REG
Example 1:
A = 1111 0001E = 0000 1000
Solution: 
1111 0001+ 0000 10001111 10001
 Answer: 
Example 2:
A = 1111 1111L = 0000 0001
Solution: 
1111 1111+ 0000 0001
 
1 0000 0000
 Answer: 
AFC B CSL D E FHL
CY A
7
A
6
A
5
A
2
A
1
A
0
CY=0 A=1111 1001CY= 1 A=0000 0000
 
CENG03. COMPUTERSYSTEM ARCHITECTURE. SAP 3. esquivelazzej
 ADC INSTRUCTIONS
(ADC = Add with carry)
ADD REG
Example 1:
A = 1000 0011E = 0001 0010CY = 1
Solution: 
1000 0011+ 0001 001011001 0110
 Answer: 
SUB INSTRUCTIONS
SUB REG
Example 1:
A = 0000 1111C = 0000 0001
Solution: 
0000 1111- 0000 00010000 1110
 Answer: 
Example 2:
A = 0000 1100C = 0001 0010
Solution: 
0000 1100- 0001 00101 1111 1010
 Answer: 
SBB INSTRUCTIONS
(SBB = Subtract with borrow)
Note:
It subtracts the contents of a specified registerand the CY flag from the accumulator contents.
Example 1:
A = 1111 1111E = 0000 0010CY = 1
Solution: 
1111 1111- 0000 001011111 1100
 Answer: 
CY=0 A=1001 0110CY=0 A=0000 1110CY=1 A=1111 1010CY=0 A=1111 1100
 
CENG03. COMPUTERSYSTEM ARCHITECTURE. SAP 3. esquivelazzej
INCREMENTS
INR REG
Note:
The INR instruction has no effect on the carryflag, but it does affect the sign flags and zero flags.
Example 1:
B = 1111 1111, andThe initial flags areS=1, Z=0, CY=0
 Answer: 
DECREMENTS
DEC REG
Example 1:
E = 0000 0000S=0, Z=1, CY=0
 Answer: 
ROTATE ALL LEFT (RAL)Note:
The CY flag is included in the rotation of bits.
Example 1:
CY = 1A = 0111 0100
 Answer: 
ROTATE ALL RIGHT (RAR)Note:
The CY flag is included in the rotation of bits.
Example 1:
CY = 1A = 0111 0100
 Answer: 
 
B = 0000 0000S=0, Z=1, CY=0E = 1111 1111S=1, Z=0, CY=0CY=0
A = 1110 1001
CY MSB A LSB
CY=0
A = 1011 1010
CY MSB A LSB

Activity (7)

You've already reviewed this. Edit your review.
1 thousand reads
1 hundred reads
Jorel Labampa liked this
Zahid Mahmood liked this
Zahid Mahmood liked this
Zahid Mahmood liked this

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->