sy2002 / QNICE-FPGA

QNICE-FPGA is a 16-bit computer system for recreational programming built as a fully-fledged System-on-a-Chip in portable VHDL.
http://qnice-fpga.com
Other
70 stars 15 forks source link

Make the native assembler independent from an external preprocessor #20

Open sy2002 opened 4 years ago

sy2002 commented 4 years ago

This one is not urgent as the use case would also need writeable SD cards, FAT32 to support writing and possibly also support for more RAM:

The idea is: One day to be able to develop for QNICE on the QNICE. For example do write and assemble QNICE assembler while working on QNICE hardware.

Besides the fact that for that we also would need a nice assembler text editor on QNICE (or even an QNICE assmbler IDE 😏 ): We need the assembler to run on QNICE.

And for that we need to make it "stand-alone", i.e. independent from an external C preprocessor.

MJoergen commented 4 years ago

When we write a new assembler it would be nice if it supported macro instructions, i.e. defining a macro consisting of small snippets of assembly. Something similar to the 6502 macro assembler, see sections 6 and 12 here: https://cc65.github.io/doc/ca65.html

sy2002 commented 4 years ago

@MJoergen Good point: Macros for the native toolchain's assembler would be nice, so @bernd-ulmann if you added a preprocessor, that would be a nice additional point. But @MJoergen Did you know: We already do have a QNICE assembler, that is capable of macros: VASM: When you go to the website, you see QNICE mentioned there. You find infos about how to use it in QNICE-FGA here, scroll down to the section VASM assembler.

MJoergen commented 4 years ago

Oh, I didn't know about VASM. Thank you for the hint.

sy2002 commented 4 years ago

Sorry, wrong link in above comment (now edited). You find how to use it in QNICE-FPGA in our README.md, here:

https://github.com/sy2002/QNICE-FPGA/tree/dev-int#programming-in-assembler

Scroll down to the section VASM assembler.

bernd-ulmann commented 4 years ago

Simple macros are also possible with the existing qasm using the C-preprocessor which is called prior the assembler run by asm. Maybe better than nothing at the moment. :-)