HPC Instruction Set Description
(Continued)
Mnemonic
Description
Action
TRANSFER OF CONTROL INSTRUCTIONS
JSRP
Jump subroutine from table
PC
x
W(SP),SP
a
2
x
SP
W(table
Y
)
PC
PC
W(SP),SP
a
2
x
SP,PC
a
Y
x
PC
(
Y
a
1024 to
b
1023)
PC
x
a
2
SP,PC
a
Y
x
PC
PC
a
Y
x
PC(
Y
is
a
32 to
b
31)
PC
a
Y
x
PC(
Y
is
a
256 to
b
255)
PC
a
Y
x
PC
a
A
a
1
x
PC
then Mem(PC)
a
PC
x
PC
PC
a
1
SP
b
2
x
SP,W(SP)
x
PC
SP
b
2
x
SP,W(SP)
x
PC, & skip
SP
b
2
x
SP,W(SP)
x
PC, interrupt re-enabled
JSR
Jump subroutine relative
JSRL
JP
JMP
JMPL
JID
JIDW
NOP
RET
RETS
RETI
Jump subroutine long
Jump relative short
Jump relative
Jump relative long
Jump indirect at PC
a
A
No Operation
Return
Return then skip next
Return from interrupt
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, I/O 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 I/O
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