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

syslinux/iso2exe: read isolinux.cfg
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Jan 12 07:47:12 2021 +0000 (2021-01-12)
parents a946c1651082
children bc4b94310a29
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 extrn _cmdnum:dword
79 skip_alloc = (byte _cmdnum+16)
80 cmp [skip_alloc],0
81 jne @@err
82 ifndef NO386
83 mov edx,[(image_himem si).size] ; m->size
84 ;dec edx
85 shr edx,10 ; to Kb
86 inc edx
87 mov ah,89h ;allocate blk of EDX kilobytes
88 else
89 ;mov ax,-1
90 ;cwd
91 ;add ax,[word (image_himem si).size] ; lo m->size
92 ;adc dx,[word (image_himem si+2).size] ; hi m->size
93 les ax,[dword (image_himem si).size] ; m->size
94 mov cl,16-10
95 extrn N_LXLSH@ES:near
96 call N_LXLSH@ES
97 inc dx
98 mov ah,9h ;allocate blk of DX kilobytes (<64Mb)
99 endif
100 call xmm_driver ;
101 jnz @@err
102 ;now: dx=handle of the blk
103 mov ah,0Ch ;lock blk
104 call xmm_driver ;
105 ;now: dx:bx=addr of blk
106 jnz @@err
107 mov [word (image_himem si).buf],bx ; lo m->buf
108 mov [word (image_himem si+2).buf],dx ; hi m->buf
109 @@err:
110 ret
112 endp @xmm_alloc$qp11image_himem
113 endif
115 ends _TEXT
117 end
119 ;###### END OF FILE ############################################