Comments (6)
Thanks, that helps a lot! I think using meta data with # would be the way to go forward. Have several labels in the followup line separated by comma, for example:
#META LABELS,ACTION_MENU
100 PRINT"What now?":INPUTA$
#META LABELS,OPEN_DOOR,REDRAW_SCREEN,ACTION_MENU
500 GOSUB 1000:GOSUB 8000:GOTO 100
would map to
ACTION_MENU
PRINT"What now?":INPUTA$
...
GOSUB OPEN_DOOR
GOSUB REDRAW_SCREEN
GOTO ACTION_MENU
from c64studio.
I'm not sure I understand correctly. You mean saving the label version as .bas file instead of the line number version?
from c64studio.
Sorry bad description. Saving with labels already seem possible. I'll rephrase it, make it possible to use any label name, just like in assembler. If there is a problem with parsing, maybe adding a ending char like colon could work.
from c64studio.
Can you please show an example where there's a problem currently, and how the resolved code should look like?
I think I understand, but that would make it a lot clearer for me.
from c64studio.
OK for example my current main file of the Chip8 emulator has 443 lines of code and will become much bigger if I include everything into it. It includes many GOSUB and GOTO statements of course. At one point I changed to LABEL mode but I actually went back. I didn't like the way the labels where named. It actually made keeping track of the code even harder than just a line numbers which is a pity. It would be really nice to be able to name my labels as the function they are suppose to execute.
An example (NOTE: Will be changed to ON GOTO later):
690 IFOX=0THENGOTO860:REM OXXX FAM
700 IFOX=16THENGOTO1010:REM 1XXX FAM
710 IFOX=32THENGOTO930:REM 2XXX FAM
720 IFOX=48THENGOTO1070:REM 3XXX FAM
730 IFOX=64THENGOTO1130:REM 4XXX FAM
740 IFOX=80THENGOTO1190:REM 5XXX FAM
750 IFOX=96THENGOTO1240:REM 6XXX FAM
760 IFOX=112THENGOTO1300:REM 7XXX FAM
770 IFOX=128THENGOTO1360:REM 8XXX FAM
780 IFOX=160THENGOTO1840:REM AXXX FAM
790 IFOX=176THENGOTO1890:REM BXXX FAM
800 IFOX=192THENGOTO2190:REM CXXX FAM
810 IFOX=208THENGOTO2250:REM DXXX FAM
820 IFOX=224THENGOTO2380:REM EXXX FAM
830 IFOX=240THENGOTO2570:REM FXXX FAM
This is the main construct of the opcode-interpreter. Now I use a comment to make it clearer where the GOTO lands.
It would be nicer and more readable if it could look like:
IFOX=0THENGOTO OXXX_FAM
IFOX=16THENGOTO 1XXX_FAM
IFOX=32THENGOTO 2XXX_FAM
IFOX=48THENGOTO 3XXX_FAM
IFOX=64THENGOTO 4XXX_FAM
IFOX=80THENGOTO 5XXX_FAM
IFOX=96THENGOTO 6XXX_FAM
IFOX=112THENGOTO 7XXX_FAM
IFOX=128THENGOTO 8XXX_FAM
IFOX=160THENGOTO AXXX_FAM
IFOX=176THENGOTO BXXX_FAM
IFOX=192THENGOTO CXXX_FAM
IFOX=208THENGOTO DXXX_FAM
IFOX=224THENGOTO EXXX_FAM
IFOX=240THENGOTO FXXX_FAM
And when switching between NUMBER and LABEL mode maybe the custom labels could be kept somewhere? Though this would of course be messed up if you started changing lots of stuff in NUMBER mode.. I don't have the exact solution there. If one would like to get advanced maybe a CRC32-checksum of row complete row content and keep that in a separate file for recreation when switching back and forth between NUMBER and LABEL mode. Rows that can't be found is recreated with those default labels.
from c64studio.
Would be really nice to have!
from c64studio.
Related Issues (20)
- Can't launch Vice, error parsing command line options HOT 1
- Quote key moves. HOT 4
- Solution / Project creation doesn't seem to match what was configured. HOT 2
- Solution node context menu offers rename project incorrectly HOT 1
- Cursor stops blinking after some seconds in the editor HOT 5
- How do you type the british pound symbol? HOT 2
- Windows 11 Trojan detected ? HOT 8
- Outline View (basic source code): double clicking on referenced variables will jump to wrong line of code HOT 2
- Charscreen reverse mode backspace clears in non-reverse. HOT 1
- Graphicscreen editor to show which colors are active in current charblock HOT 6
- Align value one off HOT 2
- Sprite Preview "Save as GIF" Produces Broken GIF HOT 2
- Huge settings.dat hangs editor while closing HOT 1
- Value table editor HOT 2
- Cannot type "\" in a BASIC #include directive HOT 2
- How to assembly 65816 in recent commits? HOT 2
- Automatic Renumber Off by Default HOT 2
- Const value not shown in 'Find all references' HOT 6
- Request: Screen editor zoom HOT 2
- Request: In screen editor, select colors for mouse buttons HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from c64studio.