|
Forum Index : Microcontroller and PC projects : Assembler on CMM2
| Author | Message | ||||
| joker Regular Member Joined: 06/02/2024 Location: GermanyPosts: 42 |
Hello, Do you remember that we talked quite a while ago about an ARM Assembler in Basic? After finishing some other projects I gave it a second thought and this time it worked. I created an assembler suite containing a - a Thumb/Thumb-2 assembler for a cortex-M7 - a disassembler to view CSUB code - file format converters from - bin to CSUB - CSUB to bin - ELF to CSUB - an assembler include file for the MMBasic API Maybe this is the most useless programm since the book "How to learn French" was translated to French, but to my surprise you can do real work with it. It is a 1.5 pass assembler, which uses some private arrays to encode forward references without a second pass. As a result, it needs some help with some encodings once in a while. It only supports Thumb (16 and 32-bit), one processor (cortex-M7) and only a limited set of assembler directives. It cannot live up to the arm-non-eabi-as or the gcc but it works. You can find the code on github.com: CMM2 Assembler Wiki Tell me what you think. Cheers Matthias |
||||
| PhenixRising Guru Joined: 07/11/2023 Location: United KingdomPosts: 1872 |
Does this mean the possibility of mere mortals being able to create CSUBS? |
||||
| JohnS Guru Joined: 18/11/2011 Location: United KingdomPosts: 4308 |
Probably easier to write them in C than ASM but still only easy if you know C. This looks an interesting post, bearing the above in mind. John |
||||
| PhenixRising Guru Joined: 07/11/2023 Location: United KingdomPosts: 1872 |
Oh, I'm not afraid of C but I understood that the tricky bit was creating the CSUB for MMBasic. The way I read the above is that not only asm code but also C code can be processed to be oven ready. Again, I am the master of misinterpreting |
||||
| joker Regular Member Joined: 06/02/2024 Location: GermanyPosts: 42 |
Hello, Yes, the converter ELF2csub.bas will convert cross compiled C-code into an CSUB, too. But ths was already possible with the tool armcfgen143.bas, which is part of the firmware package. I just included it to have everything in one place and anyway, elf2csub-bas mimics its behaviour. The problem of mere mortals is not to create a CSUB but to write something in C or assembler that pushs an MMBasic program really forward. I just paved the road, you must now walk on it (sorry, but I don't want to stress the citation from Matrix again, with the door or so. )Matthias |
||||
| JohnS Guru Joined: 18/11/2011 Location: United KingdomPosts: 4308 |
I don't see it as tricky, particularly as there's a detailed writeup with examples. However, what is needed in C and why? Mostly the CPU is doing not much (waiting for I/O or a timer). (This would be somewhat less true if PIOs didn't exist.) John |
||||
| Mixtel90 Guru Joined: 05/10/2019 Location: United KingdomPosts: 8794 |
I'm pretty sure that in most instances CSUBs aren't needed now. They were handy when MMBasic was less developed but a lot has happened since. I suppose they are handy if you want to make your programs unreadable, unsupportable and incompatible across different platforms and versions of NNBasic though. ;) Mick Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
| The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2026 |