home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-387-Vol-3of3.iso / t / tbwindow.zip / RECOLOR.ASM < prev    next >
Assembly Source File  |  1987-06-15  |  2KB  |  53 lines

  1.               title          RECOLORS
  2.               page           60,132
  3.  
  4. oldattr       equ            [bp + 0Ah]          ;
  5. newattr       equ            [bp + 06h]          ;
  6.  
  7. program       segment
  8.               assume         cs:program
  9.               push           bp
  10.               mov            bp,sp
  11.               push           ds
  12.               push           es
  13.               mov            ah,15
  14.               int            10h
  15.               cmp            al,7
  16.               jnz            color
  17.               mov            bx,0B000h
  18.               mov            dx,03BAh
  19.               jmp            short ok
  20. color:        mov            bx,0B800h
  21.               mov            dx,03DAh
  22. ok:           push           bx
  23.               pop            ds
  24.               mov            si,0001h
  25. SetScrn:      les            di,oldattr          ; get old attribute
  26.               mov            cx,es:[di]          ; to CX
  27.               les            di,newattr          ; get new attribute
  28.               mov            bx,es:[di]          ; to BX
  29.               mov            bh,cl               ; put old in BH,new in BL
  30.               mov            cx,07d0h            ; do whole screen
  31.               mov            di,0002             ; use for increment
  32.               cld                                ; clear direction flags
  33.               cli                                ; disable interrupts
  34. Waitlo1:      in             al,dx               ; get status
  35.               shr            al,1                ; is it low?
  36.               jc             WaitLo1             ; wait until it is
  37. WaitHi1:      in             al,dx               ; get status
  38.               shr            al,1                ; is it high?
  39.               jnc            WaitHi1             ; wait until it is
  40.               cmp            [si],bh
  41.               jnz            colorok1
  42.               mov            [si],bl             ; put the new attribute
  43. ColorOK1:     add            si,di               ; increment screen pointer
  44.               loop           Waitlo1             ; do it until CX=0
  45.               sti
  46. endit:        pop            es                  ; restore DS
  47.               pop            ds                  ; restore ES
  48.               pop            bp                  ; back to basic
  49. program       ends
  50.               end
  51.  
  52.  
  53.