home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / C / Samples / C-ASM_VI.ARJ / PROGASM.ZIP / PROG063.ASM < prev    next >
Assembly Source File  |  1988-04-10  |  2KB  |  44 lines

  1.  
  2. ;***********************************************************************
  3. ; Eable use of attribute to select between two                         *
  4. ; 256 character generators                                             *
  5. ;***********************************************************************
  6.  
  7. Gen_A   EQU     0                       ;For now we choose A to be first 256
  8. Gen_B   EQU     1                       ;and B to be second 256 bitmaps
  9.  
  10.         PUBLIC  _Enable_Second_Set
  11.  
  12. _Enable_Second_Set PROC    NEAR
  13.         MOV     DX,3C4H                 ;Index for SELECT register
  14.         MOV     AL,3
  15.         OUT     DX,AL
  16.         INC     DX                      ;Output value
  17.         MOV     AL,Gen_B                ;Shift Gen_B into bits 2 and 3
  18.         SHL     AL,1
  19.         SHL     AL,1
  20.         AND     AL,1100B
  21.         MOV     AH,Gen_A
  22.         AND     AH,11B                  ;Shift Gen_A into bits 0 & 1
  23.         OR      AL,AH
  24.         OUT     DX,AL                   ;Output the value
  25.         RET
  26. _Enable_Second_Set ENDP
  27.  
  28. ;************************************************************************
  29. ; Force generator to be always the first 256 characters                 *
  30. ; in plane 2                                                            *
  31. ;************************************************************************
  32.  
  33.         PUBLIC  _Disable_Second_Set
  34.  
  35. _Disable_Second_Set PROC    NEAR
  36.         MOV     DX,3C4H                 ;Fetch address of SEQUENCER
  37.         MOV     AL,3                    ;Fetch index for CHAR GEN SELECT reg
  38.         OUT     DX,AL                   ;Select index
  39.         INC     DX
  40.         MOV     AL,0                    ;Select value = same for A and B
  41.         OUT     DX,AL                   ;Set register to the value
  42.         RET
  43. _Disable_Second_Set ENDP
  44.