OpenCores
URL https://opencores.org/ocsvn/forwardcom/forwardcom/trunk

Subversion Repositories forwardcom

[/] [forwardcom/] [libraries/] [fread.as] - Rev 150

Go to most recent revision | Compare with Previous | Blame | View Log

/*********************************  fread.as  *********************************
* Author:        Agner Fog
* date created:  2018-03-21
* Last modified: 2018-03-21
* Version:       1.00
* Project:       ForwardCom library libc.li
* Description:   fread function. Read from file
* C declaration: size_t fread(void *ptr, size_t size, size_t nmemb, FILE *stream); 
*
* Copyright 2018 GNU General Public License http://www.gnu.org/licenses
*****************************************************************************/

code section execute align = 4

_fread function public reguse = 0xF

int64 r1 *= r2               // calculate total size
int64 r2 = 1                 // make r1*r2 unchanged

sys_call(r0, r1, 1, 0x112)   // system call fread. buffer base r0, size r1
return

_fread end

code end

Go to most recent revision | Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.