home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / gnu / djgpp / libsrc / gr / src / setmode.s < prev    next >
Encoding:
Text File  |  1993-10-16  |  1.3 KB  |  61 lines

  1. /* This is file SETMODe.S */
  2. /*
  3. ** Copyright (C) 1993 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954
  4. **
  5. ** This file is distributed under the terms listed in the document
  6. ** "copying.dj", available from DJ Delorie at the address above.
  7. ** A copy of "copying.dj" should accompany this file; if not, a copy
  8. ** should be available from where this file was obtained.  This file
  9. ** may not be distributed without a verbatim copy of "copying.dj".
  10. **
  11. ** This file is distributed WITHOUT ANY WARRANTY; without even the implied
  12. ** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  13. */
  14.  
  15.     .data
  16.     .globl    __GrCurMode
  17.     .comm    __GrCurMode,4
  18.     .globl    __GrSetModeHook
  19.     .comm    __GrSetModeHook,4
  20.     .globl    __GrCanBcopyInBlit
  21.     .comm    __GrCanBcopyInBlit,4
  22.  
  23.     .text
  24.     .globl    _GrSetMode
  25. _GrSetMode:
  26.     push    %ebp
  27.     movl    %esp,%ebp
  28.     pushl    %ebx
  29.     pushl    %esi
  30.     pushl    %edi
  31.  
  32.     movl    8(%ebp),%eax
  33.     movl    %eax,__GrCurMode
  34.     movb    $0xff,%ah
  35.     movl    12(%ebp),%ecx
  36.     movl    16(%ebp),%edx
  37.  
  38.     int    $0x10
  39.  
  40.     movl    %ecx,__GrSizeX
  41.     movl    %edx,__GrSizeY
  42.     decl    %ecx
  43.     decl    %edx
  44.     movl    %ecx,__GrMaxX
  45.     movl    %edx,__GrMaxY
  46.     movl    %ebx,__GrCanBcopyInBlit
  47.  
  48.     call    _GrRefreshColors
  49.     cmpl    $0,__GrSetModeHook
  50.     je    L1
  51.     call    *__GrSetModeHook
  52. L1:
  53.  
  54.     popl    %edi
  55.     popl    %esi
  56.     popl    %ebx
  57.     popl    %ebp
  58.     ret
  59.  
  60.  
  61.