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 482912f
Showing 1 changed file with 15 additions and 0 deletions.
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

0 comments on commit 482912f

Please sign in to comment.