XC800 Arch UM v0.2
XC800 Arch UM v0.2
2006
XC800
M i c r o c o n t r o l l er F a m il y
Architecture and Instruction Set
Microcontrollers
Edition 2006-02
Published by Infineon Technologies AG,
81726 München, Germany
© Infineon Technologies AG 2006.
All Rights Reserved.
Attention please!
The information herein is given to describe certain components and shall not be considered as a guarantee of
characteristics.
Terms of delivery and rights to technical change reserved.
We hereby disclaim any and all warranties, including but not limited to warranties of non-infringement, regarding
circuits, descriptions and charts stated herein.
Information
For further information on technology, delivery terms and conditions and prices please contact your nearest
Infineon Technologies Office (www.infineon.com).
Warnings
Due to technical requirements components may contain dangerous substances. For information on the types in
question please contact your nearest Infineon Technologies Office.
Infineon Technologies Components may only be used in life-support devices or systems with the express written
approval of Infineon Technologies, if a failure of such components can reasonably be expected to cause the failure
of that life-support device or system, or to affect the safety or effectiveness of that device or system. Life support
devices or systems are intended to be implanted in the human body, or to support and/or maintain and sustain
and/or protect human life. If they fail, it is reasonable to assume that the health of the user or other persons may
be endangered.
User ’s M anual, V 0.2, Feb. 2006
XC800
M i c r o c o n t r o l l er F a m il y
Architecture and Instruction Set
Microcontrollers
XC800
Fundamental Structure
1 Fundamental Structure
This manual provides an overview of the architecture and functional characteristics of
the XC800 microcontroller family. It also includes a complete description of the XC800
CPU instruction set. For detailed information on the different derivatives of the XC800 8-
bit microcontrollers, refer to the respective user’s manuals.
1.1 Introduction
The Infineon XC800 microcontroller family has a CPU which is functionally upward
compatible to the 8051. While the standard 8051 CPU is designed around a 12-clock
machine cycle, the XC800 CPU uses a two-clock period machine cycle.
The instruction set consists of 45% one-byte, 41% two-byte, and 14% three-byte
instructions. Each instruction takes 1, 2 or 4 machine cycles to execute. In case of
access to slower memory, the access time may be extended by wait states.
The XC800 microcontrollers support via the dedicated JTAG interface or the standard
UART interface, a range of debugging features including basic stop/start, single-step
execution, breakpoint support and read/write access to the data memory, program
memory and special function registers.
The key features of the XC800 microcontrollers are listed below.
• Two clocks per machine cycle
• Up to 1 Mbyte of external data memory; up to 256 bytes of internal data memory
• Up to 1 Mbyte of program memory
• Support for synchronous or asynchronous program and data memory
• Wait state support for slow memory
• Program memory download option
• 15-source, 4-level interrupt controller
• Up to eight data pointers
• Power saving modes
• Dedicated debug mode via the standard JTAG interface or UART
• Two 16-bit timers (Timer 0 and Timer 1)
• Full-duplex serial port (UART)
Fundamental Structure
typical of the standard 8051 architecture: the internal data memory consists of 128 bytes
of directly addressable Internal RAM (IRAM) and 128 bytes of indirect addressable
IRAM. On-chip ‘external’ RAM (XRAM) is also supported. External data memory may be
supported outside of the internal range. Figure 1-1 provides a general overview of the
XC800 memory space and a typical memory map in user mode.
0' C000H FF H
Special Function
Extension Stack RAM Internal RAM
Registers
80H
Internal RAM
0' 0000H 00 H
Figure 1-1 XC800 Memory Space and Typical Memory Map in user mode
In derivatives with memory extension, an additional 128 bytes of memory extension
stack RAM is available from 80H to FFH. Access to this memory is only possible by the
hardware, so the memory is effectively transparent to the user. By default after reset, the
memory extension stack pointer (MEXSP) points to 7FH. It is pre-incremented by call
instructions and post-decremented by return instructions.
Fundamental Structure
Fundamental Structure
Fundamental Structure
Fundamental Structure
The 16 bytes of IRAM that occupy addresses from 20H to 2FH are bitaddressable. Bit 0
of the internal data byte at 20H has the bit address 00H, while bit 7 of the internal data
byte at 2FH has the bit address 7FH.
By default after reset, the stack pointer points to address 07H. The stack may reside
anywhere in the IRAM.
IRAM occupying direct addresses from 30H to 7FH can be used as scratch pad.
1.2.4 Registers
All registers, except the program counter and the four general purpose register banks,
reside in the SFR area.
The lower 32 locations of the IRAM are assigned to four banks with eight general
purpose registers (GPRs) each. At any one time, only one of these banks can be enabled
by two bits in the program status word (PSW): RS0 (PSW.3) and RS1 (PSW.4). This
allows fast context switching, which is useful when entering subroutines or interrupt
service routines. The eight general purpose registers of the selected register bank may
be accessed by register addressing. For indirect addressing modes, the registers R0 and
R1 are used as pointer or index register to address internal or external memory.
The Special Function Registers (SFRs) are mapped to the internal data space in the
range 80H to FFH. The SFRs are accessible through direct addressing. The SFRs that
are located at addresses with address bit 0-2 equal to 0 (addresses 80H, 88H, 90H, ...,
F8H) are bitaddressable. Each bit of the bitaddressable SFRs has bit address
Fundamental Structure
corresponding to the SFR byte address and its position within the SFR byte. For
example, bit 7 of SFR at byte address 80H has a bit address of 87H. The bit addresses
of the SFR bits span from 80H to FFH.
As the 128-SFR range is less than the total number of registers required, register
extension mechanisms are implemented to increase the number of addressable SFRs.
These mechanisms include:
• Mapping
• Paging
Fundamental Structure
SYSCON0
System Control Register 0 Reset Value: XXXX XXX0B
7 6 5 4 3 2 1 0
- RMAP
- rw
Fundamental Structure
SFR Address
(from CPU)
PAGE 0
MOD_PAGE.PAGE
rw
SFR0
SFR1
…...
SFRx
PAGE 1
SFR0
SFR Data
SFR1
(to/from CPU)
…...
SFRy
…...
PAGE q
SFR0
SFR1
…...
SFRz
Module
Fundamental Structure
setting restored. This is possible with the storage fields STx (x = 0 - 3) for the save and
restore action of the current page setting, as illustrated in Figure 1-3. By indicating which
storage register should be used in parallel with the new page value, a single write
operation can:
• Save the contents of PAGE in STx before overwriting with the new value
(this is done in the beginning of the interrupt routine to save the current page setting
and program the new page number); or
• Overwrite the contents of PAGE with the contents of STx, ignoring the value written
to the bit positions of PAGE
(this is done at the end of the interrupt routine to restore the previous page setting
before the interrupt occurred)
ST3
ST2
ST1
ST0
STNR
MOD_PAGE
Page Register for module MOD Reset Value: 00H
7 6 5 4 3 2 1 0
OP STNR 0 PAGE
w w r rw
Fundamental Structure
Fundamental Structure
PASSWD
Password Register Reset Value: 07H
7 6 5 4 3 2 1 0
PROTECT
PASS MODE
_S
wh rh rw
CPU Architecture
2 CPU Architecture
Figure 2-1 depicts the typical architecture of an XC800 family microcontroller. It includes
the main functional blocks and standard units. The units represented by dotted boxes
may not be available, depending on the derivative; these include peripheral units and
external memory bus. Memory sizes vary depending on the XC800 microcontroller
derivative.
Internal Bus
Boot ROM External
XC800 Core Data
Memory
External
Internal Data T0 & T1 UART Code
RAM
Memory
XTAL1 OSC
XTAL2 & PLL
1)
OCDS: On-Chip Debug
Support
CPU Architecture
Internal Data
Memory
Core SFRs Register Interface
External Data
Memory External SFRs
Program Memory
Opcode &
Immediate Multiplier / Divider
Registers
fCCLK
State Machine &
Memory Wait UART
Power Saving
Reset
XC800_UM_core_user_V0.1
CPU Architecture
the next instruction to be executed. The conditional branch logic enables internal and
external events to the processor to cause a change in the program execution sequence.
The access control unit is responsible for the selection of the on-chip memory resources.
The interrupt requests from the peripheral units are handled by the interrupt controller
unit.
CPU Architecture
2.1.4 B Register
The B register is used during multiply and divide operations to provide the second
operand. For other instructions, it can be treated as another scratch pad register.
CPU Architecture
PSW
Program Status Word Register Reset Value: 00H
7 6 5 4 3 2 1 0
CY AC F0 RS1 RS0 OV F1 P
CPU Architecture
EO
Extended Operation Register Reset Value: 00H
7 6 5 4 3 2 1 0
0 TRAP_EN 0 DPSEL
r rw r rw
CPU Architecture
MEX1
Memory Extension Register 1 Reset Value: 00H
7 6 5 4 3 2 1 0
CB[19:16] NB[19:16]
rh rw
MEX2
Memory Extension Register 2 Reset Value: 00H
7 6 5 4 3 2 1 0
rw rw rw
CPU Architecture
MEX3
Memory Extension Register 3 Reset Value: 00H
7 6 5 4 3 2 1 0
rw r rw rw rw
MEXSP
Memory Extension Stack Pointer Register Reset Value: 7FH
7 6 5 4 3 2 1 0
0 MXSP
r rwh
CPU Architecture
PCON
Power Control Register Reset Value: 00H
7 6 5 4 3 2 1 0
rw r rw rw r rw
CPU Architecture
2.1.9 UART
The UART uses two SFRs, SCON and SBUF. SCON is the control register, while SBUF
is the data register. The serial port control and status register is the SFR SCON. This
register contains not only the mode selection bits, but also the 9th data bit for transmit
and receive (TB8 and RB8), and the serial port interrupt bits (TI and RI).
SBUF is the receive and transmit buffer of the serial interface. Writing to SBUF loads the
transmit register and initiates transmission. SBUF is read to access the received data
from the receive register. The two paths are independent and supports full duplex
operation.
SBUF
Serial Data Buffer Reset Value: 00H
7 6 5 4 3 2 1 0
VAL
rwh
SCON
Serial Channel Control Register Reset Value: 00H
7 6 5 4 3 2 1 0
CPU Architecture
CPU Architecture
2.1.10 Timer/Counter
Two 16-bit timers, Timer 0 and Timer 1, are available in the XC800 core.
The SFR TCON controls the running of the timers and generating of interrupts, while
SFR TMOD sets the operating modes of the timers. The timer/counter values are stored
in two pairs of 8-bit registers: TL0, TH0 and TL1, TH1 (reset value = 0000H).
TCON
Timer Control Register Reset Value: 00H
7 6 5 4 3 2 1 0
rwh rw rwh rw rw rw rw rw
CPU Architecture
TMOD
Timer Mode Register Reset Value: 00H
7 6 5 4 3 2 1 0
rw rw rw rw rw rw
CPU Architecture
IEN0
Interrupt Enable Register 0 Reset Value: 00H
7 6 5 4 3 2 1 0
rw r rw rw rw rw rw rw
CPU Architecture
The interrupt enable bits of IEN1 are used to enable or disable the corresponding
interrupts. The assignment of these bits depends on which peripheral set is available on
the derivative.
IEN1
Interrupt Enable Register 1 Reset Value: 00H
7 6 5 4 3 2 1 0
rw rw rw rw rw rw rw rw
Each interrupt source can be individually programmed to one of the four priority levels
available via the corresponding IP, IPH or IP1, IPH1 registers. IP and IP1 are
bitaddressable, but not IPH and IPH1.
IP(H)
Interrupt Priority (High) Register Reset Value: 00H
7 6 5 4 3 2 1 0
r rw rw rw rw rw rw
CPU Architecture
IP(H)1
Interrupt Priority 1 (High) Register Reset Value: 00H
7 6 5 4 3 2 1 0
rw rw rw rw rw rw rw rw
CPU Architecture
Four bits are available in TCON to control and flag the external interrupts.
TCON
Timer Control Register Reset Value: 00H
7 6 5 4 3 2 1 0
CPU Architecture
CPU Architecture
Syspend
System
Control
Control
Unit Reset
Clock
Alternate
Debug UART
Interface
TxD Reset Clock Debug PROG PROG Memory
RxD Interface & IRAM Data Control
Addresses
- parts of OCDS UART
XC800
CPU Architecture
• After processing memory address and control signals from the core, MMC provides
proper access to the dedicated memories: a Monitor ROM (holding the code) and a
Monitor RAM (for work-data and Monitor-stack)
• Two interfaces can be used to access the OCDS system:
– JTAG as a primary channel; dedicated exclusively to test and debug activities and
is not normally used in an application
– UART as an alternative channel; it has the advantage of needing fewer pins
• A dedicated pin is used as external configuration and control for both the debugging
and bootstrap-loading.
The on-chip debug concept is based on the generation and detection of debug events
and the corresponding debug actions:
• Debug events:
– Hardware Breakpoints
– Software Breakpoints
– External Breaks
• Debug event actions (non-exclusive):
– Activate the Monitor Program
– Activate the MBC pin
• Other debug features:
– Single step execution
– Return to user program
CPU Architecture
CPU Architecture
and the interrupt system will generate a LCALL to the node’s service routine, provided
this hardware-generated LCALL is not blocked by any of the following conditions:
1. An interrupt of equal or higher priority is already in progress.
2. The current (polling) cycle is not in the final cycle of the instruction in progress.
3. The instruction in progress is RETI or any write access to registers IEN0/IEN1 or
IP/IPH or IP1/IPH1.
Any of these three conditions will block the generation of the LCALL to the interrupt
service routine. Condition 2 ensures that the instruction in progress is completed before
vectoring to any service routine. Condition 3 ensures that if the instruction in progress is
RETI or any write access to registers IEN0/IEN1 or IP/IPH or IP1/IPH1, then at least one
more instruction will be executed before any interrupt is vectored to; this delay
guarantees that changes of the interrupt status can be observed by the CPU.
The polling cycle is repeated with each machine cycle, and the values polled are the
values that were present at phase 2 of the previous machine cycle. Note that if any
interrupt flag is active but its node interrupt request was not responded to for one of the
conditions already mentioned, and if the flag is no longer active at a later time when
servicing the interrupt node, the corresponding interrupt source will not be serviced. In
other words, the fact that the interrupt flag was once active but not serviced is not
remembered. Every polling cycle interrogates only the pending interrupt requests.
The processor acknowledges an interrupt request by executing a hardware generated
LCALL to the corresponding service routine. In some cases, hardware also clears the
flag that generated the interrupt, while in other cases, the flag must be cleared by the
user’s software. The hardware-generated LCALL pushes the contents of the Program
Counter (PC) onto the stack (but it does not save the PSW) and reloads the PC with an
address that depends on the interrupt node being vectored to.
Program execution returns to the next instruction after calling the interrupt when the
RETI instruction is encountered. The RETI instruction informs the processor that the
interrupt routine is no longer in progress, then pops the two top bytes from the stack and
reloads the PC. Execution of the interrupted program continues from the point where it
was stopped. Note that the RETI instruction is important because it informs the
processor that the program has left the current interrupt priority level. A simple RET
instruction would also have returned execution to the interrupted program, but it would
have left the interrupt control system on the assumption that an interrupt was still in
progress. In this case, no interrupt of the same or lower priority level would be
acknowledged.
CPU Architecture
routine will be the next instruction to be executed. The call itself takes two machine
cycles. Thus, a minimum of three complete machine cycles will elapse from activation of
the interrupt request to the beginning of execution of the first instruction of the service
routine as shown in Figure 2-4.
P1 P2 P1 P2 P1 P2 P1 P2 P1 P2
fCCLK
Interrupt request
Interrupt LCALL 1st instruction at
polled
request interrupt vector
(last cycle of
active/sampled current
instruction)
CPU Architecture
P1 P2 P1 P2 P1 P2 P1 P2 P1 P2 P1 P2 P1 P2 P1 P2
fCCLK
P1 P2 P1 P2 P1 P2 P1 P2 P1 P2 P1 P2 P1 P2 P1 P2 P1 P2 P1 P2
fCCLK
CPU Architecture
If two or more requests of different priority levels are received simultaneously, the
request of the highest priority is serviced first.
The respective bit fields of the interrupt priority registers together select one of the four
levels of priority shown in Table 2-2.
Note: The NMI always takes precedence over all other interrupts.
If requests of the same priority are received simultaneously, an internal polling sequence
determines which request is serviced first. Thus, within each priority level there is a
second priority structure determined by the polling sequence as shown in Table 2-3. The
extended interrupts that are applicable, vary depending on the XC800 derivative.
CPU Timing
3 CPU Timing
The following sections describe the CPU instruction timing, and external memory access
timing.
CPU Timing
fCCLK
CPU Timing
CCLK
PSEN
DA DA+1 DA+1/2
D[7:0]
VALID VALID VALID
1)
Address data discarded if 1-byte instruction.
In this case, no valid code is fetched
on data bus.
2)
Address A+1 valid again if previously
discarded. Corresponding code DA+1
will be fetched. XC800_UM_extfetch_user_V0.1
CPU Timing
MOVX Next
Instruction
CCLK
Ax DATA ADDRESS
RD
D[7:0] VALID
XC800_UM_extdataRD_user_V0.4 tCCLK
>
2
CPU Timing
MOVX Next
Instruction
CCLK
PSEN
WR
RD
XC800_UM_extdataWR_user_V0.1
Instruction Set
4 Instruction Set
The XC800 8-bit microcontroller family instruction set includes the 111 instructions of the
standard 8051, plus 2 additional instructions, ‘MOVC @(DPTR++),A’ and ‘TRAP’, which
are multiplexed and selected through the Special Function Register (SFR) EO. Out of
the 113 instructions, 51 are single-byte, 46 are two-byte and 16 are three-byte.
The instruction opcode format consists of a function mnemonic that is usually followed
by a “destination, source” operand field. This field specifies the data type and addressing
method(s) to be used.
Instruction Set
Instruction Set
Instruction Set
Instruction Set
4.3 Instructions
The XC800 instructions can essentially be condensed to 55 basic operations. These
operations are described in detail in the following sections.
In the above table, a 0 means the flag is always cleared, a 1 means the flag is always
set and an “X” means that the state of the flag depends on the result of the operation. A
blank cell indicates that the flag is unaffected by the instruction.
Only the carry, auxiliary carry, and overflow flags are discussed above. The parity bit is
always computed from the actual content of the accumulator.
• CY is set if the operation causes a carry to or a borrow from the resulting high-order
bit; otherwise CY is cleared.
• AC is set if the operation results in a carry from the low-order four bits of the result
(during addition), or a borrow from the high-order bits to the low-order bits (during
subtraction); otherwise AC is cleared.
• OV is set if the operation results in a carry to the high-order bit of the result but not a
carry from the bit, or vice versa; otherwise OV is cleared. OV is used in twos
complement arithmetic, because it is set when the signal result cannot be
represented in 8 bits.
• P is set if the modulo-2 sum of the eight bits in the accumulator is 1 (odd parity);
otherwise P is cleared (even parity). When a value is written to the PSW register, the
P bit remains unchanged, as it always reflects the parity of A.
Instruction Set
Instructions that directly alter addressed registers could affect the other status flags if the
instruction is applied to the PSW. Status flags can also be modified by bit manipulation.
Instruction Set
Instruction Set
Instruction Set
Instruction Set
Instruction Set
• bit: 128 bit-addressable bits of lower internal data RAM, any bit-addressable bits of
special function registers
• A: Accumulator
The definition of the symbols used in program addressing are:
• addr16: Destination address for LCALL and LJMP may be anywhere within the
64 Kbytes of the active bank located in program space
• addr11: Destination address for ACALL and AJMP will be within the same 2-Kbyte
page of program memory as the first byte of the following instruction.
• rel: SJMP and all conditional jumps include an 8-bit offset byte. Range is + 127/– 128
bytes relative to the first byte of the following instruction.
All mnemonics copyrighted: © Intel Corporation 1980
Instruction Set
Absolute Call
ACALL addr11
a10 a9 a8 1 0 0 0 1 a7 a6 a5 a4 a3 a2 a1 a0
Instruction Set
Add
ADD A, <src-byte>
0 0 1 0 1 r r r
0 0 1 0 0 1 0 1 direct address
Instruction Set
0 0 1 0 0 1 1 i
0 0 1 0 0 1 0 0 immediate data
Instruction Set
0 0 1 1 1 r r r
0 0 1 1 0 1 0 1 direct address
Instruction Set
0 0 1 1 0 1 1 i
0 0 1 1 0 1 0 0 immediate data
Instruction Set
Absolute Jump
AJMP addr11
a10 a9 a8 0 0 0 0 1 a7 a6 a5 a4 a3 a2 a1 a0
Instruction Set
The instruction
ANL P1, #01110011B
will clear bits 7, 3, and 2 of output port 1.
Instruction:
ANL A, Rn Operation: (A) ←(A) ∧ (Rn)
Bytes: 1
Cycles: 1
Encoding:
0 1 0 1 1 r r r
Instruction Set
0 1 0 1 0 1 0 1 direct address
0 1 0 1 0 1 1 i
0 1 0 1 0 1 0 0 immediate data
Instruction Set
0 1 0 1 0 0 1 0 direct address
Instruction Set
1 0 0 0 0 0 1 0 bit address
1 0 1 1 0 0 0 0 bit address
Instruction Set
Instruction Set
Instruction Set
Instruction Set
Clear Accumulator
CLR A
1 1 1 0 0 1 0 0
Instruction Set
Clear Bit
CLR <bit>
1 1 0 0 0 0 1 1
1 1 0 0 0 0 1 0 bit address
Instruction Set
Complement Accumulator
CPL A
1 1 1 1 0 1 0 0
Instruction Set
Complement Bit
CPL <bit>
1 0 1 1 0 0 1 1
1 0 1 1 0 0 1 0 bit address
Instruction Set
Table 4-15 DA
Description: DA A adjusts the eight-bit value in the accumulator resulting from the
earlier addition of two variables (each in packed BCD format),
producing two four-bit digits. Any ADD or ADDC instruction may have
been used to perform the addition.
If accumulator bits 3-0 are greater than nine (xxxx1010-xxxx1111),
or if the AC flag is one, six is added to the accumulator producing the
proper BCD digit in the low-order nibble. This internal addition would
set the carry flag if a carry-out of the low-order four-bit field
propagated through all high-order bits, but it would not clear the carry
flag otherwise.
If the carry flag is now set, or if the four high-order bits now exceed
nine (1010xxxx-1111xxxx), these high-order bits are incremented by
six, producing the proper BCD digit in the high-order nibble. Again,
this would set the carry flag if there was a carry-out of the high-order
bits, but would not clear the carry. The carry flag thus indicates if the
sum of the original two BCD variables is greater than 100, allowing
multiple precision decimal addition. OV is not affected.
All of this occurs during the one instruction cycle. Essentially; this
instruction performs the decimal conversion by adding 00H, 06H, 60H,
or 66H to the accumulator, depending on initial accumulator and
PSW conditions.
Instruction Set
1 1 0 1 0 1 0 0
Instruction Set
Decrement
DEC <byte>
0 0 0 1 0 1 0 0
0 0 0 1 1 r r r
Instruction Set
0 0 0 1 0 1 0 1 direct address
0 0 0 1 0 1 1 i
Instruction Set
Divide
DIV AB
1 0 0 0 0 1 0 0
Instruction Set
Instruction Set
1 1 0 1 1 r r r rel. address
Instruction Set
Increment
INC <byte>
0 0 0 0 0 1 0 0
0 0 0 0 1 r r r
Instruction Set
0 0 0 0 0 1 0 1 direct address
0 0 0 0 0 1 1 i
Instruction Set
1 0 1 0 0 0 1 1
Instruction Set
Table 4-21 JB
Description: If the indicated bit is a one, jump to the address indicated; otherwise
proceed with the next instruction. The branch destination is
computed by adding the signed relative-displacement in the third
instruction byte to the PC, after incrementing the PC to the first byte
of the next instruction. The bit tested is not modified. No flags are
affected.
Example: The data present at input port 1 is 11001010B. The accumulator
holds 56 (01010110B). The instruction sequence
JB P1.2,LABEL1
JB ACC.2,LABEL2
will cause program execution to branch to the instruction at label
LABEL2.
Instruction:
JB bit, rel Operation:
(PC) ←(PC) + 3
if (bit) = 1
then (PC) ←(PC) + rel
Bytes: 3
Cycles: 2
Encoding:
Instruction Set
Instruction Set
Table 4-23 JC
Description: If the carry flag is set, branch to the address indicated; otherwise
proceed with the next instruction. The branch destination is
computed by adding the signed relative-displacement in the second
instruction byte to the PC, after incrementing the PC twice. No flags
are affected.
Example: The carry flag is cleared. The instruction sequence
JC LABEL1
CPL C
JC LABEL2
will set the carry and cause program execution to continue at the
instruction identified by the label LABEL2.
Instruction:
JC rel Operation:
(PC) ←(PC) + 2
if (C) = 1
then (PC) ←(PC) + rel
Bytes: 2
Cycles: 2
Encoding:
0 1 0 0 0 0 0 0 rel. address
Instruction Set
Jump Indirect
JMP @A + DPTR
0 1 1 1 0 0 1 1
Instruction Set
Instruction Set
0 1 0 1 0 0 0 0 rel. address
Instruction Set
0 1 1 1 0 0 0 0 rel. address
Instruction Set
Table 4-28 JZ
Description: If all bits of the accumulator are zero, branch to the address
indicated; otherwise proceed with the next instruction. The branch
destination is computed by adding the signed relative-displacement
in the second instruction byte to the PC, after incrementing the PC
twice. The accumulator is not modified. No flags are affected.
Example: The accumulator originally contains 01H. The instruction sequence
JZ LABEL1
DEC A
JZ LABEL2
will change the accumulator to 00H and cause program execution to
continue at the instruction identified by the label LABEL2.
Instruction:
JZ rel Operation:
(PC) ←(PC) + 2
if (A) = 0
then (PC) ←(PC) + rel
Bytes: 2
Cycles: 2
Encoding:
0 1 1 0 0 0 0 0 rel. address
Instruction Set
Long Call
LCALL addr16
0 0 0 1 0 0 1 0 addr15..addr8 addr7..addr0
Instruction Set
Long Jump
LJMP addr16
0 0 0 0 0 0 1 0 addr15..addr8 addr7..addr0
Instruction Set
1 1 1 0 1 r r r
Instruction Set
1 1 1 0 0 1 0 1 direct address
1 1 1 0 0 1 1 i
0 1 1 1 0 1 0 0 immediate data
1 1 1 1 1 r r r
Instruction Set
1 0 1 0 1 r r r direct address
0 1 1 1 1 r r r immediate data
1 1 1 1 0 1 0 1 direct address
1 0 0 0 1 r r r direct address
Instruction Set
1 0 0 0 0 1 1 i direct address
1 1 1 1 0 1 1 i
Instruction Set
1 0 1 0 0 1 1 i direct address
0 1 1 1 0 1 1 i immediate data
Instruction Set
1 0 1 0 0 0 1 0 bit address
1 0 0 1 0 0 1 0 bit address
Instruction Set
Instruction Set
Instruction Set
1 0 0 1 0 0 1 1
MOVC A, Operation:
@A+PC (PC) ←(PC) + 1
(A) ←((A) + (PC))
Bytes: 1
Cycles: 2
Encoding:
1 0 0 0 0 0 1 1
Instruction Set
1 0 1 0 0 1 0 1
Instruction Set
Move External
MOVX <dest-byte>, <src-byte>
Instruction Set
1 1 1 0 0 0 1 i
1 1 1 0 0 0 0 0
1 1 1 1 0 0 1 i
1 1 1 1 0 0 0 0
Instruction Set
Multiply
MUL AB
1 0 1 0 0 1 0 0
Instruction Set
No Operation
NOP
0 0 0 0 0 0 0 0
Instruction Set
Logical Byte OR
ORL <dest-byte>, <src-byte>
0 1 0 0 1 r r r
Instruction Set
0 1 0 0 0 1 0 1 direct address
0 1 0 0 0 1 1 i
0 1 0 0 0 1 0 0 immediate data
Instruction Set
0 1 0 0 0 0 1 0 direct address
Instruction Set
Logical Bit OR
ORL C, <src-bit>
0 1 1 1 0 0 1 0 bit address
1 0 1 0 0 0 0 0 bit address
Instruction Set
1 1 0 1 0 0 0 0 direct address
Instruction Set
1 1 0 0 0 0 0 0 direct address
Instruction Set
0 0 1 0 0 0 1 0
Instruction Set
0 0 1 1 0 0 1 0
Instruction Set
Table 4-45 RL
Description: The eight bits in the accumulator are rotated one bit to the left. Bit 7
is rotated into the bit 0 position. No flags are affected.
Example: The accumulator holds the value 0C5H (11000101B). The instruction
RL A
leaves the accumulator holding the value 8BH (10001011B) with the
carry unaffected.
Instruction:
RL A Operation:
(An + 1) ←(An) n = 0-6
(A0) ←(A7)
Bytes: 1
Cycles: 1
Encoding:
0 0 1 0 0 0 1 1
Instruction Set
0 0 1 1 0 0 1 1
Instruction Set
Table 4-47 RR
Description: The eight bits in the accumulator are rotated one bit to the right. Bit
0 is rotated into the bit 7 position. No flags are affected.
Example: The accumulator holds the value 0C5H (11000101B). The instruction
RR A
leaves the accumulator holding the value 0E2H (11100010B) with the
carry unaffected.
Instruction:
RR A Operation:
(An) ←(An + 1) n = 0-6
(A7) ←(A0)
Bytes: 1
Cycles: 1
Encoding:
0 0 0 0 0 0 1 1
Instruction Set
0 0 0 1 0 0 1 1
Instruction Set
Set Bit
SETB <bit>
1 1 0 1 0 0 1 1
1 1 0 1 0 0 1 0 bit address
Instruction Set
Short Jump
SJMP rel
1 0 0 0 0 0 0 0 rel. address
Instruction Set
1 0 0 1 1 r r r
Instruction Set
1 0 0 1 0 1 0 1 direct address
1 0 0 1 0 1 1 i
1 0 0 1 0 1 0 0 immediate data
Instruction Set
1 1 0 0 0 1 0 0
Instruction Set
Software Break
TRAP
1 0 1 0 0 1 0 1
Instruction Set
1 1 0 0 1 r r r
Instruction Set
1 1 0 0 0 1 0 1 direct address
1 1 0 0 0 1 1 i
Instruction Set
Exchange Digit
XCHD A,@Ri
1 1 0 1 0 1 1 i
Instruction Set
0 1 1 0 1 r r r
Instruction Set
0 1 1 0 0 1 0 1 direct address
0 1 1 0 0 1 1 i
0 1 1 0 0 1 0 0 immediate data
Instruction Set
0 1 1 0 0 0 1 0 direct address
Index
5 Index
Index