]> 4ch.mooo.com Git - 16.git/blob - 16/xw__/mxcg.asm
i hate being tired wwww i will work on the project some more sometime wwww
[16.git] / 16 / xw__ / mxcg.asm
1 .387
2                 PUBLIC  MXCOLORTOGRAY
3 MX_TEXT         SEGMENT PARA PUBLIC USE16 'CODE'
4                 ASSUME CS:MX_TEXT, DS:DGROUP, SS:DGROUP
5 MXCOLORTOGRAY:
6         push            bp
7         mov             bp,sp
8         sub             sp,0
9         push            ds
10         push            si
11         push            es
12         push            di
13         mov             cx,word ptr 6[bp]
14         jcxz            L$2
15         lds             si,dword ptr 0cH[bp]
16         les             di,dword ptr 8[bp]
17         cld
18         mov             bx,4d97H
19 L$1:
20         lodsb
21         mul             bh
22         mov             dx,ax
23         lodsb
24         mul             bl
25         add             dx,ax
26         lodsb
27         mov             ah,1cH
28         mul             ah
29         add             ax,dx
30         mov             al,ah
31         stosw
32         stosb
33         loop            L$1
34 L$2:
35         pop             di
36         pop             es
37         pop             si
38         pop             ds
39         mov             sp,bp
40         pop             bp
41         retf            0aH
42 MX_TEXT         ENDS
43                 END