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