repo_id string | size int64 | file_path string | content string |
|---|---|---|---|
DrSHW/notes | 621 | 书籍/Go语言高级编程/examples/ch3.x/binary_search/binary_search_amd64.s | // Copyright © 2017 ChaiShushan <chaishushan{AT}gmail.com>.
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
TEXT ·BinarySearch+0(SB),$0
start:
MOVQ arr+0(FP), CX
MOVQ len+8(FP), AX
JMP find_index
find_index:
XORQ DX, DX
MOVQ $2, BX
IDIVQ BX
JMP comp
comp:
LEAQ (AX * 8), BX
ADDQ BX, CX
MOV... |
DrSHW/notes | 481 | 书籍/Go语言高级编程/examples/ch3.x/vector/vector_amd64.s | // Copyright © 2017 ChaiShushan <chaishushan{AT}gmail.com>.
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
TEXT ·Find+0(SB),$0
MOVQ $0, SI // zero the iterator
MOVQ vec+0(FP), BX // BX = &vec[0]
MOVQ vec+8(FP), CX // len(vec)
MOVQ num+24(FP), DX
start:
CMPQ SI, CX
JG notfound
CMPQ (... |
DrSHW/notes | 337 | 书籍/Go语言高级编程/examples/ch3.x/vector/sum_amd64.s | // Copyright © 2017 ChaiShushan <chaishushan{AT}gmail.com>.
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
TEXT ·SumVec+0(SB), $0
MOVQ vec1+0(FP), BX // Move the first vector into BX
MOVQ vec2+24(FP), CX // Move the second vector into BX
MOVUPS (BX), X0
MOVUPS (CX), X1
ADDPS X0, X1
MOVUPS X1, re... |
DrSHW/notes | 690 | 书籍/Go语言高级编程/examples/ch3.x/min/min_asm_amd64.s | // Copyright © 2017 ChaiShushan <chaishushan{AT}gmail.com>.
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
#include "textflag.h"
// func AsmMin(a, b int) int
TEXT ·AsmMin(SB), NOSPLIT, $0-24
MOVQ a+0(FP), AX // a
MOVQ b+8(FP), BX // b
CMPQ AX, BX // compare a, b
JGT 3(PC) /... |
DrSHW/notes | 1,225 | 书籍/Go语言高级编程/examples/ch3.x/hello/hello_amd64.s | // Copyright © 2017 ChaiShushan <chaishushan{AT}gmail.com>.
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
#include "textflag.h"
#include "funcdata.h"
// "Hello World!\n"
DATA text<>+0(SB)/8,$"Hello Wo"
DATA text<>+8(SB)/8,$"rld!\n"
GLOBL text<>(SB),NOPTR,$16
// utf8: "你好, 世界!\n"
// hex: e4bda0e5a5... |
DrSHW/notes | 664 | 书籍/Go语言高级编程/examples/ch3.x/add/add_asm_amd64.s | // Copyright © 2017 ChaiShushan <chaishushan{AT}gmail.com>.
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
#include "textflag.h"
// func AsmAdd(a, b int) int
TEXT ·AsmAdd(SB), NOSPLIT, $0-24
MOVQ a+0(FP), AX // a
MOVQ b+8(FP), BX // b
ADDQ AX, BX // a+b
MOVQ BX, ret+16(FP) // return ... |
DrSHW/notes | 931 | 书籍/Go语言高级编程/examples/ch3.x/ifelse/ifelse_ams_amd64.s | // Copyright © 2017 ChaiShushan <chaishushan{AT}gmail.com>.
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
#include "textflag.h"
//
// https://github.com/golang/go/issues/14288
//
// from rsc:
// But expanding what I said yesterday just a bit:
// never use MOVB or MOVW with a register destination,
// ... |
DrSHW/notes | 507 | 书籍/Go语言高级编程/examples/ch3.x/loop/loop_asm_amd64.s | // Copyright © 2017 ChaiShushan <chaishushan{AT}gmail.com>.
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
#include "textflag.h"
// func AsmLoopAdd(cnt, v0, step int) int
TEXT ·AsmLoopAdd(SB), NOSPLIT, $0-32
MOVQ cnt+0(FP), AX // cnt
MOVQ v0+8(FP), BX // v0
MOVQ step+16(FP), CX // step
loop:
... |
DrSHW/notes | 889 | 书籍/Go语言高级编程/examples/ch3.x/instr/instr_amd64.s | // Copyright © 2017 ChaiShushan <chaishushan{AT}gmail.com>.
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
#include "textflag.h"
// func Add2(n, m int64) int32
TEXT ·Add2(SB), NOSPLIT, $0-24
MOVQ n+0(FP), AX
MOVQ m+8(FP), BX
ADDQ AX, BX
MOVQ BX, ret+16(FP)
RET
// func BSF(n int64) int
TEXT ·BSF(... |
DrSHW/notes | 743 | 书籍/Go语言高级编程/examples/ch3.x/globalvar/asm_amd64.s | // Copyright © 2017 ChaiShushan <chaishushan{AT}gmail.com>.
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
#include "textflag.h"
// func GetPkgValue() int
TEXT ·GetPkgValue(SB), NOSPLIT, $0-8
MOVQ ·gopkgValue(SB), AX
MOVQ AX, ret+0(FP)
RET
// func GetPkgInfo() PkgInfo
TEXT ·GetPkgInfo(SB), NOSPLIT... |
DrSHW/notes | 1,252 | 书籍/Go语言高级编程/examples/ch3.x/slice/slice_asm_amd64.s | // Copyright © 2017 ChaiShushan <chaishushan{AT}gmail.com>.
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
#include "textflag.h"
// func AsmSumInt16Slice(v []int16) int16
TEXT ·AsmSumInt16Slice(SB), NOSPLIT, $0-26
MOVQ v_base+0(FP), R8
MOVQ v_len+8(FP), R9
SHLQ $1, R9
ADDQ R8, R9
MOVQ $0, R10
lo... |
duongphannamhung/cool-compiler | 5,447 | examples/hello_world.s | .data
.align 2
.globl class_nameTab
.globl Main_protObj
.globl Int_protObj
.globl String_protObj
.globl bool_const0
.globl bool_const1
.globl _int_tag
.globl _bool_tag
.globl _string_tag
_int_tag:
.word 3
_bool_tag:
.word 4
_string_tag:
.word 5
.globl _MemMgr_INITIALIZER
_MemMgr_INITIALIZER:
.word _NoGC... |
duongphannamhung/cool-compiler | 31,638 | assignments/PA1/stack.s | .data
.align 2
.globl class_nameTab
.globl Main_protObj
.globl Int_protObj
.globl String_protObj
.globl bool_const0
.globl bool_const1
.globl _int_tag
.globl _bool_tag
.globl _string_tag
_int_tag:
.word 4
_bool_tag:
.word 5
_string_tag:
.word 6
.globl _MemMgr_INITIALIZER
_MemMgr_INITIALIZER:
.word _NoGC... |
DVDTSB/cpu6502 | 149 | roms/ascii_test.s |
.org $FF00
DISP = $D012
MAIN:
LDX #$21
STX DISP
LOOP:
INX
STX DISP
CPX #$7E
BEQ QUIT
JMP LOOP
QUIT:
JMP QUIT
|
duysqubix/rubc | 3,712 | assets/cpu_instrs/source/06-ld r,r.s | ; Tests LD r,r ($40-$7F)
;.define PRINT_CHECKSUMS 1
.include "shell.inc"
.include "instr_test.s"
instrs:
.byte $40,0,0 ; LD B,B
.byte $41,0,0 ; LD B,C
.byte $42,0,0 ; LD B,D
.byte $43,0,0 ; LD B,E
.byte $44,0,0 ; LD B,H
.byte $45,0,0 ; LD B,L
.byte $46,0,0 ; LD B,(HL)
... |
duysqubix/rubc | 4,409 | assets/cpu_instrs/source/11-op a,(hl).s | ; Tests (HL/BC/DE) instructions.
; Takes 20 seconds.
;.define PRINT_CHECKSUMS 1
.include "shell.inc"
.include "instr_test.s"
instrs:
.byte $0A,0,0 ; LD A,(BC)
.byte $1A,0,0 ; LD A,(DE)
.byte $02,0,0 ; LD (BC),A
.byte $12,0,0 ; LD (DE),A
.byte $2A,0,0 ; LD A,(HL+)... |
duysqubix/rubc | 1,981 | assets/cpu_instrs/source/03-op sp,hl.s | ; Tests SP/HL instructions
;.define PRINT_CHECKSUMS 1
.include "shell.inc"
.include "instr_test.s"
instrs:
.byte $33,0,0 ; INC SP
.byte $3B,0,0 ; DEC SP
.byte $39,0,0 ; ADD HL,SP
.byte $F9,0,0 ; LD SP,HL
.byte $E8,$01,0 ; ADD SP,1
.byte $E8,$FF,0 ; ADD SP,-1
... |
duysqubix/rubc | 3,131 | assets/cpu_instrs/source/07-jr,jp,call,ret,rst.s | ; Tests branch instructions
;.define PRINT_CHECKSUMS 1
.include "shell.inc"
.include "instr_test.s"
instrs:
; JR cond,skip
; INC A
; skip:
.byte $18,$01,$3C ; JR *+3
.byte $20,$01,$3C ; JR NZ,*+3
.byte $28,$01,$3C ; JR Z,*+3
.byte $30,$01,$3C ; JR NC,*+3
.by... |
duysqubix/rubc | 1,128 | assets/cpu_instrs/source/01-special.s | ; Tests instructions that don't fit template
.include "shell.inc"
main:
set_test 2,"JR negative"
ld a,0
jp jr_neg
inc a
- inc a
inc a
cp 2
jp nz,test_failed
jp +
jr_neg:
jr -
+
set_test 3,"JR positive"
ld a,0
jr +
inc a
+ ... |
duysqubix/rubc | 2,530 | assets/cpu_instrs/source/08-misc instrs.s | ; Tests miscellaneous instructions
;.define PRINT_CHECKSUMS 1
.include "shell.inc"
.include "instr_test.s"
instrs:
.byte $F0,$91,0 ; LDH A,($91)
.byte $E0,$91,0 ; LDH ($91),A
.byte $F2,$00,0 ; LDH A,(C)
.byte $E2,$00,0 ; LDH (C),A
.byte $FA,$91,$FF ; LD A,($FF91)
.byte $EA,... |
duysqubix/rubc | 9,892 | assets/cpu_instrs/source/10-bit ops.s | ; Tests most register instructions.
; Takes 15 seconds.
;.define PRINT_CHECKSUMS 1
.include "shell.inc"
.include "instr_test.s"
instrs:
.byte $CB,$40,0 ; BIT 0,B
.byte $CB,$41,0 ; BIT 0,C
.byte $CB,$42,0 ; BIT 0,D
.byte $CB,$43,0 ; BIT 0,E
.byte $CB,$44,0 ; BIT 0,H
.byte $CB,$45,0 ;... |
duysqubix/rubc | 1,880 | assets/cpu_instrs/source/04-op r,imm.s | ; Tests immediate instructions
;.define PRINT_CHECKSUMS 1
.include "shell.inc"
.include "instr_test.s"
instrs:
.byte $36,0,0 ; LD (HL),$00
.byte $06,0,0 ; LD B,$00
.byte $0E,0,0 ; LD C,$00
.byte $16,0,0 ; LD D,$00
.byte $1E,0,0 ; LD E,$00
.byte $26,0,0 ; LD H,$00
.byte $... |
duysqubix/rubc | 7,694 | assets/cpu_instrs/source/09-op r,r.s | ; Tests most register instructions.
; Takes 10 seconds.
;.define PRINT_CHECKSUMS 1
.include "shell.inc"
.include "instr_test.s"
instrs:
.byte $00,0,0 ; NOP
.byte $2F,0,0 ; CPL
.byte $37,0,0 ; SCF
.byte $3F,0,0 ; CCF
.byte $B0,0,0 ; OR B
.byte $B1,0,0 ; OR C
.byte $B2,0,0 ;... |
duysqubix/rubc | 1,217 | assets/cpu_instrs/source/02-interrupts.s | ; Tests DI, EI, and HALT (STOP proved untestable)
.include "shell.inc"
main:
wreg IE,$04
set_test 2,"EI"
ei
ld bc,0
push bc
pop bc
inc b
wreg IF,$04
interrupt_addr:
dec b
jp nz,test_failed
ld hl,sp-2
ldi a,(hl)
cp <interrupt_addr
... |
duysqubix/rubc | 1,846 | assets/cpu_instrs/source/05-op rp.s | ; Tests BC/DE/HL arithmetic
;.define PRINT_CHECKSUMS 1
.include "shell.inc"
.include "instr_test.s"
instrs:
.byte $0B,0,0 ; DEC BC
.byte $1B,0,0 ; DEC DE
.byte $2B,0,0 ; DEC HL
.byte $03,0,0 ; INC BC
.byte $13,0,0 ; INC DE
.byte $23,0,0 ; INC HL
.b... |
duysqubix/rubc | 1,751 | assets/cpu_instrs/source/common/checksums.s | ; Multiple checksum table handling
.define next_checksum bss+0
.redefine bss bss+2
; If PRINT_CHECKSUMS is defined, checksums are printed
; rather than compared.
; Initializes multiple checksum handler to use checksums
; table (defined by user).
; Preserved: BC, DE, HL
checksums_init:
ld a,<chec... |
duysqubix/rubc | 1,277 | assets/cpu_instrs/source/common/build_rom.s | ; Build as GB ROM
.memoryMap
defaultSlot 0
slot 0 $0000 size $4000
slot 1 $C000 size $4000
.endMe
.romBankSize $4000 ; generates $8000 byte ROM
.romBanks 2
.cartridgeType 1 ; MBC1
.computeChecksum
.computeComplementCheck
;;;; GB ROM header
; GB header read by bootrom
.org $100
nop
... |
duysqubix/rubc | 1,224 | assets/cpu_instrs/source/common/crc.s | ; CRC-32 checksum calculation
.define checksum dp+0 ; little-endian, complemented
.redefine dp dp+4
; Initializes checksum module. Might initialize tables
; in the future.
init_crc:
jr reset_crc
; Clears CRC
; Preserved: BC, DE, HL
reset_crc:
ld a,$FF
sta checksum+0
sta checksum... |
duysqubix/rubc | 1,777 | assets/cpu_instrs/source/common/printing.s | ; Main printing routine that checksums and
; prints to output device
; Character that does equivalent of print_newline
.define newline 10
; Prints char without updating checksum
; Preserved: BC, DE, HL
.define print_char_nocrc bss
.redefine bss bss+3
; Initializes printing. HL = print routine
init_printi... |
duysqubix/rubc | 1,941 | assets/cpu_instrs/source/common/build_gbs.s | ; Build as GBS music file
.memoryMap
defaultSlot 0
slot 0 $3000 size $1000
slot 1 $C000 size $1000
.endMe
.romBankSize $1000
.romBanks 2
;;;; GBS music file header
.byte "GBS"
.byte 1 ; vers
.byte 1 ; songs
.byte 1 ; first song
.word load_addr
.word reset
.word gbs_play
.word st... |
duysqubix/rubc | 1,579 | assets/cpu_instrs/source/common/crc_fast.s | ; Fast table-based CRC-32
.define crc_tables (bss+$FF)&$FF00 ; 256-byte aligned
.redefine bss crc_tables+$400
; Initializes fast CRC tables and resets checksum.
; Time: 47 msec
init_crc_fast:
ld l,0
@next:
xor a
ld c,a
ld d,a
ld e,l
ld h,8
- rra
rr c
... |
duysqubix/rubc | 3,011 | assets/cpu_instrs/source/common/testing.s | ; Diagnostic and testing utilities
.define result bss+0
.define test_name bss+1
.redefine bss bss+3
; Sets test code and optional error text
; Preserved: AF, BC, DE, HL
.macro set_test ; code[,text[,text2]]
push hl
call set_test_
jr @set_test\@
.byte \1
.if NARGS > 1
... |
duysqubix/rubc | 4,343 | assets/cpu_instrs/source/common/apu.s | ; Sound chip utilities
; Turns APU off
; Preserved: BC, DE, HL
sound_off:
wreg NR52,0
ret
; Turns APU on
; Preserved: BC, DE, HL
sound_on:
wreg NR52,$80 ; power
wreg NR51,$FF ; mono
wreg NR50,$77 ; volume
ret
; Synchronizes to APU length counter within
; tens of clocks. Uses square... |
duysqubix/rubc | 5,856 | assets/cpu_instrs/source/common/delay.s | ; Delays in cycles, milliseconds, etc.
; All routines are re-entrant (no global data). Routines never
; touch BC, DE, or HL registers. These ASSUME CPU is at normal
; speed. If running at double speed, msec/usec delays are half advertised.
; Delays n cycles, from 0 to 16777215
; Preserved: AF, BC, DE, HL
.macro delay... |
duysqubix/rubc | 5,377 | assets/cpu_instrs/source/common/console.s | ; Scrolling text console
; Console is 20x18 characters. Buffers lines, so
; output doesn't appear until a newline or flush.
; If scrolling isn't supported (i.e. SCY is treated
; as if always zero), the first 18 lines will
; still print properly). Also works properly if
; LY isn't supported (always reads back as the sa... |
duysqubix/rubc | 1,035 | assets/cpu_instrs/source/common/cpu_speed.s | ; CPU speed manipulation.
; Switches to normal speed. No effect on DMG.
; Preserved: BC, DE, HL
cpu_norm:
; Do nothing if not CGB
ld a,(gb_id)
and gb_id_cgb
ret z
lda KEY1
rlca
ret nc
jr cpu_speed_toggle
; Switches to double speed. No effect on DMG.
; Preserved: ... |
duysqubix/rubc | 2,793 | assets/cpu_instrs/source/common/runtime.s | ; Common routines and runtime
; Must be defined by target-specific runtime:
;
; init_runtime: ; target-specific inits
; std_print: ; default routine to print char A
; post_exit: ; called at end of std_exit
; report_byte: ; report A to user
.define RUNTIME_INCLUDED 1
.ifndef bss
; address ... |
duysqubix/rubc | 2,575 | assets/cpu_instrs/source/common/numbers.s | ; Printing of numeric values
; Prints value of indicated register/pair
; as 2/4 hex digits, followed by a space.
; Updates checksum with printed values.
; Preserved: AF, BC, DE, HL
print_regs:
call print_af
call print_bc
call print_de
call print_hl
call print_newline
ret
print_a:
p... |
duysqubix/rubc | 1,783 | assets/cpu_instrs/source/common/instr_test.s | ; Framework for CPU instruction tests
; Calls test_instr with each instruction copied
; to instr, with a JP instr_done after it.
; Verifies checksum after testing instruction and
; prints opcode if it's wrong.
.include "checksums.s"
.include "cpu_speed.s"
.include "apu.s"
.include "crc_fast.s"
.define instr $DEF8
.d... |
duysqubix/rubc | 432 | assets/cpu_instrs/source/common/multi_custom.s | ; RST handlers
.bank 0 slot 0
.org 0
inc a
ret
.ds 6,0
inc a
ret
.ds 6,0
inc a
ret
.ds 6,0
inc a
ret
.ds 6,0
inc a
ret
.ds 6,0
inc a
ret
.ds 6,0
inc a
ret
.ds 6,0
inc a
ret
.ds 6,0
inc a... |
dvogel/jitcalc | 57 | ex/incr.s | .intel_syntax noprefix
inc:
inc eax
add:
add eax, 1
|
dvogel/jitcalc | 57 | ex/decr.s | .intel_syntax noprefix
dec:
dec eax
sub:
sub eax, 1
|
dvogel/jitcalc | 45 | ex/xor.s | .intel_syntax noprefix
xor:
xor eax, eax
|
dvogel/jitcalc | 55 | ex/call.s | .intel_syntax noprefix
main:
call func
func:
ret
|
dvogel/jitcalc | 47 | ex/mov.s | .intel_syntax noprefix
mov:
mov rcx, 0x02
|
dvogel/jitcalc | 87 | ex/muldiv.s | .intel_syntax noprefix
mul:
mov rcx, 0x02
imul rcx
div:
mov rcx, 0x02
idiv rcx
|
ejit-org/ejit-compiler | 147,491 | asm-test/all-and.s | # generate all ands opcodes.
.text
.word 0xf2000000
.word 0xf2000400
.word 0xf2000800
.word 0xf2000c00
.word 0xf2001000
.word 0xf2001400
.word 0xf2001800
.word 0xf2001c00
.word 0xf2002000
.word 0xf2002400
.word 0xf2002800
.word 0xf2002c00
.word 0xf2003000
.word 0xf2003400
.word 0xf2003800
.word 0xf2003c... |
ejit-org/ejit-compiler | 914 | asm-test/aarch64.s | .text
adds x0, x0, x0
subs x0, x0, x0
adcs x0, x0, x0
sbcs x0, x0, x0
ands x0, x0, x0
orr x0, x0, x0
eor x0, x0, x0
mul x0, x0, x0
udiv x0, x0, x0
sdiv x0, x0, x0
lsl x0, x0, x0
lsr x0, x0, x0
asr x0, x0, x0
ldr x0, rel
rel: add x0, x0, x0
adds x0, x0,... |
eightchip/Fast_Merge_Excel | 15,150 | umya-spreadsheet/zstd-sys/zstd/lib/decompress/huf_decompress_amd64.S | /*
* Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved.
*
* This source code is licensed under both the BSD-style license (found in the
* LICENSE file in the root directory of this source tree) and the GPLv2 (found
* in the COPYING file in the root directory of this source tree).
* You may... |
eightchip/Fast_Merge_Excel | 3,647 | umya-spreadsheet/rustix-0.37.28/src/backend/linux_raw/arch/outline/x86_64.s | // Assembly code for making x86-64 syscalls.
//
// x86-64 syscall argument register ordering is the same as the x86-64
// userspace argument register ordering except that a3 is passed in r10
// instead of rcx, and the syscall number (nr) is passed in eax.
//
// outline.rs takes care of reordering the nr argument to the... |
eightchip/Fast_Merge_Excel | 3,423 | umya-spreadsheet/rustix-0.37.28/src/backend/linux_raw/arch/outline/riscv64.s | # Assembly code for making riscv64 syscalls.
#
# riscv64 syscall argument register ordering is the same as the riscv64
# userspace argument register ordering except that the syscall number
# (nr) is passed in a7.
#
# nr_last.rs takes care of reordering the nr argument to the end for us,
# so we only need to move nr int... |
eightchip/Fast_Merge_Excel | 6,415 | umya-spreadsheet/rustix-0.37.28/src/backend/linux_raw/arch/outline/mips.s | # Assembly code for making mips64 syscalls.
#
# mips64 syscall argument register ordering is the same as the mips64
# userspace argument register ordering except that the syscall number
# (nr) is passed in v0.
#
# outline.rs takes care of reordering the nr argument to the end for us,
# so we only need to move nr into v... |
eightchip/Fast_Merge_Excel | 3,979 | umya-spreadsheet/rustix-0.37.28/src/backend/linux_raw/arch/outline/arm.s | // Assembly code for making arm syscalls.
//
// arm syscall argument register ordering is the similar to the arm
// userspace argument register ordering except that the syscall number
// (nr) is passed in r7.
//
// nr_last.rs takes care of reordering the nr argument to the end for us,
// so we only need to move nr into... |
eightchip/Fast_Merge_Excel | 12,301 | umya-spreadsheet/rustix-0.37.28/src/backend/linux_raw/arch/outline/x86.s | // Assembly code for making x86 syscalls.
//
// On x86 we use the "fastcall" convention which passes the first two
// arguments in ecx and edx. Outline.rs reorders the arguments to put
// a1 and a2 in those registers so they we don't have to move them to
// set up the kernel convention.
//
// "fastcall" expects callee ... |
eightchip/Fast_Merge_Excel | 5,751 | umya-spreadsheet/rustix-0.37.28/src/backend/linux_raw/arch/outline/mips64.s | # Assembly code for making mips64 syscalls.
#
# mips64 syscall argument register ordering is the same as the mips64
# userspace argument register ordering except that the syscall number
# (nr) is passed in v0.
#
# outline.rs takes care of reordering the nr argument to the end for us,
# so we only need to move nr into v... |
eightchip/Fast_Merge_Excel | 3,525 | umya-spreadsheet/rustix-0.37.28/src/backend/linux_raw/arch/outline/aarch64.s | // Assembly code for making aarch64 syscalls.
//
// aarch64 syscall argument register ordering is the same as the aarch64
// userspace argument register ordering except that the syscall number
// (nr) is passed in w8.
//
// outline.rs takes care of reordering the nr argument to the end for us,
// so we only need to mov... |
eightchip/Fast_Merge_Excel | 3,592 | umya-spreadsheet/rustix-0.37.28/src/backend/linux_raw/arch/outline/powerpc64.s | # Assembly code for making powerpc64le syscalls.
#
# powerpc64le syscall argument register ordering is the same as the
# powerpc64le userspace argument register ordering except that the syscall
# number (nr) is passed in r0.
#
# outline.rs takes care of reordering the nr argument to the end for us,
# so we only need to... |
el-ev/rvos | 49 | user_c/entry.S | .section .text
.globl _start
_start:
j main
|
el-ev/rvos | 2,168 | kernel/src/trap/trap.S | .macro SAVE reg, off
sd \reg, \off*8(a0)
.endm
.macro LOAD reg, off
ld \reg, \off*8(a0)
.endm
.globl _kernel_to_user
.type _kernel_to_user, @function
.align 3
_kernel_to_user:
SAVE s0, 34
SAVE s1, 35
SAVE s2, 36
SAVE s3, 37
SAVE s4, 38
SAVE s5, 39
SAVE s6, 40
SAVE ... |
EmbeddedKC/RustEKC | 2,458 | tools/fw_jump/start.S | /*
* FreeRTOS V202212.00
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including ... |
EmbeddedKC/RustEKC | 3,326 | codes/arch/allwinner_D1H/src/nk_gate.S |
.altmacro
.macro SAVE_REGISTER n
sd x\n, \n*8(sp)
.endm
.macro LOAD_REGISTER n
ld x\n, \n*8(sp)
.endm
.macro SAVE_REGISTER2 n o
sd x\n, \o*8+\n*8(x28)
.endm
.macro LOAD_REGISTER2 n o
ld x\n, \o*8+\n*8(x28)
.endm
.section .text.nktrampoline
.globl nk_entry
# 入参 x10 nkapi handler
# 入参 x11~... |
EmbeddedKC/RustEKC | 268 | codes/arch/allwinner_D1H/src/top.S | .altmacro
.macro PROXYCONTEXT n
li \n, -0x3000
.endm
.altmacro
.macro MMKAPI_TABLE n
li \n, -0x3000+0x800
.endm
.altmacro
.macro CONFIG_DATA n
li \n, -0x3000+0x400
.endm
.include "src/nk_gate.S"
.include "src/trap/trap.S"
.include "src/trap/trap_signal.S" |
EmbeddedKC/RustEKC | 3,824 | codes/arch/allwinner_D1H/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
.macro ENTRY_GATE n
li \n, -0x1000
.endm
.macro TRAP_CONTEXT n
li \n, 0xffffe
sll \n, \n, 12
.endm
# note that it break the context of t0~t6.
.macro REG_INFO
mv x31, x17
mv x30, x10
li x17, 9
... |
EmbeddedKC/RustEKC | 170 | codes/arch/allwinner_D1H/src/trap/trap_signal.S | .altmacro
.section .text.signaltrampoline
.globl __signal_trampoline
.align 2
__signal_trampoline:
# ecall sys_sigreturn
addi a7, zero, 139
ecall
|
EmbeddedKC/RustEKC | 1,583 | codes/arch/qemu_virt_armv7/src/trap/trap.S | .macro INVALID_EXCP, kind, source
.p2align 7
LDR r8, =-0x2200
MOV sp, r8
SAVE_REGS
mov r0, sp
mov r1, #\kind
mov r2, #\source
bl invalid_exception
# bl: branch to addr, and save pc+4 to lr(x30). like jal.
b .Lexception_return
.endm
.macro HANDLE_SYNC
.p2align... |
EmbeddedKC/RustEKC | 170 | codes/arch/qemu_virt_armv7/src/trap/trap_signal.S | .altmacro
.section .text.signaltrampoline
.globl __signal_trampoline
.align 2
__signal_trampoline:
# ecall sys_sigreturn
addi a7, zero, 139
ecall
|
EmbeddedKC/RustEKC | 1,832 | codes/arch/qemu_virt_armv7/src/asm/entry.S | .equ MODE_USR, 0x10 // User mode
.equ MODE_FIQ, 0x11 // FIQ mode
.equ MODE_IRQ, 0x12 // IRQ mode
.equ MODE_SVC, 0x13 // Supervisor mode (系统调用进入内核的模式)
.equ MODE_ABT, 0x17 // Abort mode
.equ MODE_UND, 0x1B // Undefined instruction mode
.equ MODE_SYS, 0x1F // System ... |
EmbeddedKC/RustEKC | 3,448 | codes/arch/qemu_virt_armv7/src/asm/nk_gate.S | .section .text.nktrampoline
.globl nk_gate
# 入参 r10 nkapi handler
# 入参 r11~r15 params
# 结构
# #####################################
# 高地址
# 维护: outer satp
# 加载: nk satp
# 加载: outer register (0, 1, ......, 31)
# 保存:nk register (0, 1, ......, 31)
# 低地址
# ######################... |
EmbeddedKC/RustEKC | 1,681 | codes/arch/qemu_virt_armv7/src/asm/top.S | #define USIZE_WIDTH 4
#define USIZE_BIT 2
// PROXYCONTEXT.
.equ PROXY_EKC_REGS, (0*USIZE_WIDTH)
.equ PROXY_EKC_SP, (13*USIZE_WIDTH)
.equ PROXY_OS_REGS, (32*USIZE_WIDTH)
.equ PROXY_OS_SP, ((32+13)*USIZE_WIDTH)
.equ PROXY_EKC_SATP, (64*USIZE_WIDTH)
.equ PROXY_OS_SATP, (65*USIZE_W... |
EmbeddedKC/RustEKC | 511 | codes/arch/qemu_virt_armv7/src/asm/cpu.S | .macro return
bx LR
.endm
.globl cpu_time
cpu_time:
MRC p15, 0, r0, c14, c0, 2
return
.globl cpu_id
cpu_id:
MRC p15, 0, r0, c0, c0, 5
return
.globl cpu_freq
cpu_freq:
MRC p15, 0, r0, c14, c0, 0
return
.globl cpu_sync
cpu_sync:
dsb ish
isb
return
.globl write_root_pt
writ... |
EmbeddedKC/RustEKC | 3,963 | codes/arch/qemu_vexpressa9_armv7/src/trap/trap_autoSVC.S | .section .text
////////////////////////////
// Assuming that OS has initialized all the stack pointer.
////////////////////////////
// FIXME:
// This macro would save all the context from user, but:
// the trap handler cannot see the correct value of lr and r10 of user!
// correct: the lr shift
.macro IRQ_TO_SVC c ... |
EmbeddedKC/RustEKC | 2,638 | codes/arch/qemu_vexpressa9_armv7/src/trap/trap.S | .section .text
////////////////////////////
// Assuming that OS has initialized all the stack pointer.
////////////////////////////
// Require IRQ: sp point to a small memory space.
.macro RECORD_IRQ a
str r0, [sp, #0]
str r7, [sp, #4]
str r8, [sp, #8]
mov r8, #\a
.endm
.macro RESTORE_IRQ... |
EmbeddedKC/RustEKC | 142 | codes/arch/qemu_vexpressa9_armv7/src/trap/trap_signal.S | .section .text
.align 12
.globl ssignaltrampoline;
ssignaltrampoline:
# ecall sys_sigreturn
mov r7, #139
svc 0
.align 12 |
EmbeddedKC/RustEKC | 1,880 | codes/arch/qemu_vexpressa9_armv7/src/asm/entry.S | .equ MODE_USR, 0x10 // User mode
.equ MODE_FIQ, 0x11 // FIQ mode
.equ MODE_IRQ, 0x12 // IRQ mode
.equ MODE_SVC, 0x13 // Supervisor mode (系统调用进入内核的模式)
.equ MODE_ABT, 0x17 // Abort mode
.equ MODE_UND, 0x1B // Undefined instruction mode
.equ MODE_SYS, 0x1F // System ... |
EmbeddedKC/RustEKC | 3,773 | codes/arch/qemu_vexpressa9_armv7/src/asm/nk_gate.S | .section .text
# 入参 r10 nkapi handler
# 入参 r11~r15 params
# 结构
# #####################################
# 高地址
# 维护: outer satp
# 加载: nk satp
# 加载: outer register (0, 1, ......, 31)
# 保存:nk register (0, 1, ......, 31)
# 低地址
# #####################################
.align 12
.g... |
EmbeddedKC/RustEKC | 1,464 | codes/arch/qemu_vexpressa9_armv7/src/asm/top.S | #define USIZE_WIDTH 4
#define USIZE_BIT 2
// PROXYCONTEXT.
.equ PROXY_EKC_REGS, (0*USIZE_WIDTH)
.equ PROXY_EKC_SP, (13*USIZE_WIDTH)
.equ PROXY_OS_REGS, (32*USIZE_WIDTH)
.equ PROXY_OS_SP, ((32+13)*USIZE_WIDTH)
.equ PROXY_EKC_SATP, (64*USIZE_WIDTH)
.equ PROXY_OS_SATP, (65*USIZE_W... |
EmbeddedKC/RustEKC | 736 | codes/arch/qemu_vexpressa9_armv7/src/asm/cpu.S | .macro return
bx LR
.endm
.macro WRITE_ROOT_PT n
MCR p15, 0, \n, c2, c0, 0
MCR p15, 0, \n, c2, c0, 1
.endm
.macro ENABIE_INTR
CPSIE I
CPSIE F
.endm
.macro DISABIE_INTR
CPSID I
CPSID F
.endm
.globl cpu_time
cpu_time:
MRC p15, 0, r0, c14, c0, 2
return
.globl cpu_id
cpu_id:... |
EmbeddedKC/RustEKC | 3,458 | codes/arch/qemu_virt_aarch64/src/nk_gate.S | .section .text.nktrampoline
.globl nk_gate
# 入参 x10 nkapi handler
# 入参 x11~x15 params
# 结构
# #####################################
# 高地址
# 维护: outer satp
# 加载: nk satp
# 加载: outer register (0, 1, ......, 31)
# 保存:nk register (0, 1, ......, 31)
# 低地址
# ######################... |
EmbeddedKC/RustEKC | 1,404 | codes/arch/qemu_virt_aarch64/src/top.S | .altmacro
.macro PROXYCONTEXT n
MOV \n, -0x3000
.endm
.altmacro
.macro MMKAPI_TABLE n
MOV \n, -0x3000+0x800
.endm
.altmacro
.macro CONFIG_DATA n
MOV \n, -0x3000+0x400
.endm
.altmacro
.macro SAVE_STACK r s
STR x\r, [\s, #\r*8]
.endm
.macro LOAD_STACK r s
LDR x\r, [\s, #\r*8]
.endm
.macro SAVE_CTX_... |
EmbeddedKC/RustEKC | 274 | codes/arch/qemu_virt_aarch64/src/cpu.S | .macro return
br x30
.endm
.globl cpu_time
cpu_time:
mrs x0, cntvct_el0
return
.globl cpu_id
cpu_id:
mrs x0, mpidr_el1
return
.globl cpu_freq
cpu_freq:
mrs x0, cntfrq_el0
return
.globl cpu_sync
cpu_sync:
dsb ish
isb
return
|
EmbeddedKC/RustEKC | 3,420 | codes/arch/qemu_virt_aarch64/src/trap/trap.S | ###########################
# TODO: This module is not finished.
# It should be put into .text.trampoline with delegation.
##########################
.macro SAVE_REGS
sub sp, sp, 34 * 8
stp x0, x1, [sp]
stp x2, x3, [sp, 2 * 8]
stp x4, x5, [sp, 4 * 8]
stp x6, x7, [sp, 6 * 8]
... |
EmbeddedKC/RustEKC | 170 | codes/arch/qemu_virt_aarch64/src/trap/trap_signal.S | .altmacro
.section .text.signaltrampoline
.globl __signal_trampoline
.align 2
__signal_trampoline:
# ecall sys_sigreturn
addi a7, zero, 139
ecall
|
EmbeddedKC/RustEKC | 3,515 | codes/arch/qemu_virt_riscv64/src/nk_gate.S |
.altmacro
.macro SAVE_REGISTER n
sd x\n, \n*8(sp)
.endm
.macro LOAD_REGISTER n
ld x\n, \n*8(sp)
.endm
.macro SAVE_REGISTER2 n o
sd x\n, \o*8+\n*8(x28)
.endm
.macro LOAD_REGISTER2 n o
ld x\n, \o*8+\n*8(x28)
.endm
.section .text.nktrampoline
.globl nk_entry
# 入参 x10 nkapi handler
# 入参 x11~... |
EmbeddedKC/RustEKC | 268 | codes/arch/qemu_virt_riscv64/src/top.S | .altmacro
.macro PROXYCONTEXT n
li \n, -0x3000
.endm
.altmacro
.macro MMKAPI_TABLE n
li \n, -0x3000+0x800
.endm
.altmacro
.macro CONFIG_DATA n
li \n, -0x3000+0x400
.endm
.include "src/nk_gate.S"
.include "src/trap/trap.S"
.include "src/trap/trap_signal.S" |
EmbeddedKC/RustEKC | 3,782 | codes/arch/qemu_virt_riscv64/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
.macro ENTRY_GATE n
li \n, -0x1000
.endm
.macro TRAP_CONTEXT n
li \n, 0xffffe
sll \n, \n, 12
.endm
# note that it break the context of t0~t6.
.macro REG_INFO
mv x31, x17
mv x30, x10
li x17, 9
... |
EmbeddedKC/RustEKC | 170 | codes/arch/qemu_virt_riscv64/src/trap/trap_signal.S | .altmacro
.section .text.signaltrampoline
.globl __signal_trampoline
.align 2
__signal_trampoline:
# ecall sys_sigreturn
addi a7, zero, 139
ecall
|
EmbeddedKC/RustEKC | 3,326 | codes/arch/k210/src/nk_gate.S |
.altmacro
.macro SAVE_REGISTER n
sd x\n, \n*8(sp)
.endm
.macro LOAD_REGISTER n
ld x\n, \n*8(sp)
.endm
.macro SAVE_REGISTER2 n o
sd x\n, \o*8+\n*8(x28)
.endm
.macro LOAD_REGISTER2 n o
ld x\n, \o*8+\n*8(x28)
.endm
.section .text.nktrampoline
.globl nk_entry
# 入参 x10 nkapi handler
# 入参 x11~... |
EmbeddedKC/RustEKC | 268 | codes/arch/k210/src/top.S | .altmacro
.macro PROXYCONTEXT n
li \n, -0x3000
.endm
.altmacro
.macro MMKAPI_TABLE n
li \n, -0x3000+0x800
.endm
.altmacro
.macro CONFIG_DATA n
li \n, -0x3000+0x400
.endm
.include "src/nk_gate.S"
.include "src/trap/trap.S"
.include "src/trap/trap_signal.S" |
EmbeddedKC/RustEKC | 3,835 | codes/arch/k210/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
.macro ENTRY_GATE n
li \n, -0x1000
.endm
.macro TRAP_CONTEXT n
li \n, 0xffffe
sll \n, \n, 12
.endm
# note that it break the context of t0~t6.
.macro REG_INFO
mv x31, x17
mv x30, x10
li x17, 9
... |
EmbeddedKC/RustEKC | 170 | codes/arch/k210/src/trap/trap_signal.S | .altmacro
.section .text.signaltrampoline
.globl __signal_trampoline
.align 2
__signal_trampoline:
# ecall sys_sigreturn
addi a7, zero, 139
ecall
|
EmbeddedKC/RustEKC | 3,233 | codes/arch/raspberry_pi4/src/nk_gate.S | .section .text.nktrampoline
.globl nk_gate
# 入参 x10 nkapi handler
# 入参 x11~x15 params
# 结构
# #####################################
# 高地址
# 维护: outer satp
# 加载: nk satp
# 加载: outer register (0, 1, ......, 31)
# 保存:nk register (0, 1, ......, 31)
# 低地址
# ######################... |
EmbeddedKC/RustEKC | 1,592 | codes/arch/raspberry_pi4/src/top.S | .altmacro
.macro PROXYCONTEXT n
MOV \n, -0x3000
.endm
.altmacro
.macro MMKAPI_TABLE n
MOV \n, -0x3000+0x800
.endm
.altmacro
.macro CONFIG_DATA n
MOV \n, -0x3000+0x400
.endm
.altmacro
.macro SAVE_STACK r s
STR x\r, [\s, #\r*8]
.endm
.macro LOAD_STACK r s
LDR x\r, [\s, #\r*8]
.endm
.macro UPDATE_PT... |
EmbeddedKC/RustEKC | 274 | codes/arch/raspberry_pi4/src/cpu.S | .macro return
br x30
.endm
.globl cpu_time
cpu_time:
mrs x0, cntvct_el0
return
.globl cpu_id
cpu_id:
mrs x0, mpidr_el1
return
.globl cpu_freq
cpu_freq:
mrs x0, cntfrq_el0
return
.globl cpu_sync
cpu_sync:
dsb ish
isb
return
|
EmbeddedKC/RustEKC | 3,265 | codes/arch/raspberry_pi4/src/trap/trap.S | .macro SAVE_REGS
sub sp, sp, 34 * 8
stp x0, x1, [sp]
stp x2, x3, [sp, 2 * 8]
stp x4, x5, [sp, 4 * 8]
stp x6, x7, [sp, 6 * 8]
stp x8, x9, [sp, 8 * 8]
stp x10, x11, [sp, 10 * 8]
stp x12, x13, [sp, 12 * 8]
stp x14, x15, [sp, 14 * 8]
stp x16, x... |
EmbeddedKC/RustEKC | 170 | codes/arch/raspberry_pi4/src/trap/trap_signal.S | .altmacro
.section .text.signaltrampoline
.globl __signal_trampoline
.align 2
__signal_trampoline:
# ecall sys_sigreturn
addi a7, zero, 139
ecall
|
emtee40/Subaru-nisutils | 2,317 | tests/test1.s | ! copyright (c) fenugrec 2018
!
! Various pathological code patterns to test nislib sh_track_reg etc.
.section .text.test1,"ax",@progbits
.global test_main
.type test_main, @function
.BALIGN 2
test_main:
! initial garbage to simulate non-code stuff. IVT, data, etc.
.word 0
.word 0xCACA
.word 0xFFFF
.word 0x7... |
emtee40/Subaru-npkern-ssmedit | 1,377 | start_ssm.s | ! For Subaru ECUs.
! Apparently they're always loaded at a fixed address in RAM : no need to move the payload
! TODO : remove auto-copy; make sure entry point is correct vs .ld file
! (c) copyright fenugrec 2022
! GPLv3
!
! This program is free software: you can redistribute it and/or modify
! it under the terms of t... |
emtee40/Subaru-npkern-ssmedit | 2,262 | start_705x.s | ! based on KPIT GNUSH
! This moves the whole payload up to the desired address,
! (c) copyright fenugrec 2016
! GPLv3
!
! This program is free software: you can redistribute it and/or modify
! it under the terms of the GNU General Public License as published by
! the Free Software Foundation, either version 3 of the ... |
encapfn/encapfn-tock | 3,160 | encapfn-tock/encapfn_c_rt/init_riscv32.S | /* encapfn_rtheader is defined by the service linker script (encapfn_layout.ld).
* It has the following layout:
*
* Field | Offset
* ------------------------------------
* Start of .data in flash | 0
* Size of .data | 4
* Start of .data in RAM... |
engomondiii/Biometric_Attendance | 8,955 | Python-3.10.0/Modules/_ctypes/libffi_osx/x86/x86-darwin.S | #ifdef __i386__
/* -----------------------------------------------------------------------
darwin.S - Copyright (c) 1996, 1998, 2001, 2002, 2003 Red Hat, Inc.
X86 Foreign Function Interface
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated do... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.