home *** CD-ROM | disk | FTP | other *** search
- ;--------------------------------------------------------------------
- ; Author : Kevin Dahl :
- ; Last Revised : June 7, 1986 :
- ; :
- ; FILENAME - V15.ENH :
- ; :
- ; RVSVIDEO :
- ; Exchanges the foreground and background attribute bits. :
- ; :
- ; EXIT :
- ; Nothing is returned. Video attribute information modified.:
- ;--------------------------------------------------------------------
- rvsvideo proc near
- push bp ; save stack
- mov bp,sp
- xor ax,ax ; zero out the ax register
- mov al,[0008h] ; attribute color information
- mov bx,ax ; save original copy
- mov cl,4 ; set up for shifting bits in ah
- shl al,cl ; move 1st nibble to 2nd nibble
- shr bl,cl ; move 2nd nibble to 1st nibble
- or al,bl ; 1st & 2nd nibbles reversed
-
- mov bl,al ; copy into bx
- and bl,088h ; save bits 3 and 7
- mov dl,bl ; save copy
- shr bl,cl ; move 2nd nibble to 1st nibble
- shl dl,cl ; move 1st nibble to 2nd nibble
- and al,077h ; turn bits 3 & 7 off
- or al,bl ; set bit 3
- or al,dl ; set bit 7
-
- mov [0008h],al ; save changes
- mov sp,bp ; restore stack
- pop bp
- ret ; remove params from stack
- rvsvideo endp