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

linux: add CONFIG_SND_PCSP
author Pascal Bellard <pascal.bellard@slitaz.org>
date Mon Jan 13 11:52:56 2020 +0100 (2020-01-13)
parents 5b6c86ca3faa
children 3d19917d3a03
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 include "himem.inc"
94 ;***************************************************************
95 ;_fastcall void xmm_alloc(struct image_himem *m)
96 ;***************************************************************
97 global @xmm_alloc$qp11image_himem:near
98 proc @xmm_alloc$qp11image_himem near
100 ifndef NO386
101 mov edx,[(image_himem bx).size] ; m->size
102 ;dec edx
103 shr edx,10 ; to Kb
104 inc edx
105 mov ah,89h ;allocate blk of EDX kilobytes
106 else
107 ;mov ax,-1
108 ;cwd
109 ;add ax,[word (image_himem bx).size] ; lo m->size
110 ;adc dx,[word (image_himem bx+2).size] ; hi m->size
111 les ax,[dword (image_himem bx).size] ; m->size
112 mov cl,16-10
113 extrn N_LXLSH@ES:near
114 call N_LXLSH@ES
115 inc dx
116 mov ah,9h ;allocate blk of DX kilobytes (<64Mb)
117 endif
118 push bx
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 pop bx
128 jnz @@err
129 mov [word (image_himem bx).buf],ax ; lo m->buf
130 mov [word (image_himem bx+2).buf],dx ; hi m->buf
131 @@err:
132 ret
134 endp @xmm_alloc$qp11image_himem
136 ends _TEXT
138 end
140 ;###### END OF FILE ############################################