herrDeng網內搜尋

自訂搜尋

Ads

2017年12月12日 星期二

ex10 使用Blocky技術寫C程式並於linux GCC環境下編譯成組合語言

程式碼中至少要有分支如if, for, while等,需有

  • C code
  • Assembly Code


61 則留言:

B10633105 劉晉良 提到...

.file "steven.c"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $0, %eax
popq %rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits

B10633105 劉晉良 提到...

.file "steven.c"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $0, %eax
popq %rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits

b10624024 提到...

#include
int main(){
int a,c,f ;
double b,e,g ;
b=g=e=0 ;
scanf("%d",&a) ;

for(c=1;c<=a;c=c+2){
b=1.0/c ;
e=e+b ;
}
for(f=2;f<=a;f=f+2){
g=1.0/f ;
e=e-g ;
}
printf ("%6f\n",e);
return 0;
}

B10633103游皓翔 提到...

#include

int gcd(int x, int y);

int main(int argc, char** argv){
printf("gcd=%d\n", gcd(123456789,987654321));
return 0;
}

int gcd(int x, int y){

int r = x % y;
if (r == 0) {
return y;
}
return gcd(y, r);
}

B10633079劉佩儒 提到...

#include

int gcd(int x, int y);

int main(int argc, char** argv){
printf("gcd=%d\n", gcd(123456789,987654321));
return 0;
}

int gcd(int x, int y){

int r = x % y;
if (r == 0) {
return y;
}
return gcd(y, r);
}

A10633020 陳俐婷 提到...

1.
#include <stdio.h>

int gcd(int x , int y);

int main(int argc, char** argv){
printf("gcd=%d\n",gcd(123456789,987654321));
return 0;
}

int gcd(int x,int y){

int r = x % y ;
if (r == 0){
return y;
}
return gcd(y,r);
}



2.
.file "gcd.c"
.section .rodata
.LC0:
.string "gcd=%d\n"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $16, %rsp
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $987654321, %esi
movl $123456789, %edi
call gcd
movl %eax, %esi
movl $.LC0, %edi
movl $0, %eax
call printf
movl $0, %eax
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits

A10633022 黃皓銘 提到...

1.
#include <stdio.h>

int gcd(int x, int y);

int main(int argc, char** argv){
printf("gcd=%d\n", gcd(123456789,987654321));
return 0;
}

int gcd(int x, int y){

int r = x % y;
if (r == 0){
return y;
}
return gcd(y,r);
}

2.
.file "gcd.c"
.section .rodata
.LC0:
.string "gcd=%d\n"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $16, %rsp
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $987654321, %esi
movl $123456789, %edi
call gcd
movl %eax, %esi
movl $.LC0, %edi
movl $0, %eax
call printf
movl $0, %eax
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits

B10633104 王湘柔 提到...

.file "fuck.c"
.section .rodata
.LC0:
.string "gcd=%d\n"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $16, %rsp
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $987654321, %esi
movl $123456789, %edi
call gcd
movl %eax, %esi
movl $.LC0, %edi
movl $0, %eax
call printf
movl $0, %eax
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits

b10633091 楊子安 提到...

C語言
#include <stdio.h>

int gcd(int x, int y);

int main(int argc, char** argv){
printf("gcd=%d\n", gcd(123456789,987654321));
return 0;
}

int gcd(int x, int y){

int r = x % y;
if (r == 0) {
return y;
}
return gcd(y, r);
}
組合語言
.file "GCD.c"
.section .rodata
.LC0:
.string "gcd=%d\n"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $16, %rsp
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $987654321, %esi
movl $123456789, %edi
call gcd
movl %eax, %esi
movl $.LC0, %edi
movl $0, %eax
call printf
movl $0, %eax
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609"
.section .note.GNU-stack,"",@progbits

B10633092 李延中 提到...

.file "wocow.c"
.section .rodata
.LC0:
.string "gcd=%d\n"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $16, %rsp
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $987654321, %esi
movl $123456789, %edi
call gcd
movl %eax, %esi
movl $.LC0, %edi
movl $0, %eax
call printf
movl $0, %eax
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits

B10633079劉佩儒 提到...

#include

int gcd(int x, int y);

int main(int argc, char** argv){
printf("gcd=%d\n", gcd(123456789,987654321));
return 0;
}

int gcd(int x, int y){

int r = x % y;
if (r == 0) {
return y;
}
return gcd(y, r);
}

B10633065 吳佳璇 提到...

.file "GCD.c"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $0, %eax
popq %rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits

b10633099 廖玟涵 提到...

.file "sexygirl.c"
.section .rodata
.LC0:
.string "gcd=%d\n"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $16, %rsp
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $987654321, %esi
movl $123456789, %edi
call gcd
movl %eax, %esi
movl $.LC0, %edi
movl $0, %eax
call printf
movl $0, %eax
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits

B10633063 黃彥菱 提到...

.file "hahaha.c"
.section .rodata
.LC0:
.string "gcd=%d\n"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $16, %rsp
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $987654321, %esi
movl $123456789, %edi
call gcd
movl %eax, %esi
movl $.LC0, %edi
movl $0, %eax
call printf
movl $0, %eax
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits

B10633084 彭玟寧 提到...

.file "yaya.c"
.section .rodata
.LC0:
.string "gcd=%d\n"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $16, %rsp
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $987654321, %esi
movl $123456789, %edi
call gcd
movl %eax, %esi
movl $.LC0, %edi
movl $0, %eax
call printf
movl $0, %eax
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits

B10633085 吳旭誠 提到...

.file "Daishablue.c"
.section .rodata
.LC0:
.string "gcd=%d\n"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $16, %rsp
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $987654321, %esi
movl $123456789, %edi
call gcd
movl %eax, %esi
movl $.LC0, %edi
movl $0, %eax
call printf
movl $0, %eax
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits

B10633106 莊子捷 提到...

.file "GGWP.c"
.section .rodata
.LC0:
.string "gcd=%d\n"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $16, %rsp
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $987654321, %esi
movl $123456789, %edi
call gcd
movl %eax, %esi
movl $.LC0, %edi
movl $0, %eax
call printf
movl $0, %eax
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits

B10633102 甘英豪 提到...

.file "MRTMRT LOL.c"
.section .rodata
.LC0:
.string "gcd=%d\n"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $16, %rsp
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $987654321, %esi
movl $123456789, %edi
call gcd
movl %eax, %esi
movl $.LC0, %edi
movl $0, %eax
call printf
movl $0, %eax
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits

B10633064 徐敏嫣 提到...

組合語言:
.file "GCD.c"
.section .rodata
.LC0:
.string "gcd=%d\n"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $16, %rsp
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $987654321, %esi
movl $123456789, %edi
call gcd
movl %eax, %esi
movl $.LC0, %edi
movl $0, %eax
call printf
movl $0, %eax
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits
c語言:
#include <stdio.h>

int gcd(int x, int y);

int main(int argc, char** argv){
printf("gcd=%d\n", gcd(123456789,987654321));
return 0;
}

int gcd(int x, int y){

int r = x % y;
if (r == 0) {
return y;
}
return gcd(y, r);
}

B10633083 黃彥浩 提到...

.file "GGGGGGGGG.c"
.section .rodata
.LC0:
.string "gcd=%d\n"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $16, %rsp
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $987654321, %esi
movl $123456789, %edi
call gcd
movl %eax, %esi
movl $.LC0, %edi
movl $0, %eax
call printf
movl $0, %eax
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits

B10633062 熊冠綸 提到...

.file "BEGSH.c"
.section .rodata
.LC0:
.string "gcd=%d\n"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $16, %rsp
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $987654321, %esi
movl $123456789, %edi
call gcd
movl %eax, %esi
movl $.LC0, %edi
movl $0, %eax
call printf
movl $0, %eax
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits

b10633079 劉佩儒 提到...

組合語言
.file "GCD.c"
.section .rodata
.LC0:
.string "gcd=%d\n"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $16, %rsp
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $987654321, %esi
movl $123456789, %edi
call gcd
movl %eax, %esi
movl $.LC0, %edi
movl $0, %eax
call printf
movl $0, %eax
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits
c語言
#include <stdio.h>

int gcd(int x, int y);

int main(int argc, char** argv){
printf("gcd=%d\n", gcd(123456789,987654321));
return 0;
}

int gcd(int x, int y){

int r = x % y;
if (r == 0) {
return y;
}
return gcd(y, r);
}

B10633086 鄭羽伸 提到...

.file "ZZZZZZ.c"
.section .rodata
.LC0:
.string "gcd=%d\n"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $16, %rsp
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $987654321, %esi
movl $123456789, %edi
call gcd
movl %eax, %esi
movl $.LC0, %edi
movl $0, %eax
call printf
movl $0, %eax
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits

B10633094 葉宜禎 提到...

.file "infinite.c"
.section .rodata
.LC0:
.string "gcd=%d\n"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $16, %rsp
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $987654321, %esi
movl $123456789, %edi
call gcd
movl %eax, %esi
movl $.LC0, %edi
movl $0, %eax
call printf
movl $0, %eax
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits

B10633105 劉晉良 提到...

機器語言

.file "steven.c"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $0, %eax
popq %rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits

C語言
int gcd(int x, int y);


int main(int argc, char** argv) {
return 0;
}
int gcd(int x, int y) {

int r = x % y;
if (r == 0) {
return y;
}
return gcd(y, r);
}

B10633095 羅世承 提到...

.file "my owo.c"
.section .rodata
.LC0:
.string "gcd=%d\n"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $16, %rsp
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $987654321, %esi
movl $123456789, %edi
call gcd
movl %eax, %esi
movl $.LC0, %edi
movl $0, %eax
call printf
movl $0, %eax
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits

B10633060韓鎮遠 提到...

#include <stdio.h>

int gcd(int x, int y);

int main(int argc, char** argv){
printf("gcd=%d\n", gcd(123456789,987654321));
return 0;
}

int gcd(int x, int y){

int r = x % y;
if (r == 0) {
return y;
}
return gcd(y, r);
}

B10633093 梁家豪 提到...

.file "123.c"
.section .rodata
.LC0:
.string "gcd=%d\n"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $16, %rsp
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $987654321, %esi
movl $123456789, %edi
call gcd
movl %eax, %esi
movl $.LC0, %edi
movl $0, %eax
call printf
movl $0, %eax
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits

D10623004 范振威 提到...

組合語言
.file "GCD.c"
.section .rodata
.LC0:
.string "gcd=%d\n"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $16, %rsp
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $987654321, %esi
movl $123456789, %edi
call gcd
movl %eax, %esi
movl $.LC0, %edi
movl $0, %eax
call printf
movl $0, %eax
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits
c語言
#include <stdio.h>

int gcd(int x, int y);

int main(int argc, char** argv){
printf("gcd=%d\n", gcd(123456789,987654321));
return 0;
}

int gcd(int x, int y){

int r = x % y;
if (r == 0) {
return y;
}
return gcd(y, r);
}

B10633104 王湘柔 提到...

C語言

int gcd(int x, int y);


int main(int argc, char** argv) {
return 0;
}
int gcd(int x, int y) {

int r = x % y;
if (r == 0) {
return y;
}
return gcd(y, r);
}

機器語言
.file "steven.c"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $0, %eax
popq %rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits

B10633097 許銓育 提到...

組合語言
.file "GCD.c"
.section .rodata
.LC0:
.string "gcd=%d\n"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $16, %rsp
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $987654321, %esi
movl $123456789, %edi
call gcd
movl %eax, %esi
movl $.LC0, %edi
movl $0, %eax
call printf
movl $0, %eax
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits
c語言
#include <stdio.h>

int gcd(int x, int y);

int main(int argc, char** argv){
printf("gcd=%d\n", gcd(123456789,987654321));
return 0;
}

int gcd(int x, int y){

int r = x % y;
if (r == 0) {
return y;
}
return gcd(y, r);
}

A10633011 邱軍霖 提到...

1.
#include <stdio.h>

int gcd(int x, int y);
int main(int argc, char** argv){
printf("gcd=%d\n", gcd(123456789,987654321));
return 0;
}

int gcd(int x, int y){

int r = x % y;
if(r == 0){
return y;
}
return gcd(y, r);
}
2.
.file "gcd.c"
.section .rodata
.LC0:
.string "gcd=%d\n"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $16, %rsp
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $987654321, %esi
movl $123456789, %edi
call gcd
movl %eax, %esi
movl $.LC0, %edi
movl $0, %eax
call printf
movl $0, %eax
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits

B10633090蘇暐庭 提到...

組合語言
.file "GCD.c"
.section .rodata
.LC0:
.string "gcd=%d\n"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $16, %rsp
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $987654321, %esi
movl $123456789, %edi
call gcd
movl %eax, %esi
movl $.LC0, %edi
movl $0, %eax
call printf
movl $0, %eax
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits
c語言
#include <stdio.h>

int gcd(int x, int y);

int main(int argc, char** argv){
printf("gcd=%d\n", gcd(123456789,987654321));
return 0;
}

int gcd(int x, int y){

int r = x % y;
if (r == 0) {
return y;
}
return gcd(y, r);
}

B10633077葉峻誠 提到...

組合語言
.file "GCD.c"
.section .rodata
.LC0:
.string "gcd=%d\n"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $16, %rsp
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $987654321, %esi
movl $123456789, %edi
call gcd
movl %eax, %esi
movl $.LC0, %edi
movl $0, %eax
call printf
movl $0, %eax
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits
c語言
#include <stdio.h>

int gcd(int x, int y);

int main(int argc, char** argv){
printf("gcd=%d\n", gcd(123456789,987654321));
return 0;
}

int gcd(int x, int y){

int r = x % y;
if (r == 0) {
return y;
}
return gcd(y, r);
}

A10633016張貴棠 提到...

#include <stdio.h>

int gad(int x, int y);

int main(int argc, char** argv){
printf("gad=%d\n", gad(12345,54321));
return 0;
}

int gad(int x, int y) {

int r = x % y ;
if(r == 0){
return y;
}
return gad(y, r);
}




.file "gad.c"
.section .rodata
.LC0:
.string "gad=%d\n"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $16, %rsp
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $54321, %esi
movl $12345, %edi
call gad
movl %eax, %esi
movl $.LC0, %edi
movl $0, %eax
call printf
movl $0, %eax
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gad
.type gad, @function
gad:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gad
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gad, .-gad
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits


B10633076 謝昀憲 提到...

C語言

int gcd(int x, int y);


int main(int argc, char** argv) {
return 0;
}
int gcd(int x, int y) {

int r = x % y;
if (r == 0) {
return y;
}
return gcd(y, r);
}

機器語言
.file "wocow.c"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $0, %eax
popq %rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits

B10633078張俊元 提到...

#include

int gcd(int x, int y);


int main(int argc, char** argv) {
printf("gcd=% d\n",gcd(123456789,987654321));
return 0;
}
int gcd(int x, int y) {

int r = x % y;
if (x == 0) {
return y;
}
return gcd(y, r);
}

B10633087劉世鈞 提到...

組合語言
.file "GCD.c"
.section .rodata
.LC0:
.string "gcd=%d\n"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $16, %rsp
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $987654321, %esi
movl $123456789, %edi
call gcd
movl %eax, %esi
movl $.LC0, %edi
movl $0, %eax
call printf
movl $0, %eax
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits
c語言
#include <stdio.h>

int gcd(int x, int y);

int main(int argc, char** argv){
printf("gcd=%d\n", gcd(123456789,987654321));
return 0;
}

int gcd(int x, int y){

int r = x % y;
if (r == 0) {
return y;
}
return gcd(y, r);
}

B10633073 吳聲佑 提到...

.file "GCD.c"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $0, %eax
popq %rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits

B10433088葉凱文 提到...

1.
#include

int gcd(int x, int y);

int main(int argc, char** argv){
printf("gcd=%d\n", gcd(123456789,987654321));
return 0;
}

int gcd(int x, int y){

int r = x % y;
if (r == 0){
return y;
}
return gcd(y,r);
}

2.
.file "gcd.c"
.section .rodata
.LC0:
.string "gcd=%d\n"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $16, %rsp
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $987654321, %esi
movl $123456789, %edi
call gcd
movl %eax, %esi
movl $.LC0, %edi
movl $0, %eax
call printf
movl $0, %eax
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits

B10537208楊蕊筑 提到...

.file "wocow.c"
.section .rodata
.LC0:
.string "gcd=%d\n"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $16, %rsp
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $987654321, %esi
movl $123456789, %edi
call gcd
movl %eax, %esi
movl $.LC0, %edi
movl $0, %eax
call printf
movl $0, %eax
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits

b10533088葉俊江 提到...

.file "wocow.c"
.section .rodata
.LC0:
.string "gcd=%d\n"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $16, %rsp
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $987654321, %esi
movl $123456789, %edi
call gcd
movl %eax, %esi
movl $.LC0, %edi
movl $0, %eax
call printf
movl $0, %eax
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits

B10633081陳蕙祺 提到...

.file "sdew.c"
.section .rodata
.LC0:
.string "gcd=%d\n"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $16, %rsp
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $987654321, %esi
movl $123456789, %edi
call gcd
movl %eax, %esi
movl $.LC0, %edi
movl $0, %eax
call printf
movl $0, %eax
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits

B10633159徐芳瑀 提到...

.file "sdew.c"
.section .rodata
.LC0:
.string "gcd=%d\n"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $16, %rsp
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $987654321, %esi
movl $123456789, %edi
call gcd
movl %eax, %esi
movl $.LC0, %edi
movl $0, %eax
call printf
movl $0, %eax
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits

b10633080黃主賜 提到...

.file "GCD.c"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $0, %eax
popq %rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits

b10633070陳鴻琪 提到...

.file "GCD.c"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $0, %eax
popq %rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits

b10633070陳鴻琪 提到...

.file "GCD.c"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $0, %eax
popq %rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits

b10633080黃主賜 提到...

.file "GCD.c"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $0, %eax
popq %rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits

b10633070陳鴻琪 提到...

.file "GCD.c"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $0, %eax
popq %rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits

b10633100 陳澔翰 提到...

.file "GCD.c"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $0, %eax
popq %rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits

B10433188 姜佩萱 提到...

.file "GCD.c"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $0, %eax
popq %rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits

B10433190 張文翰 提到...

.file "GCD.c"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $0, %eax
popq %rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits

b10533037張俊為 提到...

#include

int gcd(int x, int y);

int main(int argc, char** argv){
printf("gcd=%d\n", gcd(123456789,987654321));
return 0;
}

int gcd(int x, int y){

int r = x % y;
if (r == 0) {
return y;
}
return gcd(y, r);
}

b10514033盧昱仁 提到...

#include

int gcd(int x, int y);

int main(int argc, char** argv){
printf("gcd=%d\n", gcd(123456789,987654321));
return 0;
}

int gcd(int x, int y){

int r = x % y;
if (r == 0) {
return y;
}
return gcd(y, r);
}

b10533017古峻衛 提到...

#include

int gcd(int x, int y);

int main(int argc, char** argv){
printf("gcd=%d\n", gcd(123456789,987654321));
return 0;
}

int gcd(int x, int y){

int r = x % y;
if (r == 0) {
return y;
}
return gcd(y, r);
}

b10533031沈宏儒 提到...

#include

int gcd(int x, int y);

int main(int argc, char** argv){
printf("gcd=%d\n", gcd(123456789,987654321));
return 0;
}

int gcd(int x, int y){

int r = x % y;
if (r == 0) {
return y;
}
return gcd(y, r);
}

b10533032程泓瑋 提到...

#include

int gcd(int x, int y);

int main(int argc, char** argv){
printf("gcd=%d\n", gcd(123456789,987654321));
return 0;
}

int gcd(int x, int y){

int r = x % y;
if (r == 0) {
return y;
}
return gcd(y, r);
}

B10533082 洪承楓 提到...

#include

int gcd(int x, int y);

int main(int argc, char** argv){
printf("gcd=%d\n", gcd(123456789,987654321));
return 0;
}

int gcd(int x, int y){

int r = x % y;
if (r == 0) {
return y;
}
return gcd(y, r);
}

B10433088 葉凱文 提到...

組合語言
.file "GCD.c"
.section .rodata
.LC0:
.string "gcd=%d\n"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $16, %rsp
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movl $987654321, %esi
movl $123456789, %edi
call gcd
movl %eax, %esi
movl $.LC0, %edi
movl $0, %eax
call printf
movl $0, %eax
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.globl gcd
.type gcd, @function
gcd:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl -20(%rbp), %eax
cltd
idivl -24(%rbp)
movl %edx, -4(%rbp)
cmpl $0, -4(%rbp)
jne .L4
movl -24(%rbp), %eax
jmp .L5
.L4:
movl -4(%rbp), %edx
movl -24(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call gcd
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size gcd, .-gcd
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-4)"
.section .note.GNU-stack,"",@progbits
c語言
#include

int gcd(int x, int y);

int main(int argc, char** argv){
printf("gcd=%d\n", gcd(123456789,987654321));
return 0;
}

int gcd(int x, int y){

int r = x % y;
if (r == 0) {
return y;
}
return gcd(y, r);
}

B10441162 張芸瑄 提到...

#include

int gcd(int x, int y);

int main(int argc, char** argv){
printf("gcd=%d\n", gcd(123456789,987654321));
return 0;
}

int gcd(int x, int y){

int r = x % y;
if (r == 0) {
return y;
}
return gcd(y, r);
}

B10533083徐士興 提到...

#include

int gcd(int x, int y);

int main(int argc, char** argv){
printf("gcd=%d\n", gcd(123456789,987654321));
return 0;
}

int gcd(int x, int y){

int r = x % y;
if (r == 0) {
return y;
}
return gcd(y, r);
}

Related Posts Plugin for WordPress, Blogger...

熱門文章