]> git.sur5r.net Git - cc65/blobdiff - libsrc/cbm/cbm_read.s
Merge remote-tracking branch 'upstream/master' into soft80
[cc65] / libsrc / cbm / cbm_read.s
index 20d3db124c4f6f596dce1e4c42cfb668d1a3efe6..c84ff65aa741d389289f294000c088817a94bec1 100644 (file)
@@ -5,10 +5,10 @@
 ;
 ; int __fastcall__ cbm_read (unsigned char lfn, void* buffer, unsigned int size)
 ; /* Reads up to "size" bytes from a file to "buffer".
-;  * Returns the number of actually read bytes, 0 if there are no bytes left
-;  * (EOF) or -1 in case of an error. _oserror contains an errorcode then (see
-;  * table below).
-;  */
+; ** Returns the number of actually read bytes, 0 if there are no bytes left
+; ** (EOF) or -1 in case of an error. _oserror contains an errorcode then (see
+; ** table below).
+; */
 ; {
 ;     static unsigned int bytesread;
 ;     static unsigned char tmp;
 ;         tmp = cbm_k_basin();
 ;
 ;         /* the kernal routine BASIN sets ST to EOF if the end of file
-;          * is reached the first time, then we have store tmp.
-;          * every subsequent call returns EOF and READ ERROR in ST, then
-;          * we have to exit the loop here immidiatly. */
+;         ** is reached the first time, then we have store tmp.
+;         ** every subsequent call returns EOF and READ ERROR in ST, then
+;         ** we have to exit the loop here immediatly.
+;         */
 ;         if (cbm_k_readst() & 0xBF) break;
 ;
 ;         ((unsigned char*)buffer)[bytesread++] = tmp;
 
         .include        "cbm.inc"
 
-               .export         _cbm_read
+        .export         _cbm_read
+        .import         CHKIN, READST, BASIN, CLRCH
         .importzp       ptr1, ptr2, ptr3, tmp1
-       .import         popax, popa
+        .import         popax, popa
         .import         __oserror
 
+
 _cbm_read:
         eor     #$FF
         sta     ptr1