4 ; This function reads count bytes from the place where the address counter is.
5 ; Use lseek to place the address counter where you want to read from.
7 ; The file descriptor is ignored in this implementation. The read operation
8 ; reads bytes from a raw cart and does not understand the concept of files.
9 ; So if you read over the end of file you get data from the next file.
11 ; The count-parameter can be positive (Atari style) or negative (BLL style).
12 ; In any case the read routine will work correctly.
14 ; int __fastcall__ read(int fd,void *buf,int count)
16 .importzp _FileDestPtr
18 .import pushax,ldaxysp,ldax0sp,incsp6
33 phx ; The BLL kit uses negative counts
34 plx ; while the basic Lynx uses positive
35 bmi @1 ; make all counts negative