Subversion Repositories SvarDOS

Rev

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

Rev 410 Rev 414
Line 23... Line 23...
23
    return(-1);
23
    return(-1);
24
  }
24
  }
25
 
25
 
26
  /* one param? must be numeric in range 1+ */
26
  /* one param? must be numeric in range 1+ */
27
  if (p->argc == 1) {
27
  if (p->argc == 1) {
-
 
28
    unsigned char nlsfuncflag = 0;
28
    if (atouns(&nnn, p->argv[0]) != 0) {
29
    if (atouns(&nnn, p->argv[0]) != 0) {
29
      outputnl("Invalid code page number");
30
      outputnl("Invalid code page number");
30
      return(-1);
31
      return(-1);
31
    }
32
    }
32
    /* set code page to nnn */
-
 
33
    _asm {
33
    _asm {
-
 
34
      /* verify that NLSFUNC is installed */
34
      push ax
35
      push ax
35
      push bx
36
      push bx
36
 
37
 
-
 
38
      mov ax, 0x1400    /* DOS 3+ -- is NLSFUNC.EXE installed? */
-
 
39
      int 0x2f          /* AL = 0xff -> installed */
-
 
40
      cmp al, 0xff
-
 
41
      jne DONE
-
 
42
      mov [nlsfuncflag], 1
-
 
43
 
-
 
44
      /* set code page to nnn */
-
 
45
 
37
      mov ax, 0x6602    /* DOS 3.3+ -- Activate Code Page */
46
      mov ax, 0x6602    /* DOS 3.3+ -- Activate Code Page */
38
      mov bx, [nnn]
47
      mov bx, [nnn]
39
      int 0x21          /* CF set on error and err code in AX */
48
      int 0x21          /* CF set on error and err code in AX */
40
      jnc DONE
49
      jnc DONE
41
      mov [errcode], ax /* store err code in nnn on failure */
50
      mov [errcode], ax /* store err code in nnn on failure */
42
      DONE:
51
      DONE:
43
 
52
 
44
      pop bx
53
      pop bx
45
      pop ax
54
      pop ax
46
    }
55
    }
47
    if (errcode == 1) {   /* DOS ERR 1 means "Function number invalid" (ie. no NLS) */
56
    if (nlsfuncflag == 0) {
48
      outputnl("NLSFUNC not installed");
57
      outputnl("NLSFUNC not installed");
49
    } else if (errcode != 0) {
58
    } else if (errcode != 0) {
50
      outputnl("Failed to change code page");
59
      outputnl("Failed to change code page");
51
    }
60
    }
52
 
61