6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Fri Sep 20, 2024 3:39 pm

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Fri Apr 05, 2019 2:52 pm 
Offline

Joined: Mon Jun 24, 2013 8:18 am
Posts: 83
Location: Italy
Hello,

i'm developing a "c-like" printf() family function, in assembler, for the 65c816 uP.
Six function are in develop here:

1) cprintf(lpFmt, ..., wCount) - format parameters basis the format string and print on console
2) tprintf(lpFmt, ..., wCount) - print on default text device (useful for monitor, to redirect console)
3) printf(lpFmt, ..., wCount) - print to standard out device
4) dprintf(bHandle, lpFmt, ..., wCount) - send output to an open file handle
5) fprintf(lpStream, lpFmt, ..., wCount) - send output to an open file stream
6) snprintf(lpBuf, wSize, lpFmt, ..., wCount) - format to an user buffer

For now just cprintf() and snprintf() are fully implemented: the Others functions requires the right system calls to write a buffer to a file handle or file stream, a section that is under develop.

All functions accept a variable number of parameters, passed on stack by the caller. For an explanation about format and the method to manage a variable number of parameters on stack look at source code PRINTF.ASM on my web site:

http://65xx.unet.bz/c16sw/index.php

where also i put a revisioned source code for float point unit and for strings.

Functions on printf.asm and strings.asm are intended to be a "static library" that be used both by assembler or by an high Language like c; all are declared in fact as "pascal": parameters on stack are pushed by the caller in left-to-right order and stack cleanup is managed by functions itselfs.

Marco

_________________
http://65xx.unet.bz/ - Hardware & Software 65XX family


Top
 Profile  
Reply with quote  
PostPosted: Fri Apr 05, 2019 5:34 pm 
Offline
User avatar

Joined: Wed Mar 01, 2017 8:54 pm
Posts: 660
Location: North-Germany
So much work...

Thank you for sharing!


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 17 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: