Sie sind auf Seite 1von 25

V Jump Instruction

a)JMP address
b)Conditional jump instruction
c)PCHL
V Call and return instruction
a)JMP address
b)Conditional jump instruction
c)PCHL
V Restart instruction
a)RST N
V @nconditional jump to the address specified
along with the instruction.
V Operation : Address->PC
V No.of Bytes:3Bytes
V Flags :No flags are modified
V Example: JMP C200 H before execution
C005 OPCODE
C006 00 C005
C007 C2 PC
after execution
C200
PC
V In conditional JMP instruction when the
condition is true then only Jump is made to
specified address.
V If it is false next instruction is executed.
V No.of bytes:3
V Flags:No flags are modified.
V Operation:
If condition is true
Address->PC
else
PC+3->PC
V JC-Jump if carry is set
V JNC-Jump if carry is reset
V JZ-Jump if zero is set
V JNZ-Jump if zero is reset
V JPO-Jump if parity is reset
V JPE-Jump if parity is set
V JP-Jump if sign is reset
V JM-Jump if sign is set
Storage in memory
JC C200 000 Opcode
001 00
002 C2
Before execution of Instruction
000
PC
After execution of Instruction
If carry is set then else
C200 00

PC PC
V Load program counter with HL contents.
V PCHL is equivalent to one byte unconditional
JMP instruction.
V No.of bytes:1
V Flags:No flags are modified.
V Operation:
HL->PC
PCHL

Before execution of Instruction


C H L
PC D 1

After execution of Instruction


D 1

PC
V Stack area is normaly defined in RAM only.
V Stack is used to store information
temporarily.
V It is a part of memory used by user,for same
SP IS used.
V While storing data onto the stack SP
decrements.
V While retrieving data from the stack SP
increments.
••
Before PUSHING DATA on ÷ ••
stack
÷

SP

After PUSHING DATA on
stack ••
÷  20
÷  ÷  10
SP ÷


••
Before POPING DATA from ÷ 20
stack ÷ 10
÷
÷

SP
After POPING DATA 1020 from
stack ••
20
÷ 10
SP ÷
V @nconditional call suroutine.
V No.of bytes:3
V Flags:No flags are modified.
V Operation:
PCH->SP-1
PCL->SP-2
SP-2->SP
CALL C200 Addr data Storage in memory
A COO6 op C006 Opcode
B C COO7 C007 00
D E C008 C008 C2
C009 Next
H L C009
Instr ction
C7FF SP
C006 PC
C200 ••
••
S@BRO@TINE
C2FD ••

C7FF ••
SP
BEFORE execution of Instruction
CALL C200 Addr data Storage in memory
A COO6 op C006 Opcode
B C COO7 00 C007 00
D E C008 C2 C008 C2
C009 Next
H L C009
Instr ction
C7FD SP C200 ••
C200 PC •• S@BRO@TINE
C2FD ••
SP C7FD 09
C7FE C0
C7FF ••

AFTER execution of Instruction


V In conditional CALL instruction when the
condition is true then only CALL is made to
Subroutine.
V If it is false next instruction is executed.
V No.of bytes:3
V Flags:No flags are modified
V Operation:
If condition is true Else
PCH->SP-1 PC+3->PC
PCL->SP-2
SP-2->SP
V CC-Jump if carry is set
V CNC-Jump if carry is reset
V CZ-Jump if zero is set
V CNZ-Jump if zero is reset
V CPO-Jump if parity is reset
V CPE-Jump if parity is set
V CP-Jump if sign is reset
V CM-Jump if sign is set
V Return from subroutine.
V No.of bytes:1
V Flags:No flags are modified
V Operation:
PCH <-SP+1
PCL <-SP
SP+2->SP
RET Addr data
A COO6 Op
B C call

D E COO7 ••

H L C008 ••

C7FD SP C00

C2O PC C200 ••
•• S@BRO@TINE
C20 RET
SP C7FD 0
C7FE C0
C7FF ••

BEFORE execution of Instruction


RET Addr data
A COO6 op
B C COO7 00
D E C008 C2
H L C00
C7FF SP C200 ••
C00 PC •• S@BRO@TINE
C20 RET
SP C7FD 0
C7FE C0
C7FF ••

AFTER execution of Instruction


V In conditional RET instruction when the
condition is true then only return is made to
Subroutine.
V If it is false next instruction is executed.
V No.of bytes:1
V Flags:No flags are modified
V Operation:
If condition is true Else
PCL->SP
PCH-> SP+1 PC+1->PC
SP+2->SP
V RC-Return if carry is set
V RNC-Return if carry is reset
V RZ-Return if zero is set
V RNZ-Return if zero is reset
V RPO-Return if parity is reset
V RPE-Return if parity is set
V RP-Return if sign is reset
V RM-Return if sign is set
main program S@BRO@TINE
L•I SP, FFFF

CALL subroutine
NE•T INSTR@CTION RET

HLT
V These instructions are equivalent to 1 byte
CALL instruction at restart location i.e to one
of the memory location depending on value
of N.
V These instructions are used as software
interrupts.
V The contents of the PC are stored on to the
stack & control of the program is transferred
to one of the 8 memory location.
V No.of bytes:1
V Flags:No flags are modified
V Operation:
PCH->SP-1
PCL->SP-2
SP-2->SP
INSTR@CTION ADDRESS OF
ISR
RST 0 8*0=O 0000 H

RST 1 8*1=8 0008 H

RST 2 8*2=16 0010 H

RST 3 8*3=24 0018 H

RST 4 8*4=32 0020 H

RST 5 8*5=40 0028 H

RST 6 8*6=48 0030 H

RST 7 8*7=56 0038 H

Das könnte Ihnen auch gefallen