Ignore:
Timestamp:
Mar 3, 2012, 6:53:28 AM (12 years ago)
Author:
gregli@…
google:author:
gregli@hotmail.com
Message:

Small optimization, moved around some serial code to avoid a few jumps and unnecessary number of sectors check.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/XTIDE_Universal_BIOS/Src/Device/Serial/SerialCommand.asm

    r277 r292  
    44; Section containing code
    55SECTION .text
     6
     7%define SERIALSERVER_AH_ALREADY_HAS_COMMAND_BYTE
     8%define SERIALSERVER_NO_ZERO_SECTOR_COUNTS     
    69
    710;--------------------------------------------------------------------
     
    4346.readOrWrite:
    4447        mov     [bp+IDEPACK.bFeatures],ah       ; store protocol command
    45 
     48               
    4649        mov     dx, [di+DPT_SERIAL.wSerialPortAndBaud]
    4750
    48         jmp     SerialServer_SendReceive
     51ALIGN JUMP_ALIGN
     52SerialCommand_FallThroughToSerialServer_SendReceive:
    4953
     54%include "SerialServer.asm"
     55
     56%if SerialCommand_FallThroughToSerialServer_SendReceive <> SerialServer_SendReceive
     57%error "SerialServer_SendReceive must be the first routine at the top of SerialServer.asm in the Assembly_Library"
     58%endif
     59
     60ALIGN JUMP_ALIGN       
     61SerialCommand_ReturnError:     
     62        stc
     63        ret     
    5064
    5165;--------------------------------------------------------------------
     
    133147
    134148        test    ax,ax           ; Take care of the case that is different between master and slave.
    135         jz      .error         
     149        jz      SerialCommand_ReturnError
    136150
    137151; fall-through
     
    142156        xchg    dx, ax          ;  move ax to dx (move previously found serial drive to dx, could be zero)
    143157
    144 .identifyDeviceInDX:   
    145         jmp     SerialServerScan_ScanForServer
     158.identifyDeviceInDX:
    146159
    147 .error:
    148         stc
    149         ret
     160ALIGN JUMP_ALIGN
     161SerialCommand_FallThroughToSerialServerScan_ScanForServer:     
     162       
     163%include "SerialServerScan.asm"
     164
     165%if SerialCommand_FallThroughToSerialServerScan_ScanForServer <> SerialServerScan_ScanForServer
     166%error "SerialServerScan_ScanForServer must be the first routine at the top of SerialServerScan.asm in the Assembly_Library"
     167%endif             
     168
     169
Note: See TracChangeset for help on using the changeset viewer.