home *** CD-ROM | disk | FTP | other *** search
- NEWCOLOUR PROC FAR ;or NEAR
-
- push bx ; save bx
- push cx ; save cx
- mov bx, OFFSET PLUGBOARD ; get address of colour table
- mov ch, al ; save character
- xor al, al ; zeroise al
- ; CF is cleared
- ; ax is kbbbffff/........
- rcl ax, 1 ; now CF is blink bit
- ; ax is bbbffff./........
- pushf ; save the blink bit
- mov cl, 3 ; 3 iterations
- rol ax, cl ; ax is ffff..../.....bbb
- xlat ; ax is ffff..../....BBBB
- ; we may have a rogue blink bit
- ror ax, cl ; ax is BBBffff./.......B
- ; bit 0 of ax is rogue blink bit
- popf ; get back original blink
- rcr ax,1 ; ax is kBBBffff/........
- inc cl ; 4 iterations now
- shr ax, cl ; ax is ....kBBB/ffff....
- shr al, cl ; ax is ....kBBB/....ffff
- xlat ; ax is ....kBBB/....FFFF
- shl al, cl ; ax is ....kBBB/FFFF....
- shl ax, cl ; ax is kBBBFFFF/........
- mov al, ch ; get character back
- pop cx ; restore external cx
- pop bx ; restore external bx
- ret
-
- NEWCOLOUR ENDP
-
-