Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.
  • Root
  • » SDCC
  • » [Sdcc-user] I/O on the S51 simulator? [RSS Feed]

#1 Dec. 12, 2010 01:53:17

Peter V.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[Sdcc-user] I/O on the S51 simulator?


Is there a .h file that I'm missing that supplies a suitable putchar()
function for the s51 simulator? If I compile this program:

#include <stdio.h>

main() {

printf("hello world\r\n");

return 0;
}

it complains about no putchar() (which I think should be an error rather than
just a warning as well!):

$ "/cygdrive/c/program files/SDCC"/bin/sdcc test1.c

?ASlink-Warning-Undefined Global '_putchar' referenced by module 'vprintf'

to indicate the lack of a putchar routine that knows where a suitable output
device (i.e. the simulator console?) is. I don't see a likely looking .h file
in the include/MCS51 directory, nor any hints in the simulator documentation
(although that isn't a suprise because its not SDCC specific). There didn't
seem to be anything relevant in the mailing list archive either. This is on
a recent (week or two old) SDCC 3.0 snapshot, but the same thing happens on
2.9.0_RELEASE.

Peter Van Epp`


Sdcc-user mailing list
Sdcc-user@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/sdcc-user

Offline

#2 Dec. 12, 2010 09:55:39

roelof '.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[Sdcc-user] I/O on the S51 simulator?


On Sat, 2010-12-11 at 17:50 -0800, Peter Van Epp wrote:
> Is there a .h file that I'm missing that supplies a suitable putchar()
> function for the s51 simulator? If I compile this program:
>
> #include <stdio.h>
>
> main()
> {
> printf("hello world\r\n");
> return 0;
> }
>
> it complains about no putchar() (which I think should be an
> error rather than just a warning as well!):

Hi,

I think that you will have to write your own putchar()
that talks to your interrupt handling for the serialport
which sends the characters out. Assuming you are using
the serialport :-)

roelof




Sdcc-user mailing list
Sdcc-user@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/sdcc-user

Offline

#3 Dec. 13, 2010 20:54:11

Peter V.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[Sdcc-user] I/O on the S51 simulator?


On Sun, Dec 12, 2010 at 10:37:18AM +0100, roelof 't Hooft wrote:
> On Sat, 2010-12-11 at 17:50 -0800, Peter Van Epp wrote:
> > Is there a .h file that I'm missing that supplies a suitable putchar()
> > function for the s51 simulator? If I compile this program:
> >
> > #include <stdio.h>
> >
> > main()
> > {
> > printf("hello world\r\n");
> > return 0;
> > }
> >
> > it complains about no putchar() (which I think should be an
> > error rather than just a warning as well!):
>
> Hi,
>
> I think that you will have to write your own putchar()
> that talks to your interrupt handling for the serialport
> which sends the characters out. Assuming you are using
> the serialport :-)
>
> roelof
>

Thanks, it looks like that is the best bet, but so far I haven't been
successfull there either :-). It looks like sdcdb won't run under Cygwin
and the simulator (which seems to be happy with Cygwin) doesn't produce any
output to a file when putchar is writing to the UART. Looks like I get to put
SDCC on a Linux or FreeBSD box and try on there ... If I get something working
I'll send a howto to the mailing list for the next poor soul :-).

Peter Van Epp


Sdcc-user mailing list
Sdcc-user@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/sdcc-user

Offline

#4 Jan. 26, 2017 15:47:47

Spencerrow
Registered: 2017-01-25
Posts: 2
Reputation: +  0  -
Profile   Send e-mail  

[Sdcc-user] I/O on the S51 simulator?

This post is being moderated

Offline

  • Root
  • » SDCC
  • » [Sdcc-user] I/O on the S51 simulator? [RSS Feed]

Board footer

Moderator control

Enjoy the 22nd of October
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support