Changeset 207 in xtideuniversalbios


Ignore:
Timestamp:
Jan 7, 2012, 7:57:57 PM (12 years ago)
Author:
gregli@…
google:author:
gregli@hotmail.com
Message:

Added buffer pointer denormalization check within the serial port code and reused the last portion of the NormalizeESSI and NormalizeESDI routines to save memory.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Assembly_Library/Src/Util/Registers.asm

    r149 r207  
    6969;   Corrupts registers:
    7070;       AX, CX
     71;
     72; Inline of NORMALIZE_FAR_POINTER so that we can share the last 2/3 of the
     73; routine with Registers_NormalizeFinish.
     74;
    7175;--------------------------------------------------------------------
    7276ALIGN JUMP_ALIGN
    7377Registers_NormalizeESSI:
    74     NORMALIZE_FAR_POINTER es, si, ax, cx
    75     ret
     78    mov         cx, si
     79    and         si, byte 0fh
     80    jmp         Registers_NormalizeFinish
    7681
    7782ALIGN JUMP_ALIGN
    7883Registers_NormalizeESDI:
    79     NORMALIZE_FAR_POINTER es, di, ax, cx
     84    mov         cx, di
     85    and         di, byte 0fh
     86;;; fall-through
     87
     88ALIGN JUMP_ALIGN       
     89Registers_NormalizeFinish:     
     90    eSHR_IM     cx, 4
     91    mov         ax, es
     92    add         ax, cx
     93    mov         es, ax
    8094    ret
    81 
     95       
    8296
    8397;--------------------------------------------------------------------
  • trunk/XTIDE_Universal_BIOS/Src/Device/Serial/SerialCommand.asm

    r203 r207  
    177177        dec     dx
    178178
     179;
     180; Start off with a normalized buffer pointer
     181;
     182        call    Registers_NormalizeESDI
     183
    179184;----------------------------------------------------------------------
    180185;
     
    183188; Sends first six bytes of IDEREGS_AND_INTPACK as the command
    184189;
    185         call    Registers_NormalizeESDI
    186 
    187190        push    es              ; save off real buffer location
    188191        push    di
     
    323326        jnz     SerialCommand_OutputWithParameters_Error
    324327
     328;
     329; Normalize buffer pointer for next go round, if needed
     330;
     331        test    di,di
     332        jns     .clearBuffer
     333        call    Registers_NormalizeESDI
    325334
    326335;----------------------------------------------------------------------
     
    332341; taken care of this, but I have seen cases where this is not true.
    333342;
     343       
    334344.clearBuffer:
    335345        mov     dl,bh
     
    344354
    345355.clearBufferComplete:
     356
    346357        pop     ax              ; sector count and command byte
    347358        dec     al              ; decrememnt sector count
Note: See TracChangeset for help on using the changeset viewer.