Professional Documents
Culture Documents
Flow Control Instructions: The JUMP Instruction
Flow Control Instructions: The JUMP Instruction
Example:
CMP JL AX, BX BELOW
What is difference between CMP and TEST instruction?
True-branch statement
False-branch statements
True-branch statement
ELSE_ : EXIT_ :
Statements
printf(*);
Dec. count
False count = 0
True
LOOP TOP
Code in C
int i = 0; while ( gectchar(ch[i]) !=\n) i++;
Statements
WHILE_: CMP AL, 0DH JE END_WHILE INC CX INT 21H JMP WHILE_ END_WHILE :
Pseudo code :
REPEAT read a character UNTIL character is blank
switch (ch) { case 1 : printf(1); break; case 2 : printf(2); break; default : printf(Quit); }
MOV AH, 9 LEA DX, MSG2 INT 21H MOV AX, BX CALL OUTDEC
EXIT: