Intel mcs-48 manual INC a Increment Accumulator, INC Rr Increment Register

Models: mcs-48

1 478
Download 478 pages 26.88 Kb
Page 90
Image 90

INSTRUCTION SET

Example: INP12: IN A,P1

;INPUT PORT 1 CONTENTS

 

;TO ACC

MOV R6,A

;MOVE ACC CONTENTS TO

 

;REG 6

IN A,P2

;INPUT PORT 2 CONTENTS

 

;TO ACC

MOV R7,A

;MOVE ACC CONTENTS TO REG 7

INC A Increment Accumulator

10001101111

The contents of the accumulator are incremented by one.

(A)-- (A)+1

Example: Increment contents of location 100 in external data memory.

INCA: MOV RO,#100 ;MOVE '100'DEC TO ADDRESS

;REG 0

MOVX A,@RO ;MOVE CONTENTS OF LOCATION ;100 TO ACC

INC A;INCREMENT A

MOVX @RO,A ;MOVE ACC CONTENTS TO ;LOCATION 100

INC Rr Increment Register

1000111rrri

The contents of working register Or' are incremented by one.

(Rr)-- (Rr)+1r=0-7

Example: INCRO: INC RO

;INCREMENT ADDRESS REG 0

INC @R r Increment Data Memory Location

100011000ri

The contents of the resident data memory location addressed by register Or' bits 0-5*are incremented by one.

((Rr))-- ((Rr))+1

r=0-1

Example: INCDM: MOV R1,#03FH

;MOVE ONES TO REG 1

INC @R1

;INCREMENT LOCATION 63

Mnemonics copyright Intel Corporation 1976.

'0-6 .Ior 8039/8049

4-17

Page 90
Image 90
Intel mcs-48 manual INC a Increment Accumulator, INC Rr Increment Register, INC @R r Increment Data Memory Location