URL
https://opencores.org/ocsvn/forwardcom/forwardcom/trunk
Subversion Repositories forwardcom
[/] [forwardcom/] [libraries/] [print_string_light.as] - Rev 117
Go to most recent revision | Compare with Previous | Blame | View Log
/********************************* print_string_light.as ****************************** Author: Agner Fog* date created: 2021-05-16* Last modified: 2021-05-16* Version: 1.11* Project: ForwardCom library libc_light.li* Description: puts: print a string to stdout. Does not append linefeed* This version is for CPUs with limited capabilities* C declaration: const char * print_string (const char * str);** Copyright 2021 GNU General Public License http://www.gnu.org/licenses******************************************************************************/code section execute align = 4 // code section// Prints a string to stdout. Same as _puts, but does not append newline// Returns a pointer to the first character after the string_print_string function public reguse=3,0if (int64 r0 != 0) { // check for null pointerwhile (true) { // loop through stringint8 r1 = [r0] // read characterint64 r0++ // next characterif (int8 r1 == 0) {break} // end of stringint8 output(r1, r1, 10); // output character}}return_print_string endcode end
Go to most recent revision | Compare with Previous | Blame | View Log
