Академический Документы
Профессиональный Документы
Культура Документы
MOV AX,1234h
MOV DX,5678h
MOV AL,DL
MOV BH,DH
AX = ?
POP Des:
It pops the operand from top of stack to Des.
Des can be a general purpose register, segment register
(except CS) or memory location.
E.g.: POP AX
CODE SEGMENT
ASUME CS: CODE, DS: CODE
ORG 1000H
MOV CX, 0065H
MOV AX, 0092H
OUT PORT0, AX
MOV AX, CX
OUT PORT1, AX
INT 3
CODE ENDS
END
• SAHF:
– It copies the contents of AH to lower byte of flag register.
• PUSHF:
– Pushes flag register to top of stack.
• POPF:
– Pops the stack top to flag register.
CODE SEGMENT
ASUME CS: CODE, DS: CODE
ORG 1000H
MOV AX, 1234H
ADD AX, 5678H
INT 3
CODE ENDS
END
• IDIV Src:
– It is a signed division instruction.
MOV AX,4022h ;
MOV DX,0000h ;
MOV CX,1000h ;
DIV CX ;AX = 0004
;DX = 0022
Write an Assembly Language Program in 8086 to divide
a 32-bit number by a 16-bit number.
• NOT Src:
– It complements each bit of Src to produce 1’s
complement of the specified operand.
– The operand can be a register or memory
location.
– NOT CX
• RET:
– It returns the control from procedure to calling
program.
– Every CALL instruction should have a RET.
19 February 2019 North Bengal International 62
University
Program Execution Transfer
Instructions
• JMP Des:
– This instruction is used for unconditional jump
from one place to another.
• SCAS String:
– It scans a string.
– It compares the String with byte in AL or with
word in AX.
• CLC:
– It clears the carry flag to 0.
• CMC:
– It complements the carry flag.
• CLD:
– It clears the direction flag to 0.
– If it is reset, the string bytes are accessed from lower
memory address to higher memory address.
ADD AX, BX
JC RUET
EEE:
OR AX, 23H
JNZ LAST
RUET:
MOV CX, 0FC7H
SUB AX,CX
JZ EEE
LAST:
HLT