wok view linld/stuff/src/XMM.ASM @ rev 23992

linld: skip xmm_alloc
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Dec 12 10:41:29 2020 +0000 (2020-12-12)
parents 53c1379e13fa
children a946c1651082
line source
1 ;***************************************************************
2 ;****** This file is distributed under GPL
3 ;***************************************************************
4 ideal
5 %PAGESIZE 1000
6 %crefref
7 %noincl
8 %nomacs
9 ifdef NO386
10 p8086
11 else
12 p386
13 endif
15 group DGROUP _TEXT,_BSS
16 assume cs:DGROUP,ds:DGROUP
18 segment _BSS byte public use16 'BSS'
20 xmm_handler dd ?
22 ends _BSS
24 segment _TEXT byte public use16 'CODE'
26 ;***************************************************************
27 ;void enable_a20_xmm();
28 ;***************************************************************
29 global _enable_a20_xmm:near
30 proc _enable_a20_xmm near
32 mov ah,03h ;global enable a20
33 call xmm_driver ;
34 mov ah,05h ;local enable a20
35 ;jmp xmm_driver ;
37 endp _enable_a20_xmm
39 ;***************************************************************
40 ;Call xmm driver addr or 0 if no xmm
41 ;void xmm_driver(ah)
42 ;***************************************************************
43 proc xmm_driver near
45 push si
46 mov si,offset xmm_handler
47 ifndef NO386
48 cmp [dword si],0
49 jne @@gotit
50 push ax ; save cmd
51 mov ax,4300h ; installation check in al
52 else
53 push ax ; save cmd
54 lodsw
55 or ax,[word si]
56 jne @@gotit
57 mov ah,43h ; installation check in al
58 endif
60 int 2fh
61 mov bx,offset xmm_fail
62 push ds
63 pop es
64 cmp al,80h
65 jne @@err
66 mov ax,4310h ; get driver address in es:bx
67 int 2fh
68 @@err:
69 ifndef NO386
70 pop ax ; restore cmd
71 mov [si],bx
72 mov [si+2],es
73 @@gotit:
74 call [dword si] ; far ptr [si]
75 else
76 mov [si-2],bx
77 mov [si],es
78 @@gotit:
79 pop ax ; restore cmd
80 call [dword si-2] ; far ptr [si-2]
81 endif
82 dec ax ; Z=1=OK
83 pop si
84 ret
85 xmm_fail:
86 xor ax,ax
87 cwd
88 retf
90 endp xmm_driver
92 ifdef WITH_XMM_ALLOC
93 include "himem.inc"
95 ;***************************************************************
96 ;_fastcall void xmm_alloc(si:struct image_himem *m)
97 ;***************************************************************
98 global @xmm_alloc$qp11image_himem:near
99 proc @xmm_alloc$qp11image_himem near
101 ifndef NO386
102 mov edx,[(image_himem si).size] ; m->size
103 ;dec edx
104 shr edx,10 ; to Kb
105 inc edx
106 mov ah,89h ;allocate blk of EDX kilobytes
107 else
108 ;mov ax,-1
109 ;cwd
110 ;add ax,[word (image_himem si).size] ; lo m->size
111 ;adc dx,[word (image_himem si+2).size] ; hi m->size
112 les ax,[dword (image_himem si).size] ; m->size
113 mov cl,16-10
114 extrn N_LXLSH@ES:near
115 call N_LXLSH@ES
116 inc dx
117 mov ah,9h ;allocate blk of DX kilobytes (<64Mb)
118 endif
119 call xmm_driver ;
120 jnz @@goerr
121 ;now: dx=handle of the blk
122 mov ah,0Ch ;lock blk
123 call xmm_driver ;
124 ;now: dx:bx=addr of blk
125 xchg ax,bx
126 @@goerr:
127 jnz @@err
128 mov [word (image_himem bx).buf],ax ; lo m->buf
129 mov [word (image_himem bx+2).buf],dx ; hi m->buf
130 @@err:
131 ret
133 endp @xmm_alloc$qp11image_himem
134 endif
136 ends _TEXT
138 end
140 ;###### END OF FILE ############################################