Jump to content


  • Content Count

  • Joined

  • Last visited

Everything posted by geek504

  1. After some Googling, I found that STROUT is found in BASIC ROM on the C64 ($A000-BFFF). It's part of the BASIC PRINT command that outputs a string. Commander X16 BASIC ROM is found at $C000-FFFF in Bank #4. I need to find out the address of X16's STROUT and how to JSR to that address... maybe that FARJSR subroutine? Further analysis of X16 BASIC ROM source code, I found the start of STROUT routine in ~\x16-rom-master\basic\code7.s but it doesn't give me an address.
  2. Quick question from you C64'ers... (I'm from Apple-land): I found many references to the routines below: CHROUT = $FFD2 STROUT = $AB1E But in X16 Programmer's Reference: Commodore 64 API Compatibility $FFD2 is given a different name BSOUT... why? Why not use STROUT directly? Is it compatible with X16? It uses a different memory address... it's not ROM? Is PLOT the routine used to set LOCATE (or HTAB/VTAB)? Why did the thread's "Hello World" explicitly print a newline? Couldn't the NEWLINE be added to the string? Do you even need it? ; print newline lda #NEWLINE jsr CHROUT rts Lastly, does BASIC's GET command use BASIN or GETIN? Is there a keyboard strobe that needs to be reset before reading in the character?
  3. So sorry @desertfish for my being severely side-tracked on helping you out with Prog8! I just had to explore Lark a little bit... which ended up being a lot... I just wrote an Integer BASIC (aka Woz's Game BASIC) parser using Python and Lark in a single file with only 160 lines (36 lines for the BASIC program and 111 lines for the grammar) and it parses without error Woz's BASIC Breakout game! Beautiful syntax tree automatically generated... dare I go on and actually write the 65C02 assembly compiler for it? LOL! I'm so tempted to do it and check the benchmark against Prog8 et al.
  4. You need other directories defined as well... here's my Windows batch file I run before compiling with cc65:
  5. Just don't do a printf() version of "Hello, World!" That'll generate a binary of at least 2,000 bytes! Use CHROUT or STROUT instead with assembly or C using a specific X16 library.
  6. Point noted, just as the stx/ldx SaveX could be replaced by the most efficient phx/plx to save a few bytes more. Sometimes a more verbose code explains better than an efficient code Efficient code sometimes look like magic!
  7. My hello.asm does a byte by byte commentary on these magic numbers before your assembly code: Enjoy!
  8. LR produces a much more complex state-machine for the parser but is easier to write grammars because we don't have to worry about left recursion and left factoring. LR is also a faster parser than LL but if you were to write the parser yourself, LL parser is preferable and much easier to write, but who does that nowadays? While there are a few LR parsers for Java, I could not find something specifically for Kotlin, and I didn't spend too much time trying to figure out the Java/Kotlin integration. SINCE your grammar is already done I wouldn't change it and ANTLR is a fine product. Here are two BASIC grammars to compare, "jvm" is from ANTLR's repository. c64_basic_bnf.txt jvmBasic.g4
  9. Is it just me or am I alone in having this great aversion to LL grammar, and thus an aversion to using ANTLR? LALR(1) just makes sense to me and is so elegant especially when using EBNF notation. After checking out most lexers/parsers it seems to me that Lark is the sweetest thing since apple pie! But I am still convinced to learn Kotlin
  10. Wow, I have to explicitly write the entire "device name", how quaint... but it works!
  11. I got the alsa-dummy module loaded and alsamixer shows it as an option... but I can't seem to get option to work... it just outputs a list of sound options but I can't choose "Dummy".
  12. I am temporarily running development in a Linux box using Debian 10 (Buster). The Linux download file for X16 r38 is dynamically linked to libc 2.29 while Buster has 2.28 and no view in sight for a future libc update. I also do not want to venture into the messy multiple libcs franken-debians. Perhaps the developers could statically compile the binary? Note: Ubuntu seems to have 2.29 but not Debian yet. I'm going to compile my own BUT perhaps for future Linux users it would help. Is there a way to run x16 without sound? I don't need sound right now and it complains that it needs ALSA etc.
  13. geek504


    How cool would it be to somehow get the great Woz aware of this project? Maybe even perhaps get some insights and ideas... ... or even better, get the 8-Bit Guy to invite Woz to his YouTube show!
  14. Forgot about this detail! It might take a while to start digging inside Prog8's source code... I'm getting familiarized with Kotlin and ANTLR while fooling around with IntelliJ IDEA... all new tech to me! Being a hacker at heart, I just *have* to write a small interactive calculator using Kotlin and ANTLR to test my newfound knowledge! Edit: I am seriously consierding ditching Python and C# for Kotlin. It'll be just C, Kotlin, and Assembly (6502, 68000, x86, and ARM) for me! PROS: JVM, Java libraries, clean code like C# (a tad cleaner than Python), I prefer { } instead of indentations, statically typed, Android, better job opportunity in the JAVA field? CONS: JVM (who wants to be dependent on Oracle?), not well integrated with other technology, i.e. less mature, Kotlin/Native still being developed (iOS!)
  15. I think I'll start with the grammar file... just gotta find it. I hope it's emacs-friendly (they do have a Kotlin major-mode available). Edit: It is... I was thinking of using them as "use-once and throw away", i.e. used as a mechanism to transfer paramenters to functions, and once in the function routine, the function copies the value into its local static memory reserved for these paramenters. In this manner, the calling program does not need to know the address of the static memory of the paramenters of any function (but needs to know how many parameters and of which type). Passing objects is also possible if used to pass a pointer to the object. Does Prog8 support pointers? Supporting both the C64 and X16 was a negative point for me. It adds more complexity than is needed especially since they have different design. If we focused just on X16 (or make a fork) things would progress much faster. Trust me, when the X16 comes out, I will never ever touch a C64 again!
  16. That is a great idea and one of the things that should be used and abused! I have been thinking about NOT starting yet another 6502 BASIC compiler but instead HELP out with Prog8! Gives me a reason to learn yet another programming language (actually two... Kotlin and Prog8). After Googling Kotlin I read that it drastically reduces boilerplate code which was the big reason why I kept Java away from me with a ten-foot pole! I hope to be able to sift through your code without getting bamboozled...
  17. That explains the lack of information on the Net! I had first assumed that you created this language which led me to decide to write a compiler based on a true and tested BASIC dialect. I wouldn't need to re-invent anything, just code away the implementations. Analyzing Prog8 I can see how it is a blend of many different ideas so implementing it wouldn't present much problems... but still involve some thinking! Feel free to add simple Prog8 source along with the generated assembly code in your Prog8 thread... I love analyzing compiled code and see how efficient or how to improve efficiency!
  18. Yea, it occurred to me too! Honestly I have never heard of Prog8 and actually I thought it was invented by you! Couldn't find much on Google... anyways I know BASIC quite well and the grammar is already done for C64 BASIC V2. I am also old-school UNIX programmer so I am much more comfortable with Flex/Bison (lex/yacc) and C. I also don't feel like patching up cc65. We can definitely exchange ideas!
  19. Doesn't exist yet... since I don't expect the compiler to be compliant to C-standards, I am thinking about writing my own (yet another) BASIC compiler akin to BASIC Boss but with more improvements. The only difference is that this one will be custom-made for the X16 and its improvements. I'll borrow many ideas from Woz's Integer BASIC, add HTAB/VTAB (or LOCATE) et al. With a BASIC compiler I won't need to bother the X16 devs for C64 BASIC improvements.
  20. I use vim too... I don't discriminate I use nano and pico to edit unix config files when I'm too lazy to install vim. I reserve emacs for *real* development All I need now is a console-based X16/6502 debugger... I am seriously considering converting my Apple ][ text-only emulator into such debugger... xdb
  21. After fiddling around with Atom and VSCode I reverted back to my trusty old emacs (both Windows and Linux). I did not like installing Cygwin nor Mingw so I installed Debian WSL and got my nice bash with all the useful tools. cc65 is a nice debian package and I can run the X16 emulator from my Windows installation just fine. I use Makefile from within emacs and version control with the old diff & patch tools. Slim and quick. I also came to an epiphany... I don't actually like cc65 due to its C-stack implementation. It causes inefficient code.
  22. Err... what videos? My config.cson didn't need the use of * file-types as per the instruction of the * language-65asm package: Also you mentioned: In that case, Atom might as well be Emacs with syntax highligting...
  23. Yeah, I am having problems getting SharpNinja extension to work smoothly if at all... it's really old. I am now trying to setup Atom like Matt says below: So I revert to Matt and ask... what's your setup like? Config files, workspace, hotkeys, build process, etc.
  24. Found two bugs in your game... #1: D7-D5 (Black move) became a White pawn. #2: E7xF6 This pawn capture came out of nowhere, there wasn't any pawn on E7... and took my Bishop for free! But alas, that didn't matter... the final position: Thank you for a good game of chess!
  • Create New...

Important Information

Please review our Terms of Use