]> 4ch.mooo.com Git - 16.git/blob - 16/xw_/mxgi.asm
id_sd.c ported and is able to compile. it needs it;s variables to be project 16 compl...
[16.git] / 16 / xw_ / mxgi.asm
1                 PUBLIC  MXGETIMAGE
2                 EXTRN   SUBCLIPIMAGE:BYTE
3                 EXTRN   MX_BYTESPERLINE:BYTE
4                 EXTRN   MX_VIDEOSEGMENT:BYTE
5 MX_TEXT         SEGMENT PARA PUBLIC USE16 'CODE'
6                 ASSUME CS:MX_TEXT, DS:DGROUP, SS:DGROUP
7 MXGETIMAGE:
8         push            bp
9         mov             bp,sp
10         sub             sp,10H
11         push            ds
12         push            si
13         push            es
14         push            di
15         mov             bx,word ptr 0cH[bp]
16         mov             ax,word ptr 0aH[bp]
17         mov             cx,word ptr 8[bp]
18         mov             dx,word ptr 6[bp]
19         call            near ptr MX_TEXT:SUBCLIPIMAGE
20         jae             L$1
21         jmp             near ptr L$7
22 L$1:
23         mov             word ptr 6[bp],dx
24         add             word ptr 0eH[bp],si
25         mul             word ptr cs:MX_BYTESPERLINE
26         mov             si,bx
27         shr             si,1
28         shr             si,1
29         add             si,ax
30         mov             word ptr -0aH[bp],si
31         mov             ds,word ptr cs:MX_VIDEOSEGMENT
32         and             bl,3
33         mov             byte ptr -0eH[bp],bl
34         mov             bx,cx
35         shr             bx,1
36         shr             bx,1
37         and             cl,3
38         mov             al,8
39         shr             al,cl
40         mov             di,6
41 L$2:
42         mov             word ptr -8[bp+di],bx
43         shr             al,1
44         adc             bx,0
45         dec             di
46         dec             di
47         jge             L$2
48         cld
49         mov             byte ptr -10H[bp],4
50         lea             bx,-8[bp]
51         mov             es,word ptr 10H[bp]
52         mov             ah,byte ptr -0eH[bp]
53 L$3:
54         cmp             word ptr ss:[bx],0
55         je              L$7
56         mov             di,word ptr 0eH[bp]
57         mov             al,4
58         mov             dx,3ceH
59         out             dx,ax
60         mov             dx,word ptr 6[bp]
61         mov             si,word ptr -0aH[bp]
62 L$4:
63         push            si
64         push            di
65         mov             cx,word ptr ss:[bx]
66 L$5:
67         movsb
68         add             di,3
69         dec             cx
70         jne             L$5
71         pop             di
72         pop             si
73         add             di,word ptr 8[bp]
74         add             si,word ptr cs:MX_BYTESPERLINE
75         dec             dx
76         jne             L$4
77         inc             bx
78         inc             bx
79         inc             ah
80         test            ah,4
81         je              L$6
82         inc             word ptr -0aH[bp]
83         and             ah,3
84 L$6:
85         inc             word ptr 0eH[bp]
86         dec             byte ptr -10H[bp]
87         jne             L$3
88 L$7:
89         xor             ax,ax
90         pop             di
91         pop             es
92         pop             si
93         pop             ds
94         mov             sp,bp
95         pop             bp
96         retf            0cH
97 MX_TEXT         ENDS
98                 END