New productivity upload: File based assembler
- desertfish
- Posts: 1101
- Joined: Tue Aug 25, 2020 8:27 pm
- Location: Netherlands
New productivity upload: File based assembler
Thank you Stefan.
As long as you don't load the resulting output program, or loading it into a unoccupied piece of RAM as to not overwrite the assembler itself (so outside $0801-$5000 ish, look at the load addresses of the assembler program) you can indeed simply restart the assembler to continue editing or assembling code.
(prog8 programs generally are restartable after exit).
New productivity upload: File based assembler
On 12/6/2021 at 8:28 AM, desertfish said:
(prog8 programs generally are restartable after exit).
I noticed that about cc65 - the programs generally won't run a second time, and that definitely should not be the case. Any idea what cc65's binaries are doing to bork things up? In the grand scheme on a system like this, it's not such a big deal for games to have this behavior, as typically there was no "quit to basic" option in the game - you just flipped the power switch to get back to BASIC when you were done. But for applications that work on a file, it's definitely broken for a program to exit and then not be runnable a second time.
- desertfish
- Posts: 1101
- Joined: Tue Aug 25, 2020 8:27 pm
- Location: Netherlands
New productivity upload: File based assembler
Yeah I think they either use some modifying code that can't run multiple times or forget to reinitialize variables.
Prog8 doesn't have uninitialized variables and everything is re-initialized to their initialization value when the program is restarted.
New productivity upload: File based assembler
@desertfish Please let me know if you have thought about any changes to X16 Edit in order to make it work better with your assembler.
- desertfish
- Posts: 1101
- Joined: Tue Aug 25, 2020 8:27 pm
- Location: Netherlands
New productivity upload: File based assembler
I haven't really thought about that to be honest. The only thing that occurred to me is that you could make a version that uses ZeroByte's fixed v39 kernal rom to use LOAD instead of a CHRIN based file read loop to load large files much faster, like I did in the assembler.
Saving will still be slow because SAVE doesn't yet work with banked ram. Also that version, like my assembler now, would only work with the patched ROM...
If the patch won't get merged we'll be stuck with non working software ?
New productivity upload: File based assembler
On 12/6/2021 at 4:06 PM, ZeroByte said:
I noticed that about cc65 - the programs generally won't run a second time, and that definitely should not be the case. Any idea what cc65's binaries are doing to bork things up? In the grand scheme on a system like this, it's not such a big deal for games to have this behavior, as typically there was no "quit to basic" option in the game - you just flipped the power switch to get back to BASIC when you were done. But for applications that work on a file, it's definitely broken for a program to exit and then not be runnable a second time.
To be able to run a C program a second time without re-loading it, global variables have to be re-initialized. This requires additional startup code and basically duplication of the data section, i.e. you "waste" RAM (depending on the amount of initialized global variables). For example vbcc offers two configurations. One that does not allow to be re-run (and does not return to BASIC) and another one that fully allows re-running the code. cc65 seems to return to BASIC without re-initializing variables by default.
- desertfish
- Posts: 1101
- Joined: Tue Aug 25, 2020 8:27 pm
- Location: Netherlands
New productivity upload: File based assembler
@Stefan a small suggestion , instead of requiring CTRL-C to show the line/column number, please show these continually in the top bar or perhaps in the bottom area (like the Vim editor does).
Also, maybe, a way to set the screen and text colors beforehand by the calling application?
New productivity upload: File based assembler
On 12/11/2021 at 1:31 PM, desertfish said:
@Stefan a small suggestion , instead of requiring CTRL-C to show the line/column number, please show these continually in the top bar or perhaps in the bottom area (like the Vim editor does).
Also, maybe, a way to set the screen and text colors beforehand by the calling application?
Thanks!
Actually I've been working on a new entry point called "Load File With Options".
You may use this entry point to load a text file on start up. If the file name length is 0, it will not try to load a file, so it can be used whether or not you want to load a file.
It will let you set the following options before starting X16 Edit:
Auto indent on/off
Word wrap on/off
Tab width
Word wrap position
Current device #
Screen text color/background color
Header text color/background color
Status bar text color/background color
That code is already in the master branch on Github, but I need to test it a bit more before publishing as a new version.
I will see what I can do to display row/column all the time. That I haven't looked into.
- desertfish
- Posts: 1101
- Joined: Tue Aug 25, 2020 8:27 pm
- Location: Netherlands
New productivity upload: File based assembler
oh, and one other thing, the CTRL-K cuts a line and adds it to the clipboard. But eventually it will give an error clipboard full, which is problematic if I just wanted to delete a (large) number of lines. Can we get a kill line key or alternatively some way to clear the clipboard? ❤️