home *** CD-ROM | disk | FTP | other *** search
/ PC Plus 53 / ISSUE_53_FEB_1991 / PCPLUS / WORKSHOP / WORKSHOP.EXE / NEWCOLR.INC < prev   
Encoding:
Text File  |  1990-12-05  |  1011 b   |  34 lines

  1.     NEWCOLOUR PROC FAR        ;or NEAR
  2.  
  3.     push bx                ; save bx
  4.     push cx                ; save cx
  5.     mov bx, OFFSET PLUGBOARD    ; get address of colour table
  6.     mov ch, al            ; save character
  7.     xor al, al            ; zeroise al
  8.                     ; CF is cleared
  9.                     ; ax is kbbbffff/........
  10.     rcl ax, 1            ; now CF is blink bit
  11.                     ; ax is bbbffff./........
  12.     pushf                ; save the blink bit
  13.     mov cl, 3            ; 3 iterations
  14.     rol ax, cl            ; ax is ffff..../.....bbb
  15.     xlat                ; ax is ffff..../....BBBB
  16.                     ; we may have a rogue blink bit
  17.     ror ax, cl            ; ax is BBBffff./.......B
  18.                     ; bit 0 of ax is rogue blink bit
  19.     popf                ; get back original blink
  20.     rcr ax,1            ; ax is kBBBffff/........
  21.     inc cl                ; 4 iterations now
  22.     shr ax, cl            ; ax is ....kBBB/ffff....
  23.     shr al, cl            ; ax is ....kBBB/....ffff
  24.     xlat                ; ax is ....kBBB/....FFFF
  25.     shl al, cl            ; ax is ....kBBB/FFFF....
  26.     shl ax, cl            ; ax is kBBBFFFF/........
  27.     mov al, ch            ; get character back
  28.     pop cx                ; restore external cx
  29.     pop bx                ; restore external bx
  30.     ret
  31.  
  32.     NEWCOLOUR ENDP
  33.  
  34.