Ignore:
Timestamp:
Feb 10, 2012, 3:12:40 AM (13 years ago)
Author:
krille_n_@…
google:author:
krille_n_@hotmail.com
Message:

Changes:

  • Optimizations (both for size and speed) in IdeTransfer.asm and MemIdeTransfer.asm
  • Fixed a bug where the SingleByteRead/Write functions in IdeTransfer.asm would fail on 128 sector transfers.
  • Fixed some typos and errors in general, comments etc.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectPrint.asm

    r235 r242  
    2222    ePUSH_T ax, ROMVARS.szTitle         ; Bios title string
    2323    push    cs                          ; BIOS segment
    24        
    25 DetectPrint_BootMenuPrint_FormatCSSIfromParamsInSSBP_Relay:     
     24
     25DetectPrint_BootMenuPrint_FormatCSSIfromParamsInSSBP_Relay:
    2626    jmp     BootMenuPrint_FormatCSSIfromParamsInSSBP
    2727
     
    3232;       CS:CX:  Ptr to "Master" or "Slave" string
    3333;       CS:BP:  Ptr to IDEVARS
    34 ;       SI:     Ptr to template string 
     34;       SI:     Ptr to template string
    3535;   Returns:
    3636;       Nothing
     
    4444                                            ;             DL=COM number character, DH=.bDevice
    4545
    46     push    bp                              ; setup stack for call to 
     46    push    bp                              ; setup stack for call to
    4747    mov     bp, sp                          ; BootMenuPrint_FormatCSSIfromParamsInSSBP
    4848
    4949    push    cx                              ; Push "Master" or "Slave"
    50        
     50
    5151    mov     cl, (g_szDetectPort-$$) & 0xff  ; Setup print string for standard IDE
    5252                                            ; Note that we modify only the low order bits of CX a lot here,
     
    5555                                            ; on the same 256 byte page, which is checked in strings.asm.
    5656
    57     cmp     dx, DEVICE_SERIAL_PORT << 8     ; Check if this is a serial device, 
     57    cmp     dx, DEVICE_SERIAL_PORT << 8     ; Check if this is a serial device,
    5858                                            ; And also check if DL is zero, check with the jz below
    59                                             ; This optimization requires that DEVICE_SERIAL_PORT be 
     59                                            ; This optimization requires that DEVICE_SERIAL_PORT be
    6060                                            ; the highest value in the DEVICE_* series, ensuring that
    6161                                            ; anything less in the high order bits is a different device.
    6262
    63     jl      .pushAndPrint                   ; CX = string to print, AX = port address, DX won't be used
     63    jb      .pushAndPrint                   ; CX = string to print, AX = port address, DX won't be used
    6464
    6565    mov     cl, (g_szDetectCOM-$$) & 0xff   ; Setup print string for COM ports
     
    6868
    6969    push    dx                              ; Push COM number character
    70                                             ; If the strnig is going to be "Auto", we will push a NULL (zero)
    71                                             ; here for the COM port number, which will be eaten by the 
    72                                             ; print routine (DisplayPrint_CharacterFromAL), resulting in 
     70                                            ; If the string is going to be "Auto", we will push a NULL (zero)
     71                                            ; here for the COM port number, which will be eaten by the
     72                                            ; print routine (DisplayPrint_CharacterFromAL), resulting in
    7373                                            ; just "COM" being printed without a character after it.
    74                
     74
    7575    mov     cl, (g_szDetectCOMAuto-$$) & 0xff   ; Setup secondary print string for "Auto"
    76        
     76
    7777    jz      .pushAndPrint                   ; CX = string to print, AX and DX won't be used
    78        
     78
    7979    mov     cl, (g_szDetectCOMLarge-$$) & 0xff  ; Setup secondary print string for "COMn/xx.yK"
    8080
     
    8282    cbw                                     ; clear AH, AL will always be less than 128
    8383    xchg    si,ax                           ; move AX to SI for divide
    84     mov     ax,1152                         ; baud rate to displa is 115200/divisor, the "00" is handled
     84    mov     ax,1152                         ; baud rate to display is 115200/divisor, the "00" is handled
    8585                                            ; in the print strings
    86     xor     dx,dx                           ; clear top 16-bits of dividend
     86    cwd                                     ; clear top 16-bits of dividend
    8787    div     si                              ; and divide...  Now AX = baud rate/100, DX = 0 (always a clean divide)
    88        
     88
    8989    mov     si,10                           ; Now separate the whole portion from the fractional for "K" display
    9090    div     si                              ; and divide...  Now AX = baud rate/1000, DX = low order digit
    91        
    92     cmp     ax,si                           ; <= 10: "2400", "9600", etc.; >10: "19.2K", "38.4K", etc.
     91
     92    cmp     ax,si                           ; < 10: "2400", "9600", etc.; >= 10: "19.2K", "38.4K", etc.
    9393    jae     .pushAndPrint
    9494
    9595    mov     cl, (g_szDetectCOMSmall-$$) & 0xff  ; Setup secondary print string for "COMn/XXy00"
    96        
    97 .pushAndPrint: 
     96
     97.pushAndPrint:
    9898    push    cx                              ; Push print string
    9999    push    ax                              ; Push high order digits, or port address, or N/A
     
    102102    mov     si, g_szDetectOuter             ; Finally load SI with wrapper string "IDE %s at %s: "
    103103
    104     jmp     short DetectPrint_BootMenuPrint_FormatCSSIfromParamsInSSBP_Relay   
     104    jmp     short DetectPrint_BootMenuPrint_FormatCSSIfromParamsInSSBP_Relay
    105105
    106106
     
    127127    ret
    128128
    129 
    130 
    131 
Note: See TracChangeset for help on using the changeset viewer.