I did some experimenting with RPi assembler a handful of years back, since I used to do a lot of x86 assembler throughout the 90's. If you're interested, here are 6 completely different ways to print Hello World in Assembler for the Raspberry Pi.<p><a href="https://github.com/ksaj/helloworld">https://github.com/ksaj/helloworld</a><p>I kept the code as close to each other in format and style as possible, so comparisons are easier to make. I don't really know the benefits and drawbacks to each method, but they are there and available, so I sleuthed them out and got them working.
<a href="https://www.chibiakumas.com/z80/AmstradCPC.php" rel="nofollow noreferrer">https://www.chibiakumas.com/z80/AmstradCPC.php</a><p>Oh wow, memories!<p>Had an Amstrad CPC6128 in the mid-80s and for the life of me I just could not 'get' BASIC. "Syntax error" in everything, even those multi-page type-in games that Amstrad Action would print each month.<p>Then I discovered the MAXAM ROM - along with Protext. That, a copy of the CPC Firmware Guide, and I was away.<p>BASIC stumped me but the Z80 language just clicked.<p>Loved writing code, learnt the importance of backups, learned how to find cheats in games and so much more. Good times.
Wait what there is no integer division instruction? That sounds very weird and [1] disagrees by describing SDIV and UDIV. What?<p>[1]: <a href="https://developer.arm.com/documentation/den0024/a/The-A64-instruction-set/Data-processing-instructions/Multiply-and-divide-instructions" rel="nofollow noreferrer">https://developer.arm.com/documentation/den0024/a/The-A64-in...</a>
>hw-rpi3-5 Hello World bypassing clib altogether, and talking direcly to the hardware.<p>>Apparently this is a no-no, even if it is theoretically more efficient. The bare-metal and OS dev folk are pretty much limited to using this method<p><pre><code> mov r7, #4 /\* raw system call for write */
swi #0 /* print without using clib \*/
</code></pre>
This seems to be just a call into the linux kernel, not bare metal, essentially what the clib does itself. You have to do this to do functions the kernel supports but haven't been ported to clib yet.<p>I haven't really looked deep into it but a google search came up with this for bare metal text printing <a href="https://github.com/bztsrc/raspi3-tutorial/tree/master/0A_pcscreenfont">https://github.com/bztsrc/raspi3-tutorial/tree/master/0A_pcs...</a>
Minor nit (for me, at least):
An assembler is a tool.
Assembly is a language.<p>Though not assembly language, I think that www.ultibo.org is a cool embedded development environment for the Pi.