home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ddkx86v5.zip / DDKX86 / SRC / IBMGPMI / IPMIS3CL.ASM < prev    next >
Assembly Source File  |  1995-04-14  |  21KB  |  723 lines

  1. ;*DDK*************************************************************************/
  2. ;
  3. ; COPYRIGHT (C) Microsoft Corporation, 1989
  4. ; COPYRIGHT    Copyright (C) 1995 IBM Corporation
  5. ;
  6. ;    The following IBM OS/2 WARP source code is provided to you solely for
  7. ;    the purpose of assisting you in your development of OS/2 WARP device
  8. ;    drivers. You may use this code in accordance with the IBM License
  9. ;    Agreement provided in the IBM Device Driver Source Kit for OS/2. This
  10. ;    Copyright statement may not be removed.;
  11. ;*****************************************************************************/
  12.         PAGE    60,132
  13.         TITLE   IPMIMISC.ASM --
  14. ;/*****************************************************************************
  15. ;*
  16. ;* SOURCE FILE NAME = IPMIMISC.ASM
  17. ;*
  18. ;* DESCRIPTIVE NAME = 16 bit .286 Clock routines for Diamond Stealth.
  19. ;*
  20. ;*
  21. ;* VERSION      V2.0
  22. ;*
  23. ;* DATE
  24. ;*
  25. ;* DESCRIPTION
  26. ;*
  27. ;* FUNCTIONS
  28. ;*
  29. ;*
  30. ;* NOTES        NONE
  31. ;*
  32. ;* STRUCTURES   NONE
  33. ;*
  34. ;* EXTERNAL REFERENCES
  35. ;*
  36. ;*              NONE
  37. ;*
  38. ;* EXTERNAL FUNCTIONS
  39. ;*
  40. ;*              NONE
  41. ;*
  42. ;* CHANGE ACTIVITY =
  43. ;*   DATE      FLAG        APAR   CHANGE DESCRIPTION
  44. ;*   --------  ----------  -----  --------------------------------------
  45. ;*   mm/dd/yy  @Vr.mpppxx  xxxxx  xxxxxxx
  46. ;*   06/02/93             F69306  Hi-color support for Diamond
  47. ;*   07/12/93                     Add Diamond clock support for 1280
  48. ;*   10/06/93              72687  Add Number Nine clock support for S3
  49. ;*   10/21/93              74890  Use hi-color entries in ext clock tbl for 24bpp
  50. ;*   10/21/93              75044  Remove YEE04 fix
  51. ;*   11/01/93             D75458  Merge r206v, r205, r206, r207 S3 code
  52. ;*   02/17/94             D78589  72Hz Refresh Rate for Diamond: Clock Index
  53. ;*   04/22/94                     fix #9 VL clock
  54. ;*   07/16/94              89439  Build break, _Pascal is not recognized.
  55. ;*****************************************************************************/
  56.  
  57. .386p
  58. ;/*
  59. ;**  Include files
  60. ;*/
  61.  
  62.         include struc.inc               ; Structured assembly macros
  63.         include svgadefs.inc            ; 
  64.  
  65.         PUBLIC  SETDIAMONDCLK_S3
  66.  
  67. CODE32    SEGMENT DWORD USE32 PUBLIC 'CODE'
  68.                 ASSUME CS:FLAT, DS:FLAT, ES:NOTHING
  69.                 ALIGN   4
  70. R_from_16              LABEL FAR
  71. CODE32  ENDS
  72.  
  73. CODE2_16  SEGMENT WORD USE16 PUBLIC 'CODE'
  74.                 ASSUME CS:CODE2_16, DS:NOTHING, ES:NOTHING
  75.                 ALIGN  4
  76. fixup:
  77.         jmp far ptr FLAT:R_from_16
  78. CODE2_16  ENDS
  79. CODE16  SEGMENT WORD USE16 PUBLIC 'CODE'
  80.                 ASSUME CS:CODE16, DS:NOTHING, ES:NOTHING
  81. .286p
  82. ;;;;;;;;;;begin code for stealth 24
  83. ;
  84. eeprom_tab_l            equ     20/2            ;10 words
  85. index_m640              equ     0
  86. index_m640h             equ     1
  87. index_m640t             equ     2
  88. index_m800              equ     3
  89. index_m800h             equ     4
  90. index_m800t             equ     5
  91. index_m1024             equ     6
  92. index_m1024h            equ     7
  93. index_m960              equ     8
  94. index_m1280_16          equ     9
  95. index_m1280_256         equ     10
  96. index_m5455             equ     11
  97.  
  98. COUNTER                 equ     7fh             ; 2K x 1
  99. mon_port                equ     3c2h
  100. mon_bit                 equ     10h
  101. Read_Miscellaneous      EQU     03CCH           ;Misc output read register
  102.  
  103. Sequencer               EQU     03C4H           ;Sequencer index register
  104.  
  105. CRT_3B4                 EQU     03B4H           ;Monochrome CRT index addr
  106. CRT_3D4                 EQU     03D4H           ;Monochrome CRT index addr
  107. BT_FIX                  equ     1
  108. ;---------------------------------------------------------------------------
  109. ;       EEPROM Data Format (Each entry 20 bytes)
  110. ;       db      0       ;bit7=vpol. bit6=hpol. bit5=interlace
  111. ;                        bit4,3   = reserved
  112. ;                        bit2,1,0 = entry
  113. ;       db      0,0,0   ;clock data (3 bytes)
  114. eeprom_reg_index        label   byte
  115.         db      3bh,0,1,2,3,4,5,6,7,10h,11h,16h,17h,5Dh,33h,0ffh
  116.  
  117. org_5c         label byte
  118.         db      0
  119. ;
  120. ;---------------------------------------------------------------------------
  121. ;       input   (al)=eeprom table entry address
  122. ;       output  all registers saved except (ax)
  123.  
  124. upd_crtc_eeprom:
  125.         push    bx
  126.         push    cx
  127.         push    dx
  128.         push    ax
  129.         call    Find_6845_Address
  130.         mov     ax,0011h                ;unlock crtc
  131.         out     dx,ax
  132.         pop     ax
  133.         mov     bx, offset cs:eeprom_reg_index
  134.         push    ax              ;(al)=address of eeprom +0
  135.         inc     al              ;(al)=address of eeprom +1
  136. ;       inc     al              ;(al)=address of eeprom +2
  137. pp_1:   inc     al              ;(al)=address of eeprom +3
  138.         push    ax
  139.         call    read_eeprom
  140.         mov     cx,ax
  141.         mov     al,cs:[bx]
  142.         cmp     al,0ffh
  143.         jz      pp_2
  144.         mov     ah,cl
  145.         out     dx,ax
  146.         inc     bx
  147.         mov     al,cs:[bx]
  148.         cmp     al,0ffh
  149.         jz      pp_2
  150.         mov     ah,ch
  151.         out     dx,ax
  152.         inc     bx
  153.         pop     ax
  154.         jmp     pp_1
  155.  
  156. pp_2:   pop     ax
  157.         pop     ax
  158.         push    ax
  159.         call    read_eeprom
  160.         mov     cx,ax
  161.         ;--------------------------------------------;
  162.         ;  update vclk params & interlaced bit       ;
  163.         ;--------------------------------------------;
  164. ;set interlace & clock select
  165.         mov     ah,cl
  166.         and     ah,28h          ;entry.5 interlace bit of cr42.5
  167.                                 ;entry.3 clk3 bit of cr42.3
  168.         or      ah,3            ;clock select 0,1
  169.         mov     al,42h          ;crtc 42 (clock & interlace)
  170.         out     dx,ax
  171. ;set polarity
  172.         push    dx
  173.         mov     dx,3cch
  174.         in      al,dx
  175.         and     al,3fh
  176.         and     cl,0c0h         ;polarity
  177.         or      al,cl
  178.         or      al,0ch          ;clock force to extended
  179.         mov     dx,3c2h
  180.         out     dx,al
  181.         pop     dx
  182. ;clock program
  183.         mov     bh,ch           ;1st byte
  184.         pop     ax
  185.         inc     al              ;offset +1
  186.         call    read_eeprom
  187.         mov     cl,al           ;2nd byte
  188.         mov     bl,ah           ;3rd byte
  189. ;
  190.         call    program_clk_chip_stl24
  191.  
  192.         pop     dx
  193.         pop     cx
  194.         pop     bx
  195.         jmp     far ptr CODE2_16:fixup
  196. ;        ret
  197. ;
  198. ;---------------------------------------------------------------------------
  199. ;       input   (cl)= 2nd byte, (bh)=1st byte, (bl)= 3rd byte
  200. ;       output  bx,cx destroed
  201. ;
  202. ;;      public  program_clk_chip_stl24
  203. program_clk_chip_stl24 :
  204.         push    ax
  205.         push    dx
  206.  
  207.         mov     dx,3c4h
  208.         mov     al,1
  209.         out     dx,al
  210.         mov     ah,al
  211.         inc     dx
  212.         in      al,dx
  213.         push    ax
  214.         or      al,20h
  215.         out     dx,al           ;screen off
  216.  
  217.         call    Find_6845_Address
  218.         mov     ax,0a039h       ;unlock sc regs
  219.         out     dx,ax
  220.         mov     ax,04838h       ;unlock s3 regs
  221.         out     dx,ax
  222.  
  223.         mov     ch,80h          ;25     ;1000   ;25
  224. skip_0_stl24:
  225.         push    bx
  226.         push    cx
  227.         call    p_clock_stl24
  228.         pop     cx
  229.         pop     bx
  230.         mov     dx,3c2h
  231.         in      al,dx
  232.         test    al,10h
  233.         jnz     skip_2_stl24
  234.         dec     ch
  235.         jnz     skip_0_stl24
  236. skip_2_stl24:
  237.  
  238.         mov     dx,3c4h
  239.         mov     al,1
  240.         out     dx,al
  241.         inc     dx
  242.         pop     ax              ;screen recover
  243.         out     dx,al           ;LIN fix 12/17/92 should be al ; not ax
  244.  
  245.         call    wait_vertical_retrace_stl24
  246.         call    wait_vertical_retrace_stl24
  247.  
  248.         pop     dx
  249.         pop     ax
  250.         ret
  251.  
  252. ;
  253. ;---------------------------------------------------------------------------
  254. ;public p_clock
  255. p_clock_stl24:
  256.         mov     dx,3cch         ;read misc. out reg
  257.         in      al,dx
  258.         push    ax              ;save value
  259.         or      al,0ch
  260.         mov     dx,3c2h
  261.         out     dx,al
  262.         call    Find_6845_Address
  263.         mov     al,42h          ;sc2
  264.         out     dx,al
  265.         xchg    al,ah
  266.         inc     dx
  267.         in      al,dx
  268.         xchg    al,ah
  269.         dec     dx
  270.         push    ax              ;previous vclock selection
  271.  
  272. ;unlock seq
  273.         or      ah,2            ;data high
  274.         mov     ch,6    ;5      ;toggle clk 5 times
  275.         cli
  276. kk_1_stl24:
  277.         and     ah,0feh         ;clock low
  278.         out     dx,ax
  279.         out     dx,ax
  280.         or      ah,1            ;clock high
  281.         out     dx,ax
  282.         out     dx,ax
  283.         dec     ch
  284.         jnz     kk_1_stl24
  285.  
  286.         and     ah,0feh
  287.         out     dx,ax
  288.         out     dx,ax
  289.         and     ah,0fch         ;clock low data low
  290.         out     dx,ax
  291.         out     dx,ax
  292.         or      ah,1            ;clock high
  293.         out     dx,ax
  294.         out     dx,ax
  295.         and     ah,0fch         ;clock low data low
  296.         out     dx,ax
  297.         out     dx,ax
  298.         or      ah,1            ;clock high
  299.         out     dx,ax
  300.         out     dx,ax
  301. ;
  302.         mov     ch,24
  303. Send_Serial_stl24:
  304.         and     ah,0fdh         ;send inverted data first
  305.         shl     bx,1
  306.         rcl     cl,1
  307.         jc      Send_Serial_1_stl24
  308.         or      ah,2
  309. Send_Serial_1_stl24:
  310.         out     dx,ax           ;not data out
  311.         out     dx,ax
  312.         and     ah,0feh         ;clock low
  313.         out     dx,ax
  314.         out     dx,ax
  315.         xor     ah,2            ;now real data out
  316.         out     dx,ax
  317.         out     dx,ax
  318.         or      ah,1            ;clock high
  319.         out     dx,ax
  320.         out     dx,ax
  321.         dec     ch
  322.         jnz     Send_Serial_stl24
  323. ;stop bit
  324.         or      ah,2            ;data_high
  325.         out     dx,ax
  326.         out     dx,ax
  327.         and     ah,0feh         ;clock low
  328.         out     dx,ax
  329.         out     dx,ax
  330.         or      ah,1            ;clock high
  331.         out     dx,ax
  332. ;
  333.         pop     ax
  334.         out     dx,ax           ;restore prev. clock for vertical retrace
  335.         out     dx,ax
  336. ;
  337.         pop     ax              ;save value
  338.         mov     dx,3c2h         ;misc. out reg for vclock recover
  339.         out     dx,al
  340.         sti
  341.         ret
  342. ;
  343. ;----------------------------------------------------------------------------
  344. ;        public  wait_vertical_retrace
  345. ;
  346. wait_vertical_retrace_stl24:
  347.         push    ax
  348.         push    cx
  349.         push    dx
  350.         call    Find_6845_Address               ;Get CRTC address
  351.         add     dl,6
  352.  
  353.         mov     cx,0
  354. wv_0:   in      al,dx
  355.         test    al,8
  356.         jnz     wv_1
  357.         loop    wv_0
  358.  
  359.         mov     cx,0
  360. wv_1:   in      al,dx
  361.         test    al,8
  362.         jz      wv_2
  363.         loop    wv_1
  364.  
  365. wv_2:   pop     dx
  366.         pop     cx
  367.         pop     ax
  368.         ret
  369. ;
  370. ;---------------------------------------------------------------------------
  371.         ;input al=adress, unlocked
  372.         ;output ax=data
  373.         ;all registers reserved
  374. read_eeprom:
  375.         push    bx
  376.         mov     bx,ax
  377.         call    read_conf
  378.         pop     bx
  379.         ret
  380. ;
  381. ;---------------------------------------------------------------------------
  382.         ;input bl=adress
  383.         ;output ax=data
  384.         ;all registers reserved
  385. read_conf:
  386.         push    bx
  387.         push    cx
  388.         push    dx
  389.         call    init_ports      ;video disabled ,crtc 41 bit1 set
  390.                                 ;(dx)=3d5/3b5   crtc index = 5ch selected
  391.                                 ;(al)=crtc 5ch data
  392. ;
  393.         mov     bh,bl
  394.         push    bx
  395.         mov     cx,4
  396.         mov     bx,0110000000000000b
  397.         call    send_data_stl24 ;send read command
  398.         pop     bx
  399.  
  400.         mov     cx,9
  401.         call    send_data_stl24 ;send address
  402.         mov     cx,16
  403.         mov     bx,0
  404. rc_1:
  405.         and     al,0efh         ;clock low
  406.         call    del_out
  407.         shl     bx,1
  408.  
  409.         push    dx
  410.         push    ax
  411.         mov     dx,mon_port
  412.         in      al,dx
  413.         test    al,mon_bit
  414.         pop     ax
  415.         pop     dx
  416.  
  417.         jz      rc_2
  418.         or      bl,1
  419. rc_2:
  420.         or      al,10h          ;clock high
  421.         call    del_out
  422.         loop    rc_1
  423.  
  424.         and     al,0efh         ;clock low
  425.         call    del_out
  426. ;LIN    and     al,0bfh          ;chip select low
  427. ;LIN    call    del_out
  428.         call    recover_ports
  429.         mov     ax,bx
  430.         pop     dx
  431.         pop     cx
  432.         pop     bx
  433.         ret
  434.  
  435. ;
  436. ;---------------------------------------------------------------------------
  437. init_ports:
  438.         mov     dx,3c4h
  439.         mov     al,1
  440.         out     dx,al
  441.         inc     dx
  442.         in      al,dx
  443.         or      al,20h          ;screen off
  444.         out     dx,al
  445.  
  446.         mov     dx,3cch
  447.         in      al,dx
  448.         mov     dx,3d4h
  449.         test    al,1
  450.         jnz     init_1
  451.         mov     dx,3b4h
  452. init_1:
  453.         mov     ax,04838h
  454.         out     dx,ax           ;unlock s3
  455.         mov     ax,0a539h
  456.         out     dx,ax           ;unlock sc
  457.  
  458.         mov     al,5ch
  459.         out     dx,al
  460.         inc     dx
  461.         in      al,dx
  462.  
  463.         mov     byte ptr cs:[org_5c] ,al           ; save the original cr.5c
  464.  
  465.         or      al,40h          ;enable chip
  466.         and     al,0cfh
  467.         out     dx,al
  468.         ret
  469. ;
  470. ;---------------------------------------------------------------------------
  471. recover_ports:
  472.         mov     al, byte ptr cs:[org_5c]          ; recover the original cr.5c
  473.         and     al,0bfh         ;chip select low
  474.         call    del_out         ;out dx(3d5.5c),al
  475.  
  476.         dec     dx              ;3d4/3b4
  477.         mov     ax,038h
  478.         out     dx,ax           ;lock s3
  479.         mov     ax,039h
  480.         out     dx,ax           ;lock sc
  481.  
  482.         mov     dx,3c4h
  483.         mov     al,1
  484.         out     dx,al
  485.         inc     dx
  486.         in      al,dx
  487.         and     al,0dfh         ;screen on
  488.         out     dx,al
  489.         ret
  490.  
  491.         ;input bl=adress, (ax)=data
  492.         ;output  all registers reserved
  493.  
  494. chk_ready:
  495.         push    dx
  496.         push    ax
  497. wait_1: mov     dx,mon_port
  498.         in      al,dx
  499.         test    al,mon_bit
  500.         jz      wait_1
  501.         pop     ax
  502.         pop     dx
  503.         ret
  504.  
  505. a_clock:
  506.         and     al,0dfh         ;data low
  507.         or      al,10h          ;clock high
  508.         call    del_out
  509.         and     al,0efh         ;clock low
  510.         call    del_out
  511.         ret
  512. ;
  513. ;---------------------------------------------------------------------------
  514. send_data_stl24:
  515.         and     al,0cfh
  516.         shl     bx,1
  517.         jnc     send_data_1_stl24
  518.         or      al,20h
  519. send_data_1_stl24:
  520.         call    del_out         ;data & clock low
  521.         or      al,10h
  522.         call    del_out         ;clock high
  523.         loop    send_data_stl24
  524.         ret
  525.  
  526. del_out:
  527.         out     dx,al
  528.         out     dx,al
  529.         out     dx,al
  530.         out     dx,al
  531.         out     dx,al
  532.         out     dx,al
  533.         out     dx,al
  534.         out     dx,al
  535.         out     dx,al
  536.         out     dx,al
  537.         ret
  538. ;
  539. ;---------------------------------------------------------------------------
  540. Find_6845_Address PROC
  541.         PUSH    AX
  542.         MOV     DX,Read_Miscellaneous           ;Get Misc read register
  543.         IN      AL,DX                           ;Read the register
  544.         MOV     DX,CRT_3B4                      ;Set Mono
  545.         TEST    AL,01                           ;0 - MONO 1 - Color
  546.         JE      Set_Mono                        ;Return Mono
  547.         MOV     DX,CRT_3D4                      ;Set Color
  548.  
  549. Set_Mono:
  550.         POP     AX
  551.         RET
  552. Find_6845_Address ENDP
  553. ;
  554. ;end code for stealth 24
  555. ;/***************************************************************************
  556. ;*
  557. ;* FUNCTION NAME = VGAWait
  558. ;*
  559. ;* DESCRIPTION   = wait for video retrace before a write to port
  560. ;*                 3C0h, register 10h
  561. ;*
  562. ;*                 ENTRY POINT: VGAWait
  563. ;*                 LINKAGE:   CALL FAR
  564. ;*
  565. ;* INPUT         = NONE
  566. ;*
  567. ;* RETURN-NORMAL = NONE
  568. ;* RETURN-ERROR  = NONE
  569. ;*
  570. ;**************************************************************************/
  571.  
  572. VGAWait PROC    NEAR
  573.         sti
  574.         push    ax
  575.         push    cx
  576.         push    dx
  577.         MOV     DX,Read_Miscellaneous        ;Get Misc read register
  578.         IN      AL,DX                        ;Read the register
  579.         MOV     DX,3bah                      ;Set Mono
  580.         TEST    AL,01                        ;0 - MONO 1 - Color
  581.         JE      _Mono                        ;Return Mono
  582.         MOV     DX,3dah                      ;Set Color
  583.  
  584. _Mono:
  585.         xor     cx,cx           ; time out in case a card never sets this bit
  586. VGAWait1:
  587.         in      al,dx
  588.         test    al,8            ; look for retrace bit
  589.         loopnz  VGAWait1        ; wait for retrace to end
  590.         xor     cx,cx           ; time out in case a card never sets this bit
  591. VGAWait2:
  592.         sti
  593.         nop
  594.         nop                     ; 486     work around
  595.         cli
  596.         in      al,dx
  597.         test    al,8            ; look for retrace bit
  598.         loopz   VGAWait2        ;wait for retrace to begin again
  599.  
  600.         pop     dx
  601.         pop     cx
  602.         pop     ax
  603.         ret
  604. VGAWait ENDP
  605.  
  606.  
  607. CODE16     ENDS
  608.  
  609. .386p
  610.  
  611. CODE32    SEGMENT
  612.           ASSUME CS:FLAT, DS:FLAT, ES:NOTHING
  613.         .errnz ($ - R_from_16)                    ; label defining return jmp location
  614.         jmp return_from_upd
  615. ;/***************************************************************************
  616. ;*
  617. ;* FUNCTION NAME = SETDIAMONDCLK_S3
  618. ;*
  619. ;* DESCRIPTION   = Set the video clock on diamond stealth /Pro on per
  620. ;*                 mode basis.
  621. ;*
  622. ;*                 ENTRY POINT: SetDiamondClk_S3
  623. ;*                 LINKAGE:   CALL NEAR
  624. ;*
  625. ;* INPUT         = (Passed on stack)
  626. ;*                 ULONG HResolution
  627. ;*                 ULONG nColor
  628. ;*
  629. ;* RETURN-NORMAL = Specified clock bits set serially.
  630. ;* RETURN-ERROR  = NONE
  631. ;*
  632. ;**************************************************************************/
  633. ;HRes            equ     WORD  PTR [ebp+0ch]         ;                     
  634. ;nColor          equ     WORD  PTR [ebp+8]
  635. HRes            equ     WORD  PTR [ebp+08]   ;          
  636. nColor          equ     WORD  PTR [ebp+0ch]  ;          
  637. SETDIAMONDCLK_S3        PROC  NEAR
  638.         push    ebp
  639.         mov     ebp, esp
  640.         push    edi
  641.         push    esi
  642.         push    ebx
  643.         mov     dx, word ptr HRes
  644.         mov     cx, word ptr nColor              ;get #colors                               ;          
  645.         mov     ax,eeprom_tab_l*index_m1024
  646.         cmp     dx, 1024
  647.         jne     short res_800
  648.  
  649.         cmp     cx, 16                  ;check for hi-color               
  650.         jne     @F
  651.         mov     ax,eeprom_tab_l*index_m1024h
  652. @@:
  653.         jmp     update_eeprom
  654.  
  655. res_800:
  656.         cmp     dx, 800
  657.         jne     short res_640
  658.         cmp     cx, 16                  ;check for hi-color               
  659.         jne     @F
  660.         mov     ax,eeprom_tab_l*index_m800h
  661.         jmp     short   update_eeprom
  662.  
  663. @@:
  664.         cmp     cx, 24                  ;check for true-color             
  665.         jne     @F
  666.         mov     ax,eeprom_tab_l*index_m800t                    ;          
  667.         jmp     short   update_eeprom
  668.  
  669. @@:
  670.         mov     ax,eeprom_tab_l*index_m800
  671.         jmp     short   update_eeprom
  672.  
  673. res_640:
  674.         cmp     dx, 640
  675.         jne     res_1280                ;check for 1280 res               
  676.         cmp     cx, 16                  ;check for hi-color               
  677.         jne     @F
  678.         mov     ax,eeprom_tab_l*index_m640h
  679.         jmp     short   update_eeprom
  680.  
  681. @@:
  682.         cmp     cx, 24                  ;check for true-color             
  683.         jne     @F
  684.         mov     ax,eeprom_tab_l*index_m640t                    ;          
  685.         jmp     short   update_eeprom
  686.  
  687. @@:
  688.         mov     ax,eeprom_tab_l*index_m640
  689.         jmp     short   update_eeprom
  690.  
  691. res_1280:                               ;          
  692.         cmp     dx, 1280
  693.         jne     @F
  694. ;;;;;;; Index_m1280_256 (10 = computed value of 64h) yields a flickering or   ;          
  695. ;;;;;;; strobe effect on the OS/2 and WinOS/2 desktop after a save/restore    ;          
  696. ;;;;;;; on 1280x1024x256.  Index_m1280_16 (9 = computed value of 5Ah) works   ;          
  697. ;;;;;;; for all refresh rates supported by the StlMode Utility (43.5, 60, 72) ;          
  698. ;;      mov     ax,eeprom_tab_l*index_m1280_256                               ;          
  699.         mov     ax,eeprom_tab_l*index_m1280_16                                ;          
  700.         jmp     short   update_eeprom
  701.  
  702. @@:
  703.         cmp     dx, 1056
  704.         jne     @F
  705.         mov     ax,eeprom_tab_l*index_m5455
  706. @@:
  707. update_eeprom:
  708.         jmp     FAR PTR upd_crtc_eeprom
  709.  
  710. return_from_upd:
  711.         pop     ebx
  712.         pop     esi
  713.         pop     edi
  714.         pop     ebp
  715. ;        ret     8            
  716.         ret
  717. SETDIAMONDCLK_S3  ENDP
  718. CODE32  ENDS
  719.  
  720. END
  721.  
  722.  
  723.