[Home] [Downloads] [Search] [Help/forum]

Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  Electronics
. -> [Folder]  G-Pascal
. . -> [Subject]  Code before Ben Eater version?

Code before Ben Eater version?

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Posted by Robbbates   (6 posts)  [Biography] bio
Date Wed 01 May 2024 03:03 AM (UTC)
Would you happen to have the code before you implemented the serial with VIA? I'd like to implement a version using the UART, but there seems to be a lot of things changed in many places in the code, specifically using the serial_in_byte_received related function. It's hard to dig out what's trying to be done in each instance. I'd like to roll it back and then

[Go to top] top

Posted by Nick Gammon   Australia  (23,016 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Wed 01 May 2024 05:29 AM (UTC)
The original code can be found here: http://www.gammon.com.au/GPascal/source/

If you look at the code here:


You can see the minor changes that are made for the emulator, which I used for a lot of testing.

You basically need to replace:

  • CHRIN - gets a character from serial (blocks)
  • write_char - writes a character to serial
  • GETIN - same as CHRIN
  • serial_available - (non-blocking) see if a character is available from serial

That's it!

In the emulator CHRIN was slightly different to GETIN. CHRIN read an entire line (it made typing a line of text easier) whereas GETIN read a single character.

Look for the ".if EMULATOR" directive.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum

[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at HostDash]