]> wirehaze git hosting - MS-DOS.git/blob - v4.0/src/MAPPER/LSEEK.ASM

wirehaze git hosting

MZ is back!
[MS-DOS.git] / v4.0 / src / MAPPER / LSEEK.ASM
1 ;
2 page 80,132
3 ;\e0\ f
4 title CP/DOS DosChgFilePtr mapper * * *
5 ;
6 dosxxx segment byte public 'dos'
7 assume cs:dosxxx,ds:nothing,es:nothing,ss:nothing
8
9 ;**********************************************************************
10 ;*
11 ;* MODULE: doschgfileptr
12 ;*
13 ;* FILE NAME: dos007.asm
14 ;*
15 ;* CALLING SEQUENCE:
16 ;*
17 ;* push word file handle
18 ;* push dword distance
19 ;* push word move type
20 ;* push@ dword new pointer
21 ;* call doschgfileptr
22 ;*
23 ;* MODULES CALLED: PC-DOS Int 21h, ah=42h, move file pointer
24 ;*
25 ;*********************************************************************
26
27 public doschgfileptr
28 .sall
29 .xlist
30 include macros.inc
31 .list
32
33 str struc
34 old_bp dw ?
35 return dd ?
36 newptr dd ? ; new file pointer
37 movtyp dw ? ; move type
38 dstnce dd ? ; distance to be moved
39 handle dw ? ; file handle
40 str ends
41
42 doschgfileptr proc far
43 Enter doschgfileptr ; push registers
44
45 push es
46 les dx,[bp].dstnce
47 mov cx,es ; set distance
48 pop es
49 mov ax,[bp].movtyp ; get move type
50 mov bx,[bp].handle ; get handle
51
52 mov ah,42h
53 int 21h ; move file pointer
54 jc exit ; return if error
55
56 lds si,[bp].newptr ; set pointer
57 mov word ptr [si],ax ; save the new pointer
58 mov word ptr [si]+2,dx ;
59 sub ax,ax ; set godd return code
60
61 exit: mexit ;pop registers
62 ret size str - 6 ;return
63
64 doschgfileptr endp
65
66 dosxxx ends
67
68 end