QNICE-FPGA icon indicating copy to clipboard operation
QNICE-FPGA copied to clipboard

Make the native assembler independent from an external preprocessor

Open sy2002 opened this issue 3 years ago • 5 comments

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.

sy2002 avatar Jul 31 '20 22:07 sy2002

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

MJoergen avatar Aug 08 '20 18:08 MJoergen

@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.

sy2002 avatar Aug 08 '20 19:08 sy2002

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

MJoergen avatar Aug 08 '20 19:08 MJoergen

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.

sy2002 avatar Aug 08 '20 19:08 sy2002

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. :-)

bernd-ulmann avatar Aug 08 '20 21:08 bernd-ulmann