]> 4ch.mooo.com Git - 16.git/blob - 16/xw_/mxpn.asm
code miraculously works on real hardware
[16.git] / 16 / xw_ / mxpn.asm
1                 PUBLIC  MXPAN
2                 EXTRN   MX_BYTESPERLINE:BYTE
3                 EXTRN   MXWAITDISPLAY:BYTE
4                 EXTRN   MXSTARTADDRESS:BYTE
5 MX_TEXT         SEGMENT PARA PUBLIC USE16 'CODE'
6                 ASSUME CS:MX_TEXT, DS:DGROUP, SS:DGROUP
7 MXPAN:
8         push            bp
9         mov             bp,sp
10         sub             sp,0
11         mov             ax,word ptr 6[bp]
12         mul             word ptr cs:MX_BYTESPERLINE
13         mov             dx,word ptr 8[bp]
14         shr             dx,1
15         shr             dx,1
16         add             ax,dx
17         push            ax
18         call            far ptr MXWAITDISPLAY
19         call            far ptr MXSTARTADDRESS
20         mov             dx,3daH
21         in              al,dx
22         mov             dx,3c0H
23         mov             al,33H
24         out             dx,al
25         mov             al,byte ptr 8[bp]
26         and             al,3
27         shl             al,1
28         out             dx,al
29         xor             ax,ax
30         mov             sp,bp
31         pop             bp
32         retf            4
33 MX_TEXT         ENDS
34                 END