INSTRUCTION SET
STRT
CNT
Start Event Counter
10100101011
The test 1 (T1) pin
is
enabled
as
the event-counter
input and the
counter
is started. The event-counter
register
is
incremented with each
high-to-Iow
transition
on the
T1
pin.
Example: Initialize and start event counter. Assume overflow
is desired with first
T1
input.
STARTC:
EN
TCNTI ;ENABLE COUNTER INTERRUPT
MOV
A,#OFFH ;MOVE 'FF' HEX (ONES) TO
;ACC
MOV
T,A ;MOVE ONES TO COUNTER
STRT
CNT
;ENABLE
T1
AS COUNTER
;INPUT
AND START
STRT T Start Timer
Example:
10101101011
Timer accumulation is initiated in the
timer
register.
The register
is
incremented every
32
instruction
cycles.
The prescaler
which
counts the
32
cycles
is
cleared
but the
timer
register is not.
Initialize and start timer.
STARTT: CLR A
MOV T,A
EN
TCNTI
STRT T
;CLEAR
ACC TO ZEROS
;MOVE ZEROS
TO
TIMER
;ENABLE TIMER INTERRUPT
;START TIMER
SWAP A Swap Nibbles Within Accumulator
1
0
100101111
Bits 0-3
of
the
accumulator
are swapped with bits
4-7
of
the accumulator.
(A
4
-
7
)
~
(A
o
-
3
)
Example: Pack bits 0-3
of
locations 50-51 into location
50.
PCKDIG: MOV
RO,
#50 ;MOVE '50' DEC TO REG 0
MOV
R1,
#51
;MOVE '51' DEC TO
REG
1
XCHD
A,@RO
;EXCHANGE BITS 0-3 OF
ACC
;AND LOCATION 50
SWAP A
;SWAP BITS 0-3
AND
4-7 OF
ACC
XCHD A,@R1 ;EXCHANGE BITS 0-3 OF ACC AND
;LOCATION
51
MOV
@RO,A
;MOVE CONTENTS OF
ACC
TO
;LOCATION
50
Mnemonics copyright Intel Corporation 1976.
4-34