83Plus:Software:usb8x/Asm Interface/MSD/UFI Write: Difference between revisions

From WikiTI
Jump to navigationJump to search
mNo edit summary
m Forgot input
Line 6: Line 6:
Writes one sector from sector buffer to LBA address in (MSDLBA).
Writes one sector from sector buffer to LBA address in (MSDLBA).


=== Inputs ===
=== Inputs ==
* DE points to data to be written
* (MSDLBA) contains LBA address of sector to write
* (MSDLBA) contains LBA address of sector to write


=== Outputs ===
=== Outputs ===
* (MBDLBA) address contains data from sector buffer
* C set if problems
* C set if problems



Revision as of 00:57, 12 September 2006

Synopsis

Name: UFI_Write

Minimum usb8x version: 0.10

Writes one sector from sector buffer to LBA address in (MSDLBA).

= Inputs

  • DE points to data to be written
  • (MSDLBA) contains LBA address of sector to write

Outputs

  • C set if problems

Destroys

  • AF, BC, DE, HL

Notes

(MSDLBA) is a 4-byte area in the mass storage driver's internal memory buffer used by this routine. The following example code would set the value to zero, where appBackUpScreen is where the mass storage internal buffer is:

xor a
ld (appBackUpScreen+MSDLBA),a
ld (appBackUpScreen+MSDLBA+1),a
ld (appBackUpScreen+MSDLBA+2),a
ld (appBackUpScreen+MSDLBA+3),a

This is just to demonstrate where MSDLBA is in memory. See [[../MSD_Initialize|MSD_Initialize]] for more information about the internal buffer used by the mass storage driver.

See Also

  • [[../MSD_Initialize|MSD_Initialize]] - Initializes the mass storage driver