![](http://datasheet.mmic.net.cn/190000/HPC46400EV2_datasheet_14918413/HPC46400EV2_25.png)
HPC Instruction Set Description (Continued)
Mnemonic
Description
Action
TRANSFER OF CONTROL INSTRUCTIONS
JSRP
Jump subroutine from table
PC
xW(SP)SPa2xSP
W(table )
xPC
JSR
Jump subroutine relative
PC
xW(SP)SPa2xSPPCa xPC
( is a1024 to b1023)
JSRL
Jump subroutine long
PC
xW(SP)SPa2xSPPCa xPC
JP
Jump relative short
PCa
xPC( is a32 to b31)
JMP
Jump relative
PCa
xPC( is a256 to b255)
JMPL
Jump relative long
PCa
xPC
JID
Jump indirect at PC a APCaAa1
xPC
JIDW
then Mem(PC)aPC
xPC
NOP
No Operation
PC
wPC a 1
RET
Return
SPb2
xSPW(SP)xPC
RETS
Return then skip next
SPb2
xSPW(SP)xPC
skip
RETI
Return from interrupt
SPb2
xSPW(SP)xPC interrupt re-enabled
Note
W is 16-bit word of memory
MA is Accumulator A or direct memory (8-bit or 16-bit)
Mem is 8-bit byte or 16-bit word of memory
MemI is 8-bit or 16-bit memory or 8-bit or 16-bit immediate data
imm is 8-bit or 16-bit immediate data
Memory Usage
For information on memory usage and instruction timing
please refer to the HPC46400E User’s Manual (See page
25 for ordering information)
Code Efficiency
The HPC46400E has been designed to be extremely code-
efficient The HPC46400E looks very good in all the stan-
dard coding benchmarks however it is not realistic to rely
only on benchmarks Many large jobs have been pro-
grammed onto the HPC46400E and the code savings over
other popular microcontrollers has been considerable
Reasons for this saving of code include the following
SINGLE BYTE INSTRUCTIONS
The majority of instructions on the HPC46400E are single-
byte There are two especially code-saving instructions
JP is a 1-byte jump True it can only jump within a range of
plus or minus 32 but many loops and decisions are often
within a small range of program memory Most other micros
need 2-byte instructions for any short jumps
JSRP is a 1-byte call subroutine The user makes a table of
his 16 most frequently called subroutines and these calls
will only take one byte Most other micros require two and
even three bytes to call a subroutine The user does not
have to decide which subroutine addresses to put into his
table the assembler can give him this information
EFFICIENT SUBROUTINE CALLS
The 2-byte JSR instructions can call any subroutine within
plus or minus 1k of program memory
MULTIFUNCTION INSTRUCTIONS FOR DATA MOVE-
MENT AND PROGRAM LOOPING
The HPC46400E has single-byte instructions that perform
multiple tasks For example the XS instruction will do the
following
1 Exchange A and memory pointed to by the B register
2 Increment or decrement the B register
3 Compare the B register to the K register
4 Generate a conditional skip if B has passed K
The value of this multipurpose instruction becomes evident
when looping through sequential areas of memory and exit-
ing when the loop is finished
BIT MANIPULATION INSTRUCTIONS
Any bit of memory IO or registers can be set reset or
tested by the single byte bit instructions The bits can be
addressed directly or indirectly Since all registers and IO
are mapped into the memory it is very easy to manipulate
specific bits to do efficient control
DECIMAL ADD AND SUBTRACT
This instruction is needed to interface with the decimal user
world
It can handle both 16-bit words and 8-bit bytes
The 16-bit capability saves code since many variables can
be stored as one piece of data and the programmer does
not have to break his data into two bytes Many applications
store most data in 4-digit variables The HPC46400E sup-
plies 8-bit byte capability for 2-digit variables and literal vari-
ables
MULTIPLY AND DIVIDE INSTRUCTIONS
The HPC46400E has 16-bit multiply 16-bit by 16-bit divide
and 32-bit by 16-bit divide instructions This saves both
code and time Multiply and divide can use immediate data
or data from memory The ability to multiply and divide by
immediate data saves code since this function is often
needed for scaling base conversion computing indexes of
arrays etc
25