Changeset 491 in xtideuniversalbios for trunk/Assembly_Library/Src/File/FileIO.asm


Ignore:
Timestamp:
Dec 15, 2012, 2:46:29 PM (11 years ago)
Author:
krille_n_@…
google:author:
krille_n_@hotmail.com
Message:

Changes:

  • Added a new define (USE_UNDOC_INTEL) that enables optimizations possible by using undocumented instructions available on all Intel processors and truly compatible clones. AFAIK the only exceptions are the NEC V-series and the Sony CXQ70108 processors so this option should be safe for use on the AT builds.
  • Building BIOSDRVS or the BIOS without MODULE_STRINGS_COMPRESSED would fail due to the recent code exclusions so I changed them a bit. Also fixed the mistaken change to Main.asm
  • Changed the Tandy specific info in Configuration_FullMode.txt so it matches the info in the Wiki.
  • Optimizations and fixes in general.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Assembly_Library/Src/File/FileIO.asm

    r446 r491  
    33
    44;
    5 ; XTIDE Universal BIOS and Associated Tools 
     5; XTIDE Universal BIOS and Associated Tools
    66; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team.
    77;
     
    1010; the Free Software Foundation; either version 2 of the License, or
    1111; (at your option) any later version.
    12 ; 
     12;
    1313; This program is distributed in the hope that it will be useful,
    1414; but WITHOUT ANY WARRANTY; without even the implied warranty of
    1515; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    16 ; GNU General Public License for more details.     
     16; GNU General Public License for more details.
    1717; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
    1818;
    19        
     19
    2020
    2121; Section containing code
     
    3737ALIGN JUMP_ALIGN
    3838FileIO_CreateWithPathInDSSIandAttributesInCX:
    39     xchg    dx, si      ; Path now in DS:DX
    4039    mov     ah, CREATE_OR_TRUNCATE_FILE
    41     jmp     SHORT CreateOrOpenFile
    42 
     40    SKIP2B  bx
     41    ; Fall to FileIO_OpenWithPathInDSSIandFileAccessInAL
    4342
    4443;--------------------------------------------------------------------
     
    5554;       AX, BX
    5655;--------------------------------------------------------------------
    57 ALIGN JUMP_ALIGN
    5856FileIO_OpenWithPathInDSSIandFileAccessInAL:
     57    mov     ah, OPEN_EXISTING_FILE
    5958    xchg    dx, si      ; Path now in DS:DX
    60     mov     ah, OPEN_EXISTING_FILE
    61 CreateOrOpenFile:
    6259    int     DOS_INTERRUPT_21h
    6360    xchg    si, dx
     
    8784    ret
    8885
    89 ;--------------------------------------------------------------------
    90 ; File position is updated so next read will start where
    91 ; previous read stopped.
    92 ;
    93 ; FileIO_ReadCXbytesToDSSIusingHandleFromBX
    94 ;   Parameters:
    95 ;       BX:     File handle
    96 ;       CX:     Number of bytes to read
    97 ;       DS:SI:  Ptr to destination buffer
    98 ;   Returns:
    99 ;       AX:     Number of bytes actually read if successful (0 if at EOF before call)
    100 ;               DOS error code if CF set
    101 ;       CF:     Clear if successful
    102 ;               Set if error
    103 ;   Corrupts registers:
    104 ;       Nothing
    105 ;--------------------------------------------------------------------
    106 ALIGN JUMP_ALIGN
    107 FileIO_ReadCXbytesToDSSIusingHandleFromBX:
    108     xchg    dx, si              ; DS:DX now points to destination buffer
    109     mov     ah, READ_FROM_FILE_OR_DEVICE
    110     int     DOS_INTERRUPT_21h
    111     xchg    si, dx
    112     ret
    113 
    11486
    11587;--------------------------------------------------------------------
     
    134106    ret
    135107
     108
     109;--------------------------------------------------------------------
     110; File position is updated so next read will start where
     111; previous read stopped.
     112;
     113; FileIO_ReadCXbytesToDSSIusingHandleFromBX
     114;   Parameters:
     115;       BX:     File handle
     116;       CX:     Number of bytes to read
     117;       DS:SI:  Ptr to destination buffer
     118;   Returns:
     119;       AX:     Number of bytes actually read if successful (0 if at EOF before call)
     120;               DOS error code if CF set
     121;       CF:     Clear if successful
     122;               Set if error
     123;   Corrupts registers:
     124;       Nothing
     125;--------------------------------------------------------------------
     126ALIGN JUMP_ALIGN
     127FileIO_ReadCXbytesToDSSIusingHandleFromBX:
     128    mov     ah, READ_FROM_FILE_OR_DEVICE
     129    SKIP2B  f
     130    ; Fall to FileIO_WriteCXbytesFromDSSIusingHandleFromBX
     131
    136132;--------------------------------------------------------------------
    137133; File position is updated so next write will start where
    138134; previous write stopped.
    139135;
    140 ; FileIO_WriteCXbytesFromDSSIusingHandleFromBX:
     136; FileIO_WriteCXbytesFromDSSIusingHandleFromBX
    141137;   Parameters:
    142138;       BX:     File handle
     
    151147;       Nothing
    152148;--------------------------------------------------------------------
    153 ALIGN JUMP_ALIGN
    154149FileIO_WriteCXbytesFromDSSIusingHandleFromBX:
    155     xchg    dx, si              ; DS:DX now points to source buffer
    156150    mov     ah, WRITE_TO_FILE_OR_DEVICE
     151    xchg    dx, si              ; DS:DX now points to buffer
    157152    int     DOS_INTERRUPT_21h
    158153    xchg    si, dx
     
    232227
    233228;--------------------------------------------------------------------
    234 ; FileIO_GetFileSizeToDXAXusingHandleFromBXandResetFilePosition:
     229; FileIO_GetFileSizeToDXAXusingHandleFromBXandResetFilePosition
    235230;   Parameters:
    236231;       BX:     File handle
     
    287282
    288283;--------------------------------------------------------------------
    289 ; FileIO_SeekFromOriginInALtoOffsetInDXAXusingHandleFromBX:
     284; FileIO_SeekFromOriginInALtoOffsetInDXAXusingHandleFromBX
    290285;   Parameters:
    291286;       AL:     SEEK_FROM.(origin)
Note: See TracChangeset for help on using the changeset viewer.