Subversion Repositories SvarDOS

Rev

Rev 387 | Go to most recent revision | Details | Last modification | View Log | RSS feed

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