home *** CD-ROM | disk | FTP | other *** search
/ FreeWare Collection 2 / FreeSoftwareCollection2pd199x-jp.img / look / src / vram.asm < prev    next >
Assembly Source File  |  1990-06-14  |  13KB  |  664 lines

  1. ;*****************************************************************
  2. ;
  3. ;void    VRAN_wrtstr(char *str,x,y,font,ccol,bcol,seg,off);
  4. ;
  5. ;struct {
  6. ;    int    v_x, v_y;        /* Displry X ,Y */
  7. ;    int    v_font;            /* Font Size 16 or 8 */
  8. ;    int    v_ccol, v_bcol;        /* color */
  9. ;    int    v_seg;            /* write segment */
  10. ;    int    v_off;            /* VRAM offset Y */
  11. ;} PARA;
  12. ;
  13. ; font = Font Size 8 or 16 , (if bit7 == 1 then duble font) 
  14. ;
  15. ;*****************************************************************
  16. v_para    struc
  17. v_x    dd    ?
  18. v_y    dd    ?
  19. v_font    dd    ?
  20. v_ccol    dd    ?
  21. v_bcol    dd    ?
  22. v_seg    dd    ?
  23. v_off    dd    ?
  24. v_para    ends
  25.  
  26. extrn    MOS_disp:near
  27. ;*************************************
  28. ;    VRAM Direct Access Program
  29. ;*************************************
  30. bitptn    segment    'DATA'
  31. fntptn:
  32.     dd    000000000h,0F0000000h,00F000000h,0FF000000h
  33.     dd    000F00000h,0F0F00000h,00FF00000h,0FFF00000h
  34.     dd    0000F0000h,0F00F0000h,00F0F0000h,0FF0F0000h
  35.     dd    000FF0000h,0F0FF0000h,00FFF0000h,0FFFF0000h
  36.     dd    00000F000h,0F000F000h,00F00F000h,0FF00F000h
  37.     dd    000F0F000h,0F0F0F000h,00FF0F000h,0FFF0F000h
  38.     dd    0000FF000h,0F00FF000h,00F0FF000h,0FF0FF000h
  39.     dd    000FFF000h,0F0FFF000h,00FFFF000h,0FFFFF000h
  40.     dd    000000F00h,0F0000F00h,00F000F00h,0FF000F00h
  41.     dd    000F00F00h,0F0F00F00h,00FF00F00h,0FFF00F00h
  42.     dd    0000F0F00h,0F00F0F00h,00F0F0F00h,0FF0F0F00h
  43.     dd    000FF0F00h,0F0FF0F00h,00FFF0F00h,0FFFF0F00h
  44.     dd    00000FF00h,0F000FF00h,00F00FF00h,0FF00FF00h
  45.     dd    000F0FF00h,0F0F0FF00h,00FF0FF00h,0FFF0FF00h
  46.     dd    0000FFF00h,0F00FFF00h,00F0FFF00h,0FF0FFF00h
  47.     dd    000FFFF00h,0F0FFFF00h,00FFFFF00h,0FFFFFF00h
  48.     dd    0000000F0h,0F00000F0h,00F0000F0h,0FF0000F0h
  49.     dd    000F000F0h,0F0F000F0h,00FF000F0h,0FFF000F0h
  50.     dd    0000F00F0h,0F00F00F0h,00F0F00F0h,0FF0F00F0h
  51.     dd    000FF00F0h,0F0FF00F0h,00FFF00F0h,0FFFF00F0h
  52.     dd    00000F0F0h,0F000F0F0h,00F00F0F0h,0FF00F0F0h
  53.     dd    000F0F0F0h,0F0F0F0F0h,00FF0F0F0h,0FFF0F0F0h
  54.     dd    0000FF0F0h,0F00FF0F0h,00F0FF0F0h,0FF0FF0F0h
  55.     dd    000FFF0F0h,0F0FFF0F0h,00FFFF0F0h,0FFFFF0F0h
  56.     dd    000000FF0h,0F0000FF0h,00F000FF0h,0FF000FF0h
  57.     dd    000F00FF0h,0F0F00FF0h,00FF00FF0h,0FFF00FF0h
  58.     dd    0000F0FF0h,0F00F0FF0h,00F0F0FF0h,0FF0F0FF0h
  59.     dd    000FF0FF0h,0F0FF0FF0h,00FFF0FF0h,0FFFF0FF0h
  60.     dd    00000FFF0h,0F000FFF0h,00F00FFF0h,0FF00FFF0h
  61.     dd    000F0FFF0h,0F0F0FFF0h,00FF0FFF0h,0FFF0FFF0h
  62.     dd    0000FFFF0h,0F00FFFF0h,00F0FFFF0h,0FF0FFFF0h
  63.     dd    000FFFFF0h,0F0FFFFF0h,00FFFFFF0h,0FFFFFFF0h
  64.     dd    00000000Fh,0F000000Fh,00F00000Fh,0FF00000Fh
  65.     dd    000F0000Fh,0F0F0000Fh,00FF0000Fh,0FFF0000Fh
  66.     dd    0000F000Fh,0F00F000Fh,00F0F000Fh,0FF0F000Fh
  67.     dd    000FF000Fh,0F0FF000Fh,00FFF000Fh,0FFFF000Fh
  68.     dd    00000F00Fh,0F000F00Fh,00F00F00Fh,0FF00F00Fh
  69.     dd    000F0F00Fh,0F0F0F00Fh,00FF0F00Fh,0FFF0F00Fh
  70.     dd    0000FF00Fh,0F00FF00Fh,00F0FF00Fh,0FF0FF00Fh
  71.     dd    000FFF00Fh,0F0FFF00Fh,00FFFF00Fh,0FFFFF00Fh
  72.     dd    000000F0Fh,0F0000F0Fh,00F000F0Fh,0FF000F0Fh
  73.     dd    000F00F0Fh,0F0F00F0Fh,00FF00F0Fh,0FFF00F0Fh
  74.     dd    0000F0F0Fh,0F00F0F0Fh,00F0F0F0Fh,0FF0F0F0Fh
  75.     dd    000FF0F0Fh,0F0FF0F0Fh,00FFF0F0Fh,0FFFF0F0Fh
  76.     dd    00000FF0Fh,0F000FF0Fh,00F00FF0Fh,0FF00FF0Fh
  77.     dd    000F0FF0Fh,0F0F0FF0Fh,00FF0FF0Fh,0FFF0FF0Fh
  78.     dd    0000FFF0Fh,0F00FFF0Fh,00F0FFF0Fh,0FF0FFF0Fh
  79.     dd    000FFFF0Fh,0F0FFFF0Fh,00FFFFF0Fh,0FFFFFF0Fh
  80.     dd    0000000FFh,0F00000FFh,00F0000FFh,0FF0000FFh
  81.     dd    000F000FFh,0F0F000FFh,00FF000FFh,0FFF000FFh
  82.     dd    0000F00FFh,0F00F00FFh,00F0F00FFh,0FF0F00FFh
  83.     dd    000FF00FFh,0F0FF00FFh,00FFF00FFh,0FFFF00FFh
  84.     dd    00000F0FFh,0F000F0FFh,00F00F0FFh,0FF00F0FFh
  85.     dd    000F0F0FFh,0F0F0F0FFh,00FF0F0FFh,0FFF0F0FFh
  86.     dd    0000FF0FFh,0F00FF0FFh,00F0FF0FFh,0FF0FF0FFh
  87.     dd    000FFF0FFh,0F0FFF0FFh,00FFFF0FFh,0FFFFF0FFh
  88.     dd    000000FFFh,0F0000FFFh,00F000FFFh,0FF000FFFh
  89.     dd    000F00FFFh,0F0F00FFFh,00FF00FFFh,0FFF00FFFh
  90.     dd    0000F0FFFh,0F00F0FFFh,00F0F0FFFh,0FF0F0FFFh
  91.     dd    000FF0FFFh,0F0FF0FFFh,00FFF0FFFh,0FFFF0FFFh
  92.     dd    00000FFFFh,0F000FFFFh,00F00FFFFh,0FF00FFFFh
  93.     dd    000F0FFFFh,0F0F0FFFFh,00FF0FFFFh,0FFF0FFFFh
  94.     dd    0000FFFFFh,0F00FFFFFh,00F0FFFFFh,0FF0FFFFFh
  95.     dd    000FFFFFFh,0F0FFFFFFh,00FFFFFFFh,0FFFFFFFFh
  96. bitptn    ends
  97.  
  98. VRAM    segment 'CODE'
  99.     assume  cs:VRAM
  100. ;*************************************
  101. ;    漢字フォントの取り出し
  102. ;*************************************
  103. ; in    eax    = Kanji Code
  104. ; out    es:esi = Kanji Font Address
  105. ;*************************************
  106. kanfon    proc    near
  107.     push    eax
  108.     push    edx
  109.     push    fs
  110.     push    ds
  111.  
  112.     mov    ebx,eax
  113.     bt    ebx,15
  114.     jnc    kanfn0
  115.  
  116.     cmp    bh,9fh
  117.     jbe    sjto1
  118.     sub    bh,0B1h-071h
  119. sjto1:  sub    bh,071h
  120.     shl    bh,1
  121.     inc    bh
  122.     cmp    bl,7fh
  123.     jbe    sjto2
  124.     dec    bl
  125. sjto2:    cmp    bl,9eh
  126.     jb    sjto3
  127.     sub    bl,7dh
  128.     inc    bh
  129.     jmp    kanfn0
  130. sjto3:    sub    bl,1fh
  131.  
  132. kanfn0:    mov    ax,0110h
  133.     mov    fs,ax
  134.     mov    ax,0100h
  135.     mov    dx,1010h
  136.     call    pword ptr fs:[00a0h]
  137.     pop    ds
  138.     pop    fs
  139.     pop    edx
  140.     pop    eax
  141.     ret
  142. kanfon    endp
  143. ;**************************************
  144. ;    Write Kanji Code (JIS or SJIS)
  145. ;**************************************
  146. ; in    eax = kanji Code
  147. ;    edi = VRAM Address
  148. ; out    edi = next VRAM Address
  149. ;**************************************
  150. wrtkan    proc    near
  151.     push    ds
  152.     push    edi
  153.     push    esi
  154.  
  155.     call    kanfon
  156.  
  157.     mov    ecx,[ebp].v_font
  158.     mov    ch,cl
  159.     and    cl,18h
  160.  
  161. wrtkn1:    mov    dx,es:[esi]
  162.     lea    esi,[esi+2]
  163.     bt    ecx,8+4
  164.     jc    wrtkn2
  165.     or    dx,es:[esi]
  166.     lea    esi,[esi+2]
  167.  
  168. wrtkn2:    bt    ecx,8+7
  169.     jnc    wrtkn3    
  170.     xchg    dh,dl
  171.     mov    ax,dx
  172.     sar    dx,1
  173.     or    dx,ax
  174.     xchg    dh,dl
  175.  
  176. wrtkn3:    movzx    eax,dl
  177.     mov    eax,ds:[eax*4+offset fntptn]
  178.     mov    ebx,eax
  179.     not    ebx
  180.     and    eax,[ebp].v_ccol
  181.     and    ebx,[ebp].v_bcol
  182.     or    eax,ebx
  183.     mov    fs:[edi],eax
  184.  
  185.     movzx    eax,dh
  186.     mov    eax,ds:[eax*4+offset fntptn]
  187.     mov    ebx,eax
  188.     not    ebx
  189.     and    eax,[ebp].v_ccol
  190.     and    ebx,[ebp].v_bcol
  191.     or    eax,ebx
  192.     mov    fs:[edi+4],eax
  193.  
  194.     add    edi,512
  195.     and    edi,03FFFFh
  196.     add    edi,[ebp].v_seg
  197.     dec    cl
  198.     jnz    wrtkn1
  199.  
  200.     pop    esi
  201.     pop    edi
  202.     pop    ds
  203.     add    edi,8
  204.     ret
  205. wrtkan    endp
  206. ;***********************************
  207. ;    Write ANK code
  208. ;***********************************
  209. ; in    eax = ANK Code
  210. ;    edi = VRAM Address
  211. ; out    edi = next VRAM Address
  212. ;***********************************
  213. wrtank    proc    near
  214.         push       edi
  215.         push       esi
  216.  
  217.     movzx    esi,al
  218.     mov    ecx,[ebp].v_font
  219.     mov    ch,cl
  220.     and    cl,18h
  221.     bt    ecx,8+4
  222.     jnc    wrtak1
  223.     shl    esi,4
  224.     add    esi,3D800h
  225.     jmp    wrtak2
  226. wrtak1:    shl    esi,3
  227.     add    esi,3D000h
  228.  
  229. wrtak2:    movzx    eax,byte ptr es:[esi]
  230.     inc    esi
  231.     bt    ecx,8+7
  232.     jnc    wrtak3
  233.     mov    dx,ax
  234.     sar    ax,1
  235.     or    ax,dx
  236. wrtak3:    mov    eax,ds:[eax*4+offset fntptn]
  237.     mov    ebx,eax
  238.     not    ebx
  239.     and    eax,[ebp].v_ccol
  240.     and    ebx,[ebp].v_bcol
  241.     or    eax,ebx
  242.     mov    fs:[edi],eax
  243.     add    edi,512
  244.     and    edi,03FFFFh
  245.     add    edi,[ebp].v_seg
  246.     dec    cl
  247.     jnz    wrtak2
  248.  
  249.         pop        esi
  250.         pop        edi
  251.     add    edi,4
  252.         ret
  253. wrtank    endp
  254. ;***********************************
  255. ;    Color Pattan Seting
  256. ;***********************************
  257. ; int    EAX Color No
  258. ; out   EAX Color Pattn
  259. ;***********************************
  260. colptn    proc    near
  261.     push    ebx
  262.     mov    ebx,eax
  263.     shl    eax,4
  264.     or    eax,ebx
  265.     mov    ebx,eax
  266.     shl    eax,8
  267.     or    eax,ebx
  268.     mov    ebx,eax
  269.     shl    eax,16
  270.     or    eax,ebx
  271.     pop    ebx
  272.     ret
  273. colptn    endp    
  274. ;***********************************
  275. ;    Write String
  276. ;***********************************
  277.     public    VRAM_wrtstr
  278. VRAM_wrtstr proc near
  279.     push    0
  280.     call    MOS_disp
  281.     add    esp,4
  282.  
  283.         push    ebp
  284.         mov        ebp,esp
  285.         push       esi
  286.         push       edi
  287.     push    ebx
  288.     push    es
  289.     push    fs
  290.  
  291.     mov    esi,8[ebp]
  292.     lea    ebp,12[ebp]
  293.  
  294.     mov    edi,[ebp].v_y
  295.     add    edi,[ebp].v_off
  296.     shl    edi,9
  297.     mov    eax,[ebp].v_x
  298.     sar    eax,1
  299.     add    edi,eax
  300.     and    edi,03FFFFh
  301.     add    edi,[ebp].v_seg
  302.  
  303.     mov    eax,[ebp].v_ccol
  304.     call    colptn
  305.     mov    [ebp].v_ccol,eax
  306.     mov    eax,[ebp].v_bcol
  307.     call    colptn
  308.     mov    [ebp].v_bcol,eax
  309.  
  310.     mov    ax,138h
  311.     mov    es,ax
  312.     mov    eax,104h
  313.     mov    fs,ax
  314.  
  315. wrtst1:    mov    al,[esi]
  316.     inc    esi
  317.     or    al,al
  318.     jz    wrtst6
  319.     cmp    al,81h
  320.     jb    wrtst4
  321.     cmp    al,9fh
  322.     jbe    wrtst3
  323.     cmp    al,0e0h
  324.     jb    wrtst4
  325.     cmp    al,0fch
  326.     jnbe    wrtst4
  327. wrtst3:    mov    ah,al
  328.     mov    al,[esi]
  329.     inc    esi
  330.     cmp    al,40h
  331.     jb    wrtst5
  332.     cmp    al,7fh
  333.     jz    wrtst5
  334.     cmp    al,0fch
  335.     jnbe    wrtst5
  336.     call    wrtkan
  337.     jmp    wrtst1
  338.  
  339. wrtst5:    mov    al,ah
  340.     dec    esi
  341. wrtst4:    call    wrtank
  342.     jmp    wrtst1
  343.  
  344. wrtst6:    pop    fs
  345.     pop    es
  346.     pop    ebx
  347.         pop        edi
  348.         pop        esi
  349.     pop    ebp
  350.  
  351.     push    1
  352.     call    MOS_disp
  353.     add    esp,4
  354.         ret
  355. VRAM_wrtstr endp
  356. ;***************************************
  357. ;    write Bit Ptan
  358. ;*****************************************************
  359. ;void    wrtptn(char *ptn, x, y, sx, sy, col, bak)
  360. ;             8   12 16  20  24  28   32
  361. ;*****************************************************
  362.     public    wrtptn
  363. wrtptn    proc
  364.     push    0
  365.     call    MOS_disp
  366.     add    esp,4
  367.  
  368.         push    ebp
  369.         mov        ebp,esp
  370.         push       esi
  371.         push       edi
  372.     push    ebx
  373.     push    es
  374.  
  375.     mov    esi,8[ebp]
  376.     mov    edi,16[ebp]
  377.     shl    edi,9
  378.     mov    eax,12[ebp]
  379.     sar    eax,1
  380.     add    edi,eax
  381.  
  382.     mov    eax,28[ebp]
  383.     call    colptn
  384.     mov    28[ebp],eax
  385.     mov    eax,32[ebp]
  386.     call    colptn
  387.     mov    32[ebp],eax
  388.  
  389.     sar    dword ptr 20[ebp],3
  390.  
  391.     mov    ax,104h
  392.     mov    es,ax
  393.  
  394. wrtpt1:    mov    ecx,20[ebp]
  395.     push    edi
  396. wrtpt2:    movzx    eax,byte ptr[esi]
  397.     inc    esi
  398.     mov    eax,ds:[eax*4+offset fntptn]
  399.     mov    ebx,eax
  400.     not    ebx
  401.     and    eax,28[ebp]
  402.     and    ebx,32[ebp]
  403.     or    eax,ebx
  404.     mov    es:[edi],eax
  405.     lea    edi,[edi+4]
  406.     loop    wrtpt2
  407.     pop    edi
  408.     add    edi,512
  409.     dec    dword ptr 24[ebp]
  410.     jnz    wrtpt1
  411.  
  412.     pop    es
  413.     pop    ebx
  414.         pop        edi
  415.         pop        esi
  416.         leave
  417.  
  418.     push    1
  419.     call    MOS_disp
  420.     add    esp,4
  421.         ret
  422. wrtptn    endp
  423. ;***************************************************
  424. ;    Clear VRAM
  425. ;***************************************************
  426. ;void    VRAM_clear(x, y, sizeX, sizeY, col, seg, off);
  427. ;           8  12 16     20     24   28   32
  428. ;***************************************************
  429.     public    VRAM_clear
  430. VRAM_clear proc
  431.         push    ebp
  432.         mov        ebp,esp
  433.         push       esi
  434.         push       edi
  435.     push    ebx
  436.     push    es
  437.  
  438.     mov    esi,12[ebp]
  439.     add    esi,32[ebp]
  440.     shl    esi,9
  441.     mov    eax,8[ebp]
  442.     sar    eax,1
  443.     add    esi,eax
  444.     and    esi,03FFFFh
  445.     add    esi,28[ebp]
  446.  
  447.     mov    ebx,16[ebp]
  448.     sar    ebx,3
  449.  
  450.     mov    eax,104h
  451.     mov    es,ax
  452.  
  453.     cld
  454.     mov    edx,20[ebp]
  455.     mov    eax,24[ebp]
  456.     call    colptn
  457. clear1:    mov    ecx,ebx
  458.     mov    edi,esi
  459.     rep stosd
  460.     add    esi,512
  461.     and    esi,03FFFFh
  462.     add    esi,28[ebp]
  463.     dec    edx
  464.     jnz    clear1
  465.  
  466.     pop    es
  467.     pop    ebx
  468.         pop        edi
  469.         pop        esi
  470.         leave
  471.         ret
  472. VRAM_clear endp
  473. ;******************************
  474. ;void    VRAM_allclear(seg);
  475. ;******************************
  476.     public    VRAM_allclear
  477. VRAM_allclear proc
  478.     mov    eax,4[esp]
  479.     push    edi
  480.     push    es
  481.  
  482.     mov    ecx,1024*512/8
  483.     mov    edi,eax
  484.     mov    ax,104h
  485.     mov    es,ax
  486.     xor    eax,eax
  487.     cld
  488.     rep stosd
  489.  
  490.     pop    es
  491.     pop    edi
  492.     ret
  493. VRAM_allclear endp
  494. ;**************************************************************
  495. ;    page move VRAM
  496. ;**************************************************************
  497. ;void    VRAM_move(x, y, sizeX, sizeY, Sseg, Dseg, Soff, Doff);
  498. ;          8  12 16     20     24    28    32    36
  499. ;**************************************************************
  500.     public    VRAM_move
  501. VRAM_move proc
  502.         push    ebp
  503.         mov        ebp,esp
  504.         push       esi
  505.         push       edi
  506.     push    ebx
  507.     push    ds
  508.     push    es
  509.  
  510.     mov    esi,12[ebp]
  511.     shl    esi,9
  512.     mov    eax,8[ebp]
  513.     sar    eax,1
  514.     add    esi,eax
  515.     mov    edi,esi
  516.  
  517.     mov    eax,32[ebp]
  518.     shl    eax,9
  519.     add    esi,eax
  520.     and    esi,03FFFFh
  521.     add    esi,24[ebp]
  522.  
  523.     mov    eax,36[ebp]
  524.     shl    eax,9
  525.     add    edi,eax
  526.     and    edi,03FFFFh
  527.     add    edi,28[ebp]
  528.  
  529.     mov    ax,104h
  530.     mov    ds,ax
  531.     mov    es,ax
  532.  
  533.     mov    eax,16[ebp]
  534.     mov    ebx,512
  535.     sar    eax,1
  536.     sub    ebx,eax
  537.     sar    eax,2
  538.  
  539.     cld
  540.     mov    edx,20[ebp]
  541. vmove1:    mov    ecx,eax
  542.     rep movsd
  543.     add    esi,ebx
  544.     and    esi,03FFFFh
  545.     add    esi,24[ebp]
  546.     add    edi,ebx
  547.     and    edi,03FFFFh
  548.     add    edi,28[ebp]
  549.     dec    edx
  550.     jnz    vmove1
  551.  
  552.     pop    es
  553.     pop    ds
  554.     pop    ebx
  555.         pop        edi
  556.         pop        esi
  557.         leave
  558.         ret
  559. VRAM_move endp
  560. ;**************************************************************
  561. ;    BitMap Img to GVRAM
  562. ;**************************************************************
  563. ;void    IMG_move(struct img_para *para);
  564. ;struct imsg_para {
  565. ;    int    im_page;    /* 0x00000 or 0x40000 */
  566. ;    int    im_off;        /* Disp Offset */
  567. ;    int    im_x, im_y;    /* Display Point */
  568. ;    int    im_sx,im_sy;    /* Display Size */
  569. ;    char    *img_adr;    /* img address */
  570. ;    int    im_ix,im_iy;    /* img Display Point */
  571. ;    int    im_isx,im_isy;    /* img size */
  572. ;**************************************************************
  573. i_para    struc
  574. i_page    dd    ?
  575. i_off    dd    ?
  576. i_x    dd    ?
  577. i_y    dd    ?
  578. i_sx    dd    ?
  579. i_sy    dd    ?
  580. i_adr    dd    ?
  581. i_ix    dd    ?
  582. i_iy    dd    ?
  583. i_isx    dd    ?
  584. i_isy    dd    ?
  585. i_para    ends
  586.  
  587.     public    IMG_move
  588. IMG_move proc
  589.     push    0
  590.     call    MOS_disp
  591.     add    esp,4
  592.         push    ebp
  593.         mov        ebp,[esp+8]
  594.         push       esi
  595.         push       edi
  596.     push    ebx
  597.     push    es
  598.  
  599.     mov    edi,[ebp].i_y
  600.     shl    edi,9
  601.     mov    eax,[ebp].i_x
  602.     sar    eax,1
  603.     add    edi,eax
  604.     mov    eax,[ebp].i_off
  605.     shl    eax,9
  606.     add    edi,eax
  607.     and    edi,03FFFFh
  608.     add    edi,[ebp].i_page
  609.  
  610.     mov    ecx,[ebp].i_iy
  611.     mov    eax,[ebp].i_isx
  612.     sar    eax,1
  613.     xor    esi,esi
  614.     or    ecx,ecx
  615.     jz    IMG_m3
  616. IMG_m2:    add    esi,eax
  617.     loop    IMG_m2
  618. IMG_m3:    mov    eax,[ebp].i_ix
  619.     sar    eax,1
  620.     add    esi,eax
  621.     add    esi,[ebp].i_adr
  622.  
  623.     mov    ax,104h
  624.     mov    es,ax
  625.  
  626.     mov    edx,[ebp].i_sy
  627.     mov    eax,[ebp].i_sx
  628.     sar    eax,1
  629.     mov    ebx,eax
  630.     and    ebx,3
  631.     sar    eax,2
  632.     sar    [ebp].i_isx,1
  633.     cld
  634. IMG_m1:    
  635.     push    esi
  636.     push    edi
  637.     mov    ecx,ebx
  638.     jecxz    IMG_m4
  639.     rep movsb
  640. IMG_m4:    mov    ecx,eax
  641.     rep movsd
  642.     pop    edi
  643.     pop    esi
  644.     add    esi,[ebp].i_isx
  645.     add    edi,512
  646.     and    edi,03FFFFh
  647.     add    edi,[ebp].i_page
  648.     dec    edx
  649.     jnz    IMG_m1
  650.  
  651.     pop    es
  652.     pop    ebx
  653.         pop        edi
  654.         pop        esi
  655.         pop    ebp
  656.     push    1
  657.     call    MOS_disp
  658.     add    esp,4
  659.         ret
  660. IMG_move endp
  661.  
  662. VRAM    ends
  663.     end
  664.