Subversion Repositories SvarDOS

Rev

Rev 1629 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1629 Rev 1823
Line 36... Line 36...
36
 
36
 
37
#include "helpers.h"
37
#include "helpers.h"
38
 
38
 
39
 
39
 
40
 
40
 
-
 
41
void dos_get_date(unsigned short *y, unsigned char *m, unsigned char *d) {
-
 
42
  /* get cur date */
-
 
43
  _asm {
-
 
44
    mov ah, 0x2a  /* DOS 1+ -- Query DOS Date */
-
 
45
    int 0x21      /* CX=year DH=month DL=day */
-
 
46
    mov bx, y
-
 
47
    mov [bx], cx
-
 
48
    mov bx, m
-
 
49
    mov [bx], dh
-
 
50
    mov bx, d
-
 
51
    mov [bx], dl
-
 
52
  }
-
 
53
}
-
 
54
 
-
 
55
 
-
 
56
void dos_get_time(unsigned char *h, unsigned char *m, unsigned char *s) {
-
 
57
  _asm {
-
 
58
    mov ah, 0x2c  /* DOS 1+ -- Query DOS Time */
-
 
59
    int 0x21      /* CH=hour CL=minutes DH=seconds DL=1/100sec */
-
 
60
    mov bx, h
-
 
61
    mov [bx], ch
-
 
62
    mov bx, m
-
 
63
    mov [bx], cl
-
 
64
    mov bx, s
-
 
65
    mov [bx], dh
-
 
66
  }
-
 
67
}
-
 
68
 
-
 
69
 
41
/* case-insensitive comparison of strings, compares up to maxlen characters.
70
/* case-insensitive comparison of strings, compares up to maxlen characters.
42
 * returns non-zero on equality. */
71
 * returns non-zero on equality. */
43
int imatchlim(const char *s1, const char *s2, unsigned short maxlen) {
72
int imatchlim(const char *s1, const char *s2, unsigned short maxlen) {
44
  while (maxlen--) {
73
  while (maxlen--) {
45
    char c1, c2;
74
    char c1, c2;