source: sbliveos2/trunk/drv16/vddentry.asm@ 151

Last change on this file since 151 was 151, checked in by sandervl, 25 years ago

update

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.3 KB
Line 
1; $Id: vddentry.asm 151 2000-05-28 16:50:46Z sandervl $
2
3.386
4.seq
5
6_HEADER segment dword public use16 'DATA'
7_HEADER ends
8
9_DATA segment dword public use16 'DATA'
10_DATA ends
11
12CONST segment dword public use16 'DATA'
13CONST ends
14
15CONST2 segment dword public use16 'DATA'
16CONST2 ends
17
18_BSS segment dword public use16 'BSS'
19_BSS ends
20
21_ENDDS segment dword public use16 'ENDDS'
22_ENDDS ends
23
24_INITDATA segment dword public use16 'ENDDS'
25_INITDATA ends
26
27_ENDINITDATA segment dword public use16 'ENDDS'
28_ENDINITDATA ends
29
30_TEXT segment dword public use16 'CODE'
31_TEXT ends
32
33RMCODE segment dword public use16 'CODE'
34RMCODE ends
35
36_ENDCS segment dword public use16 'CODE'
37_ENDCS ends
38
39_INITTEXT segment dword public use16 'CODE'
40_INITTEXT ends
41
42DGROUP group _HEADER, CONST, CONST2, _DATA, _BSS, _ENDDS, _INITDATA, _ENDINITDATA
43CGROUP group _TEXT, RMCODE, _ENDCS, _INITTEXT
44
45
46_TEXT SEGMENT DWORD PUBLIC USE16 'CODE'
47 assume cs:cgroup, ds:dgroup
48
49
50; Route VDD IDC request to C code to implement
51; 16:16 entry from 16:32 caller
52;
53; Called from VDD using pascal calling conventions:
54; Parms pushed left to right, callee clears the stack
55;
56ulFunc EQU DWORD PTR [bp+18] ; Pascal conventions push parms left to right
57ul1 EQU DWORD PTR [bp+14] ; 8 bytes for 16:32 far return address
58ul2 EQU DWORD PTR [bp+10] ; 2 bytes for save of callers stack frame ptr
59
60 PUBLIC IDCENTRY_VDD
61 EXTERN IDCENTRY_VDD_C:near
62IDCENTRY_VDD PROC FAR ; 16:16 entry from 16:32 ; VDD calls PDD
63 push bp
64 mov bp, sp
65 push ds
66 mov ax, seg _DATA
67 push ulFunc ; pascal calling convention
68 mov ds, ax
69 push ul1
70 push ul2
71 call IDCENTRY_VDD_C
72 shl edx, 16 ; Move DX:AX return value
73 and eax, 0000FFFFh ; into eax
74 pop ds
75 or eax, edx
76 leave
77 db 66h ; Force next instruction 32-bit
78 ret 12 ; 16:32 far return, pop parms
79IDCENTRY_VDD ENDP
80
81pPacket EQU DWORD PTR [bp+10h] ; 8 bytes for 16:32 far return address
82ulCmd EQU DWORD PTR [bp+0Ch] ; cdecl conventions push parms right to left
83
84 PUBLIC _OSSIDC_ENTRY
85 EXTERN _OSSIDC_EntryPoint:near
86_OSSIDC_ENTRY PROC FAR ; 16:16 entry from 16:32 ; called from 32 bits pdd
87 push ebp
88 mov bp, sp
89 push ds
90 mov ax, seg _DATA
91 push DWORD PTR [bp+10h] ; cdecl calling convention
92 mov ds, ax
93 push DWORD PTR [bp+0Ch]
94 call _OSSIDC_EntryPoint
95 add sp, 8
96 shl edx, 16 ; Move DX:AX return value
97 and eax, 0000FFFFh ; into eax
98 pop ds
99 or eax, edx
100 pop ebp
101 db 66h ; Force next instruction 32-bit
102 ret ; 16:32 far return
103_OSSIDC_ENTRY ENDP
104
105 PUBLIC _inpd
106_inpd proc near
107 in eax, dx
108 mov dx, ax
109 shr eax, 16
110 xchg ax, dx
111 ret
112_inpd endp
113
114 PUBLIC _outpd
115_outpd proc near
116 mov ax, cx
117 shl eax, 16
118 mov ax, bx
119 out dx, eax
120 ret
121_outpd endp
122
123_TEXT ENDS
124
125END
Note: See TracBrowser for help on using the repository browser.