2022-08-07 20:10:08 +00:00
|
|
|
#
|
|
|
|
! $Source$
|
|
|
|
! $State$
|
|
|
|
! $Revision$
|
|
|
|
|
2022-08-26 17:20:56 +00:00
|
|
|
#include "libsysasm.h"
|
2022-08-07 20:10:08 +00:00
|
|
|
|
|
|
|
! .sys_zret: if the carry flag is set, then set `errno' from the DOS error
|
2022-08-17 20:34:06 +00:00
|
|
|
! code in ax, and return an int -1. If the carry flag is clear, just
|
|
|
|
! return an int zero.
|
2022-08-07 20:10:08 +00:00
|
|
|
!
|
|
|
|
! .sys_axret: if the carry flag is set, then set `errno' from the DOS error
|
|
|
|
! code in ax, and return a shortword -1. If the carry flag is clear, just
|
2022-08-26 17:20:56 +00:00
|
|
|
! return eax := ax as a return value.
|
2022-08-07 20:10:08 +00:00
|
|
|
!
|
2022-08-24 15:17:04 +00:00
|
|
|
! .sys_dxaxret: same as .sys_axret, but return -1 or eax := dx:ax as a
|
|
|
|
! return value.
|
2022-08-26 17:20:56 +00:00
|
|
|
!
|
|
|
|
! .sys_toolongret: a file name is too long: set `errno' to E2BIG, and return
|
|
|
|
! -1.
|
2022-08-07 20:10:08 +00:00
|
|
|
|
|
|
|
.extern .sys_zret
|
|
|
|
.extern .sys_axret
|
|
|
|
.extern .sys_dxaxret
|
2022-08-26 17:20:56 +00:00
|
|
|
.extern .sys_toolongret
|
2022-08-07 20:10:08 +00:00
|
|
|
.sys_zret:
|
|
|
|
jc error
|
2022-08-17 20:34:06 +00:00
|
|
|
xor eax, eax
|
2022-08-07 20:10:08 +00:00
|
|
|
no_error:
|
|
|
|
ret
|
2022-08-17 20:34:06 +00:00
|
|
|
|
2022-08-07 20:10:08 +00:00
|
|
|
.sys_axret:
|
2022-08-17 20:34:06 +00:00
|
|
|
jc error
|
2022-08-26 17:20:56 +00:00
|
|
|
movzx eax, ax
|
2022-08-17 20:34:06 +00:00
|
|
|
ret
|
|
|
|
|
2022-08-07 20:10:08 +00:00
|
|
|
.sys_dxaxret:
|
2022-08-17 20:34:06 +00:00
|
|
|
jc error
|
|
|
|
shl edx, 16
|
|
|
|
o16 mov dx, ax
|
|
|
|
mov eax, edx
|
|
|
|
ret
|
|
|
|
|
2022-08-26 17:20:56 +00:00
|
|
|
.sys_toolongret:
|
|
|
|
mov (_errno), 7 ! E2BIG
|
|
|
|
or eax, -1
|
|
|
|
ret
|
|
|
|
|
2022-08-07 20:10:08 +00:00
|
|
|
error:
|
2022-08-17 20:34:06 +00:00
|
|
|
movzx eax, ax
|
|
|
|
push eax
|
2022-08-07 20:10:08 +00:00
|
|
|
call __sys_seterrno
|
2022-08-17 20:34:06 +00:00
|
|
|
pop ecx
|
2022-08-07 20:10:08 +00:00
|
|
|
ret
|