summaryrefslogtreecommitdiff
path: root/v4.0/src/MAPPER/LSEEK.ASM
diff options
context:
space:
mode:
Diffstat (limited to 'v4.0/src/MAPPER/LSEEK.ASM')
-rw-r--r--v4.0/src/MAPPER/LSEEK.ASM68
1 files changed, 68 insertions, 0 deletions
diff --git a/v4.0/src/MAPPER/LSEEK.ASM b/v4.0/src/MAPPER/LSEEK.ASM
new file mode 100644
index 0000000..450f8c7
--- /dev/null
+++ b/v4.0/src/MAPPER/LSEEK.ASM
@@ -0,0 +1,68 @@
1;
2page 80,132
3;0
4title CP/DOS DosChgFilePtr mapper * * *
5;
6dosxxx 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
33str struc
34old_bp dw ?
35return dd ?
36newptr dd ? ; new file pointer
37movtyp dw ? ; move type
38dstnce dd ? ; distance to be moved
39handle dw ? ; file handle
40str ends
41
42doschgfileptr 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
61exit: mexit ;pop registers
62 ret size str - 6 ;return
63
64doschgfileptr endp
65
66dosxxx ends
67
68 end