Re: [cc65] a question about the write function

From: Jac Ato <jaxatwork11gmail.com>
Date: 2007-02-12 15:43:10
Hi, thanks for the help.

I actually wrote the function back as you stated, but it still fails
to even call fwrite. Im using the default configuration file (-t nes)
and I dont think that this is the problem. The program reaches _printf
and goes into a dead state by jumping $601E (it might also be
calling). I am tracing right now the _printf routine and Ive noticed
some discrepencies between the cc65-2.1.1.0 source file (looking at
the _print.s) and the file generate by my cc65 (2.11.0).

For example, label @L2 shows
tya
add format
...

where as from my debugger i've tya, clc and then adc format.

Ok now I understand something. All the way after @L3, there is jsr
CallOutFunc. In my program, CallOutFunc is defined as $601E, so here
you go. CallOutFunc is suppose to be the fwrite function? There are a
couple of places which have CallOutFuncs too.

CallOutFunc:    jmp     $0000

What is that suppose to do?

Finally, I wanted to know if there is a function similar to printf
(fprintf?) that would return a pointer to a formated string. This way,
I could just pass it to my uart_send_byte_ptr()...
Regarding fprintf, I saw that one of the parameter was a FILE*. And
that the FILE is actually a structure that stores three byte. Is there
a way to manipulate the FILE structure so that I can extract the
formated string from it.

My test program is:

int main(void){
       printf("hello %d", 123);
       while(1)

       return EXIT_SUCCESS;
}

And uses the write function as you described it.

JA
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Mon Feb 12 15:43:26 2007

This archive was generated by hypermail 2.1.8 : 2007-02-12 15:43:29 CET