home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS - Coast to Coast / simteldosarchivecoasttocoast.iso / screen / swap.a86 < prev    next >
Text File  |  1994-03-05  |  705b  |  33 lines

  1.     .text
  2.     .=0x100
  3.  
  4. | this routine swaps between the b&w display and the color display
  5. | on the IBM personal computer.  80 character width is always selected
  6.  
  7. start:    push    ax
  8.     push    ds
  9.     xor    ax,ax        |zero AX
  10.     mov    ds,ax        |use data at very beginning of memory
  11.     xorb    0x410,#0x20    | ?
  12.     movb    al,0x449    | this is the "current video mode"
  13.     cmpb    al,#7        |  if it is 7, the monochrome display
  14.     jz    color        |  is in use, and we swith to color.
  15. mono:    mov    ax,#3        | AH=0 -> set mode, AL=3 -> 80 column color
  16.     int    0x10
  17.     j    exit
  18. color:    mov    ax,#7
  19.     int    0x10
  20.     mov    ax,#0x0501
  21.     int    0x10
  22. wait:    inc    ax
  23.     jnz    wait
  24.     mov    ax,#0x0500
  25.     int    0x10
  26.     mov    ax,#3        |dont ask me why I have to do it twice...
  27.     int    0x10
  28.     
  29. exit:    pop    ds
  30.     pop    ax
  31.     int    0x20
  32.     ret
  33.