Skip to content
Snippets Groups Projects
Commit 666c34b2 authored by Peter Gerwinski's avatar Peter Gerwinski
Browse files

Tafelbilder, Beispiele, Screenshots und Fotos 7.6.2019

parent 25ed4965
No related branches found
No related tags found
No related merge requests found
Showing with 166 additions and 0 deletions
main(){puts(1);}
#include <stdio.h>
int fak (int n)
{
if (n <= 1)
return 1;
else
return n * fak (n - 1);
}
int main (void)
{
printf ("7! = %d\n", fak (7));
return 0;
}
.file "fak-1.c"
.text
.globl fak
.type fak, @function
fak:
.LFB11:
.cfi_startproc
movl $1, %eax
cmpl $1, %edi # #include <stdio.h>
jle .L8 #
pushq %rbx # int fak (int n)
.cfi_def_cfa_offset 16 # {
.cfi_offset 3, -16 # if (n <= 1)
movl %edi, %ebx # return 1;
leal -1(%rdi), %edi # else
call fak # return n * fak (n - 1);
imull %ebx, %eax # }
popq %rbx #
.cfi_restore 3 # int main (void)
.cfi_def_cfa_offset 8 # {
.L8: # printf ("7! = %d\n", fak (7));
rep ret # return 0;
.cfi_endproc # }
.LFE11:
.size fak, .-fak
.section .rodata.str1.1,"aMS",@progbits,1
.LC0:
.string "7! = %d\n"
.text
.globl main
.type main, @function
main:
.LFB12:
.cfi_startproc
subq $8, %rsp
.cfi_def_cfa_offset 16
movl $7, %edi
call fak
movl %eax, %esi
leaq .LC0(%rip), %rdi
movl $0, %eax
call printf@PLT
movl $0, %eax
addq $8, %rsp
.cfi_def_cfa_offset 8
ret
.cfi_endproc
.LFE12:
.size main, .-main
.ident "GCC: (Debian 6.3.0-18+deb9u1) 6.3.0 20170516"
.section .note.GNU-stack,"",@progbits
+--hello-1.c------------------------------------------------------------------------------------------+
|2 |
|3 int main (void) |
B+>|4 { |
|5 printf ("Hello, world!\n"); |
|6 return 0; |
|7 } |
|8 |
|9 |
|10 |
|11 |
|12 |
|13 |
|14 |
|15 |
|16 |
|17 |
|18 |
+-----------------------------------------------------------------------------------------------------+
native process 24957 In: main L4 PC: 0x5555555546b0
(gdb) disassemble /r main
Dump of assembler code for function main:
=> 0x00005555555546b0 <+0>: 48 83 ec 08 sub $0x8,%rsp
0x00005555555546b4 <+4>: 48 8d 3d 99 00 00 00 lea 0x99(%rip),%rdi # 0x555555554754
0x00005555555546bb <+11>: e8 a0 fe ff ff callq 0x555555554560 <puts@plt>
0x00005555555546c0 <+16>: b8 00 00 00 00 mov $0x0,%eax
0x00005555555546c5 <+21>: 48 83 c4 08 add $0x8,%rsp
0x00005555555546c9 <+25>: c3 retq
End of assembler dump.
(gdb)
#include <stdio.h>
int main (void)
{
printf ("Hello, world!\n");
return 0;
}
.file "hello-1.c"
.section .rodata.str1.1,"aMS",@progbits,1
.LC0:
.string "Hello, world!"
.text
.globl main
.type main, @function
main:
.LFB11:
.cfi_startproc # #include <stdio.h>
subq $8, %rsp #
.cfi_def_cfa_offset 16 # int main (void)
leaq .LC0(%rip), %rdi # {
call puts@PLT # printf ("Hello, world!\n");
movl $0, %eax # return 0;
addq $8, %rsp # }
.cfi_def_cfa_offset 8
ret
.cfi_endproc
.LFE11:
.size main, .-main
.ident "GCC: (Debian 6.3.0-18+deb9u1) 6.3.0 20170516"
.section .note.GNU-stack,"",@progbits
20190607/photo-20190607-133025.jpg

153 KiB

20190607/photo-20190607-133131.jpg

153 KiB

20190607/photo-20190607-133241.jpg

144 KiB

20190607/photo-20190607-133301.jpg

160 KiB

20190607/photo-20190607-133353.jpg

142 KiB

20190607/photo-20190607-133443.jpg

160 KiB

20190607/segments-1.png

66 KiB

#include <stdio.h>
int main (void)
{
char *hello = "Hello, wörld!\n";
hello[8] = 'o';
printf (hello);
return 0;
}
#include <stdio.h>
int main (void)
{
char hello[] = "Hello, wörld!\n";
hello[8] = 'o';
printf (hello);
return 0;
}
#include <stdio.h>
int main (void)
{
static char hello[] = "Hello, wörld!\n";
hello[8] = 'o';
printf (hello);
return 0;
}
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main (void)
{
char *hello = malloc (42);
strcpy (hello, "Hello, wörld!\n");
hello[8] = 'o';
printf (hello);
return 0;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment