Intel UPI- 41A User Manual page 31

Microprocessor peripherals
Table of Contents

Advertisement

operations Both Carry and Auxiliary Carry are part of
the Program Status Word (PSW) and are stored in the
stack during subroutine calls The F
general-purpose flags which can be cleared or comple-
mented by UPI instructions F
Program Status Word and is stored in the stack with
the Carry flags F
reflects the condition of the A
1
and caution must be used when setting or clearing it
Register Operations
The working registers can be accessed via the accumu-
lator as explained above or they can be loaded with
immediate data constants from program memory In
addition they can be incremented or decremented di-
rectly or they can be used as loop counters as explained
in the section on branch instructions
Additional Data Memory locations can be accessed
with indirect instructions via R
Branch Instructions
The UPI-41A 41AH 42 42AH Instruction Set in-
cludes 17 jump instructions The unconditional allows
jumps anywhere in the 1K words of program memory
All other jump instructions are limited to the current
page (256 words) of program memory
Conditional jump instructions can test the following in-
puts and maching flags

TEST 0 input pin

TEST 1 input pin

Input Buffer Full flag

Output Buffer Full flag

Timer flag

Accumulator zero

Accumulator bit

Carry flag

F
flag
0

F
flag
1
The conditions tested by these instructions are the
instantaneous values at the time the conditional jump
instruction is executed For instance the jump on accu-
mulator zero instruction tests the accumulator itself
not an intermediate flag
The decrement register and jump if not zero (DJNZ)
instruction combines decrement and branch operations
in a single instruction which is useful in implementing a
loop counter This instruction can designate any of the
and F
flags are
8 working registers as a counter and can effect a branch
0
1
to any address within the current page of execution
is accessible via the
0
A special indirect jump instruction (JMPP
line
the program to be vectored to any one of several differ-
0
ent locations based on the contents of the accumulator
The contents of the accumulator point to a location in
program memory which contains the jump address As
an example this instruction could be used to vector to
any one of several routines based on an ASCII charac-
ter which has been loaded into the accumulator In this
way ASCII inputs can be used to initiate various rou-
tines
Control
The UPI-41A 41AH 42 42AH Instruction Set has six
and R
instructions for control of the DMA interrupts and
0
1
selection of working registers banks
The UPI-41A 41AH 42 42AH provides two instruc-
tions for control of the external microcomputer system
IBF and OBF flags can be routed to PORT 2 allowing
interrupts of the external processor DMA handshaking
signals can also be enabled using lines from PORT 2
The IBF interrupt can be enabled and disabled using
two instructions Also the interrupt is automatically
disabled following a RESET input or during an inter-
rupt service routine
The working register bank switch instructions allow the
programmer to immediately substitute a second 8 regis-
ter bank for the one in use This effectively provides
either 16 working registers or the means for quickly
saving the contents of the first 8 registers in response to
an interrupt The user has the option of switching regis-
ter banks when an interrupt occurs However if the
banks are switched the original bank will automatically
be restored upon execution of a return and restore
status (RETR) instruction at the end of the interrupt
service routine
Timer
The 8-bit on-board timer counter can be loaded or read
via the accumulator while the counter is stopped or
while counting
The counter can be started as a timer with an internal
clock source or as an event counter or timer with an
UPI-41A 41AH 42 42AH USER'S MANUAL
A) allows
27

Advertisement

Table of Contents
loading

Table of Contents