Changeset 621 in xtideuniversalbios for trunk/Assembly_Library/Src
- Timestamp:
- Nov 21, 2021, 2:15:32 PM (3 years ago)
- Location:
- trunk/Assembly_Library/Src
- Files:
-
- 3 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 ;-------------------------------------------------------------------- -
trunk/Assembly_Library/Src/String/String.asm
r619 r621 79 79 ; CX: Number of characters copied 80 80 ; SI,DI: Updated by CX characters 81 ; CF: Cleared 81 82 ; Corrupts registers: 82 83 ; Nothing … … 90 91 .CopyNextCharacter: 91 92 lodsb ; Load from DS:SI to AL 92 test al, al ; NULL to end string? 93 jz SHORT .EndOfString93 test al, al ; NULL to end string? (Clears CF) 94 jz SHORT PopAXandReturn 94 95 stosb ; Store from AL to ES:DI 95 96 inc cx ; Increment number of characters written 96 97 jmp SHORT .CopyNextCharacter 97 98 ALIGN STRING_JUMP_ALIGN99 .EndOfString:100 pop ax101 ret102 98 103 99 … … 126 122 stc 127 123 sbb cx, si ; Subtract NULL 124 PopAXandReturn: 128 125 pop ax 129 126 ret -
trunk/Assembly_Library/Src/Util/Memory.asm
r602 r621 160 160 ALIGN JUMP_ALIGN 161 161 Memory_SumCXbytesFromESSItoAL: 162 push si 163 dec si 162 add si, cx 164 163 xor al, al 165 164 ALIGN JUMP_ALIGN 166 165 .AddNextByteToAL: 167 inc si166 dec si 168 167 add al, [es:si] 169 168 loop .AddNextByteToAL 170 pop si171 169 ret 172 170 %endif
Note:
See TracChangeset
for help on using the changeset viewer.