Presentation is loading. Please wait.

Presentation is loading. Please wait.

Arithmetic Instructions By Dr. S. N. Sampat, Team leader Ms. R. P

Similar presentations


Presentation on theme: "Arithmetic Instructions By Dr. S. N. Sampat, Team leader Ms. R. P"— Presentation transcript:

1 Arithmetic Instructions By Dr. S. N. Sampat, Team leader Ms. R. P
Arithmetic Instructions By Dr. S. N. Sampat, Team leader Ms. R. P. Merchant, Member Mr. A. K. Bilakhia, Member RC-1093 , Group-004, Domain-Electrical and Allied branches Team for OER creation IDP in Educational Technology, IIT Bombay Four-Week ISTE STTP on Use of ICT in Education for Online and Blended Learning

2 Learning Objectives for Arithmetic Instructions
Define Arithmetic instruction. Define status of source and destination registers before and after execution of Arithmetic instruction Define status of flags after execution of Arithmetic instruction. Apply different Arithmetic instructions to achieve same operation. Four-Week ISTE STTP on Use of ICT in Education for Online and Blended Learning

3 Arithmetic Instructions
These instructions perform the operations like: Addition Subtraction Increment Decrement Four-Week ISTE STTP on Use of ICT in Education for Online and Blended Learning

4 Arithmetic Instructions
ADD R ADD M The contents of register or memory are added to the contents of accumulator. The result is stored in accumulator. If the operand is memory location, its address is specified by H-L pair. Example: ADD C or ADD M Four-Week ISTE STTP on Use of ICT in Education for Online and Blended Learning

5 Arithmetic Instructions
BEFORE EXECUTION AFTER EXECUTION A 20 A 50 ADD C A=A+R B C 30 D E H L B C 30 D E H L Four-Week ISTE STTP on Use of ICT in Education for Online and Blended Learning

6 Arithmetic Instructions
BEFORE EXECUTION AFTER EXECUTION ADD M A=A+M A 20 A 30 B C D E H 20 L 50 B C D E H 20 L 50 2050H 2050H 10 10 Four-Week ISTE STTP on Use of ICT in Education for Online and Blended Learning

7 Arithmetic Instructions
ADC R ADC M The contents of register or memory and Carry Flag (CY) are added to the contents of accumulator. The result is stored in accumulator. If the operand is memory location, its address is specified by H-L pair. All flags are modified to reflect the result of the addition. Example: ADC C or ADC M Four-Week ISTE STTP on Use of ICT in Education for Online and Blended Learning

8 Arithmetic Instructions
BEFORE EXECUTION AFTER EXECUTION CY 1 CY A 50 A 71 B C 20 D E H L B C 20 D E H L ADC C A=A+R+CY Four-Week ISTE STTP on Use of ICT in Education for Online and Blended Learning

9 Arithmetic Instructions
BEFORE EXECUTION AFTER EXECUTION 30 30 CY 1 CY ADC M A=A+M+CY 2050H 2050H A 20 A 51 H 20 L 50 H 20 L 50 Four-Week ISTE STTP on Use of ICT in Education for Online and Blended Learning

10 Arithmetic Instructions
ADI 8-bit data The 8-bit data is added to the contents of accumulator. The result is stored in accumulator. Example: ADI 10 H Four-Week ISTE STTP on Use of ICT in Education for Online and Blended Learning

11 Arithmetic Instructions
BEFORE EXECUTION AFTER EXECUTION ADI 10H A=A+DATA(8) A 50 A 60 Four-Week ISTE STTP on Use of ICT in Education for Online and Blended Learning

12 Arithmetic Instructions
ACI 8-bit data The 8-bit data and the Carry Flag (CY) are added to the contents of accumulator. The result is stored in accumulator. Example: ACI 20 H Four-Week ISTE STTP on Use of ICT in Education for Online and Blended Learning

13 Arithmetic Instructions
BEFORE EXECUTION AFTER EXECUTION ACI 20H A=A+DATA (8)+CY CY 1 CY A 30 A 51 Four-Week ISTE STTP on Use of ICT in Education for Online and Blended Learning

14 Arithmetic Instructions
DAD Register pair The 16-bit contents of the register pair are added to the contents of H-L pair. The result is stored in H-L pair. If the result is larger than 16 bits, then CY is set. Example: DAD D Four-Week ISTE STTP on Use of ICT in Education for Online and Blended Learning

15 Arithmetic Instructions
BEFORE EXECUTION AFTER EXECUTION CY CY SP SP DAD D HL=HL+R B C D 10 E 20 H L 50 B C D 10 E 20 H 30 L 70 Four-Week ISTE STTP on Use of ICT in Education for Online and Blended Learning

16 Arithmetic Instructions
SUB R SUB M The contents of the register or memory location are subtracted from the contents of the accumulator. The result is stored in accumulator. If the operand is memory location, its address is specified by H-L pair. Example: SUB B or SUB M Four-Week ISTE STTP on Use of ICT in Education for Online and Blended Learning

17 Arithmetic Instructions
AFTER EXECUTION BEFORE EXECUTION A 50 A 20 B 30 C D E H L SUB B A=A-R B 30 C D E H L Four-Week ISTE STTP on Use of ICT in Education for Online and Blended Learning

18 Arithmetic Instructions
AFTER EXECUTION BEFORE EXECUTION 10 10 1020H A 50 1020H A 40 SUB M A=A-M H 10 L 20 H 10 L 20 Four-Week ISTE STTP on Use of ICT in Education for Online and Blended Learning

19 Arithmetic Instructions
SBB R SBB M The contents of the register or memory location and Borrow Flag (i.e.CY) are subtracted from the contents of the accumulator. The result is stored in accumulator. If the operand is memory location, its address is specified by H-L pair. Example: SBB C or SBB M Four-Week ISTE STTP on Use of ICT in Education for Online and Blended Learning

20 Arithmetic Instructions
AFTER EXECUTION BEFORE EXECUTION CY 1 CY A 40 A 19 SBB C A=A-R-CY B C 20 D E H L B C 20 D E H L Four-Week ISTE STTP on Use of ICT in Education for Online and Blended Learning

21 Arithmetic Instructions
AFTER EXECUTION BEFORE EXECUTION 10 10 CY 1 CY 2050H 2050H A 50 A 39 SBB M A=A-M-CY H 20 L 50 H 20 L 50 Four-Week ISTE STTP on Use of ICT in Education for Online and Blended Learning

22 Arithmetic Instructions
SUI 8-bit data OPERATION: A=A-DATA(8) The 8-bit immediate data is subtracted from the contents of the accumulator. The result is stored in accumulator. Example: SUI 45 H Four-Week ISTE STTP on Use of ICT in Education for Online and Blended Learning

23 Arithmetic Instructions
SBI 8-bit data The 8-bit data and the Borrow Flag (i.e. CY) is subtracted from the contents of the accumulator. The result is stored in accumulator. Example: SBI 20 H Four-Week ISTE STTP on Use of ICT in Education for Online and Blended Learning

24 Arithmetic Instructions
AFTER EXECUTION BEFORE EXECUTION SBI 20H A=A-DATA(8)-CY CY CY 1 A 29 A 50 Four-Week ISTE STTP on Use of ICT in Education for Online and Blended Learning

25 Arithmetic Instructions
INR R INR M The contents of register or memory location are incremented by 1. The result is stored in the same place. If the operand is a memory location, its address is specified by the contents of H-L pair. Example: INR B or INR M Four-Week ISTE STTP on Use of ICT in Education for Online and Blended Learning

26 Arithmetic Instructions
BEFORE EXECUTION BEFORE EXECUTION AFTER EXECUTION A A A INR B R=R+1 B 10 C D E H L B 10 C D E H L B 11 C D E H L Four-Week ISTE STTP on Use of ICT in Education for Online and Blended Learning

27 Arithmetic Instructions
BEFORE EXECUTION AFTER EXECUTION 31 30 INR M M=M+1 H 20 L 50 H 20 L 50 2050H 2050H Four-Week ISTE STTP on Use of ICT in Education for Online and Blended Learning

28 Arithmetic Instructions
INX Rp The contents of register pair are incremented by 1. The result is stored in the same place. Example: INX H Four-Week ISTE STTP on Use of ICT in Education for Online and Blended Learning

29 Arithmetic Instructions
BEFORE EXECUTION AFTER EXECUTION INX H RP=RP+1 SP SP B C D E H 11 L 21 B C D E H 10 L 20 Four-Week ISTE STTP on Use of ICT in Education for Online and Blended Learning

30 Arithmetic Instructions
DCR R DCR M The contents of register or memory location are decremented by 1. The result is stored in the same place. If the operand is a memory location, its address is specified by the contents of H-L pair. Example: DCR E or DCR M Four-Week ISTE STTP on Use of ICT in Education for Online and Blended Learning

31 Arithmetic Instructions
BEFORE EXECUTION AFTER EXECUTION A A B C D E 20 H L DCR E R=R-1 B C D E 19 H L Four-Week ISTE STTP on Use of ICT in Education for Online and Blended Learning

32 Arithmetic Instructions
BEFORE EXECUTION AFTER EXECUTION 20 21 DCR M M=M-1 H 20 L 50 H 20 L 50 2050H 2050H Four-Week ISTE STTP on Use of ICT in Education for Online and Blended Learning

33 Arithmetic Instructions
DCX Rp The contents of register pair are decremented by 1. The result is stored in the same place. Example: DCX D Four-Week ISTE STTP on Use of ICT in Education for Online and Blended Learning

34 Arithmetic Instructions
BEFORE EXECUTION AFTER EXECUTION SP SP DCX D RP=RP-1 B C D 10 E 19 H L B C D 10 E 20 H L Four-Week ISTE STTP on Use of ICT in Education for Online and Blended Learning

35 Thank you all Four-Week ISTE STTP on Use of ICT in Education for Online and Blended Learning


Download ppt "Arithmetic Instructions By Dr. S. N. Sampat, Team leader Ms. R. P"

Similar presentations


Ads by Google