diff options
| author | Jacob McDonnell <jacob@jacobmcdonnell.com> | 2026-03-14 20:45:12 -0400 |
|---|---|---|
| committer | Jacob McDonnell <jacob@jacobmcdonnell.com> | 2026-03-14 20:45:12 -0400 |
| commit | 68b9f87bc3b6bd6ccb3773641578b0d914e61104 (patch) | |
| tree | 89d2851472d7331337e1a5e10bdc2e4634925b48 /examples/instructions.s | |
| parent | 0c81ee06d19d1d7f67dab3c2c9da268b0c55e3c0 (diff) | |
refactor!: Switched from x86_64 to RISC-V
Switched from x86_64 to RISC-V because RISC-V is a cleaner and simpler
architecture and I'm more familiar with it since it's similar to MIPS.
BREAKING CHANGE: Switched from x86_64 to RISC-V
Diffstat (limited to 'examples/instructions.s')
| -rw-r--r-- | examples/instructions.s | 43 |
1 files changed, 35 insertions, 8 deletions
diff --git a/examples/instructions.s b/examples/instructions.s index f16e6c1..5379657 100644 --- a/examples/instructions.s +++ b/examples/instructions.s @@ -1,8 +1,35 @@ -movl $4, %eax -movl $1, %ebx -movl $1, %eax -movl $0, %ebx -int $0x80 - -movl $str, %ecx -movl $str_len, %edx +# R-Type +add x5, x6, x7 +sub x10, x11, x12 +and x1, x2, x3 +sll x8, x9, x10o + +# I-Type +addi x5, x6, 10 +andi x1, x2, 3 + +# I-Type +lw x5, 0(x6) +lh x3, 4(x8) + +# I-Type +jalr x1, 0(x5) + +# S-Type +sw x5, 0(x6) +sb x3, 8(x4) +sh x10, 12(x2) + +# B-Type +beq x5, x6, loop +bne x1, x2, done +blt x3, x4, less +bge x7, x8, end + +# U-Type +lui x5, 0x12345 +auipc x10, 0x20000 + +# J-Type +jal x1, function +jal x0, loop |
