Subversion Repositories SvarDOS

Rev

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

Rev 1780 Rev 1781
Line 78... Line 78...
78
 * functions. Using them avoids a dependency on FILE, hence makes the binary
78
 * functions. Using them avoids a dependency on FILE, hence makes the binary
79
 * smaller if the application does not need to pull fopen() and friends
79
 * smaller if the application does not need to pull fopen() and friends
80
 * I use pragma aux directives for more compact size. open-watcom only. */
80
 * I use pragma aux directives for more compact size. open-watcom only. */
81
#ifndef WITHSTDIO
81
#ifndef WITHSTDIO
82
 
82
 
83
static unsigned short FOPEN(const char *s);
83
static unsigned short FOPEN(const char far *s);
84
 
84
 
85
#pragma aux FOPEN = \
85
#pragma aux FOPEN = \
86
"push ds" \
86
"push ds" \
-
 
87
"push es" \
87
"mov ds, ax" \
88
"pop ds" \
88
"mov ax, 0x3D00" /* open file, read-only (fname at DS:DX) */ \
89
"mov ax, 0x3D00" /* open file, read-only (fname at DS:DX) */ \
89
"int 0x21" \
90
"int 0x21" \
90
"jnc DONE" \
91
"jnc DONE" \
91
"xor ax, ax" \
92
"xor ax, ax" \
92
"DONE:" \
93
"DONE:" \
93
"pop ds" \
94
"pop ds" \
94
parm [ax dx] \
95
parm [es dx] \
95
value [ax];
96
value [ax];
96
 
97
 
97
 
98
 
98
static void FCLOSE(unsigned short handle);
99
static void FCLOSE(unsigned short handle);
99
 
100
 
Line 135... Line 136...
135
 
136
 
136
  return(res);
137
  return(res);
137
}
138
}
138
 
139
 
139
 
140
 
140
static void FSEEK(unsigned short handle, unsigned short bytes) {
141
static void FSEEK(unsigned short handle, unsigned short bytes);
-
 
142
 
141
  _asm {
143
#pragma aux FSEEK = \
142
    mov ax, 0x4201  /* move file pointer from cur pos + CX:DX */
144
"mov ax, 0x4201"  /* move file pointer from cur pos + CX:DX */ \
143
    mov bx, handle
145
"xor cx, cx" \
144
    xor cx, cx
146
"int 0x21" \
145
    mov dx, bytes
147
parm [bx] [dx] \
146
    int 0x21
148
modify [ax cx dx]
147
  }
-
 
148
}
149
 
149
#endif
150
#endif
150
 
151
 
151
 
152
 
152
int svarlang_load(const char *fname, const char *lang) {
153
int svarlang_load(const char *fname, const char *lang) {
153
  unsigned short langid;
154
  unsigned short langid;