)Branching,
The branching
instructions alter normal sequential program flow, either unconditionally or
conditionally. The unconditional branching instructions are as follows:
JMP Jump
CALL Call
RET Return
Conditional branching instructions examine the status of one of four condition flags to determine whether the specified branch is to be executed. The conditions that may be specified are as follows:
NZ Not Zero (Z = 0)
Z Zero (Z = 1)
NC No Carry (C = 0)
C Carry (C = 1)
PO Parity Odd (P = 0)
PE Parity Even (P = 1)
P Plus (S = 0)
M Minus (S = 1)
Thus, the conditional branching instructions are specified as follows:
Jumps Calls Returns
C CC RC (Carry)
INC CNC RNC (No Carry)
JZ CZ RZ (Zero)
JNZ CNZ RNZ (Not Zero)
JP CP RP (Plus)
JM CM RM (Minus)
JPE CPE RPE (Parity Even)
JP0 CPO RPO (Parity Odd)
Two other instructions can affect a branch by replacing the contents or the program counter:
PCHL Move H & L to Program Counter
RST Special Restart Instruction Used
with Interrupts
Stack I/O, and Machine Control Instructions:
The following instructions affect the Stack and/or Stack Pointer:
PUSH Push Two bytes of Data onto the Stack
POP Pop Two Bytes of Data off the Stack
XTHL Exchange Top of Stack with H & L
SPHL Move content of H & L to Stack Pointer
The I/0 instructions are as follows:
IN Initiate Input Operation
OUT Initiate Output Operation
The Machine Control instructions are as follows:
EI Enable Interrupt System
DI Disable Interrupt System
HLT Halt
NOP No Operations
JMP Jump
CALL Call
RET Return
Conditional branching instructions examine the status of one of four condition flags to determine whether the specified branch is to be executed. The conditions that may be specified are as follows:
NZ Not Zero (Z = 0)
Z Zero (Z = 1)
NC No Carry (C = 0)
C Carry (C = 1)
PO Parity Odd (P = 0)
PE Parity Even (P = 1)
P Plus (S = 0)
M Minus (S = 1)
Thus, the conditional branching instructions are specified as follows:
Jumps Calls Returns
C CC RC (Carry)
INC CNC RNC (No Carry)
JZ CZ RZ (Zero)
JNZ CNZ RNZ (Not Zero)
JP CP RP (Plus)
JM CM RM (Minus)
JPE CPE RPE (Parity Even)
JP0 CPO RPO (Parity Odd)
Two other instructions can affect a branch by replacing the contents or the program counter:
PCHL Move H & L to Program Counter
RST Special Restart Instruction Used
with Interrupts
Stack I/O, and Machine Control Instructions:
The following instructions affect the Stack and/or Stack Pointer:
PUSH Push Two bytes of Data onto the Stack
POP Pop Two Bytes of Data off the Stack
XTHL Exchange Top of Stack with H & L
SPHL Move content of H & L to Stack Pointer
The I/0 instructions are as follows:
IN Initiate Input Operation
OUT Initiate Output Operation
The Machine Control instructions are as follows:
EI Enable Interrupt System
DI Disable Interrupt System
HLT Halt
NOP No Operations
e) Miscellaneous
i) STACK
the stack is defined as a set of
memory location in R/W memory specified by a program in main memory these main
memory are used to store binary information temporarily during execution of
the program. The beginning of the stack
in the program by usin g the instructin LXI SP,!6 bit address.
Once the stackj location has been defined it loads the 16 bit
address in the stack pointer register.
Some
left
ii) Push RP/PSW
·
Store
content of register pair in the stack
·
1
byte instruction
·
Copies
the content of specified register pair or program status word i.e. PSW,
accumulator and flag an the stagment
·
Stack
pointer is increment and the content of higher order register is copied .Then
it is again decremented and content of lower order is copied.
iii) POP RP/PSW
retrieve register Pair from stack
1 byte instruction register pair
or program status word
Lapes the content of the top to
memory locations on the stack into specified register pair or program status
word.
Content of memory location indicated by the SP
is copied into low order register and sp is incremented by 1figure ok …………….
Then the content of memory
locationspecified by sp is copied into high order register and sp is
incremented by one .
No comments:
Post a Comment
its cool