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

linld: add iso support
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Jan 08 20:15:35 2021 +0000 (2021-01-08)
parents 3d19917d3a03
children 5c1ce90eb1d6
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
16 assume cs:DGROUP,ds:DGROUP
18 segment _TEXT byte public use16 'CODE'
20 ;***************************************************************
21 ;void enable_a20_xmm();
22 ;***************************************************************
23 global _enable_a20_xmm:near
24 proc _enable_a20_xmm near
26 mov ah,03h ;global enable a20
27 call xmm_driver ;
28 mov ah,05h ;local enable a20
29 ;jmp xmm_driver ;
31 endp _enable_a20_xmm
33 ;***************************************************************
34 ;Call xmm driver addr or 0 if no xmm
35 ;void xmm_driver(ah)
36 ;***************************************************************
37 proc xmm_driver near
39 push ax ; save cmd
40 mov ax,4300h ; installation check in al
41 int 2fh
42 mov bx,offset @@xmm_fail
43 push cs
44 pop es
45 cmp al,80h
46 jne @@err
47 mov ax,4310h ; get driver address in es:bx
48 int 2fh
49 @@err:
50 pop ax ; restore cmd
52 push cs ; call far
53 call @@jmp_esbx
54 dec ax ; Z=1=OK
55 ret
57 @@jmp_esbx:
58 push es ; \
59 push bx ; > jmp far es:bx
60 retf ; /
62 @@xmm_fail:
63 xor ax,ax
64 cwd
65 retf
67 endp xmm_driver
69 ifdef WITH_XMM_ALLOC
70 include "himem.inc"
72 ;***************************************************************
73 ;_fastcall void xmm_alloc(si:struct image_himem *m)
74 ;***************************************************************
75 global @xmm_alloc$qp11image_himem:near
76 proc @xmm_alloc$qp11image_himem near
78 ifndef NO386
79 mov edx,[(image_himem si).size] ; m->size
80 ;dec edx
81 shr edx,10 ; to Kb
82 inc edx
83 mov ah,89h ;allocate blk of EDX kilobytes
84 else
85 ;mov ax,-1
86 ;cwd
87 ;add ax,[word (image_himem si).size] ; lo m->size
88 ;adc dx,[word (image_himem si+2).size] ; hi m->size
89 les ax,[dword (image_himem si).size] ; m->size
90 mov cl,16-10
91 extrn N_LXLSH@ES:near
92 call N_LXLSH@ES
93 inc dx
94 mov ah,9h ;allocate blk of DX kilobytes (<64Mb)
95 endif
96 call xmm_driver ;
97 jnz @@goerr
98 ;now: dx=handle of the blk
99 mov ah,0Ch ;lock blk
100 call xmm_driver ;
101 ;now: dx:bx=addr of blk
102 xchg ax,bx
103 @@goerr:
104 jnz @@err
105 mov [word (image_himem bx).buf],ax ; lo m->buf
106 mov [word (image_himem bx+2).buf],dx ; hi m->buf
107 @@err:
108 ret
110 endp @xmm_alloc$qp11image_himem
111 endif
113 ends _TEXT
115 end
117 ;###### END OF FILE ############################################