Specifications
Branch on LOwn
BLO IOC
t.5 YS, 2.6~s
Offset
t 1 0, 1 , 3 , 1 4 I I I I I 1.1
95 e 7 0
Operation: lot + (PC) if C = 1
Description: BLO is the same instruction as BCS
q The following example illustrates the use of some of the instructions and
addressing modes described thus far. Two new instructions are used: INC
(INCrement) and ASL (Arithmetic Shift Left) which respectively, add 1 (INC)
and multiply an operand by 2 (ASL). Their operation is fully described later
in this chapter.
This example demonstrates the generation of a table (histogram) that shows
the frequency of occurrence of each value in another table (within a range
of values l-100). Histogram generation (including initialization) requires
22 words. Values outside the range l-1OB are ignored.
HIST: MOV #OTABLE, RO
MOV #-loo., Rl
CLOOP:
‘yg p+
BNE CLOOP
MOV #ITABLE, RO
MOV # -lOOO., Rl
MOV #lOO., R2
HLOOP: MOV (RO)+, R4
BLE NOCOUNT
CMP R4, R2
BGT NOCOUNT
ASL R4
INC OTABLE (R4)
NOCOUNT: INC- Rl
BNE HLOOP
HALT
;set up to clear output table
;lOO entries in output table
;clear next entry
;check if done
;if not, continue clearing
;set up input pointer
;length of table
;max input value
;get next input value
;ignore if less than or equal zero
;check against max value
;ignore if greater
;2 bytes per table entry
;increment proper element
;input done?
;if not, continue scanning
;histogram complete
The JUMP Instruction-JMP (JUMP) provides more flexible program branch-
ing then is provided with the branch instructions. Control may be transferred
to any location in memory (no range limitation) and can be accomplished
with the full flexibility of the PDP-11 addressing modes.
JUMP
JMP
dst
1.2US
01 ‘0 0
1
dst
I I I I I I I I I I t 1
15 6 5 0
Operation: dst + (PC)
Conditioned Codes: not affected
Description: Register mode is illegal in JMP instructions and will cause an
“illegal instruction” condition. (Program control cannot be transferred to a
register.) Register deferred mode is legal and will cause program control to
be transferred to the address held in the specified register. Note that instruc-
tions are word data and must therefore be fetched from an even-numbered
26