7bca5fab5b
git-svn-id: svn://svn.compuextreme.de/Viitor/V962/Viitor_cc65@4352 504e572c-2e33-0410-9681-be2bf7408885
65 lines
2.0 KiB
HTML
65 lines
2.0 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
|
|
<HTML>
|
|
<HEAD>
|
|
<META NAME="GENERATOR" CONTENT="LinuxDoc-Tools 0.9.20">
|
|
<TITLE>Diskette Sector I/O Routines: Reading and writing sectors</TITLE>
|
|
<LINK HREF="dio-3.html" REL=next>
|
|
<LINK HREF="dio-1.html" REL=previous>
|
|
<LINK HREF="dio.html#toc2" REL=contents>
|
|
</HEAD>
|
|
<BODY>
|
|
<A HREF="dio-3.html">Next</A>
|
|
<A HREF="dio-1.html">Previous</A>
|
|
<A HREF="dio.html#toc2">Contents</A>
|
|
<HR>
|
|
<H2><A NAME="s2">2.</A> <A HREF="dio.html#toc2">Reading and writing sectors</A></H2>
|
|
|
|
|
|
<P>The read and write functions are:</P>
|
|
<P>
|
|
<BLOCKQUOTE><CODE>
|
|
<PRE>
|
|
unsigned char __fastcall__ dio_read (dhandle_t handle,
|
|
sectnum_t sect_num,
|
|
void *buffer);
|
|
</PRE>
|
|
</CODE></BLOCKQUOTE>
|
|
</P>
|
|
<P>This function will read the sector specified by <CODE>sect_num</CODE> into the memory
|
|
location at buffer.</P>
|
|
<P>
|
|
<BLOCKQUOTE><CODE>
|
|
<PRE>
|
|
unsigned char __fastcall__ dio_write (dhandle_t handle,
|
|
sectnum_t sect_num,
|
|
const void *buffer);
|
|
</PRE>
|
|
</CODE></BLOCKQUOTE>
|
|
</P>
|
|
<P>This function will write the memory contents at buffer to the sector specified
|
|
by <CODE>sect_num</CODE>. No verify is performed.</P>
|
|
<P>
|
|
<BLOCKQUOTE><CODE>
|
|
<PRE>
|
|
unsigned char __fastcall__ dio_write_verify (dhandle_t handle,
|
|
sectnum_t sect_num,
|
|
const void *buffer);
|
|
</PRE>
|
|
</CODE></BLOCKQUOTE>
|
|
</P>
|
|
<P>This function will write the memory contents at buffer to the sector specified
|
|
by <CODE>sect_num</CODE>. A verification is performed.</P>
|
|
|
|
<P>Use the <CODE>
|
|
<A HREF="dio-3.html#sectsize">dio_query_sectsize</A></CODE> function to query the size of a sector.</P>
|
|
<P>All these functions will return 0 for success and an OS specific error code in
|
|
case of failure.</P>
|
|
|
|
|
|
<HR>
|
|
<A HREF="dio-3.html">Next</A>
|
|
<A HREF="dio-1.html">Previous</A>
|
|
<A HREF="dio.html#toc2">Contents</A>
|
|
</BODY>
|
|
</HTML>
|