home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / INFO / TURBOPAS / TUR6_101.ZIP / V15.ASM < prev    next >
Encoding:
Assembly Source File  |  1986-06-07  |  2.3 KB  |  38 lines

  1. ;--------------------------------------------------------------------
  2. ; Author       : Kevin Dahl                                         :
  3. ; Last Revised : June 7, 1986                                       :
  4. ;                                                                   :
  5. ; FILENAME - V15.ENH                                                :
  6. ;                                                                   :
  7. ; RVSVIDEO                                                          :
  8. ;        Exchanges the foreground and background attribute bits.    :
  9. ;                                                                   :
  10. ; EXIT                                                              :
  11. ;        Nothing is returned.  Video attribute information modified.:
  12. ;--------------------------------------------------------------------
  13. rvsvideo      proc      near
  14.               push      bp                       ; save stack
  15.               mov       bp,sp
  16.               xor       ax,ax                    ; zero out the ax register
  17.               mov       al,[0008h]               ; attribute color information
  18.               mov       bx,ax                    ; save original copy
  19.               mov       cl,4                     ; set up for shifting bits in ah
  20.               shl       al,cl                    ; move 1st nibble to 2nd nibble
  21.               shr       bl,cl                    ; move 2nd nibble to 1st nibble
  22.               or        al,bl                    ; 1st & 2nd nibbles reversed
  23.  
  24.               mov       bl,al                    ; copy into bx
  25.               and       bl,088h                  ; save bits 3 and 7
  26.               mov       dl,bl                    ; save copy
  27.               shr       bl,cl                    ; move 2nd nibble to 1st nibble
  28.               shl       dl,cl                    ; move 1st nibble to 2nd nibble
  29.               and       al,077h                  ; turn bits 3 & 7 off
  30.               or        al,bl                    ; set bit 3
  31.               or        al,dl                    ; set bit 7
  32.  
  33.               mov       [0008h],al               ; save changes
  34.               mov       sp,bp                    ; restore stack
  35.               pop       bp
  36.               ret                                ; remove params from stack
  37. rvsvideo      endp
  38.