Mitsubishi Motors DS5000TK User Manual

Page 161

Advertising
background image

USER’S GUIDE

050396 160/173

161

LCALL RBYTE ; Read the day of month.
ANL A, #3FH ; Isolate it.
LCALL HEX_OUT ; Display day of month.
MOV A, #’/’
LCALL CHAR_OUT
MOV R0, #10
LCALL RBYTE ; Read the year.
LCALL HEX_OUT ; Display the year.
MOV DPTR, #TEXT2
LCALL TEXT_OUT
MOV R0, #4
LCALL RBYTE ; Read the hour.
DEC R0
LCALL HEX_OUT ; Display the hour.
MOV A, #’:’
LCALL CHAR_OUT
LCALL RBYTE ; Read the minute.
LCALL HEX_OUT ; Display the minute.
MOV A, #’:’
LCALL CHAR_OUT
LCALL RBYTE ; Read the second.
LCALL HEX_OUT ; Display the second.
MOV A, #’.’
LCALL CHAR_OUT
LCALL RBYTE ; Read fraction of second.
LCALL HEX_OUT ; Display fraction of second.
MOV DPTR, #TEXT3
LCALL TEXT_OUT
MOV A, #80H
MOV R0, #11
LCALL WBYTE ; Un–freeze the registers.
;
SJMP CONTINUE ; Repeat indefinitely.
;
;Utilities

HEX_IN:
MOV B, #0
HEX_LP:
LCALL CHAR_IN
LCALL CHAR_OUT
CJNE A, #0DH, NOT_CR
MOV A, B
RET
NOT_CR:
ADD A, #–30H
JNC HEX_LP
CJNE A, #10, $+3
JC HEX_XX
ADD A, #–7
CJNE A, #10, $+3
JC HEX_LP
CJNE A, #16, $+3
JNC HEX_LP
HEX_XX:
XCH A, B
ANL A, #0FH
SWAP A

Advertising
This manual is related to the following products: