Skip to content

Commit

Permalink
add linux mips assembler for gas ABI o32
Browse files Browse the repository at this point in the history
Since the two assembly examples for MIPS are targeting the SPIM, A MIPS32 Simulator, I felt appropriate to add a Linux version for the same targeting the common o32 ABI.
Can be tested on x86 Linux using qemu and cross gcc.

The following is for mipsel:

$ mipsel-linux-gnu-as -mips32 -EL a/Assembler_mipsel_linux.s -o /tmp/hello.o
$ mipsel-linux-gnu-ld /tmp/hello.o -o hello
$ qemu-mipsel ./hello
  • Loading branch information
alessandrocarminati committed May 23, 2022
1 parent b0bd238 commit c8297d9
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
15 changes: 15 additions & 0 deletions a/Assembler_mipsel_linux.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.rdata
.align 2
hello: .asciz "Hello world\n"<0>
.align 4
length: .word . - hello
.text
.globl __start
__start:
move $a0,$0
la $a1,hello
lw $a2,length
li $v0,0xfa4
syscall
li $v0,0xfa1
syscall
4 changes: 3 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Thanks to everyone who continues to contribute; new languages are created every
Make sure to see [contributing.md](/contributing.md) for instructions on contributing to the project!

<!--Languages start-->
## Languages (893 total)
## Languages (895 total)

* [!](%23/%21)
* [!@#$%^&*()_+](%23/%21%40%23%24%25%5E%26%E2%88%97%28%29_%2B)
Expand Down Expand Up @@ -184,6 +184,7 @@ Make sure to see [contributing.md](/contributing.md) for instructions on contrib
* [Assembler Z80 Knightos](a/Assembler%20Z80%20Knightos.asm)
* [Assembler Z80 TI83calculator](a/Assembler%20Z80%20TI83calculator.asm)
* [Assembler Z80 zxspectrum](a/Assembler%20Z80%20zxspectrum.asm)
* [Assembler_mipsel_linux](a/Assembler_mipsel_linux.s)
* [ATS2](a/ATS2.dats)
* [Attache](a/Attache.%40)
* [AutoHotKey](a/AutoHotKey.ahk)
Expand Down Expand Up @@ -542,6 +543,7 @@ Make sure to see [contributing.md](/contributing.md) for instructions on contrib
* [LUA](l/LUA.lua)
* [LWC](l/LWC.html)
* [Löve](l/L%C3%B6ve.lua)
* [.Mips.s](m/.Mips.s.swp)
* [M4](m/M4.m4)
* [MacLisp](m/MacLisp.lisp)
* [Macsyma](m/Macsyma.mac)
Expand Down

0 comments on commit c8297d9

Please sign in to comment.