64-bit assembly language example programmes for 15 instruction set architectures

Started by lucho, September 25, 2024, 04:44:12 PM

Previous topic - Next topic

lucho

During my job (from which I retired) of teaching assembly language, I've written a set of examples (from easiest to most difficult) which then translated to 21 other 32-bit instruction set architectures (ISA).

As 64-bit computing has now become prevalent, I've translated them to 15 of the 64-bit ISA too.
You can see their listings on my site, https://lucho.ddns.net/ and download the AMD64(x64)/UASM versions there.
Anyone who needs them for another ISA, please let me know and I'll translate the comments from Bulgarian to English and if needed, I can also provide SSH access to a Linux machine with that ISA.
Below is a list of these 15 ISA (those in parentheses are emulated only – I don't have real machines for them):

AMD64, ARM64, PPC64, SPARC64, MIPS64, RISCV64, LoongArch64, (S/390x, ARC64, Alpha AXP, MMIX, PA-RISC 2.0, TILE-Gx, IA-64, E2K)

jj2007

Hi Lucho,

Thanks for this, very interesting :thumbsup:

There might be some confusion about "15 instruction set architectures". It seems they are all using the x64 instruction set... so what do you really mean? 15 what?

_japheth

Quote from: jj2007 on September 25, 2024, 05:40:04 PMThere might be some confusion about "15 instruction set architectures". It seems they are all using the x64 instruction set... so what do you really mean? 15 what?

The architectures are listed in the OP:

  • AMD64
  • ARM64
  • PPC64
  • SPARC64
  • MIPS64
  • RISCV64
  • LoongArch64
  • S/390x
  • ARC64
  • Alpha AXP
  • MMIX
  • PA-RISC 2.0
  • TILE-Gx
  • IA-64
  • E2K

Dummheit, gepaart mit Dreistigkeit - eine furchtbare Macht.

sinsi

Aren't they built with UASM, not MASM? There seemed to be a lot of C code too.

🍺🍺🍺

lucho

I chose UASM to present the examples in the main page because it has the most descriptive source code, with the high-level constructs and idents. There are also GAS (GNU as) versions for the x64 examples, and all the examples for the other ISAs are for GAS too, so that must be taken into account when choosing the section for this topic.

I've now added a list of all ISAs and links to their instruction set references. The big exception is (IMHO) the best ISA – ARC64 (ARCv3). So good that there are no microprocessors with it yet. Why, you'd ask? I think, because Synopisys made the ISA secret! To get it, one must do some paperwork, sign a licence, NDA etc. Hence I don't have a reference for this ISA, just the examples for it (working and tested like all the others).

Last not least – my offer for SSH access to machines with the first 7 ISAs is valid even if one won't use MY examples but anyone else's. For instance, those from the new book of Randall Hyde "The Art of ARM Assembly". Moreover, the first 5 of them support 32-bit mode too, so they can be used for 32-bit programs too.

lucho

Quote from: lucho on September 25, 2024, 04:44:12 PMAnyone who needs them for another ISA, please let me know and I'll translate the comments from Bulgarian to English and if needed, I can also provide SSH access to a Linux machine with that ISA.
Sorry, the above is too vague and inexact. Let me clarify. If you need to learn assembly language for:
  • AMD64/x64 or x86
  • ARM64 or 32
  • PPC64 or 32
  • SPARC64 or 32
  • MIPS64 or 32
  • RISCV64
  • LoongArch64
but don't have access to a machine with that ISA, you can get one. Just send me your public SSH key, and I'll ask you a test question. If you answer correctly, I'll let you know how to access the machine, translate the comments of my examples for that ISA into English, and copy the examples to your directory.

It's a free service with no support or warranty. Any activity that loads the CPU continuously for more than a few minutes or uses more than a few megabytes of disk space will result in account removal.