Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.
 Entire forum ➜ Electronics ➜ G-Pascal ➜ Separate Editor/Assembler/Pascal

Separate Editor/Assembler/Pascal

Posting of new messages is disabled at present.

Refresh page


Posted by Robbbates   (6 posts)  Bio
Date Mon 29 Apr 2024 08:27 PM (UTC)

Amended on Mon 29 Apr 2024 08:30 PM (UTC) by Robbbates

Message
Hi Nick,

This looks very promising. I've been scouring the net for a 6502 text editor and have no luck except some dusty 1977 era items which look nigh impossible to find, much less re-compile with the latest assemblers.

I was wondering if you had thought of separating the three modules into stand alone programs. I realize you can opt out of the assembler and pascal during compile, but I don't know how much extra baggage there will be. As well as the additional includes. e.g. hardware, i2c, spi, lcd, etc. I'm planning on trimming them down to just the essentials anyway.

I would like to try out pascal, but don't think I'd want to include it in my already packed ROM. The editor for sure and very likely the assembler.

Also, Ben has added a 6551 UART chip to his design, but your code is relying on bit banging the VIA. Have you thought of updating that as well?

Lastly, I use ca65 as my main assembler. I'm going to try to scrub your code to change all the Vasm stuff to ca65 dialect. Should be a fun exercise!

Thoughts?

Thanks,
Robb
Top

Posted by Nick Gammon   Australia  (23,122 posts)  Bio   Forum Administrator
Date Reply #1 on Tue 30 Apr 2024 06:56 AM (UTC)
Message
You can omit the Pascal, Assembler and LCD stuff with existing conditional compiles. I didn't think to do the SPI and I2C, but if you omit the above you can probably drop those files as well with minimal impact.

Quote:

Also, Ben has added a 6551 UART chip to his design, but your code is relying on bit banging the VIA. Have you thought of updating that as well?


Yeah, I looked at that, but thought the difference would be minimal. Already you have an interrupt on an incoming byte, and the time saved by having the UART is not much. Plus, I don't think you will get much extra baud rate, if any, because you are limited to how fast you can process the bytes and shove them in memory anyway. It's another chip, more wiring, and not much benefit.

You are, of course, welcome to incorporate his code (I think it is on his YouTube page about how he did that).

The other thing you could do is add a bit more of a "monitor" program as Ben also described, although I think I have most of that covered, with the shell "Memory", "Poke", "JSR" and "JMP" commands.

It's a fun project, enjoy making modifications!

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Robbbates   (6 posts)  Bio
Date Reply #2 on Tue 30 Apr 2024 12:49 PM (UTC)
Message
I've been chipping away at your code.

I got a crude version working. Ugly formatting on my 40 column homebrew. Only linefeeds and no carriage returns. But it loads, saves, assembles and pascals.

I'm currently stripping down the editor to make it entirely stand alone. No assembler, pascal or any monitor functionality, as I have that elsewhere.

Just a text editor and nothing else.

Next I'll *try* to make the Assembler and Pascal stand alone as well. Either the Assembler/Pascal will call the editor or the other way around. We'll see.
Top

Posted by Nick Gammon   Australia  (23,122 posts)  Bio   Forum Administrator
Date Reply #3 on Tue 30 Apr 2024 08:40 PM (UTC)
Message
As for the carriage returns (I didn't do them because I was using a terminal program that would translate \n as carriage return and newline) you could modify COUT in utilities.inc to also output a 0x0D whenever it saw a 0x0A.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Robbbates   (6 posts)  Bio
Date Reply #4 on Tue 30 Apr 2024 09:58 PM (UTC)
Message
Great timing.

I did a wholesale find/swap with CR and NL. A few places where it mattered, but I think I found them. i.e in the GETLINE routine and the editor when you hit enter to go to the next line of code.

I just got it up and working like SECONDS before receiving this post. It compiled the adventure game without errors. Running it threw some problems. But I'll figure it out.

https://youtu.be/1NQ1Z0Kf53U

Thanks,
Robb
Top

Posted by Nick Gammon   Australia  (23,122 posts)  Bio   Forum Administrator
Date Reply #5 on Wed 01 May 2024 08:04 AM (UTC)
Message
You could have just changed:


NL               =  $0A   ; newline


to:



NL               =  $0D   ; newline


However that would not give you CR+NL for line endings.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Mklcolvin   (1 post)  Bio
Date Reply #6 on Wed 22 May 2024 09:22 PM (UTC)

Amended on Wed 22 May 2024 09:25 PM (UTC) by Mklcolvin

Message
@Robbates. I'm trying to do something similar, trying to port G-Pascal to the Commander x16. I'll probably need to strip all of the serial I/O stuff out, but right now I'm running out of zero page space. (ca65 reports that I'm using 360+ bytes over the limit). Nick, any idea of how much of this needs to be in zero page? I want to make this stand-alone (without needing to load into ROM space, just as a simple executable that could be LOADed and RUN from the x16 command line).
Maybe breaking it up into 3 separate programs might be the way to go, but I like your integration of the 3 for my workflow needs.
Top

Posted by Nick Gammon   Australia  (23,122 posts)  Bio   Forum Administrator
Date Reply #7 on Fri 24 May 2024 11:24 PM (UTC)
Message
Sorry for not replying sooner, I'm on a lengthy train trip.

You can probably move some of those zero page variables somewhere else.

You shouldn't need over 300 of them.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
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.


3,111 views.

Posting of new messages is disabled at present.

Refresh page

Go to topic:           Search the forum


[Go to top] top

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