Changeset 491 in xtideuniversalbios for trunk/Assembly_Library/Src/File
- Timestamp:
- Dec 15, 2012, 2:46:29 PM (12 years ago)
- google:author:
- krille_n_@hotmail.com
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Assembly_Library/Src/File/FileIO.asm
r446 r491 3 3 4 4 ; 5 ; XTIDE Universal BIOS and Associated Tools 5 ; XTIDE Universal BIOS and Associated Tools 6 6 ; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team. 7 7 ; … … 10 10 ; the Free Software Foundation; either version 2 of the License, or 11 11 ; (at your option) any later version. 12 ; 12 ; 13 13 ; This program is distributed in the hope that it will be useful, 14 14 ; but WITHOUT ANY WARRANTY; without even the implied warranty of 15 15 ; 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. 17 17 ; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 18 18 ; 19 19 20 20 21 21 ; Section containing code … … 37 37 ALIGN JUMP_ALIGN 38 38 FileIO_CreateWithPathInDSSIandAttributesInCX: 39 xchg dx, si ; Path now in DS:DX40 39 mov ah, CREATE_OR_TRUNCATE_FILE 41 jmp SHORT CreateOrOpenFile42 40 SKIP2B bx 41 ; Fall to FileIO_OpenWithPathInDSSIandFileAccessInAL 43 42 44 43 ;-------------------------------------------------------------------- … … 55 54 ; AX, BX 56 55 ;-------------------------------------------------------------------- 57 ALIGN JUMP_ALIGN58 56 FileIO_OpenWithPathInDSSIandFileAccessInAL: 57 mov ah, OPEN_EXISTING_FILE 59 58 xchg dx, si ; Path now in DS:DX 60 mov ah, OPEN_EXISTING_FILE61 CreateOrOpenFile:62 59 int DOS_INTERRUPT_21h 63 60 xchg si, dx … … 87 84 ret 88 85 89 ;--------------------------------------------------------------------90 ; File position is updated so next read will start where91 ; previous read stopped.92 ;93 ; FileIO_ReadCXbytesToDSSIusingHandleFromBX94 ; Parameters:95 ; BX: File handle96 ; CX: Number of bytes to read97 ; DS:SI: Ptr to destination buffer98 ; Returns:99 ; AX: Number of bytes actually read if successful (0 if at EOF before call)100 ; DOS error code if CF set101 ; CF: Clear if successful102 ; Set if error103 ; Corrupts registers:104 ; Nothing105 ;--------------------------------------------------------------------106 ALIGN JUMP_ALIGN107 FileIO_ReadCXbytesToDSSIusingHandleFromBX:108 xchg dx, si ; DS:DX now points to destination buffer109 mov ah, READ_FROM_FILE_OR_DEVICE110 int DOS_INTERRUPT_21h111 xchg si, dx112 ret113 114 86 115 87 ;-------------------------------------------------------------------- … … 134 106 ret 135 107 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 ;-------------------------------------------------------------------- 126 ALIGN JUMP_ALIGN 127 FileIO_ReadCXbytesToDSSIusingHandleFromBX: 128 mov ah, READ_FROM_FILE_OR_DEVICE 129 SKIP2B f 130 ; Fall to FileIO_WriteCXbytesFromDSSIusingHandleFromBX 131 136 132 ;-------------------------------------------------------------------- 137 133 ; File position is updated so next write will start where 138 134 ; previous write stopped. 139 135 ; 140 ; FileIO_WriteCXbytesFromDSSIusingHandleFromBX :136 ; FileIO_WriteCXbytesFromDSSIusingHandleFromBX 141 137 ; Parameters: 142 138 ; BX: File handle … … 151 147 ; Nothing 152 148 ;-------------------------------------------------------------------- 153 ALIGN JUMP_ALIGN154 149 FileIO_WriteCXbytesFromDSSIusingHandleFromBX: 155 xchg dx, si ; DS:DX now points to source buffer156 150 mov ah, WRITE_TO_FILE_OR_DEVICE 151 xchg dx, si ; DS:DX now points to buffer 157 152 int DOS_INTERRUPT_21h 158 153 xchg si, dx … … 232 227 233 228 ;-------------------------------------------------------------------- 234 ; FileIO_GetFileSizeToDXAXusingHandleFromBXandResetFilePosition :229 ; FileIO_GetFileSizeToDXAXusingHandleFromBXandResetFilePosition 235 230 ; Parameters: 236 231 ; BX: File handle … … 287 282 288 283 ;-------------------------------------------------------------------- 289 ; FileIO_SeekFromOriginInALtoOffsetInDXAXusingHandleFromBX :284 ; FileIO_SeekFromOriginInALtoOffsetInDXAXusingHandleFromBX 290 285 ; Parameters: 291 286 ; AL: SEEK_FROM.(origin)
Note:
See TracChangeset
for help on using the changeset viewer.