Changeset 621 in xtideuniversalbios for trunk/Assembly_Library/Src/File
- Timestamp:
- Nov 21, 2021, 2:15:32 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Assembly_Library/Src/File/FileIO.asm
r592 r621 66 66 67 67 ;-------------------------------------------------------------------- 68 ; FileIO_ReadDXCXbytesToDSSIusingHandleFromBX69 ; Parameters:70 ; BX: File handle71 ; DX:CX: Number of bytes to read72 ; DS:SI: Ptr to destination buffer73 ; Returns:74 ; AX: DOS error code if CF set75 ; CF: Clear if successful76 ; Set if error77 ; Corrupts registers:78 ; AX79 ;--------------------------------------------------------------------80 ALIGN JUMP_ALIGN81 FileIO_ReadDXCXbytesToDSSIusingHandleFromBX:82 push bp83 mov bp, FileIO_ReadCXbytesToDSSIusingHandleFromBX84 call SplitLargeReadOrWritesToSmallerBlocks85 pop bp86 ret87 88 89 ;--------------------------------------------------------------------90 ; FileIO_WriteDXCXbytesFromDSSIusingHandleFromBX91 ; Parameters:92 ; BX: File handle93 ; DX:CX: Number of bytes to write94 ; DS:SI: Ptr to source buffer95 ; Returns:96 ; AX: DOS error code if CF set97 ; CF: Clear if successful98 ; Set if error99 ; Corrupts registers:100 ; AX101 ;--------------------------------------------------------------------102 ALIGN JUMP_ALIGN103 FileIO_WriteDXCXbytesFromDSSIusingHandleFromBX:104 push bp105 mov bp, FileIO_WriteCXbytesFromDSSIusingHandleFromBX106 call SplitLargeReadOrWritesToSmallerBlocks107 pop bp108 ret109 110 111 ;--------------------------------------------------------------------112 68 ; File position is updated so next read will start where 113 69 ; previous read stopped. … … 158 114 159 115 ;-------------------------------------------------------------------- 160 ; SplitLargeReadOrWritesToSmallerBlocks 161 ; Parameters: 116 ; FileIO_ReadDXCXbytesToDSSIusingHandleFromBX 117 ; Parameters: 118 ; BX: File handle 119 ; DX:CX: Number of bytes to read 120 ; DS:SI: Ptr to destination buffer 121 ; Returns: 122 ; AX: DOS error code if CF set 123 ; CF: Clear if successful 124 ; Set if error 125 ; Corrupts registers: 126 ; AX 127 ;-------------------------------------------------------------------- 128 ALIGN JUMP_ALIGN 129 FileIO_ReadDXCXbytesToDSSIusingHandleFromBX: 130 push bp 131 mov bp, FileIO_ReadCXbytesToDSSIusingHandleFromBX 132 jmp SHORT SplitLargeReadOrWriteToSmallerBlocks 133 134 135 ;-------------------------------------------------------------------- 136 ; FileIO_WriteDXCXbytesFromDSSIusingHandleFromBX 137 ; Parameters: 138 ; BX: File handle 139 ; DX:CX: Number of bytes to write 140 ; DS:SI: Ptr to source buffer 141 ; Returns: 142 ; AX: DOS error code if CF set 143 ; CF: Clear if successful 144 ; Set if error 145 ; Corrupts registers: 146 ; AX 147 ;-------------------------------------------------------------------- 148 ALIGN JUMP_ALIGN 149 FileIO_WriteDXCXbytesFromDSSIusingHandleFromBX: 150 push bp 151 mov bp, FileIO_WriteCXbytesFromDSSIusingHandleFromBX 152 ; Fall to SplitLargeReadOrWriteToSmallerBlocks 153 154 ;-------------------------------------------------------------------- 155 ; SplitLargeReadOrWriteToSmallerBlocks 156 ; Parameters: 157 ; [SP]: Saved BP (restored on return) 162 158 ; BX: File handle 163 159 ; BP: Ptr to transfer function … … 171 167 ; AX 172 168 ;-------------------------------------------------------------------- 173 ALIGN JUMP_ALIGN 174 SplitLargeReadOrWritesToSmallerBlocks: 169 SplitLargeReadOrWriteToSmallerBlocks: 175 170 push ds 176 171 push si … … 199 194 call NormalizeDSSI 200 195 call bp 196 SKIP1B dl 197 .ErrorOccurredDuringTransfer: 198 pop cx ; Remove bytes for last transfer 201 199 .ReturnErrorCodeInAX: 202 200 pop cx … … 204 202 pop si 205 203 pop ds 206 ret 207 .ErrorOccurredDuringTransfer: 208 pop cx ; Remove bytes for last transfer 209 jmp SHORT .ReturnErrorCodeInAX 204 pop bp ; Restore BP saved to stack by "caller" 205 ret 206 210 207 211 208 ;-------------------------------------------------------------------- … … 279 276 FileIO_CloseUsingHandleFromBX: 280 277 mov ah, CLOSE_FILE 281 SKIP2B f ; cmp ax, <next instruction>278 SKIP2B f 282 279 ; Fall to FileIO_SeekFromOriginInALtoOffsetInDXAXusingHandleFromBX 283 284 280 285 281 ;--------------------------------------------------------------------
Note:
See TracChangeset
for help on using the changeset viewer.