carl
This commit is contained in:
81
library/alpha_driver.s
Normal file
81
library/alpha_driver.s
Normal file
@ -0,0 +1,81 @@
|
||||
.file "alpha_driver.c"
|
||||
.text
|
||||
.globl main
|
||||
.type main, @function
|
||||
main:
|
||||
.LFB0:
|
||||
endbr64
|
||||
pushq %rbp
|
||||
movq %rsp, %rbp
|
||||
subq $48, %rsp
|
||||
movl %edi, -36(%rbp)
|
||||
movq %rsi, -48(%rbp)
|
||||
movl $0, -32(%rbp)
|
||||
cmpl $1, -36(%rbp)
|
||||
jle .L2
|
||||
movq -48(%rbp), %rax
|
||||
addq $8, %rax
|
||||
movq (%rax), %rax
|
||||
movq %rax, %rdi
|
||||
call strlen@PLT
|
||||
movl %eax, -32(%rbp)
|
||||
.L2:
|
||||
movl -32(%rbp), %eax
|
||||
cltq
|
||||
addq $4, %rax
|
||||
movq %rax, %rdi
|
||||
call malloc@PLT
|
||||
movq %rax, -16(%rbp)
|
||||
movq -16(%rbp), %rax
|
||||
movq %rax, -24(%rbp)
|
||||
movq -24(%rbp), %rax
|
||||
movl -32(%rbp), %edx
|
||||
movl %edx, (%rax)
|
||||
cmpl $1, -36(%rbp)
|
||||
jle .L3
|
||||
addq $4, -24(%rbp)
|
||||
movq -48(%rbp), %rax
|
||||
movq 8(%rax), %rax
|
||||
movq %rax, -8(%rbp)
|
||||
movl $0, -28(%rbp)
|
||||
jmp .L4
|
||||
.L5:
|
||||
movl -28(%rbp), %eax
|
||||
movslq %eax, %rdx
|
||||
movq -8(%rbp), %rax
|
||||
addq %rdx, %rax
|
||||
movzbl (%rax), %edx
|
||||
movq -24(%rbp), %rax
|
||||
movb %dl, (%rax)
|
||||
addq $1, -24(%rbp)
|
||||
addl $1, -28(%rbp)
|
||||
.L4:
|
||||
movl -28(%rbp), %eax
|
||||
cmpl -32(%rbp), %eax
|
||||
jl .L5
|
||||
.L3:
|
||||
movq -16(%rbp), %rax
|
||||
movq %rax, %rdi
|
||||
call entry@PLT
|
||||
leave
|
||||
ret
|
||||
.LFE0:
|
||||
.size main, .-main
|
||||
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0"
|
||||
.section .note.GNU-stack,"",@progbits
|
||||
.section .note.gnu.property,"a"
|
||||
.align 8
|
||||
.long 1f - 0f
|
||||
.long 4f - 1f
|
||||
.long 5
|
||||
0:
|
||||
.string "GNU"
|
||||
1:
|
||||
.align 8
|
||||
.long 0xc0000002
|
||||
.long 3f - 2f
|
||||
2:
|
||||
.long 0x3
|
||||
3:
|
||||
.align 8
|
||||
4:
|
Reference in New Issue
Block a user