home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ddkx86v2.zip / DDKX86 / DBCSDD / SRC_DBCS / VDHV / VDHJIOPL.ASM < prev    next >
Assembly Source File  |  1995-04-14  |  26KB  |  532 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   VDHJIOPL.ASM -- Video Device Handler Japanese Ring 2 Routines
  14.  
  15. ;/*****************************************************************************
  16. ;*
  17. ;* SOURCE FILE NAME = VDHJIOPL.ASM
  18. ;*
  19. ;* DESCRIPTIVE NAME = Video Device Handler Japanese Ring 2 Routines
  20. ;*
  21. ;*
  22. ;* VERSION      V2.0
  23. ;*
  24. ;* DATE
  25. ;*
  26. ;* DESCRIPTION
  27. ;*
  28. ;* FUNCTIONS
  29. ;*
  30. ;* NOTES        NONE
  31. ;*
  32. ;* STRUCTURES   NONE
  33. ;*
  34. ;* EXTERNAL REFERENCES  NONE
  35. ;*
  36. ;* EXTERNAL FUNCTIONS
  37. ;*
  38. ;*              NONE
  39. ;*
  40. ;* CHANGE ACTIVIY =
  41. ;*   DATE      FLAG       APAR    CHANGE DESCRIPTION
  42. ;*   --------  ---------- -----   --------------------------------------
  43. ;*   mm/dd/yy  @Vr.mpppxx xxxxx   xxxxxxx
  44. ;*   09/25/92   Before access CMOS register, you MUST check if current machine;j-@mh01
  45. ;*              is MCA or ISA. Otherwise some machine's CMOS, sach as           ;j-@mh01
  46. ;*              DynaBook, is brocken.                                           ;j-@mh01
  47. ;****************************************************************************/
  48.  
  49. .286p
  50.  
  51.         .xlist
  52.         include vdh.inc                 ; Definitions
  53.         include vdhequ.inc              ; Definitions
  54.         INCLUDE strucJ.inc              ; Structured Macros
  55.         INCLUDE phoenix.inc             ; Structured Macros     ;J-RH
  56.         INCLUDE vdhstruc.inc            ; Structured Macros     ;J-KK1011
  57.         .list
  58.         include iodelay.inc             ; IODelay macro              ;J-IODelay
  59.  
  60.         extrn   DOSOPEN:far                                             ;j-@mh01
  61.         extrn   DOSDEVIOCTL2:far                                        ;j-@mh01
  62.         extrn   DOSCLOSE:far                                            ;j-@mh01
  63.         INCL_DOSFILEMGR equ     1                                       ;j-@mh01
  64.  
  65. _DATA   SEGMENT WORD PUBLIC 'DATA'      ; Global Data Segment
  66.  
  67. ;; Slot Number
  68. ;;              0       : On Planar
  69. ;;              1 <-> 8 : On Slot
  70. ;;              FF      : Not Exist
  71. ;;
  72. ;; if ATLAS# == SBCS# == 0, both are on planar.
  73. ;; if ATLAS# == SBCS# != 0, both are on the same slot.
  74. ;; if ATLAS# != SBCS#
  75. ;;  if ATLAS# != 0 & SBCS# == 0, SBCS is on planar and ATLAS on slot.
  76. ;;  if ATLAS# != 0 & SBCS# != 0, SBCS is on slot and ATLAS on another slot.
  77.  
  78. On_Planar       equ   0
  79. Not_Exist       equ   0ffh
  80.  
  81. ATLAS_videoslot db  Not_Exist            ; ATLAS Adaptor Slot#           J-KKB12
  82. SBCS_videoslot  db  Not_Exist            ; SBCS  Adaptor Slot#           J-KKB12
  83.  
  84. OEMHelp         db  'OEMHLP$'           ;Name of OEM Help Dev Drvr      ;j-@mh01
  85. hOEM            dw  0                                                   ;j-@mh01
  86. action          dw  0                                                   ;j-@mh01
  87.                                                                         ;j-@mh01
  88. _BIOSINFO       struc                                                   ;j-@mh01
  89.         Model           dw      0                                       ;j-@mh01
  90.         SubModel        dw      0                                       ;j-@mh01
  91.         RevisionLevel   dw      0                                       ;j-@mh01
  92.         ABIOS_Present   dw      0                                       ;j-@mh01
  93. _BIOSINFO       ends                                                    ;j-@mh01
  94. BIOSInfo        _BIOSINFO       <>      ;BIOS Level Information         ;j-@mh01
  95. LEN_BIOSInfo    equ     $ - BIOSInfo                                    ;j-@mh01
  96.                                                                         ;j-@mh01
  97. OEM_BIOS_INFO   equ     5                                               ;j-@mh01
  98. OEM_CATEGORY    equ     80h                                             ;j-@mh01
  99.  
  100. _DATA   ENDS
  101.  
  102. R2SEG   SEGMENT DWORD PUBLIC 'CODE'                                    ;J-IODlay
  103.         ASSUME  CS: R2SEG, DS: DGROUP
  104.  
  105. ;------------------------------------------------------------------------
  106. ; Function : Check if both ATLAS and SBCS video subsystem exist by reading
  107. ;            the card ID in CMOS. And their slot# are stored in the global
  108. ;            data area.
  109. ; OutPut   : ATLAS_videoslot   ATLAS slot number ( 1 - 8 )
  110. ;            SBCS_videoslot    SBCS video subsystem slot number         J-KKB13
  111. ;              Temporary 0
  112. ;            AX - 0: Exist,   -1: None
  113. ;------------------------------------------------------------------------
  114. _CheckID PROC   FAR
  115.         PUBLIC  _CheckID
  116.  
  117.         ; Before access CMOS register, you MUST check if current machine;j-@mh01
  118.         ; is MCA or ISA. Otherwise some machine's CMOS, sach as         ;j-@mh01
  119.         ; DynaBook, is brocken.                                         ;j-@mh01
  120.         push    ds                                                      ;j-@mh01
  121.         mov     ax,_DATA                                                ;j-@mh01
  122.         mov     ds,ax                                                   ;j-@mh01
  123.                                                                         ;j-@mh01
  124.         mov     ds:BIOSInfo.ABIOS_Present, 0    ;assume not MCA machine ;j-@mh01
  125.         push    ds                                                      ;j-@mh01
  126.         push    offset OEMHelp                                          ;j-@mh01
  127.         push    ds                                                      ;j-@mh01
  128.         push    offset hOEM                                             ;j-@mh01
  129.         push    ds                                                      ;j-@mh01
  130.         push    offset action                                           ;j-@mh01
  131.         push    0               ;push dword file size                   ;j-@mh01
  132.         push    0                                                       ;j-@mh01
  133.         push    0               ;push word fileattribute                ;j-@mh01
  134.         push    1               ;push word OpenFlag                     ;j-@mh01
  135.         push    40h             ;push word OpenMode                     ;j-@mh01
  136.         push    0               ;push dword reserved 0                  ;j-@mh01
  137.         push    0                                                       ;j-@mh01
  138.         call    DosOpen                                                 ;j-@mh01
  139.                                                                         ;j-@mh01
  140.         .if <zero ax>                                                   ;j-@mh01
  141.                 push    ds                                              ;j-@mh01
  142.                 push    offset BIOSInfo                                 ;j-@mh01
  143.                 push    LEN_BIOSInfo                                    ;j-@mh01
  144.                 push    0               ;No parameter                   ;j-@mh01
  145.                 push    0                                               ;j-@mh01
  146.                 push    0               ;No param length                ;j-@mh01
  147.                 push    OEM_BIOS_INFO                                   ;j-@mh01
  148.                 push    OEM_CATEGORY                                    ;j-@mh01
  149.                 push    hOEM            ;Handle to OEM device driver    ;j-@mh01
  150.                 call    DosDevIOCtl2                                    ;j-@mh01
  151.                                                                         ;j-@mh01
  152.                 push    hOEM                                            ;j-@mh01
  153.                 call    DosClose                                        ;j-@mh01
  154.         .endif                                                          ;j-@mh01
  155.                                                                         ;j-@mh01
  156.         mov     ax,ds:BIOSInfo.ABIOS_Present                            ;j-@mh01
  157.         pop     ds                                                      ;j-@mh01
  158.         .if<nonzero ax> near            ;check if MCA machine           ;j-@mh01
  159.  
  160.         push    bx
  161.         push    cx
  162.         push    dx
  163.         push    si                      ;                             J-IODelay
  164. ;
  165.         mov     bx,0001h
  166.         mov     cl,01h
  167.         mov     dx,0074h                ;CMOS Address register
  168.         .repeat
  169.             mov     ax,bx               ;odd adrress
  170.             out     dx,ax
  171.             kIODelay si                 ; D1085                       J-IODelay
  172.             add     dx,2
  173.             in      al,dx               ;al high data
  174.             sub     dx,2
  175.             dec     bx                  ;even address
  176.             xchg    ax,bx
  177.             out     dx,ax
  178.             kIODelay si                 ; D1085                       J-IODelay
  179.             xchg    ax,bx
  180.             inc     bx                  ;odd address
  181.             mov     ah,al
  182.             add     dx,2
  183.             in      al,dx               ;al low  data
  184.             sub     dx,2
  185.             .if     <ax e AtlasId> or   ; ATLAS
  186.             .if     <ax e AtlasKENT>    ; ATLAS-KENT                    J-KK0814
  187.                 push    ds
  188.                 mov     ax,_DATA
  189.                 mov     ds,ax
  190.                 mov     ds:ATLAS_videoslot, cl ; Slot Number
  191.                 mov     byte ptr ds:SBCS_videoslot, 0 ; Planar          J-KKB13
  192.                 pop     ds
  193.                 jmp     adaptor_exist
  194.  
  195.             .else
  196.                 IFDEF   IDS             
  197.                     .if     <ax e AtlasIDS> or 
  198.                 ENDIF                   
  199.                 .if     <ax e AtlasSP2> or    
  200.                 .if     <ax ae AtlasII_Start> and 
  201.                 .if     <ax be AtlasII_End  > 
  202.                     push    ds          
  203.                     push    ax          
  204.                     mov     ax,_DATA    
  205.                     mov     ds,ax       
  206.                     mov     ds:ATLAS_videoslot, cl 
  207.                     mov     byte ptr ds:SBCS_videoslot, cl 
  208.                     pop     ax          
  209.                     pop     ds          
  210.                     jmp     adaptor_exist 
  211.                 .else                   ; 
  212.                     inc     cl          ; 
  213.                     add     bx,0023H    ;next entry
  214.                 .endif                  ; 
  215.             .endif                      
  216.         .until  < cl e maxslot+1 >      ; Search all of 8 slots.        J-KK0208
  217.         mov     ax, -1                  ; Japanese Adaptor Not Exist
  218.         jmp     gethw_exit
  219.  
  220. adaptor_exist:
  221.         xor     ax, ax                  ; Japanese Adaptor Exist
  222. gethw_exit:
  223.         pop     si                      ;                             J-IODelay
  224.         pop     dx
  225.         pop     cx
  226.         pop     bx
  227.  
  228.         .else                                                           ;j-@mh01
  229.         mov     ax, -1                  ; Japanese Adaptor Not Exist    ;j-@mh01
  230.         .endif                                                          ;j-@mh01
  231.  
  232.         RET
  233. _CheckID ENDP
  234.  
  235. ;------------------------------------------------------------------------
  236. ; Function : Get H/W Configuration
  237. ; OutPut   : AX - Configuaration Data
  238. ;------------------------------------------------------------------------
  239. _GetHWConf PROC FAR
  240.         PUBLIC  _GetHWConf
  241.  
  242.         push    cx                      ;                             J-IODelay
  243.         push    dx
  244. ;
  245. ;; Enable ATLAS
  246.         call    vga2japan
  247.  
  248. ;; Read Configuration Register
  249.         mov     dx,3E0H                 ; Get ATLAS Config Data1
  250.         mov     al,0AH                  ; 
  251.         out     dx,al                   ; 
  252.         kIODelay cx                     ; D1085                       J-IODelay
  253.         inc     dx                      ; 
  254.         in      al,dx                   ; 
  255.         xchg    al,ah                   ; 
  256. ;
  257.         mov     dx,3E0H                 ; 
  258.         mov     al,0BH                  ; 
  259.         out     dx,al                   ; 
  260.         kIODelay cx                     ; D1085                       J-IODelay
  261.         inc     dx                      ; 
  262.         in      al,dx                   ; 
  263.         xchg    al,ah                   ; 
  264. ;;                              AX - ATLAS Configuration Data
  265.  
  266. ;
  267. ;; Enable VGA
  268.         push    ax
  269.         call    japan2vga
  270.         pop     ax
  271.  
  272.         pop     dx                      ; 
  273.         pop     cx                      ;                             J-IODelay
  274.         ret
  275. _GetHWConf ENDP
  276.  
  277. ;---------------------------------------------------------------------------
  278. ;    Enable Atlas and Disable VGA
  279. ;---------------------------------------------------------------------------
  280. vga2japan proc  near                    ; 
  281.         public  vga2japan
  282.  
  283.         push    ds                      ;                               J-KKB13
  284.         push    _DATA                   ; DS : Global Segment           J-KKB13
  285.         pop     ds                      ;                               J-KKB13
  286.  
  287.         mov     al, ds:SBCS_videoslot   ; Get Slot Number               J-KKB13
  288.         .if     < al ne <byte ptr ds:ATLAS_videoslot>> ; Both on Slot/Planar?J-KKB13
  289.                                         ; Enable/Disable is necessary.  J-KKB13
  290. ;; Disable VGA
  291.             mov     al, 70h             ; Set Slot POS into             @KIKO
  292.             out     96h, al             ;   non-setup mode.             @KIKO
  293.  
  294.             xor     ax, ax              ; Disable VGA ( SBCS Adaptor )   J-KKB12
  295.             CLI                         ; 
  296.             Call    nSBCSAdaptor_Enb    ;                                J-KKB12
  297.  
  298. ;; Enable ATLAS
  299.             mov     ax, 1               ; Enable  ATLAS                  J-KKB12
  300.             Call    nATLAS_Enb          ;                                J-KKB12
  301.             STI                         ; 
  302.  
  303.         .endif                          ;                               J-KKB13
  304.  
  305.         pop     ds                      ;                               J-KKB13
  306.         ret
  307. vga2japan endp
  308.  
  309. ;---------------------------------------------------------------------------
  310. ;  Disable Atlas, Enable VGA, and Enable ROS E000h.
  311. ;---------------------------------------------------------------------------
  312. japan2vga   proc    near                ; 
  313.             public  japan2vga
  314.  
  315.             push    bx                  ;                               J-KKB13
  316.             push    ds                  ;                               J-KKB13
  317.             push    _DATA               ; DS : Global Segment           J-KKB13
  318.             pop     ds                  ;                               J-KKB13
  319.  
  320.             xor     bl, bl              ;               ; Clear Flag    J-KKB13
  321.             mov     al, ds:SBCS_videoslot ; Get Slot Number             J-KKB13
  322.             .if     < al ne <byte ptr ds:ATLAS_videoslot>> ; Both on Slot/PlanarJ-KKB13
  323.                 mov     bl, 1           ; Enable/Disable is necessary.  J-KKB13
  324.             .endif                      ;                               J-KKB13
  325.  
  326. ;; Check PD Busy
  327.             Call    Check_PDBUSY        ; Fix ATLAS             ;;J-KK0128
  328.                                         ; If DBCS video mode, CLI now.
  329.  
  330.             .if     < nonzero bl >      ; Enable/Disable is necessary.  J-KKB13
  331.  
  332. ;; VGA Passthru Mode
  333.                 mov     dx,3e0h         ;Rout to VGA
  334.                 mov     ax,0302h        ;Mode Register
  335.                 out     dx,ax           ;Character/VGA passthru Mode
  336.  
  337. ;; Disable ATLAS
  338.                 mov     al, 0ffh        ; Set Planer POS into           @KIKO
  339.                 out     94h, al         ;   non-setup mode.             @KIKO
  340.  
  341.                 xor     ax, ax          ; Disable ATLAS                 J-KKB12
  342.                 CLI                     ; 
  343.                 Call    nATLAS_Enb      ;                               J-KKB12
  344.  
  345. ;; Enable VGA
  346.                 mov     ax, 1           ; Enable VGA ( SBCS Adaptor )   J-KKB12
  347.                 Call    nSBCSAdaptor_Enb ;                              J-KKB12
  348.  
  349.             .else                       ; 
  350.                 mov     dx,3e0h         
  351.                 mov     ax,0100h        
  352.                 out     dx,ax           
  353.  
  354.             .endif                      ; 
  355.             STI                         ; <=== Must be here.
  356.  
  357.             pop     ds                  ;                               J-KKB13
  358.             pop     bx                  ;                               J-KKB13
  359.             ret
  360. japan2vga   endp
  361.  
  362. ;;----------------------------------------------------------------------------
  363. ;; Function     : Enable/Disable SBCS Adaptor                           J-KKB12
  364. ;; Input        : AX - 0: Disable    1: Enable
  365. ;; Output       : AX - 0: No Error  Others: Error
  366. ;;----------------------------------------------------------------------------
  367.  
  368. nSBCSAdaptor_Enb proc near
  369.         public  nSBCSAdaptor_Enb
  370.  
  371.         mov     ah, al                  ; AH : Enable or Disable
  372.         mov     al, ds:SBCS_videoslot   ; Get SBCS Slot
  373.         .if     < al ne Not_Exist >     ; Exist ?
  374.             .if     < nonzero al >      ; On Slot
  375.  
  376.                 Call    Slot_Enb        ; Enable/Disable for Slot
  377.  
  378.             .else                       ; On Planar
  379.                 mov     al,0dfh         ; To Setup Mode
  380.                 out     94h,al          ;                               @KIKO
  381.  
  382.                 mov     dx,102h         ; 
  383.                 in      al, dx          ; 
  384.                 .if     < zero ah >     ; 
  385.                     and     al, 0FEh    ; Disable
  386.                 .else                   ; 
  387.                     or      al, 01h     ; Enable
  388.                 .endif                  ; 
  389.                 out     dx,al           ; 
  390.  
  391.                 mov     al,0ffh         ; To non-setup mode
  392.                 out     94h,al          ;                               @KIKO
  393.             .endif                      ; 
  394.             xor     ax, ax              ; No Error
  395.         .else                           ; 
  396.             mov     ax, 1               ; Error
  397.         .endif                          ; 
  398.  
  399.         ret
  400. nSBCSAdaptor_Enb endp
  401.  
  402. ;;----------------------------------------------------------------------------
  403. ;; Function     : Enable/Disable ATLAS                                  J-KKB12
  404. ;; Input        : AX - 0: Disable    1: Enable
  405. ;; Output       : AX - 0: No Error  Others: Error
  406. ;;----------------------------------------------------------------------------
  407.  
  408. nATLAS_Enb proc near
  409.         public  nATLAS_Enb
  410.                                         ; 
  411.         mov     ah, al                  ; AH : Enable or Disable
  412.         mov     al, ds:ATLAS_videoslot  ; Get Slot Number
  413.         .if     < al ne Not_Exist >     ; Exist ?
  414.             .if     < nonzero al >      ; On Slot
  415.                 Call    Slot_Enb        ; Enable/Disable for Slot
  416.             .else                       ; On Planar
  417. ;;              Call    XXXX            ; ???? Not Implemented, yet.
  418.             .endif                      ; 
  419.             xor     ax, ax              ; No Error
  420.         .else                           ; 
  421.             mov     ax, 1               ; Error
  422.         .endif                          ; 
  423.  
  424.         ret
  425. nATLAS_Enb endp
  426.  
  427. ;;----------------------------------------------------------------------------
  428. ;; Function     : Enable/Disable Slot                                   J-KKB12
  429. ;; Input        : AL - Slot# ( 1 - 8 )
  430. ;;              : AH - 0: Disable    1: Enable
  431. ;; Output       : none
  432. ;;----------------------------------------------------------------------------
  433. Slot_Enb proc   near
  434.         public  Slot_Enb
  435.  
  436.         dec     al                      ; To Zero Origin
  437.         or      al,08h                  ; To Setup Mode for Slot      @MAINSALE
  438.         out     96h,al                  ;                               @KIKO
  439.  
  440.         mov     dx,102h                 ; Get Pos Reg Data
  441.         in      al, dx                  ; 
  442.         .if     < zero ah >             ; 
  443.             and     al, 0FEh            ; Disable
  444.         .else                           ; 
  445.             or      al, 01h             ; Enable
  446.         .endif                          ; 
  447.         out     dx,al                   ; 
  448.         mov     al,00h                  ; To Non SetUp Mode           @MAINSALE
  449.         out     96h,al                  ;                               @KIKO
  450.  
  451.         ret
  452. Slot_Enb endp
  453.  
  454. ;;-----------------------------------------------------------------------
  455. ;; Function : Check PD-Busy
  456. ;;
  457. ;;   At exit,
  458. ;;      If ATLAS is disabled, then STI.
  459. ;;      Otherwise CLI.
  460. ;;-----------------------------------------------------------------------
  461. Check_PDBUSY proc near                  ;                               @IDS
  462.         public  Check_PDBUSY            ;                               @IDS
  463.         push    ax                      ;                               @IDS
  464.         push    dx                      ;                               @IDS
  465.  
  466.         mov     dx, LS_PORT             ; select sequencer register     @IDS
  467.         mov     al, 03h                 ; select PD status register     @IDS
  468.         CLI                             ; <==== Caution !!!!!           @IDS
  469.         out     dx, al                  ;                               @IDS
  470.         inc     dx                      ;                               @IDS
  471.         in      al, dx                  ; al = PD status                @IDS
  472.         test    al, 00000001b           ; PD is busy?                   @IDS
  473.         .if     < nz > and              ;                               @IDS
  474.         STI                             ; <===                          @IDS
  475.         .if     < al ne 0ffh >          ; ATLAS Disable?                @IDS
  476.             push    cx                  ;                               @IDS
  477.             xor     cx, cx              ; Max Loop Count                @IDS
  478.             Call    Check_PDBUSY_LOOP   ; Check PD Busy                 @IDS
  479.             pop     cx                  ;                               @IDS
  480.             .if     < c >               ; Still Busy                    @IDS
  481.                 mov     dx, LF_PORT     ; Reset                         @IDS
  482.                 mov     al, 18h         ; PD Reset Register             @IDS
  483.                 CLI                     ; <===                          @IDS
  484.                 out     dx, al          ;                               @IDS
  485.                 inc     dx              ;                               @IDS
  486.                 mov     al, 7           ; FM, DRAW and FIFO Busy        @IDS
  487.                 out     dx, al          ;                               @IDS
  488.                 dec     dx              ;                               @IDS
  489.                 mov     al, 18h         ; PD Reset Register             @IDS
  490.                 out     dx, al          ;                               @IDS
  491.                 inc     dx              ;                               @IDS
  492.                 xor     al, al          ;                               @IDS
  493.                 out     dx, al          ;                               @IDS
  494.             .endif                      ;                               @IDS
  495.         .endif                          ;                               @IDS
  496.  
  497.         pop     dx                      ;                               @IDS
  498.         pop     ax                      ;                               @IDS
  499.         ret                             ;                               @IDS
  500. Check_PDBUSY endp                       ;                               @IDS
  501.  
  502. Check_PDBUSY_LOOP proc near             ;                               @IDS
  503.         public  Check_PDBUSY_LOOP       ;                               @IDS
  504.         .repeat                         ;                               @IDS
  505.             mov     dx, LS_PORT         ; select sequencer register     @IDS
  506.             mov     al, 03h             ; select PD status register     @IDS
  507.             CLI                         ; <==== Caution !!!!!           @IDS
  508.             out     dx, al              ;                               @IDS
  509.             inc     dx                  ;                               @IDS
  510.             in      al, dx              ; al = PD status                @IDS
  511.             test    al, 00000001b       ; PD is busy?                   @IDS
  512.             .if     < z >               ; if so, wait until not busy    @IDS
  513.                 clc                     ; No Carry                      @IDS
  514.                 ret                     ;                               @IDS
  515.             .endif                      ;                               @IDS
  516.             STI                         ; <===== Important !!!          @IDS
  517.             Call    justwait            ;                               @IDS
  518.         .loop                           ;                               @IDS
  519.         stc                             ; Carry                         @IDS
  520.         ret                             ; Still Busy                    @IDS
  521. Check_PDBUSY_LOOP endp                  ;                               @IDS
  522.  
  523. justwait proc   near                    ;SK0001
  524.         pusha                           ;SK0001
  525.         kIODelay                        ; D1085                       J-IODelay
  526.         popa                            ;SK0001
  527.         ret                             ;SK0001
  528. justwait endp                           ;SK0001
  529.  
  530. R2SEG   ENDS
  531. END
  532.