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

Subversion Repositories forwardcom

[/] [forwardcom/] [libraries/] [print_characters_light.as] - Blame information for rev 96

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 96 Agner
/*********************************  print_characters_light.as **************
2
* Author:        Agner Fog
3
* date created:  2021-05-16
4
* Last modified: 2021-05-16
5
* Version:       1.11
6
* Project:       ForwardCom library libc_light.li
7
* Description:   puts: print a string to stdout. Does not append linefeed
8
* This version is for CPUs with limited capabilities
9
* C declaration: void print_characters.as(int64_t r0);
10
*
11
* Copyright 2021 GNU General Public License http://www.gnu.org/licenses
12
******************************************************************************/
13
 
14
code section execute                   // code section
15
 
16
// Prints multiple characters to stdout
17
// The characters to print are contained in integer s0
18
// Can be used with a 32-bit register or 64-bit register as parameter
19
// The parameter can hold a maximum of 4 characters if 32 bits, or 8 characters if 64 bits
20
 
21
_print_characters function public reguse=1,0
22
while (uint64 r0 != 0) {
23
    int8 output(r0, r0, 10);
24
    uint64 r0 >>= 8;
25
}
26
return
27
_print_characters end
28
 
29
code end

powered by: WebSVN 2.1.0

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