Subversion Repositories SvarDOS

Rev

Rev 1042 | Rev 1066 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1042 Rev 1056
Line 29... Line 29...
29
#define PVER "2022.3"
29
#define PVER "2022.3"
30
#define COPYRDATE "2021-2022"
30
#define COPYRDATE "2021-2022"
31
 
31
 
32
static enum cmd_result cmd_ver(struct cmd_funcparam *p) {
32
static enum cmd_result cmd_ver(struct cmd_funcparam *p) {
33
  char *buff = p->BUFFER;
33
  char *buff = p->BUFFER;
34
  unsigned char maj = 0, min = 0;
34
  unsigned char maj = 0, min = 0, rev = 0, verflags = 0;
35
 
35
 
36
  /* help screen */
36
  /* help screen */
37
  if (cmd_ishlp(p)) {
37
  if (cmd_ishlp(p)) {
38
    nls_outputnl(20,0); /* "Displays the DOS version." */
38
    nls_outputnl(20,0); /* "Displays the DOS version." */
39
    outputnl("");
39
    outputnl("");
40
    outputnl("ver [/about]");
40
    output("ver [/about]");
41
#ifdef VERDBG
41
#ifdef VERDBG
42
    outputnl("ver /dbg");
42
    output(" [/dbg]");
43
#endif
43
#endif
-
 
44
    outputnl("");
44
    return(CMD_OK);
45
    return(CMD_OK);
45
  }
46
  }
46
 
47
 
47
#ifdef VERDBG
48
#ifdef VERDBG
48
  if ((p->argc == 1) && (imatch(p->argv[0], "/dbg"))) {
49
  if ((p->argc == 1) && (imatch(p->argv[0], "/dbg"))) {
Line 98... Line 99...
98
    outputnl("potrafili docenic wartosci minionych pokolen, jednoczesnie czerpiac radosc");
99
    outputnl("potrafili docenic wartosci minionych pokolen, jednoczesnie czerpiac radosc");
99
    outputnl("z prostych przyjemnosci dnia codziennego.  Lair, jesien 2021.");
100
    outputnl("z prostych przyjemnosci dnia codziennego.  Lair, jesien 2021.");
100
    return(CMD_OK);
101
    return(CMD_OK);
101
  }
102
  }
102
 
103
 
103
  if (p->argc != 0) {
-
 
104
    nls_outputnl(0,6); /* "Invalid parameter" */
-
 
105
    return(CMD_FAIL);
-
 
106
  }
-
 
107
 
-
 
108
  _asm {
104
  _asm {
109
    push ax
105
    push ax
110
    push bx
106
    push bx
111
    push cx
107
    push cx
-
 
108
    push dx
-
 
109
 
112
    mov ah, 0x30   /* Get DOS version number */
110
    mov ax, 0x3306 /* Get true DOS version number */
113
    int 0x21       /* AL=maj_ver_num  AH=min_ver_num  BX,CX=OEM */
111
    int 0x21       /* AL=maj_ver_num  AH=min_ver_num  BX,CX=OEM */
114
    mov [maj], al
112
    mov [maj], bl
115
    mov [min], ah
113
    mov [min], bh
-
 
114
    mov [rev], dl
-
 
115
    mov [verflags], dh
-
 
116
 
-
 
117
    pop dx
116
    pop cx
118
    pop cx
117
    pop bx
119
    pop bx
118
    pop ax
120
    pop ax
119
  }
121
  }
120
 
122
 
121
  sprintf(buff, svarlang_str(20,1), maj, min); /* "DOS kernel version %u.%u" */
123
  sprintf(buff, svarlang_str(20,1), maj, min); /* "DOS kernel version %u.%u" */
-
 
124
  outputnl(buff);
122
 
125
 
-
 
126
  sprintf(buff, svarlang_str(20,5), 'A' + rev); /* Revision %c */
123
  outputnl(buff);
127
  outputnl(buff);
-
 
128
 
-
 
129
  {
-
 
130
    const char *loc = svarlang_str(20,7);        /* low memory */
-
 
131
    if (verflags & 16) loc = svarlang_str(20,8); /* HMA */
-
 
132
    if (verflags & 8) loc = svarlang_str(20,9);  /* ROM */
-
 
133
    sprintf(buff, svarlang_str(20,6), loc);      /* DOS is in %s */
-
 
134
    outputnl(buff);
-
 
135
  }
-
 
136
 
-
 
137
  outputnl("");
124
  nls_output(20,2); /* "SvarCOM shell ver" */
138
  nls_output(20,2); /* "SvarCOM shell ver" */
125
  outputnl(" " PVER);
139
  outputnl(" " PVER);
-
 
140
 
126
  return(CMD_OK);
141
  return(CMD_OK);
127
}
142
}