Subversion Repositories SvarDOS

Compare Revisions

Ignore whitespace Rev 396 → Rev 397

/svarcom/trunk/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 (cmd_ishlp(p)) {
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);
}