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

yarock: fix FindTaglib.cmake
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Oct 19 10:25:12 2019 +0200 (2019-10-19)
parents 6e3d30b3031f
children 53c1379e13fa
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 else
50 mov cx,[word si]
51 or cx,[word si+2]
52 endif
53 jne @@gotit
55 push ax ; save cmd
56 mov ax,4300h ; installation check in al
57 int 2fh
58 mov bx,offset xmm_fail
59 push ds
60 pop es
61 cmp al,80h
62 jne @@err
63 mov ax,4310h ; get driver address in es:bx
64 int 2fh
65 @@err:
66 pop ax ; restore cmd
67 mov [si],bx
68 mov [si+2],es
69 @@gotit:
70 call [dword si] ; far ptr [si]
71 dec ax ; Z=1=OK
72 pop si
73 ret
74 xmm_fail:
75 xor ax,ax
76 cwd
77 retf
79 endp xmm_driver
81 include "himem.inc"
83 ;***************************************************************
84 ;_fastcall void xmm_alloc(struct image_himem *m)
85 ;***************************************************************
86 global @xmm_alloc$qp11image_himem:near
87 proc @xmm_alloc$qp11image_himem near
89 ifndef NO386
90 mov edx,[(image_himem bx).size] ; m->size
91 ;dec edx
92 shr edx,10 ; to Kb
93 inc edx
94 mov ah,89h ;allocate blk of EDX kilobytes
95 else
96 ;mov ax,-1
97 ;cwd
98 ;add ax,[word (image_himem bx).size] ; lo m->size
99 ;adc dx,[word (image_himem bx+2).size] ; hi m->size
100 les ax,[dword (image_himem bx).size] ; m->size
101 mov cl,16-10
102 extrn N_LXLSH@ES:near
103 call N_LXLSH@ES
104 inc dx
105 mov ah,9h ;allocate blk of DX kilobytes (<64Mb)
106 endif
107 push bx
108 call xmm_driver ;
109 jnz @@goerr
110 ;now: dx=handle of the blk
111 mov ah,0Ch ;lock blk
112 call xmm_driver ;
113 ;now: dx:bx=addr of blk
114 xchg ax,bx
115 @@goerr:
116 pop bx
117 jnz @@err
118 mov [word (image_himem bx).buf],ax ; lo m->buf
119 mov [word (image_himem bx+2).buf],dx ; hi m->buf
120 @@err:
121 ret
123 endp @xmm_alloc$qp11image_himem
125 ends _TEXT
127 end
129 ;###### END OF FILE ############################################