repo_id string | size int64 | file_path string | content string |
|---|---|---|---|
BlueQuantumx/rCore-Tutorial-fork | 675 | kernel/src/task/switch.s | .altmacro
.macro SAVE_SN n
sd s\n, (\n+2)*8(a0)
.endm
.macro LOAD_SN n
ld s\n, (\n+2)*8(a1)
.endm
.section .text
.globl __switch
__switch:
# __switch(
# current_task_cx_ptr: *mut TaskContext,
# next_task_cx_ptr: *const TaskContext
# )
# save kernel stack of current task
s... |
BlueQuantumx/rCore-Tutorial-fork | 1,640 | kernel/src/trap/trap.S | .altmacro
.macro SAVE_GP n
sd x\n, \n*8(sp)
.endm
.macro LOAD_GP n
ld x\n, \n*8(sp)
.endm
.section .text.trampoline
.globl __alltraps
.globl __restore
.align 2
__alltraps:
csrrw sp, sscratch, sp
# now sp->*TrapContext in user space, sscratch->user stack
# save other general purpose r... |
blueseason/os_experiment | 676 | os/src/task/switch.S | .altmacro
.macro SAVE_SN n
sd s\n, (\n+2)*8(a0)
.endm
.macro LOAD_SN n
ld s\n, (\n+2)*8(a1)
.endm
.section .text
.globl __switch
__switch:
# __switch(
# current_task_cx_ptr: *mut TaskContext,
# next_task_cx_ptr: *const TaskContext
# )
# save kernel stack of current task
s... |
blueseason/os_experiment | 2,041 | os/src/trap/trap.S | .altmacro
.macro SAVE_GP n
sd x\n, \n*8(sp)
.endm
.macro LOAD_GP n
ld x\n, \n*8(sp)
.endm
.section .text.trampoline
.globl __alltraps
.globl __restore
.align 2
__alltraps:
csrrw sp, sscratch, sp
# now sp->kernel stack, sscratch->user stack
# allocate a TrapContext on kernel stack
... |
bluleap-ai/OpenBLT-Rust | 18,424 | openblt/boards/s32k148/startup/startup_S32K148.S | /******************************************************************************
* File: startup_S32K148.S
* Purpose: Startup file for S32K148
******************************************************************************/
.syntax unified
.arch armv7-m
.thumb
.section .isr_vector, "a"
.align 2
... |
bmaag90/riscv-emu | 68 | examples/add/add.s | main:
addi x29, x0, 5
addi x30, x0, 37
add x31, x30, x29 |
Bqrry4/riscv_emu | 97 | tests/asm/rv64i/sub_underflow.s | .text
.globl _start
_start:
li t3, 0
li t4, 1
sub t5, t3, t4
call exit
|
Bqrry4/riscv_emu | 97 | tests/asm/rv64i/sub.s | .text
.globl _start
_start:
li t3, 3
li t4, 2
sub t5, t3, t4
call exit
|
Bqrry4/riscv_emu | 140 | tests/asm/rv64i/sltu.s | .text
.globl _start
_start:
addi t3, zero, -366
addi t4, zero, 366
sltu t5, t3, t4
sltiu t6, t3, 366
call exit
|
Bqrry4/riscv_emu | 131 | tests/asm/rv64i/xor.s | .text
.globl _start
_start:
li t3, 0b1001
li t4, 0b0101
xor t5, t3, t4
xori t6, t3, 0b0101
call exit
|
Bqrry4/riscv_emu | 114 | tests/asm/rv64i/add_overflow.s | .text
.globl _start
_start:
addi t3, zero, -1
addi t4, zero, 1
add t5, t4, t3
call exit
|
Bqrry4/riscv_emu | 130 | tests/asm/rv64i/or.s | .text
.globl _start
_start:
li t3, 0b0101
li t4, 0b1010
or t5, t3, t4
ori t6, t3, 0b1010
call exit
|
Bqrry4/riscv_emu | 139 | tests/asm/rv64i/slt.s | .text
.globl _start
_start:
addi t3, zero, -366
addi t4, zero, 366
slt t5, t3, t4
slti t6, t3, 366
call exit
|
Bqrry4/riscv_emu | 113 | tests/asm/rv64i/add.s | .text
.globl _start
_start:
addi t3, zero, 1
addi t4, zero, 2
add t5, t4, t3
call exit
|
Bqrry4/riscv_emu | 132 | tests/asm/rv64i/sll.s | .text
.globl _start
_start:
addi t3, zero, 1
addi t4, zero, 2
sll t5, t3, t4
slli t6, t3, 2
call exit
|
Bqrry4/riscv_emu | 131 | tests/asm/rv64i/and.s | .text
.globl _start
_start:
li t3, 0b0101
li t4, 0b1010
and t5, t3, t4
andi t5, t3, 0b1010
call exit
|
Bqrry4/riscv_emu | 117 | tests/asm/rv64i/sra.s | .text
.globl _start
_start:
li t3, -1
li t4, 1
sra t5, t3, t4
srai t6, t3, 1
call exit
|
Bqrry4/riscv_emu | 117 | tests/asm/rv64i/srl.s | .text
.globl _start
_start:
li t3, -1
li t4, 1
srl t5, t3, t4
srli t6, t3, 1
call exit
|
Bqrry4/riscv_emu | 221 | tests/asm/include/exit.s | .equ ADDR, 0x100000
.equ EXIT_VAL, 0x5555
.globl exit
# Writes FINISHER_PASS to the TEST device
exit:
lui t0, %hi(ADDR)
addi t0, t0, %lo(ADDR)
li t1, EXIT_VAL
sw t1, 0(t0)
ret
|
Bqrry4/riscv_emu | 97 | tests/asm/rv64m/rem.s | .text
.globl _start
_start:
li t3, -1
li t4, 4
rem t5, t3, t4
call exit
|
Bqrry4/riscv_emu | 98 | tests/asm/rv64m/divu.s | .text
.globl _start
_start:
li t3, -1
li t4, 3
divu t5, t3, t4
call exit
|
Bqrry4/riscv_emu | 100 | tests/asm/rv64m/mulhu.s | .text
.globl _start
_start:
li t3, -1
li t4, 3
mulhu t5, t3, t4
call exit
|
Bqrry4/riscv_emu | 97 | tests/asm/rv64m/div.s | .text
.globl _start
_start:
li t3, -1
li t4, 3
div t5, t3, t4
call exit
|
Bqrry4/riscv_emu | 97 | tests/asm/rv64m/mul.s | .text
.globl _start
_start:
li t3, 2
li t4, 2
mul t5, t3, t4
call exit
|
Bqrry4/riscv_emu | 96 | tests/asm/rv64m/div_bz.s | .text
.globl _start
_start:
li t3, 1
li t4, 0
div t5, t3, t4
call exit
|
Bqrry4/riscv_emu | 98 | tests/asm/rv64m/remu.s | .text
.globl _start
_start:
li t3, -1
li t4, 4
remu t5, t3, t4
call exit
|
Bqrry4/riscv_emu | 100 | tests/asm/rv64m/mulhsu.s | .text
.globl _start
_start:
li t3, -1
li t4, 3
mulhsu t5, t3, t4
call exit
|
Bqrry4/riscv_emu | 98 | tests/asm/rv64m/mulh.s | .text
.globl _start
_start:
li t3, -1
li t4, 3
mulh t5, t3, t4
call exit
|
Bqrry4/riscv_emu | 96 | tests/asm/rv64m/rem_bz.s | .text
.globl _start
_start:
li t3, 1
li t4, 0
rem t5, t3, t4
call exit
|
brndel/co2_compiler | 360 | src/compile/template.s | .text
.global main
.extern getchar
.extern putchar
.extern fflush
.extern stdout
.extern calloc
.extern abort
main:
call main_start_0
push %rax
mov stdout(%rip), %rdi
call fflush
pop %rax
# move the return value into the first argument for the syscall
movq %rax, %rdi
# move the exit syscall number into rax
movq $0x3C,... |
BTCGhostdag/BTCD-miner | 5,802 | src/keccakf1600_x86-64-osx.s | # Source: https://github.com/dot-asm/cryptogams/blob/master/x86_64/keccak1600-x86_64.pl
.text
.p2align 5
__KeccakF1600:
.cfi_startproc
.byte 0xf3,0x0f,0x1e,0xfa
movq 60(%rdi),%rax
movq 68(%rdi),%rbx
movq 76(%rdi),%rcx
movq 84(%rdi),%rdx
movq 92(%rdi),%rbp
jmp L$oop
.p2align 5
L$oop:
movq -100(%rdi),%r8
mo... |
BTCGhostdag/BTCD-miner | 6,073 | src/keccakf1600_x86-64.s | # Source: https://github.com/dot-asm/cryptogams/blob/master/x86_64/keccak1600-x86_64.pl
.text
.type __KeccakF1600,@function
.align 32
__KeccakF1600:
.cfi_startproc
.byte 0xf3,0x0f,0x1e,0xfa
movq 60(%rdi),%rax
movq 68(%rdi),%rbx
movq 76(%rdi),%rcx
movq 84(%rdi),%rdx
movq 92(%rdi),%rbp
jmp .Loop
.align 32
.Loo... |
Budmeister/bk | 813 | src/boot.s | // AArch64 mode
// To keep this in the first portion of the binary.
.section ".text.boot"
// Make _start global.
.globl _start
.globl kernel_main
// Linker script will place this object at the right starting point.
.org 0x0
// Entry point for the kernel. Registers:
// x0 -> 32 bit pointer to DTB in memory (prima... |
Bush-Man/study-operating-system | 4,723 | src/boot.s | /* Declare constants for the multiboot header. */
.set ALIGN, 1<<0 /* align loaded modules on page boundaries */
.set MEMINFO, 1<<1 /* provide memory map */
.set FLAGS, ALIGN | MEMINFO /* this is the Multiboot 'flag' field */
.set MAGIC, 0x1BADB002 /* 'magic number' lets bootloa... |
cadaritre/Lapis-Monetae-Rust | 5,802 | crypto/hashes/src/keccakf1600_x86-64-osx.s | # Source: https://github.com/dot-asm/cryptogams/blob/master/x86_64/keccak1600-x86_64.pl
.text
.p2align 5
__KeccakF1600:
.cfi_startproc
.byte 0xf3,0x0f,0x1e,0xfa
movq 60(%rdi),%rax
movq 68(%rdi),%rbx
movq 76(%rdi),%rcx
movq 84(%rdi),%rdx
movq 92(%rdi),%rbp
jmp L$oop
.p2align 5
L$oop:
movq -100(%rdi),%r8
mo... |
cadaritre/Lapis-Monetae-Rust | 6,073 | crypto/hashes/src/keccakf1600_x86-64.s | # Source: https://github.com/dot-asm/cryptogams/blob/master/x86_64/keccak1600-x86_64.pl
.text
.type __KeccakF1600,@function
.align 32
__KeccakF1600:
.cfi_startproc
.byte 0xf3,0x0f,0x1e,0xfa
movq 60(%rdi),%rax
movq 68(%rdi),%rbx
movq 76(%rdi),%rcx
movq 84(%rdi),%rdx
movq 92(%rdi),%rbp
jmp .Loop
.align 32
.Loo... |
Cai1Hsu/ostd_loongarch_base | 815 | hello.S | # SPDX-License-Identifier: MPL-2.0
# Minimal hello world program for LoongArch64
# adapted from https://asterinas.github.io/book/ostd/a-100-line-kernel.html
.global _start # entry point
.section .text # code section
_start:
li.d $a7, 64 # syscall number ... |
Cai1Hsu/ostd-la-test-base | 815 | hello.S | # SPDX-License-Identifier: MPL-2.0
# Minimal hello world program for LoongArch64
# adapted from https://asterinas.github.io/book/ostd/a-100-line-kernel.html
.global _start # entry point
.section .text # code section
_start:
li.d $a7, 64 # syscall number ... |
caius-iulius/hypervisor | 526 | src/start.s | .globl _start
.extern LD_STACK_PTR
.section ".text.boot"
_start:
// Initialize DRAM.
ldr x0, __bss_start
ldr x1, __bss_end_exclusive
// Initialize bss section to zero
.L_init_bss:
cmp x0, x1
b.eq .L_init_bss_end
stp xzr, xzr, [x0], #16
b .L_init_bss
.L_init_bss_end:
// Load stack pointer
ldr x30,... |
caiwen666/my_rcore | 386 | os/src/task/switch.S | .altmacro
.macro SAVE_SN n
sd s\n, (\n+2)*8(a0)
.endm
.macro LOAD_SN n
ld s\n, (\n+2)*8(a1)
.endm
.section .text
.globl __switch
__switch:
sd sp, 8(a0)
sd ra, 0(a0)
.set n, 0
.rept 12
SAVE_SN %n
.set n, n + 1
.endr
ld ra, 0(a1)
.set n, 0
.rept 12
L... |
caiwen666/my_rcore | 1,253 | os/src/trap/trap.S | .altmacro
.macro SAVE_GP n
sd x\n, \n*8(sp)
.endm
.macro LOAD_GP n
ld x\n, \n*8(sp)
.endm
.section .text.trampoline
.globl __alltraps
.globl __restore
.align 2
__alltraps:
# 交换用户栈和内核栈栈指针,在下一条命令之前,sp为用户栈
csrrw sp, sscratch, sp
# 从此开始sp变为内核栈
# 从第四章开始,此处的 sp 指向的是用户空间的 trap 上下文,并非内核栈... |
caiyuanrui/rCore-Tutorial-v3 | 722 | os/src/task/switch.S | .altmacro
.macro SAVE_SN n
sd s\n, (\n+2)*8(a0)
.endm
.macro LOAD_SN n
ld s\n, (\n+2)*8(a1)
.endm
.section .text
.globl __switch
__switch:
# stage [1]
# __switch(
# current_task_cx_ptr: *mut TaskContext,
# next_task_cx_ptr: *const TaskContext
# )
# stage [2]
# save ke... |
caiyuanrui/rCore-Tutorial-v3 | 1,673 | os/src/trap/trap.S | .altmacro
.macro SAVE_GP n
sd x\n, \n*8(sp)
.endm
.macro LOAD_GP n
ld x\n, \n*8(sp)
.endm
.section .text
.globl __alltraps
.globl __restore
.align 2
__alltraps:
csrrw sp, sscratch, sp
# now sp->kernel stack, sscratch->user stack
# allocate a TrapContext on kernel stack
addi sp, s... |
calico-project/calico-miner | 8,619 | src/asm/keccakf1600_x86-64-elf.s | # Source: https://github.com/dot-asm/cryptogams/blob/master/x86_64/keccak1600-x86_64.pl
.text
.type __KeccakF1600,@function
.align 32
__KeccakF1600:
.cfi_startproc
.byte 0xf3,0x0f,0x1e,0xfa
movq 60(%rdi),%rax
movq 68(%rdi),%rbx
movq 76(%rdi),%rcx
movq 84(%rdi),%rdx
movq 92(%rdi),%rbp
jmp .Loop
.align 32
.Loo... |
calico-project/calico-miner | 10,572 | src/asm/keccakf1600_x86-64-win64.s | # Source: https://github.com/dot-asm/cryptogams/blob/master/x86_64/keccak1600-x86_64.pl
.text
.def __KeccakF1600; .scl 3; .type 32; .endef
.p2align 5
__KeccakF1600:
.byte 0xf3,0x0f,0x1e,0xfa
movq 60(%rdi),%rax
movq 68(%rdi),%rbx
movq 76(%rdi),%rcx
movq 84(%rdi),%rdx
movq 92(%rdi),%rbp
jmp .Loop
.p2align 5
.L... |
calico-project/calico-miner | 8,238 | src/asm/keccakf1600_x86-64-osx.s | # Source: https://github.com/dot-asm/cryptogams/blob/master/x86_64/keccak1600-x86_64.pl
.text
.p2align 5
__KeccakF1600:
.cfi_startproc
.byte 0xf3,0x0f,0x1e,0xfa
movq 60(%rdi),%rax
movq 68(%rdi),%rbx
movq 76(%rdi),%rcx
movq 84(%rdi),%rdx
movq 92(%rdi),%rbp
jmp L$oop
.p2align 5
L$oop:
movq -100(%rdi),%r8
mo... |
calico-project/calico-miner | 10,572 | src/asm/keccakf1600_x86-64-mingw64.s | # Source: https://github.com/dot-asm/cryptogams/blob/master/x86_64/keccak1600-x86_64.pl
.text
.def __KeccakF1600; .scl 3; .type 32; .endef
.p2align 5
__KeccakF1600:
.byte 0xf3,0x0f,0x1e,0xfa
movq 60(%rdi),%rax
movq 68(%rdi),%rbx
movq 76(%rdi),%rcx
movq 84(%rdi),%rdx
movq 92(%rdi),%rbp
jmp .Loop
.p2align 5
.L... |
calico-project/rusty-calico | 5,802 | crypto/hashes/src/keccakf1600_x86-64-osx.s | # Source: https://github.com/dot-asm/cryptogams/blob/master/x86_64/keccak1600-x86_64.pl
.text
.p2align 5
__KeccakF1600:
.cfi_startproc
.byte 0xf3,0x0f,0x1e,0xfa
movq 60(%rdi),%rax
movq 68(%rdi),%rbx
movq 76(%rdi),%rcx
movq 84(%rdi),%rdx
movq 92(%rdi),%rbp
jmp L$oop
.p2align 5
L$oop:
movq -100(%rdi),%r8
mo... |
calico-project/rusty-calico | 6,073 | crypto/hashes/src/keccakf1600_x86-64.s | # Source: https://github.com/dot-asm/cryptogams/blob/master/x86_64/keccak1600-x86_64.pl
.text
.type __KeccakF1600,@function
.align 32
__KeccakF1600:
.cfi_startproc
.byte 0xf3,0x0f,0x1e,0xfa
movq 60(%rdi),%rax
movq 68(%rdi),%rbx
movq 76(%rdi),%rcx
movq 84(%rdi),%rdx
movq 92(%rdi),%rbp
jmp .Loop
.align 32
.Loo... |
carlos5674/my-projects | 172 | Modular_CPU_Logisim/tests/integration-lui/in/lui-basic.s | addi t0, x0, 89
addi t1, x0, 17
mul t0, t0, t1
lui s0, 554580
addi s0, s0, 801
lui s1, 74565
addi s1, s1, 1656
mul t0, s0, s0
mul t1, s1, s1
mul t2, s0, s1
mul t2, s1, s0
|
carlos5674/my-projects | 66 | Modular_CPU_Logisim/tests/integration-addi/in/addi-positive.s | addi t0, x0, 1
addi s0, x0, 2047
addi t1, x0, 255
addi t2, t1, 16
|
carlos5674/my-projects | 66 | Modular_CPU_Logisim/tests/integration-addi/in/addi-basic.s | addi t0, x0, 1
addi t0, x0, 42
addi t0, x0, 256
addi t0, x0, 2047
|
carlos5674/my-projects | 70 | Modular_CPU_Logisim/tests/integration-addi/in/addi-negative.s | addi t0, x0, -1
addi s0, x0, -2048
addi t1, x0, -255
addi t2, t1, -16
|
carlos5674/my-projects | 390 | Modular_CPU_Logisim/tests/integration-branch/in/branch-basic.s | addi s1, x0, 1
addi s0, x0, -1
label5: beq x0, x0, label1
label6: bltu x0, s0, label8
label4: blt s1, x0, label5
beq x0, x0, label6
label3: beq s1, s1, label4
label10: beq s0, s0, end
label2: blt x0, s1, label3
label9: blt s0, s1, label10
label1: beq x0, x0, label2
label8: blt... |
carlos5674/my-projects | 1,025 | Modular_CPU_Logisim/tests/integration-all-regs/in/all-regs-basic.s | addi x0, x0, 0
addi s0, x0, 0
addi x1, x0, 1
addi s0, x1, 0
addi x2, x0, 2
addi s0, x2, 0
addi x3, x0, 3
addi s0, x3, 0
addi x4, x0, 4
addi s0, x4, 0
addi x5, x0, 5
addi s0, x5, 0
addi x6, x0, 6
addi s0, x6, 0
addi x7, x0, 7
addi s0, x7, 0
addi x8, x0, 8
addi s0, x8, 0
addi x9, x0, 9
addi s0, x9, 0
addi x10, x0, 10
add... |
carlos5674/my-projects | 94,016 | Modular_CPU_Logisim/tests/integration-jump/in/jump-far.s | lui ra, 4 # 4094 * 4 = 16376
addi ra, ra, -8
jalr x0, ra, 0
addi s0, x0, 1
addi s0, x0, 2
addi s0, x0, 3
addi s0, x0, 4
addi s0, x0, 5
addi s0, x0, 6
addi s0, x0, 7
addi s0, x0, 8
addi s0, x0, 9
addi s0, x0, 10
addi s0, x0, 11
addi s0, x0... |
carlos5674/my-projects | 647 | Modular_CPU_Logisim/tests/integration-jump/in/jump-basic.s | addi s0, x0, 1 # 1, addr 0x00
addi s1, x0, 2 # 2, addr 0x04
jal x0, label1 # 3, addr 0x08
addi s1, s0, -1 # x, addr 0x0C
addi s1, s0, -2 # x, addr 0x10
label1: addi s1, x0, 0 # 4, addr 0x14
addi s0, s1, 0 # 5, addr 0x18
jal ra, label2 # 6, addr 0x1C, ... |
carlos5674/my-projects | 50 | Modular_CPU_Logisim/tests/integration-jump/in/jump-empty.s | addi ra, x0, 1024
jalr x0, ra, 512
addi s1, x0, 7
|
carlos5674/my-projects | 463 | Modular_CPU_Logisim/tests/integration-programs/in/programs-fib.s | addi s0 x0 46 #n =46
addi t0 x0 1 #i =1
addi t1 x0 1 #i =1
addi ra x0 1000
beq s0, x0, Ret0
addi s1, x0, 1
beq s0, s1, Ret1
addi s0, s0, -2
Loop: beq s0, x0, RetF
add s1, t0, t1
addi t1, t0, 0
addi t0, s1, 0
addi s0, s0,... |
carlos5674/my-projects | 267 | Modular_CPU_Logisim/tests/integration-programs/in/programs-power.s | addi s0 x0 3
addi s1 x0 19
addi ra x0 1000
addi t0 x0 1
addi t1 s0 0
addi s0 x0 1
loop: blt s1 t0 end
mul s0 s0 t1
addi t0 t0 1
jal x0 loop
end: add s0, x0, s0 # padding to fix venus oddity
|
carlos5674/my-projects | 16 | Modular_CPU_Logisim/tests/integration-custom/in/load-test.s | lh x5, -204(x8)
|
carlos5674/my-projects | 40 | Modular_CPU_Logisim/tests/integration-custom/in/I-type-test.s | addi t1 x0 5
addi t2 t1 6
addi t0 t2 15
|
carlos5674/my-projects | 53 | Modular_CPU_Logisim/tests/integration-custom/in/R-type-test.s | addi s0 x0 10
add s1 x0 s0
addi t0 x0 5
xor t1 s1 t0
|
carlos5674/my-projects | 196 | Modular_CPU_Logisim/tests/integration-mem/in/mem-sign-extend.s | addi s0, x0, 200
lui s1, 554580
addi s1, s1, 801
sw s1, 80(s0)
sw s1, -20(s0)
lw t0, 80(s0)
lh t0, 80(s0)
lh t1, 82(s0)
lb t0, 80(s0)
lb t1, 81(s0)
lb t2, 82(s0)
lb t0, 83(s0)
|
carlos5674/my-projects | 547 | Modular_CPU_Logisim/tests/integration-mem/in/mem-store-basic.s | addi s0, x0, 200
lui s1, 86627 # 0x15263748
addi s1, s1, 1864
sw s1, 80(s0)
lw a0, 80(s0)
sh s1, 80(s0)
lw a0, 80(s0)
sh s1, 82(s0)
lw a0, 80(s0)
sb s1, 80(s0)
lw a0, 80(s0)
sb s1, 81(s0)
lw a0, 80(s0)
sb s1, 82(s0)
lw a0, 80(s0)
sb s1, 83(s0)
lw a0, 80(s0)
sw s1, -204(s0)
lw a0, ... |
carlos5674/my-projects | 338 | Modular_CPU_Logisim/tests/integration-mem/in/mem-load-basic.s | addi s0, x0, 200
lui s1, 86627 # 0x15263748
addi s1, s1, 1864
sw s1, 80(s0)
sw s1, -20(s0)
lw t0, 80(s0)
lh t0, 80(s0)
lh t1, 82(s0)
lb t0, 80(s0)
lb t1, 81(s0)
lb t2, 82(s0)
lb t0, 83(s0)
lw t0, -204(s0)
lh t0, -204(s0)
lh t1, -202(s0)
lb t0, -204(s0)
lb t1, -203(s0)
lb t2, -202(s0)
... |
carlos5674/my-projects | 459 | Modular_CPU_Logisim/tests/integration-immediates/in/immediates-basic.s | addi s0, x0, 1919
lui s0, 703710
lui s0, 0
lui s0, 1
lui s0, 1048574
lui s0, 1048575
addi t0, x0, 2047
addi t1, x0, -2048
addi t0, t0, 1919
lui s0, 699051 # 0xAAAAAAAA (yBLdQ1a4-JI)
addi s0, s0, -1366
andi t0, s0, 2047
andi t0, s0, -2048
ori t0, s0, 2047
ori t0, s0, -2048
xori t0, s0, 2047
xori t0, s0, -... |
cblh/kira-rs | 450 | hello.S | # 代码段.
.text
# `main` 函数, 程序的入口.
.globl main
main:
addi sp, sp, -16
sw ra, 12(sp)
sw s0, 8(sp)
sw s1, 4(sp)
la s0, hello_str
li s1, 0
1:
add a0, s0, s1
lbu a0, 0(a0)
beqz a0, 1f
call putch
addi s1, s1, 1
j 1b
1:
li a0, 0
lw s1, 4(sp)
lw s0, 8(sp)... |
cc-aegis/amine | 60 | examples/add.s | add(u16,u16)->u16:
mov r0 [#-4]
add r0 [#-3]
ret |
cc-aegis/amine | 137 | examples/main.s | start:
mov rs STACK
call main()
exit
define NUM #317
include add.s
main():
dbg NUM
.loop:
jmp .loop
STACK: |
cc-aegis/amine | 1,998 | projects/recursive_scheduler/thread.s | ; TODO: store parent instead of alive -> don't have to filter for dead children every time a thread is scheduled; only filter on parent when ::kill is called
; Thread { stack: &any, children: Vec*, alive: bool }
define STACK_SIZE #128
include vec.s
OS_THREAD_RS:
dw #nullptr
CURR_THREAD:
dw #nullptr
; ... |
cc-aegis/amine | 1,800 | projects/recursive_scheduler/vec.s | ; Vec { arr: any*, len: u16, cap: u16 }
define DEFAULT_VEC_SIZE #4
include mem.s
Vec::new()->Vec*:
push DEFAULT_VEC_SIZE
call mem::alloc(u16)->any*
pusht r0 #3
call mem::alloc(u16)->any*
writeitr r0 [#1]
writeitr r0 #0
write r0 DEFAULT_VEC_SIZE
sub r0 #2
ret
Vec::push(Vec*... |
cc-aegis/amine | 279 | projects/recursive_scheduler/mem.s | mem::alloc(u16)->any*:
read r0 mem::HEAP
sub r0 [#-3]
write mem::HEAP r0
ret
mem::free(any*):
ret
mem::copy(any*,any*,u16).loop:
copyitr [#-5] [#-4]
mem::copy(any*,any*,u16):
jrnzdec [#-3] mem::copy(any*,any*,u16).loop
ret
mem::HEAP:
dw #0 |
cc-aegis/amine | 516 | projects/recursive_scheduler/main.s | start:
mov rs STACK
call main()
exit
dependencies:
include mem.s
include vec.s
include thread.s
include apps/test.s
include apps/child_test.s
include apps/self_replicate.s
include apps/random_replicate.s
main():
; setup
push random_replicate::main() ; child_test::main()... |
cc-aegis/amine | 354 | projects/recursive_scheduler/random.s | random::SEED:
dw #44257
random::next()->any:
read r0 random::SEED
push r0
and [#0] #1
sshr r0
jrz [#0] .end
xor r0 #46080
.end:
dec rs
write random::SEED r0
ret
random::seed(any):
write random::SEED [#-3]
ret
random::salt(any):
read r0 random::SEED
xor r0 [#-3]... |
cc-aegis/amine | 2,152 | projects/vec_test/vec.s | ; Vec { arr: any*, len: u16, cap: u16 }
define DEFAULT_VEC_SIZE #4
include mem.s
Vec::new()->Vec*:
push DEFAULT_VEC_SIZE
call mem::alloc(u16)->any*
pusht r0 #3
call mem::alloc(u16)->any*
writeitr r0 [#1]
writeitr r0 #0
write r0 DEFAULT_VEC_SIZE
sub r0 #2
ret
; TODO: ex... |
cc-aegis/amine | 279 | projects/vec_test/mem.s | mem::alloc(u16)->any*:
read r0 mem::HEAP
sub r0 [#-3]
write mem::HEAP r0
ret
mem::free(any*):
ret
mem::copy(any*,any*,u16).loop:
copyitr [#-5] [#-4]
mem::copy(any*,any*,u16):
jrnzdec [#-3] mem::copy(any*,any*,u16).loop
ret
mem::HEAP:
dw #0 |
cc-aegis/amine | 513 | projects/vec_test/main.s | start:
mov rs STACK
call main()
exit
dependencies:
include vec.s
main():
call Vec::new()->Vec*
mov r1 r0
dbg r1
pusht r1 #1
dbg #1
call Vec::push(Vec*,any)
sub rs #2
pusht r1 #2
dbg #2
call Vec::push(Vec*,any)
sub rs #2
pusht r1 #3
dbg #3
call... |
cc-aegis/amine | 281 | projects/recursive_scheduler/apps/self_replicate.s | include thread.s
; self-replicate once; print thread-id every tick
self_replicate::main():
call thread::next()
push self_replicate::main()
call thread::spawn(fn()*)->Thread*
dec rs
.loop:
read r0 CURR_THREAD
dbg r0
call thread::next()
jmp .loop |
cc-aegis/amine | 363 | projects/recursive_scheduler/apps/random_replicate.s | include thread.s
include random.s
random_replicate::main():
.loop:
call random::next()->any
and r0 #511
jrnz r0 .skip
.inner_loop:
call random::next()->any
and r0 #1
jrnz r0 .skip
push random_replicate::main()
call thread::spawn(fn()*)->Thread*
dec rs
jmp .inner_loop
.... |
cc-aegis/amine | 221 | projects/recursive_scheduler/apps/child_test.s | include apps/test.s
child_test::main():
.loop:
dbg #12345
push test::main()
call thread::spawn(fn()*)->Thread* ; TODO: make ::spawn auto push to .children
dec rs
call thread::next()
jmp .loop |
cc-aegis/amine | 116 | projects/recursive_scheduler/apps/test.s | include thread.s
test::main():
mov r0 #0
.loop:
dbg r0
inc r0
call thread::next()
jmp .loop |
cc-aegis/amine | 529 | examples/scanline_video_player_128x96/u8iter.s | ; struct U8Iter { ptr: u8*, curr: u16 }
; curr will NEVER be 0 unless it is explicitly set as nullptr
include mem.s
U8Iter::new(u16*)->U8Iter*:
push #2
call mem::alloc(u16)->any*
writeitr r0 [#-3]
write r0 #nullptr
dec r0
ret
U8Iter::next(U8Iter*)->u8:
push r1
readitr r1 [#-3]
... |
cc-aegis/amine | 342,023 | examples/scanline_video_player_128x96/video.s | dw #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #12543 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #6553... |
cc-aegis/amine | 367,799 | examples/scanline_video_player_128x96/video_10fps.s | dw #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #12543 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #6553... |
cc-aegis/amine | 255 | examples/scanline_video_player_128x96/mem.s | mem::alloc(u16)->any*:
read r0 mem::HEAP
sub r0 [#-3]
write mem::HEAP r0
ret
mem::free(any*):
ret
mem::copy(any*,any*,u16).loop:
copyitr [#-5] [#-4]
mem::copy(any*,any*,u16):
jrnzdec [#-3] .loop
ret
mem::HEAP:
dw #0 |
cc-aegis/amine | 1,296 | examples/scanline_video_player_128x96/main.s | start:
mov rs STACK
call main()
exit
DEVICE_DISPLAY:
dw #0
VIDEO:
include video.s
dw #115 #116 #97 #114 #116 #32 #111 #102 #32 #112 #114 #111 #103 #114 #97 #109
include u8iter.s
render_frame(U8Iter*):
pusht r1 r2
pusht r3 r4
read rd DEVICE_DISPLAY
ctx #0 #1
mov r1 #0 ;... |
cc-aegis/amine | 367 | examples/amine_os/terminal.s | ; Terminal { len: u16, off: u16, buf: &char[512], input_buf: &char[16], input_idx: u8|{-1} }
Terminal::new()->Terminal*:
callw mem::alloc(u16)->any* #5
store r1 r0
writeitr r1 #0
writeitr r1 #0
callw mem::alloc(u16)
Terminal::free(Terminal*):
Terminal::push(Terminal*,char*):
Terminal::readln(Te... |
cc-aegis/amine | 1,167 | examples/amine_os/vec.s | ; Vec { arr, len, cap }
include mem.s
Vec::new()->Vec*:
push #4
call mem::alloc(u16)->any*
pusht r0 r3
call mem::alloc(u16)->any*
writeitr r0 [#0]
writeitr r0 #0
write r0 #4
sub r0 #2
ret
Vec::push(Vec*,any):
; cap:r0 len:r1 arr:r2
pusht r1 r2
; if vec.len == vec.... |
cc-aegis/amine | 279 | examples/amine_os/mem.s | mem::alloc(u16)->any*:
read r0 mem::HEAP
sub r0 [#-3]
write mem::HEAP r0
ret
mem::free(any*):
ret
mem::copy(any*,any*,u16).loop:
copyitr [#-5] [#-4]
mem::copy(any*,any*,u16):
jrnzdec [#-3] mem::copy(any*,any*,u16).loop
ret
mem::HEAP:
dw #0 |
cc-aegis/amine | 1,520 | examples/amine_os/main.s | start:
mov rs #8000
push BadApple::main()
call thread::spawn(App*)->Thread*
dec rs
add r0 #15
write THREAD_2 r0
write THREAD_2b r0
; call VecTest
call Mode7::main()
exit
dependencies:
include mem.s
include apps/mode7.s
include apps/vec_test.s
include apps/fill_re... |
cc-aegis/amine | 164 | examples/fib/main.s | start:
mov rs STACK
call main()
exit
main():
mov r0 #0
mov r1 #1
.loop:
add r0 r1
dbg r0
add r1 r0
dbg r1
jmp .loop
STACK: |
cc-aegis/amine | 80 | examples/mem/add.s | add(u16,u16)->u16:
mov r0 [#-4]
add r0 [#-3]
ret
include main.s |
cc-aegis/amine | 298 | examples/mem/main.s | mem::alloc(u16)->any*:
read r0 mem::HEAP
sub r0 [#-3]
write mem::HEAP r0
ret
include add.s
mem::free(any*):
ret
mem::copy(any*,any*,u16).loop:
copyitr [#-5] [#-4]
mem::copy(any*,any*,u16):
jrnzdec [#-3] mem::copy(any*,any*,u16).loop
ret
mem::HEAP:
dw #0 |
cc-aegis/amine | 278 | examples/amine_os/apps/fill_red.s | include main.s
FillRed::main():
mov rd #1
ctx #3 #192
.loop0:
ctx #0 #1
mov r0 #128
.loop1:
ctx #1 r0
mov r1 #96
.loop2:
ctx #2 r1
send
jrnzdec r1 .loop2
jrnzdec r0 .loop1
ctx #0 #2
send
call thread::next()
jmp .loop0 |
cc-aegis/amine | 165,492 | examples/amine_os/apps/mode7.s | CAMERA:
CAMERA.x:
dw #0.0
CAMERA.y:
dw #25.0
CAMERA.z:
dw #0.0
CAMERA.r:
dw #0
sin(i16)->f16:
sub [#-3] #16384
cos(i16)->f16:
itof [#-3] [#-3]
fmul [#-3] #0.000015259254737998596
mov r0 [#-3]
fadd r0 #0.25
floor r0
fadd r0 #0.25
fsub [#-3] r0
mov r0 [#-3]
and r0 ... |
cc-aegis/amine | 627 | examples/amine_os/apps/vec_test.s | include vec.s
VecTest:
call Vec::new()->Vec*
mov r1 r0
pusht r1 #1
call Vec::push(Vec*,any)
sub rs #2
pusht r1 #2
call Vec::push(Vec*,any)
sub rs #2
pusht r1 #3
call Vec::push(Vec*,any)
sub rs #2
pusht r1 #4
call Vec::push(Vec*,any)
sub rs #2
pusht r... |
cc-aegis/amine | 529 | examples/amine_os/apps/bad_apple/u8iter.s | ; struct U8Iter { ptr: u8*, curr: u16 }
; curr will NEVER be 0 unless it is explicitly set as nullptr
include mem.s
U8Iter::new(u16*)->U8Iter*:
push #2
call mem::alloc(u16)->any*
writeitr r0 [#-3]
write r0 #nullptr
dec r0
ret
U8Iter::next(U8Iter*)->u8:
push r1
readitr r1 [#-3]
... |
cc-aegis/amine | 138,525 | examples/amine_os/apps/bad_apple/video.s | dw #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #12543 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #65535 #6553... |
cc-aegis/amine | 1,409 | examples/amine_os/apps/bad_apple/main.s | DEVICE_DISPLAY:
dw #1
VIDEO:
include apps/bad_apple/video.s
dw #115 #116 #97 #114 #116 #32 #111 #102 #32 #112 #114 #111 #103 #114 #97 #109
include apps/bad_apple/u8iter.s
include main.s
render_frame(U8Iter*):
pusht r1 r2
pusht r3 r4
read rd DEVICE_DISPLAY
ctx #0 #1
mov r1 #0 ; ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.