You are on page 1of 8

11/5/2022

(3)
Branch Group
Dr. Mazin H. Aziz 2nd-Class Microprocessor 11/5/2022 1

11/5/2022 2
Dr. Mazin H. Aziz 2nd-Class Microprocessor

1
11/5/2022

Dr. Mazin H. Aziz 2nd-Class Microprocessor 11/5/2022 3

15 8 7 0

x x x x OF DF IF TF SF ZF x AF x PF x CF

Dr. Mazin H. Aziz 2nd-Class Microprocessor 11/5/2022 4

2
11/5/2022

Dr. Mazin H. Aziz 2nd-Class Microprocessor 11/5/2022 5

Dr. Mazin H. Aziz 2nd-Class Microprocessor 11/5/2022 6

3
11/5/2022

Dr. Mazin H. Aziz 2nd-


Class Microprocessor

11/5/2022 7

Dr. Mazin H. Aziz 2nd-Class Microprocessor 11/5/2022 8

4
11/5/2022

; FE = -- 2 < FF = --1

; SF < > OF

Dr. Mazin H. Aziz 2nd-


Class Microprocessor

11/5/2022 9

Dr. Mazin H. Aziz 2nd-Class Microprocessor 11/5/2022 10

10

5
11/5/2022

Dr. Mazin H. Aziz


2nd-Class
Microprocessor

11/5/2022 11

11

INST. OPERANDS FUNCTION

JUMP to LABLE IF CX=ZERO

Example:
MOV CX, 5
JCXZ LABLE CONT: ADD AL,AL
DEC CX
JCXZ EXIT
JMP CONT
EXIT: MOV RSLT,AL

Dr. Mazin H. Aziz 2nd-Class Microprocessor 11/5/2022 12

12

6
11/5/2022

INST. OPERANDS FUNCTION

DEC CX THEN JUMP to LABLE


LOOP IF CX<>ZERO

LOOPNE DEC CX THEN JUMP to LABLE

LOOPNZ LABLE IF CX<>ZERO AND ZF=0

LOOPE DEC CX THEN JUMP to LABLE


IF CX<>ZERO AND ZF=1
LOOPZ

Dr. Mazin H. Aziz 2nd-Class Microprocessor 11/5/2022 13

13

INST. OPERANDS FUNCTION

JUMP to LABLE
JMP
LABLE
CALL CALL SUBROUTINE STARTED
at IP=LABLE
TOS-2=IP for THE NEXT
INSTRUCTION

NO IP=TOS
RET OPERAND
IP WILL POINTS to THE
INSTRUCTION NEXT TO CALL

Dr. Mazin H. Aziz 2nd-Class Microprocessor 11/5/2022 14

14

7
11/5/2022

1) Write a program that finds the number of repetition of “A” in 100


bytes of memory starting from 30000h.
2) Write a program to compare CX with DX and write the code of “>”,
”<“ or “=“ in AL, if CX > DX, CX < DX or CX = DX respectively.
3) Write a program that fills 1K byte of memory starting from
60050h, by the letter “M”.
4) Write a program to find the “sine(AL)” using XLAT. The LUT
length is 180 bytes and the angles ranges from 1-180. Read the
angles from input-port 20h & write the result to output-port 30h.
5) Write a program that exchanges the 500 bytes stored at 20000h
with the 500 bytes stored at 70000h.
Dr. Mazin H. Aziz 2nd-Class Microprocessor 11/5/2022 15

15

Dr. Mazin H. Aziz 2nd-Class Microprocessor 11/5/2022 16

16

You might also like