Subversion Repositories SvarDOS

Rev

Rev 379 | Rev 397 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 379 Rev 387
1
/*
1
/*
2
 * ver
2
 * ver
3
 */
3
 */
4
 
4
 
5
#define PVER "20211027"
5
#define PVER "20211027"
6
 
6
 
7
static int cmd_ver(struct cmd_funcparam *p) {
7
static int cmd_ver(struct cmd_funcparam *p) {
8
  char *buff = p->BUFFER;
8
  char *buff = p->BUFFER;
9
  unsigned char maj = 0, min = 0;
9
  unsigned char maj = 0, min = 0;
10
 
10
 
11
  /* help screen */
11
  /* help screen */
12
  if ((p->argc == 1) && (imatch(p->argv[0], "/?"))) {
12
  if (cmd_ishlp(p)) {
13
    outputnl("Displays the DOS version.");
13
    outputnl("Displays the DOS version.");
14
    return(-1);
14
    return(-1);
15
  }
15
  }
16
 
16
 
17
  if (p->argc != 0) {
17
  if (p->argc != 0) {
18
    outputnl("Invalid parameter");
18
    outputnl("Invalid parameter");
19
    return(-1);
19
    return(-1);
20
  }
20
  }
21
 
21
 
22
  _asm {
22
  _asm {
23
    push ax
23
    push ax
24
    push bx
24
    push bx
25
    push cx
25
    push cx
26
    mov ah, 0x30   /* Get DOS version number */
26
    mov ah, 0x30   /* Get DOS version number */
27
    int 0x21       /* AL=maj_ver_num  AH=min_ver_num  BX,CX=OEM */
27
    int 0x21       /* AL=maj_ver_num  AH=min_ver_num  BX,CX=OEM */
28
    mov [maj], al
28
    mov [maj], al
29
    mov [min], ah
29
    mov [min], ah
30
    pop cx
30
    pop cx
31
    pop bx
31
    pop bx
32
    pop ax
32
    pop ax
33
  }
33
  }
34
 
34
 
35
  sprintf(buff, "DOS kernel version %u.%u", maj, min);
35
  sprintf(buff, "DOS kernel version %u.%u", maj, min);
36
 
36
 
37
  outputnl(buff);
37
  outputnl(buff);
38
  outputnl("SvarCOM shell ver " PVER);
38
  outputnl("SvarCOM shell ver " PVER);
39
  return(-1);
39
  return(-1);
40
}
40
}
41
 
41