INSTRUCTION SET

INIT: MOV R7,A

;MOVE ACC CONTENTS TO

 

;LOCATION 7

SEL RB1

;SELECT REG BANK 1

MOV R7,#OFAH

;MOVE 'FA'HEX TO LOCATION 31

SEL RBO

;SELECT REG BANK 0

MOV A,R7

;RESTORE ACC FROM LOCATION 7

RETR

;RETURN - RESTORE PC AND PSW

STOP TCNT Stop Timer/Event-Counter

10110101011

This instruction is used to stop both time accumulation and event counting.

Example: Disable interrupt, but jump to interrupt routine after eight overflows and stop timer. Count overflows in register 7.

START: DIS TCNTI

;DISABLE TIMER INTERRUPT

CLR A

;CLEAR ACC TO ZEROS

MOV T,A

;MOVE ZEROS TO TIMER

MOV R7,A

;MOVE ZEROS TO REG 7

STRT T

;START TIMER

MAIN: JTF COUNT

;JUMP TO ROUTINE 'COUNT'

 

;IF TF=1 AND CLEAR TIMER FLAG

JMP MAIN

;CLOSE LOOP

COUNT: INC R7

;INCREMENT REG 7

MOV A,R7

;MOVE REG 7 CONTENTS TO ACC

JB31NT

;JUMP TO ROUTINE 'INT'IF ACe

 

;BIT 3 IS SET (REG 7=8)

JMP MAIN

;OTHERWISE RETURN TO ROUTINE

 

;MAIN

INT: STOP TCNT ;STOP TIMER

JMP 7H ;JUMP TO LOCATION 7 (TIMER) ;INTERRUPT ROUTINE

Mnemonics copyright Intel Corporation 1976.

4-33

Page 106
Image 106
Intel mcs-48 manual Stop Tcnt Stop Timer/Event-Counter, 10110101011, Jump to Routine Intif ACe, BIT 3 is SET REG 7=8