Changeset 551 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Device
- Timestamp:
- Jun 6, 2013, 3:31:51 PM (11 years ago)
- google:author:
- aitotat@gmail.com
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeDmaBlock.asm
r545 r551 1 1 ; Project name : XTIDE Universal BIOS 2 2 ; Description : IDE Read/Write functions for transferring 3 ; 4 ; 5 3 ; block using DMA. 4 ; These functions should only be called from IdeTransfer.asm. 5 ; Modified JJP 05-Jun-13 6 6 ; 7 7 ; XTIDE Universal BIOS and Associated Tools … … 19 19 ; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 20 20 ; 21 22 21 23 22 ; Section containing code … … 81 80 add dl, XTCF_CONTROL_REGISTER 82 81 83 ; Calculate bytes for first page 84 mov ax, di 85 neg ax ; AX = Max BYTEs for first page 82 ; convert sectors in CX to BYTES 86 83 %ifdef USE_186 87 84 shl cx, 9 ; CX = Block size in BYTEs 88 85 %else 89 xchg cl, ch86 xchg cl, ch 90 87 shl cx, 1 91 88 %endif 89 90 ; Calculate bytes for first page 91 mov ax, di 92 neg ax ; 2s compliment 93 94 ; if DI was zero carry flag will be cleared (and set otherwise) 95 ; When DI is zero only one transfer is required since we've limited the 96 ; XT-CFv3 block size to 32k 97 jnc .TransferLastDmaPageWithSizeInCX 98 99 ; CF was set, so DI != 0 and we might need one or two transfers 92 100 cmp cx, ax ; if we won't cross a physical page boundary... 93 jbe 101 jbe SHORT .TransferLastDmaPageWithSizeInCX ; ...perform the transfer in one operation 94 102 95 103 ; Calculate how much we can transfer on first and second rounds 96 xchg cx, ax; CX = BYTEs for first page97 sub ax, cx 98 push ax; Save bytes for second transfer on stack104 xchg cx, ax ; CX = BYTEs for first page 105 sub ax, cx ; AX = BYTEs for second page 106 push ax ; Save bytes for second transfer on stack 99 107 100 108 ; Transfer first DMA page … … 111 119 ; Parameters: 112 120 ; BL: Byte for DMA Mode Register 113 ; CX: Number of BYTEs to transfer ( 512...32768 since max block size is limited to 64)121 ; CX: Number of BYTEs to transfer (1...32768 since max block size is limited to 64) 114 122 ; DX: XT-CFv3 Control Register 115 123 ; ES: Bits 3..0 have physical address bits 19..16
Note:
See TracChangeset
for help on using the changeset viewer.