Subversion Repositories SvarDOS

Compare Revisions

Ignore whitespace Rev 378 → Rev 379

/svarcom/cmd/ver.c
0,0 → 1,40
/*
* ver
*/
 
#define PVER "20211027"
 
static int cmd_ver(struct cmd_funcparam *p) {
char *buff = p->BUFFER;
unsigned char maj = 0, min = 0;
 
/* help screen */
if ((p->argc == 1) && (imatch(p->argv[0], "/?"))) {
outputnl("Displays the DOS version.");
return(-1);
}
 
if (p->argc != 0) {
outputnl("Invalid parameter");
return(-1);
}
 
_asm {
push ax
push bx
push cx
mov ah, 0x30 /* Get DOS version number */
int 0x21 /* AL=maj_ver_num AH=min_ver_num BX,CX=OEM */
mov [maj], al
mov [min], ah
pop cx
pop bx
pop ax
}
 
sprintf(buff, "DOS kernel version %u.%u", maj, min);
 
outputnl(buff);
outputnl("SvarCOM shell ver " PVER);
return(-1);
}
/svarcom/cmd.c
27,6 → 27,7
#include "cmd/path.c"
#include "cmd/prompt.c"
#include "cmd/set.c"
#include "cmd/ver.c"
 
#include "cmd.h"
 
44,6 → 45,7
{"PATH", cmd_path},
{"PROMPT", cmd_prompt},
{"SET", cmd_set},
{"VER", cmd_ver},
{NULL, NULL}
};