Hallo Besucher, der Thread wurde 6,4k mal aufgerufen und enthält 16 Antworten

letzter Beitrag von Snoopy am

BASIC 10 keywords in C65 ROM

  • I just looked in the C65 ROM (V0.9.910111) and searched for the BASIC 10 keywords. They are stored from address 124a4 hex / 74916 dec.


    The keywords are stored in ASCII code for each letter of the keyword.

    Only the last letter is stored as his ASCII code + 128 dec as a sign for being the last letter of the keyword.


    I found 181 keywords in the C65 ROM:


    As a little test I have changed the PRINT command to WRITE.


    Using the so changed C65 ROM in the Xemu emulator I can use WRITE as the new command to show text. :)


  • [...]

    As a little test I have changed the PRINT command to WRITE.


    Using the so changed C65 ROM in the Xemu emulator I can use WRITE as the new command to show text. :)

    IMHO total bullshit.

    BASIC is BASIC and not PASCAL (Pascal programmers are so blind because they can't C).

    If someone want a more procedural language, he should move to pascal, and not try to abuse BASIC.

    PRINTing output is the BASIC-Way of doing such stuff


    Of course: this is MY point of view..

  • It was only a little test, whether the keywords can be changed in the ROM and "write" was as long as "print" (5 letters).


    Of course I don't want to change PRINT into WRITE in the BASIC 10. ;)

  • I'm curious about the BASIC 10 commands and have made some reading about the differences to BASIC 7 to get a feeling about it all.


    If someone is interested:


    I just made a table with a comparison of the commands in BASIC 10 (C65) and BASIC 7 (C128).


    There are 30 commands which are in BASIC 10 and not in BASIC 7:


    And there are 17 commands in BASIC 7 but not in BASIC 10:


    I attached a PDF showing all BASIC 10 and 7 commands in a comparising table (commands only in BASIC 10 have a blue background, commands only in BASIC 7 have a green background).

  • WINDOW gibt es durchaus in BASIC 7

    Die Befehle für die REU (FETCH,STASH & SWAP) sind obsolet, da der Erweiterungsspeicher des C65 völlig anders organisiert ist und dementsprechend mit eigene (neue) Befehle die den REC, den DMAgic und den Mikrokontroler-Internen MMU ansprechen.

  • There are 30 commands which are in BASIC 10 and not in BASIC 7:

    Naja.

    UNTIL, USING und WINDOW gibt es auch in Basic 7, ebenso OFF und QUIT.


    BACKGROUND, BORDER, FOREGROUND, HIGHLIGHT, PEN sind nur syntaktischer Zucker, in Basic 7 heißt das alles COLOR (mit entsprechenden Argumenten).


    LPEN ist der neue Name für das, was in Basic 7 PEN hieß (Lightpen-Abfrage).


    ERASE scheint ein Alias für SCRATCH zu sein.

    BVERIFY ist wohl einfach das, was bisher bei LOAD/SAVE/VERIFY/DLOAD/DSAVE/DVERIFY/BLOAD/BSAVE noch gefehlt hat.

    DMA ist der Ersatz für FETCH/STASH/SWAP.


    CUT, PASTE und LINE sind neue Namen für SSHAPE/GSHAPE/DRAW, jedenfalls werden die gleichen Token benutzt. Vielleicht mit anderer Syntax, das ist bei den anderen Grafikanweisungen ja auch so.


    DMODE, DPAT, GCOPY, SCREEN, VIEWPORT, POLYGON, ELLIPSE, PALETTE sind neue Grafikanweisungen (teils wegen der neuen Hardware).


    Somit bleiben übrig:

    MOUSE set mouse parameters

    RMOUSE read mouse position

    DISK send disc command (besser spät als nie)

    TYPE list basic program from disc
    CHANGE edit program?

    FIND search basic program?

    SET set system parameter?

    GENLOCK ?

    PIC ?

    And there are 17 commands in BASIC 7 but not in BASIC 10:

    COLINT? Woher hast Du denn das?

    Alle anderen sind entweder umbenannt, werden aus anderen Token zusammengesetzt (GETKEY gibt es gar nicht, das ist immer GET und KEY) oder sind Variablen (EL, ER, TI). Letztere müsste es auch in Basic 10 geben, probier das mal aus.

  • Vielen Dank für die informativen Antworten! Da habe ich in Bezug auf BASIC-Befehle noch was nachzuarbeiten. :)

    And there are 17 commands in BASIC 7 but not in BASIC 10:

    COLINT? Woher hast Du denn das?

    Aus dem C64-Wiki. Wie alle BASIC 7-Befehle. Dies erschien mir eine recht zuverlässige Quelle für das Thema zu sein.


    Overview_of_BASIC_Version_7.0_Commands



  • Also, WINDOW ist definitiv ein BASIC 7 Befehl, COLINT sehe ich auch fürs erste Mal, was soll der bewirken?.

    Zuverlässlichste Quelle ist immer noch das offizielle Handbuch des C128.

    Gibt's z.B. in der Wolke.

    Syntax: WINDOW los,lor,urs,urr (,c)


    los = Linke obere Spalte

    lor = Linke obere Reihe

    urs = untere rechte Spalte

    urr = untere rechte Reihe


    c = kann zusätzlich angegeben werden, wobei c=1 ein 'clear screen' im Fenster macht (nur im definierten WINDOW)

  • I think, it is the right place here ...


    Thinking about the unfinished BASIC 10 commands, I see three possible ways to handle this:


    a) modify the original C65 ROM and try to implement the commands inside the existing ROM routines,


    b) integrate all BASIC 10 commands into the new written OpenROM,


    c) write an extension (a program) which contains the unfinished (or all) BASIC 10 commands and which is being loaded into the Mega65 before one can use this commands.


    Are there any other possibilities to "finish" the unimplemented commands in BASIC 10?


    My thoughts about the points above:


    to a): besides the legal problem with the unclear copyright, noone knows how far and correct the existing commands are implemented from Commodore and the new routines for the commands has to fit into the existing ROM


    to b): it would be a great afford and work to rebuild the whole C65 ROM. The advantage of this would be the freedom to write the commands in a way who lets test and control all routines about their correct way of working and the Mega65 could be sold with this OpenROM because of the lack of copyright problems.


    to c): an extension could be used both with the original ROM and the OpenROM because it is not in the ROM and maybe there is more freedom to program the commands because there is no need to fit the routines into the existing ROM memory. The disadvantage ist that the extension has to be load every start of the Mega65.

  • I wrote exactly the same ideas yesterday.

    So lets discus what each method means:

    a) patching the ROM depends how much space is availlable. nevertheless it is still based on (c)- material, so it doesn't solve the (c)-problem

    b) means it needs to recreate a whole clone of BASIC 10, which could of course also be used in a fully (c)-free environment (with the OpenROM/Kernal).

    c) would be the easiest way. It is simply load a basic-extention like many did on c64/c128 (Simon's Basic, TSB, Graphic Booster, and several other extentions).


    In my opinion the first goal should be option c) and then maybe go to option a) if possible.

    You should consider that it is not that impossible to program now with the existing uncompleted BASIC 10. Zaadi showed us already some examples, and there also exist older Demo's für the C65 who runs well without the missing commands.


    As for the option b) the complete clone or better of BASIC10, this could be the Mega-BASIC for the C65-Next Generation aka -> MEGA65-Mode. Although I think that the MEGA65-Mode should not have a BASIC in Rom, but instead (like all modern computers) load a programming language (Basic/Pascal/Forth etc.pp) from storage device.


    A last word: Of course this is all doable. The question is: who stands up and start programming this stuff?

  • I'm afraid you can't just write BASIC extension for both C65 and OpenROMs.

    Example: WINDOW command, which limits the character output to certain area of the screen. It needs Kernal screen editor support - C128 has it, C65 has it (the command works), but OpenROMs does not have it (it's intended to be compatible with C64 Kernal, which lacks this functionality). You would have to extend Kernal implementation for this - and, for compatibility, keep the WINDOW boundaries somewhere in C65 extended RAM.

    Besides - the OpenROM BASIC is really primitive right now, there is no math at all, no variables, no proper expression parser - just few simple commands. There is still a lot to do to bring it to BASIC V2 level.

    Also remember, that this is not a simple task. Development of the original ROMs took many man-years of people working full-time (remember, that C65 ROM is based on C128 ROM, which is based on C64 and Plus4 ROMs, which are based on..., which is partially based on BASIC purchased from Microsoft) - not volunteers who work in the evenings, if they are not tired, and if they actually have some spare time.

  • Also the 264 series have that support, although they didn't have a window-command, but with <esc-T> for top and <esc-B> for bottom you can define windows.

    pressing <home> moves the cursor to top of defined window, pressing tiwcw <home> exits the window and moves the cursor 'home'.

  • Ich versuche mich ein bisschen im Bereich BASIC Erweiterung schlauer zu machen, da ist oben im Programmierkopf noch viel Leerraum für Kenntnisse. :)


    Um möglichst "klein" einzusteigen, meine Frage, ergibt es da Sinn, mich zu dem Thema BASIC-Erweiterung erst einmal mit dem C64 auseinanderzusetzen (z.B. mit dem Artikel), da es vom Prinzip her ähnlich ist oder läuft das beim C65 komplett anders ab?

  • Ich versuche mich ein bisschen im Bereich BASIC Erweiterung schlauer zu machen, da ist oben im Programmierkopf noch viel Leerraum für Kenntnisse. :)


    Um möglichst "klein" einzusteigen, meine Frage, ergibt es da Sinn, mich zu dem Thema BASIC-Erweiterung erst einmal mit dem C64 auseinanderzusetzen (z.B. mit dem Artikel), da es vom Prinzip her ähnlich ist oder läuft das beim C65 komplett anders ab?

    Nun ja, mit dem Artikel weist du wenigstens wie es funktioniert.

  • Ist es bei einer BASIC-Erweiterung eigentlich möglich, die schon bestehenden Befehle "abzuschalten" oder "umzuleiten" ohne das direkt im ROM zu ändern?


    Mal als Beispiel angenommen, in der Erweiterung soll der LOCATE-Befehl zur Verfügung gestellt werden. Der Befehl ist ja beim C65 nicht implementiert. Man schreibt die entsprechende Routine und das funktioniert auch.


    Allerdings existiert ja der Befehl an sich im ROM und wird von diesem auch als Befehl erkannt, nur eben nicht ausgeführt.


    Woher "weiß" der Computer dann, dass er nicht den internen LOCATE-Befehl ausführen soll, der ja nicht geht, sondern den neuen LOCATE-Befehl? Die heißen ja genau gleich.


    Oder muss man bei der Erweiterung die Befehle anders nennen, also z.B. dann @LOCATE oder ähnlich?

  • Genaueres weiss ich nicht, aber die nicht implementierte Befehle haben 'Platzhaltern'.

    Das heisst: der Token ist vorhanden, den Wortlaut des Befehls ist vorhanden und die Einsprungsadresse zeigt auf die Meldung "UNIMPLEMENTED COMMAND" oder so ähnlich.

    Nun müßte die BASIC Erweiterung eigentlich nur diese Einsprungadresse 'umbiegen' auf den (nachgeladenen) tatsächlichen Code für den LOCATE Befehl.

  • just add a ...


    d) program a compiler for the BASIC 10 commands (for PCs or even for the C65/Mega65) and let the compiled program run on the C65/Mega65.


    to d): No need to change the ROM and to have total freedom in programming the commands. Disadvantage is: If there is only a compiler for PCs one can't type the BASIC 10 programs on the Mega65, only start the compiled version on the "real" machine.