Jump to content


  • Posts

  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

hth313's Achievements


Newbie (1/14)

One Year In Dedicated Week One Done One Month Later

Recent Badges



  1. My 6502 C compiler tool chain as an early release. Send a private request to me for details on how to download it if you are interested. Documentation is available here: https://drive.google.com/file/d/1Eai87NQhPZ_XoTtgwmo-g_Upk0xDAyx0/view?usp=sharing I have installers for macOS, Arch and Debian Linux (x86_64). Highlights: ISO C 99 compiler for 6502/65C02. This is a freestanding implementation with many features you will typically find in a hosted compiler. Fully reentrant code model. Support for all integer types up to 64 bits 'long long'. Floating point supported (32 bits IEEE-754). Full support for struct, union, typedef and what you expect to find in C. The C stack is located outside the zero page, which means it can be as large as available memory (in the full 64K address range). Support for (stack allocated) variable sized arrays. Run-time model based on using pseudo registers in the zero page. Parameter passing uses A and pseudo zero page registers (up to 8 bytes). Any remaining arguments are passed on the stack. The compiler utilizes zero page as much as possible for local and temporary variables. Optimizing compiler that can output source level debugging information. Source code debugger included. Support for ELF/DWARF, hex output as well as RAW and PRG (Commodore) style program files.
  2. About Swedish computers... The ABC-80 was popular at the time, though a little bit pricey. It was often found in schools. It was later "replaced" with the ABC-800 series, which was more for professional use. These are BASIC machines, much like C64 and such. The ABC-800 was really built like a tank, I think it would survive in a real battlefield, the ABC-80 less so, but it was totally decent. The Jet-80 was also around, it used CP/M 3 and was a very nice machine. Full Z80 chip set including DMA and banking to provide more TPA (larger application program area, I think you got 60-61K). All the above used Z80. DIAB (who produced the ABC-80) later also made the DS90 which was a UNIX machine (DNIX). These were 68k based. There was also the Compis ("Kompis" means pal or friend in Swedish, so it got a C for Computer, I think) which was intended as a school computer, running the futuristic 80186. This one was not so successful.
  3. Very promising, however I find the high pitched fragile synthetic tone (I do not know how to describe it) very annoying. I want more a heavy metal tune.
  4. "SysReq/PrtSc, Scroll Lock and Pause/Break", I have never used those keys and in most cases cannot imagine what they do, LOL The only thing that bothers me is that it puts the CTRL key down in the corner, which is a stupidity introduced by PC. Old UNIX keyboards (terminals) and my current (Happy Hacking) keyboard put it where the never used SHIFT LOCK is located on the X16 keyboard. Even the Commodore 64 got it in a better position (TAB) than down in the corner. Having it down there means I need to twist my hand to reach it, and I use that key a lot. It is actually very annoying to me, but I guess that I am the minority. (Rant off)
  5. I do not care so much of having CP/M on the X16, I would get a dedicated machine for that and they are not too pricey. What I do care about is having a proper serial port. Not having that is a huge turnoff for me. Would at least be possible to have it in the motherboard design even if it is not populated? I have one or two 6551 in my stash, there are new serial adapters using Rockwell 6551 sold on Ebay for the C64, not sure where they are sourced from.
  6. I used the BASIC that came with the C64 and C128 back in the day and while they can be used for various things, they quickly fall short and I abandoned them for Forth and assembly. With the X16 I will not even bother to try the BASIC, I will go to C and assembly instead. I wish it could boot into Forth and I could choose to play in that environment, or just load (C or assembly) software, then I would be very happy. Another alternative would be Scheme, I am not sure how feasible that is? My little 8-bit Lisp machine..
  7. Is there some special considerations to be made if I want to pick up some YM2151 chips online? Given the shipping cost it seems sensible to buy at least 10. The reason for buying them is to ensure I have some spares if the stocks run out or low causing price to go up significantly.
  8. @desertfishThank you for the suggested way of going back to the Kernal. I have added that as the fallback way of doing explicit exit(), which is useful if the program has messed things up too much and want to exit back to a clean machine.
  9. I changed the C startup code to simply use the existing stack as-is. This solves the problem and I now get back to the blinking prompt when main() returns. I also took the opportunity to optimize it to the metal, more or less. I still have a proper C startup for the X16, but I changed the C code to be more like how I would write a Hello World in assembly, using a loop to send it to a character out routine, no printf() or stream related functions dragged in from the C library, no 0 exit code return either. The result is a C program that when compiled and linked results in a .PRG file that is 88 bytes.
  10. To be honest, an 8-bit like the 6502 is not at all about compact code, perhaps not even elegant. You will get much nicer instruction set if you move to the MSP430 or 68000. Even something like the RISC-V may be considered elegant compared to the 6502. An interesting approach would be to join something like Vera with a nice 16 or 32-bit based instruction set CPU. However, you would have to start from scratch with the "operating system" and the group of people interested in a 6502 computer would have to learn a new ISA, and somehow I think you would lose most of the audience along the road. I am not saying it is a bad idea. If the X16 is successful, it may make sense to produce a follow up going to a more modern ISA. It could have the same chipset (more or less). If people avoid 6502 assembly as an implementation language (there are BASIC, C, Forth etc), some software may be possible to migrate with reasonable effort.
  11. The problem is that I take over and set my own stack. I also put some stuff in zero page, but that should be in permitted and safe area (so far). What I am looking for is some soft-reset entry point back to BASIC that leaves the display and program. It should perhaps clear variables and sets up the stack again. Perhaps I should not touch the CPU stack at all?
  12. I just got my first output from my (own) C compiler and it was also among the first times I ever played with the X16 emulator, so I want to share my (minor) success. How should I exit from the program back to the system? Sorry if this is really a stupid question, but it was a long time ago since I programmed a Commodore 8-bit machine.
  13. Moving the bank registers to zero page only makes sense if it is also possible to read them. It is useful to allow calls between banks using a trampoline (bank switcher) in non-banked memory. Such trampoline needs to push the bank number together with the return address so that it later can return via another trampoline to the caller (switching the bank back). If reading is not possible, a shadow bank number could be written to RAM, but that would mean writing the bank twice which defeats the gain of having it in zero page.
  14. If seeking is not available then ELF is out. I do not think is practical to read several program header structures, not knowing how many they are. I still think it is a good idea to be able to load a file into memory and have banks populated automatically. Can someone explain how GEOS helps to load a banked program at power on when I get the READY prompt?
  • Create New...

Important Information

Please review our Terms of Use