发布于 2007-09-10 10:15:59
0楼
LD SM0.0 // Every scan cycle,
TODR VB4040 // read the real-time clock.
HTA VB4041, VB500, 2 // Convert the month to ASCII
// and display on the TD 200.
MOVB 16#2D, VB502 // Load a "-" for display.
HTA VB4042, VB503, 2 // Convert the day of the month
// and display.
MOVB 16#2D, VB505 // Load a "-" for display.
HTA VB4040, VB506, 2 // Convert the year to ASCII
// and display.
MOVW 16#2020, VW508 // Load two blanks.
MOVW 16#2020, VW510 // Load two blanks.
LD SM0.0 // Every scan cycle,
HTA VB4043, VB512, 2 // convert the hour to ASCII
// and display on the TD 200.
MOVB 16#3A, VB514 // Load a ":" for display.
HTA VB4044, VB515, 2 // Convert the minutes to ASCII
// and display on the TD 200.
MOVB 16#3A, VB517 // Load a ":" for display.
HTA VB4045, VB518, 2 // Convert the seconds to ASCII
// and display on the TD 200.
显示格式:
年-月-日 时-分-秒
求知上进.