Skip to Main Content
8051 Microcontroller (Internals, Instructions, Programming and Interfacing)
book

8051 Microcontroller (Internals, Instructions, Programming and Interfacing)

by Subrata Ghosal
May 2024
Intermediate to advanced content levelIntermediate to advanced
503 pages
17h 2m
English
Pearson India
Content preview from 8051 Microcontroller (Internals, Instructions, Programming and Interfacing)
181
A routine to increment the minute counter should process both memory locations. A program for that,
using DA A instruction, may be developed as follows.
; Program to update the BCD minute (and hour, if necessary) counter of a clock.
UPCLK: MOV A, 30H ; old BCD minute count in A
ADD A, #01H ; increment it by one
DA A ; adjust for BCD increment
MOV 30H, A ; update minute count
CJNE A, #60H, GOBAK ; yet to complete an hour
MOV 30H, #00H ; 1 h over, set minute as 00
MOV A, 31H ; get hour count in A
ADD A, #01H ; increment hour by one
DA A ; adjust for BCD increment
MOV 31H, A ; store back hour ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

8051 Microcontroller, Internals, Instructions, Programming and Interfacing, 2nd Edition

8051 Microcontroller, Internals, Instructions, Programming and Interfacing, 2nd Edition

Subrata Ghoshal

Publisher Resources

ISBN: 9781282655034Publisher Website