
190
PROGRAMMING EXAMPLESIII
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 count
CJNE A, #24H, GOBAK ; no need to reset hour
MOV 31H, #00H ; reset hour count also
GOBAK: RET ; over
13.6 | Display Shift for Right Entry
Example 13.6
Purpose: To highlight the coordination of XCH, XCHD and SWAP instructions.
Problem
A four-digit BCD display to be shifted left by one digit in order to accommodate a f ...