home *** CD-ROM | disk | FTP | other *** search
/ Between Heaven & Hell 2 / BetweenHeavenHell.cdr / 300 / 295 / flip.asm < prev    next >
Assembly Source File  |  1985-06-25  |  2KB  |  41 lines

  1. ; FLIP.COM  by K. S. Hunziker
  2. ; See PC Mag V4 No.4 p256
  3. ; Switches between page 0 and page 1 of the color/graphics display
  4. ; in text mode.  Note that some "end run" programs always write to
  5. ; page 0 rather than the active page.
  6. code_seg    segment
  7.             assume cs:code_seg
  8.             org 100h
  9. begin:      mov ah,15      ; read video state (call to BIOS)
  10.             int 10h
  11.             and bh,1       ; make sure we deal only with 0 or 1
  12.             xor bh,1       ; switch to other page
  13.             mov bl,bh      ; save new page number
  14.             mov al,bh      ; set new active page (call to BIOS)
  15.             mov ah,5
  16.             int 10h
  17.             mov dh,22      ; set cursor to row 22
  18.             mov dl,0       ;   and column 0
  19.             mov ah,2       ; set cursor position (call to BIOS)
  20.             int 10h
  21.             mov ch,6       ; assume page 0, begin cursor at 6
  22.             mov cl,7       ; end cursor at line 7
  23.             or  bh,bh      ; check new page number
  24.             jz  is_zero    ; if new page is 0, we guessed right
  25.             mov ch,0       ; cursor begins at line 0
  26. is_zero:    mov ah,1       ; set cursor type (call to BIOS)
  27.             int 10h
  28.             mov ch,23      ; set upper left of window to row 23
  29.             mov cl,0       ;   and column 0
  30.             mov dh,24      ; set lower right of window to row 24
  31.             mov dl,79      ;   and column 79
  32.             mov al,0       ; blank the window
  33.             mov bh,7       ; use white on black
  34.             mov ah,6       ; perform window scroll (call to BIOS)
  35.             int 10h
  36.             mov al,bl      ; supply new page number as return code
  37.             mov ah,4ch     ; exit to DOS
  38.             int 21h
  39. code_seg    ends
  40.             end  begin
  41.