Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
CALL Instructions
ACALL: Absolute Call
It calls subroutines with a target address
within 2K bytes from the current program
counter (PC). 2 byte instruction.
LCALL: Long Call
To reach the target address in the 64K bytes
maximum ROM space of 8051, we must
use LCALL. 3 byte instruction
05/03/16
8 bit microcontrollers
05/03/16
LCALL 2050h
8 bit microcontrollers
JUMP Instructions
AJMP: Absolute Jump
It transfers program execution to the target
address unconditionally, within 2k bytes of
program memory. 2 byte instruction
LJMP: Long jump
It is used to jump unconditionally to any
address location within 64K bytes of
program memory. 3 byte instruction.
05/03/16
8 bit microcontrollers
05/03/16
8 bit microcontrollers
An absolute range
2K byte page
A long range
Any address
A short range
relative to PC
(-128 to +127)
(0000- FFFF) anywhere in the program
memory
Jumps.
Bit jumps:
All bit jumps either operate according to the status
of carry flag of PSW or status of any bit addressable
location..
All bit jumps are relative to the PC(-128 to +127)
05/03/16
8 bit microcontrollers
JC radd
2 Byte Instr.
JNC radd
JZ radd
JNZ radd
2 Byte Instr.
2 Byte Instr
2 Byte Instr
JB b, radd
3 Byte Instr.
JNB b, radd
3 Byte Instr.
JBC b, radd
3 Byte Instr.
8 bit microcontrollers
Byte jumps
CJNE dest. byte, source byte, addrs.
3 Byte Instr
3 Byte Instr
3 Byte Instr
3 Byte Instr
3 Byte Instr
Unconditional jumps
JMP @A+DPTR
1 Byte Instr
AJMP sadd
2 Byte Instr
LJMP ladd
3 Byte Instr
SJMP radd
2 Byte Instr
05/03/16
8 bit microcontrollers
10
Over:
05/03/16
Org 0000h
Jz next
Inc r0
inc a
inc a
mov a,#34h
jnc over
clr a
mov r0,a
mov r1,a
mov r2,a
mov r3,a
mov r4,#45h
jnc again
end
8 bit microcontrollers
11