home *** CD-ROM | disk | FTP | other *** search
/ 98 Driver Collection MD-0164 / DRIVER_KING_98.iso / CPU / cyrix / LOWLEV.ASM < prev    next >
Encoding:
Assembly Source File  |  1993-04-01  |  1.8 KB  |  56 lines

  1. assume  cs:_TEXT
  2.  
  3. public    _cx_w
  4. public    _cx_r
  5.  
  6. _TEXT    segment byte public 'CODE'
  7.  
  8.  
  9. ;**************************************************************************    
  10. ;       Function:    char cx_r (char index)
  11. ;
  12. ;       Purpose:        Reads Cyrix Configuration Register at index
  13. ;       Inputs:         byte index, Cyrix Configuration Register
  14. ;       Output:         al, Contents of Cyrix Configuration Register
  15. ;**************************************************************************
  16. _cx_r    proc    near
  17.     push    bp
  18.     mov    bp,sp
  19.     sub    sp,4
  20.         pushf                           ; save flags
  21.         cli                             ; clear interrupt in flags
  22.     mov    al, byte ptr [bp+4]     ; get index
  23.     out    22h, al                 ; tell CPU which config. register
  24.     in    al, 23h                 ; write to CPU config. register
  25.         popf                            ; restore flags
  26.     mov    sp,bp
  27.     pop    bp
  28.     ret    
  29. _cx_r    endp
  30.  
  31. ;**************************************************************************    
  32. ;       Function:    char cx_w (char index, char val)
  33. ;
  34. ;       Purpose:        Write Cyrix Configuration Register at index with val
  35. ;       Inputs:         byte index, Cyrix Configuration Register
  36. ;                       byte val, value to be written to index
  37. ;       Output:         nothing
  38. ;**************************************************************************
  39. _cx_w    proc    near
  40.     push    bp
  41.     mov    bp,sp
  42.     sub    sp,4
  43.         pushf                           ; save flags
  44.         cli                             ; clear interrupt in flags
  45.     mov    al, byte ptr [bp+4]     ; get index
  46.         out    22h, al                 ; tell CPU which config. register
  47.     mov    al, byte ptr [bp+6]     ; get val
  48.     out    23h, al                 ; write to CPU config. register
  49.         popf                            ; restore flags
  50.     mov    sp,bp
  51.     pop    bp
  52.     ret    
  53. _cx_w    endp
  54. _TEXT    ends
  55.     end
  56.