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

  1.         title   Swap color mono display
  2.         page    ,132
  3. ; this routine swaps between the b&w display and the color display
  4. ; on the IBM personal computer.  80 character width is always selected
  5. data    segment at 40h
  6.     org    10h
  7. eqflg    dw    ?        ;equipment flag
  8.     org    49h
  9. curvid    db    ?        ;current state
  10. data    ends
  11. code    segment
  12.         assume  cs:code,ds:data
  13. swap    proc    far
  14.     push    ds        ;save dos's data segment 
  15.         xor     ax,ax           ;zero AX for return
  16.         push    ax
  17.     mov    ax,data        ;establish addressing
  18.         mov     ds,ax        
  19.         cmp     curvid,7            ;  if it is 7, the monochrome display
  20.         jnz      color           ;  is in use, and we swith to color.
  21. mono:    mov    ax,eqflg    ;switch to color
  22.     and    al,0cfh
  23.     or    al,20h        ;I don't know what these bits do!!!
  24.     mov    eqflg,ax
  25.         jmp     exit
  26. color:  or    eqflg,30h    ;switch to mono
  27. exit:   mov     ax,3 
  28.         int     10H
  29.         ret
  30. swap    endp
  31. code    ends
  32.         end
  33.