Subversion Repositories SvarDOS

Rev

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

Rev 1556 Rev 1557
Line 27... Line 27...
27
}
27
}
28
 
28
 
29
unsigned short mdr_dos_fopen(const char *fname, unsigned short *fhandle) {
29
unsigned short mdr_dos_fopen(const char *fname, unsigned short *fhandle) {
30
  unsigned short res = 0;
30
  unsigned short res = 0;
31
  unsigned short handle = 0;
31
  unsigned short handle = 0;
32
  unsigned short fname_seg = FP_SEG(fname);
-
 
33
  unsigned short fname_off = FP_OFF(fname);
-
 
34
  _asm {
32
  _asm {
35
    push cx
33
    push cx
36
    push dx
34
    push dx
37
 
35
 
38
    mov ax, 0x3d00
36
    mov ax, 0x3d00
39
    mov dx, fname_off
37
    mov dx, fname
40
    xor cl, cl
38
    xor cl, cl
41
    push ds
-
 
42
    mov ds, fname_seg
-
 
43
    int 0x21
39
    int 0x21
44
    pop ds
-
 
45
    jc err
40
    jc err
46
    mov handle, ax
41
    mov handle, ax
47
    jmp done
42
    jmp done
48
    err:
43
    err:
49
    mov res, ax
44
    mov res, ax
Line 110... Line 105...
110
 
105
 
111
  return(segnum);
106
  return(segnum);
112
}
107
}
113
 
108
 
114
 
109
 
115
unsigned short mdr_dos_resizeblock(unsigned short siz, unsigned short segn, unsigned short *maxsiz) {
110
unsigned short mdr_dos_resizeblock(unsigned short siz, unsigned short segn) {
116
  unsigned short resbx = 0;
-
 
117
  unsigned short res = 0;
111
  unsigned short res = 0;
118
 
112
 
119
  _asm {
113
  _asm {
120
    push bx
114
    push bx
121
    push es
115
    push es
Line 123... Line 117...
123
    mov ah, 0x4a
117
    mov ah, 0x4a
124
    mov bx, siz
118
    mov bx, siz
125
    mov es, segn
119
    mov es, segn
126
    int 0x21
120
    int 0x21
127
    jnc done
121
    jnc done
128
    mov resbx, bx
-
 
129
    mov res, ax
122
    mov res, ax
130
 
123
 
131
    done:
124
    done:
132
 
125
 
133
    pop es
126
    pop es
134
    pop bx
127
    pop bx
135
  }
128
  }
136
 
129
 
137
  *maxsiz = resbx;
-
 
138
  return(res);
130
  return(res);
139
}
131
}
140
 
132
 
141
 
133
 
142
unsigned short mdr_dos_read(unsigned short handle, void far *buf, unsigned short count, unsigned short *bytes) {
134
unsigned short mdr_dos_read(unsigned short handle, void far *buf, unsigned short count, unsigned short *bytes) {