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

syslinux: fix build
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Feb 28 16:32:57 2021 +0000 (2021-02-28)
parents c1844f1c4954
children 6b6d14c9f7e9
line source
1 ;***************************************************************
2 ;****** This file is distributed under GPL
3 ;***************************************************************
4 ideal
5 %PAGESIZE 1000
6 %crefref
7 %noincl
8 %nomacs
10 include "common.inc"
12 p8086
14 group DGROUP _TEXT
15 assume cs:DGROUP,ds:DGROUP
17 segment _TEXT byte public use16 'CODE'
19 ;***************************************************************
20 ;void enable_a20_xmm();
21 ;***************************************************************
22 global _enable_a20_xmm:near
23 proc _enable_a20_xmm near
25 mov ch,03h ;global enable a20
26 call xmm_driver ;
27 mov ch,05h ;local enable a20
28 ;jmp xmm_driver ;
30 endp _enable_a20_xmm
32 ;***************************************************************
33 ;Call xmm driver addr (success: ax=1)
34 ;void xmm_driver(ah)
35 ;***************************************************************
36 proc xmm_driver near
38 pop bx ; \
39 push cs ; fake far call
40 push bx ; /
41 mov ax,4300h ; installation check in al
42 int 2fh
43 cmp al,80h
44 jne @@xmm_fail
45 mov ax,4310h ; get driver address in es:bx
46 int 2fh
47 xchg ax,cx ; restore cmd
49 push es ; jmp far es:bx
50 push bx ; avoid 08h 0Fh 12h and 8Fh functions using bx
51 @@xmm_fail:
52 retf
54 endp xmm_driver
56 ifdef WITH_XMM_ALLOC
57 include "himem.inc"
59 ;***************************************************************
60 ;_fastcall void xmm_alloc(si:struct image_himem *m)
61 ;***************************************************************
62 global @xmm_alloc$qp11image_himem:near
63 proc @xmm_alloc$qp11image_himem near
65 extrn _cmdnum:dword
66 skip_alloc = (byte _cmdnum+16)
67 LARGE_XMM_ALLOC = 1
68 ifdef LARGE_XMM_ALLOC
69 mov ch,89h ;allocate blk of EDX kilobytes
70 test [skip_alloc],ch
71 jne @@err
72 extrn _cpu386:byte
73 test [_cpu386],ch
74 je @@not386
75 p386
76 mov edx,[(image_himem si).size] ; m->size
77 ;dec edx
78 shr edx,10 ; to Kb
79 inc edx
80 call xmm_driver ;
81 dec ax ; Z=OK
82 jz @@gotit
83 @@not386:
84 mov cl,16-10
85 else
86 mov cl,16-10
87 test [skip_alloc],cl ; 06h & ('*'=2Ah) = 02h
88 jne @@err
89 endif
90 p8086
91 ;mov ax,-1
92 ;cwd
93 ;add ax,[word (image_himem si).size] ; lo m->size
94 ;adc dx,[word (image_himem si+2).size] ; hi m->size
95 les ax,[dword (image_himem si).size] ; m->size
96 extrn N_LXLSH@ES:near
97 call N_LXLSH@ES
98 inc dx
99 mov ch,9h ;allocate blk of DX kilobytes (<64Mb)
100 call xmm_driver ;
101 dec ax ; Z=OK
102 jnz @@err
103 @@gotit:
104 ;now: dx=handle of the blk
105 mov ch,0Ch ;lock blk
106 call xmm_driver ;
107 ;now: dx:bx=addr of blk
108 ;dec ax ; Z=OK
109 ;jnz @@err
110 mov [word (image_himem si).buf],bx ; lo m->buf
111 mov [word (image_himem si+2).buf],dx ; hi m->buf
112 @@err:
113 ret
115 endp @xmm_alloc$qp11image_himem
116 endif
118 ends _TEXT
120 end
122 ;###### END OF FILE ############################################