2 ; date_verify loosely checks bcd date values to be in range in bin_date_time
5 assume ds:code,es:nothing
6 cmp byte ptr bin_date_time+0,20h ; century check
7 ja date_error ; jmp error
8 jz century_20 ; jmp in 20th century
9 cmp byte ptr bin_date_time+0,19h ; century check
10 jb date_error ; jmp error
11 cmp byte ptr bin_date_time+1,80h ; year check
12 jb date_error ; jmp error
14 cmp byte ptr bin_date_time+1,99h ; year check
15 ja date_error ; jmp error
16 cmp byte ptr bin_date_time+2,12h ; month check
17 ja date_error ; jmp error
18 cmp byte ptr bin_date_time+2,00h ; month check
19 jbe date_error ; jmp error
20 cmp byte ptr bin_date_time+3,31h ; day check
21 ja date_error ; jmp error
22 cmp byte ptr bin_date_time+3,00h ; day check
23 jbe date_error ; jmp error
24 clc ; set success flag
31 ; time_verify very loosely checks bcd date values to be in range in bin_date_time
34 assume ds:code,es:nothing
35 cmp byte ptr bin_date_time+0,24H
37 cmp byte ptr bin_date_time+1,59H
39 cmp byte ptr bin_date_time+2,59H
48 ; bcd_verify checks values in bin_date_time to be valid
49 ; bcd numerals. carry set if any nibble out of range
52 assume ds:code,es:nothing
53 mov cx,4 ; 4 bytes to check
54 mov bx,offset bin_date_time ;
56 mov al,[bx] ; get a bcd number (0..99)
58 and ax,0f00fh ; 10's place in high ah, 1's in al
59 cmp al,10 ; is 1's place in range?
60 ja bv_error ; jmp out of range
61 shr ah,1 ; swap nibbles
65 and ah,0fh ; get rid of any erroneous bits
66 cmp ah,10 ; is 10's place in range
67 ja bv_error ; jmp out of range
71 clc ; set success flag
77 ; Dos 3.30 - The real time clock structures were moved to msbio2.asm