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

Beispiele 4.4.2024

parent 80de45bc
No related branches found
No related tags found
No related merge requests found
Showing
with 363 additions and 0 deletions
.file "add-01.c"
.text
.section .rodata
.LC0:
.string "%llu\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 $32, %rsp
movabsq $5000000000, %rax
movq %rax, -8(%rbp)
movabsq $6000000000, %rax
movq %rax, -16(%rbp)
movq -8(%rbp), %rdx
movq -16(%rbp), %rax
addq %rdx, %rax
movq %rax, -24(%rbp)
movq -24(%rbp), %rax
movq %rax, %rsi
leaq .LC0(%rip), %rax
movq %rax, %rdi
movl $0, %eax
call printf@PLT
movl $0, %eax
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.ident "GCC: (Debian 12.2.0-14) 12.2.0"
.section .note.GNU-stack,"",@progbits
.file "add-01.c"
.text
.section .rodata.str1.1,"aMS",@progbits,1
.LC0:
.string "%llu\n"
.text
.globl main
.type main, @function
main:
.LFB11:
.cfi_startproc
subq $8, %rsp
.cfi_def_cfa_offset 16
movabsq $11000000000, %rsi
leaq .LC0(%rip), %rdi
movl $0, %eax
call printf@PLT
movl $0, %eax
addq $8, %rsp
.cfi_def_cfa_offset 8
ret
.cfi_endproc
.LFE11:
.size main, .-main
.ident "GCC: (Debian 12.2.0-14) 12.2.0"
.section .note.GNU-stack,"",@progbits
.file "add-01.c"
.text
.section .rodata
.LC0:
.string "%llu\n"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
leal 4(%esp), %ecx
.cfi_def_cfa 1, 0
andl $-16, %esp
pushl -4(%ecx)
pushl %ebp
movl %esp, %ebp
.cfi_escape 0x10,0x5,0x2,0x75,0
pushl %esi
pushl %ebx
pushl %ecx
.cfi_escape 0xf,0x3,0x75,0x74,0x6
.cfi_escape 0x10,0x6,0x2,0x75,0x7c
.cfi_escape 0x10,0x3,0x2,0x75,0x78
subl $44, %esp
call __x86.get_pc_thunk.si
addl $_GLOBAL_OFFSET_TABLE_, %esi
movl $705032704, -32(%ebp)
movl $1, -28(%ebp)
movl $1705032704, -40(%ebp)
movl $1, -36(%ebp)
movl -32(%ebp), %ecx
movl -28(%ebp), %ebx
movl -40(%ebp), %eax
movl -36(%ebp), %edx
addl %ecx, %eax
adcl %ebx, %edx
movl %eax, -48(%ebp)
movl %edx, -44(%ebp)
subl $4, %esp
pushl -44(%ebp)
pushl -48(%ebp)
leal .LC0@GOTOFF(%esi), %eax
pushl %eax
movl %esi, %ebx
call printf@PLT
addl $16, %esp
movl $0, %eax
leal -12(%ebp), %esp
popl %ecx
.cfi_restore 1
.cfi_def_cfa 1, 0
popl %ebx
.cfi_restore 3
popl %esi
.cfi_restore 6
popl %ebp
.cfi_restore 5
leal -4(%ecx), %esp
.cfi_def_cfa 4, 4
ret
.cfi_endproc
.LFE0:
.size main, .-main
.section .text.__x86.get_pc_thunk.si,"axG",@progbits,__x86.get_pc_thunk.si,comdat
.globl __x86.get_pc_thunk.si
.hidden __x86.get_pc_thunk.si
.type __x86.get_pc_thunk.si, @function
__x86.get_pc_thunk.si:
.LFB1:
.cfi_startproc
movl (%esp), %esi
ret
.cfi_endproc
.LFE1:
.ident "GCC: (Debian 12.2.0-14) 12.2.0"
.section .note.GNU-stack,"",@progbits
.file "add-01.c"
.text
.section .rodata.str1.1,"aMS",@progbits,1
.LC0:
.string "%llu\n"
.text
.globl main
.type main, @function
main:
.LFB11:
.cfi_startproc
leal 4(%esp), %ecx
.cfi_def_cfa 1, 0
andl $-16, %esp
pushl -4(%ecx)
pushl %ebp
movl %esp, %ebp
.cfi_escape 0x10,0x5,0x2,0x75,0
pushl %ebx
pushl %ecx
.cfi_escape 0xf,0x3,0x75,0x78,0x6
.cfi_escape 0x10,0x3,0x2,0x75,0x7c
call __x86.get_pc_thunk.bx
addl $_GLOBAL_OFFSET_TABLE_, %ebx
subl $4, %esp
pushl $2
pushl $-1884901888
leal .LC0@GOTOFF(%ebx), %eax
pushl %eax
call printf@PLT
addl $16, %esp
movl $0, %eax
leal -8(%ebp), %esp
popl %ecx
.cfi_restore 1
.cfi_def_cfa 1, 0
popl %ebx
.cfi_restore 3
popl %ebp
.cfi_restore 5
leal -4(%ecx), %esp
.cfi_def_cfa 4, 4
ret
.cfi_endproc
.LFE11:
.size main, .-main
.section .text.__x86.get_pc_thunk.bx,"axG",@progbits,__x86.get_pc_thunk.bx,comdat
.globl __x86.get_pc_thunk.bx
.hidden __x86.get_pc_thunk.bx
.type __x86.get_pc_thunk.bx, @function
__x86.get_pc_thunk.bx:
.LFB12:
.cfi_startproc
movl (%esp), %ebx
ret
.cfi_endproc
.LFE12:
.ident "GCC: (Debian 12.2.0-14) 12.2.0"
.section .note.GNU-stack,"",@progbits
#include <stdio.h>
#include <stdint.h>
int main (void)
{
uint64_t x = 5000000000;
uint64_t y = 6000000000;
uint64_t z = x + y;
printf ("%llu\n", z);
return 0;
}
#include <stdio.h>
#include <stdint.h>
#include <inttypes.h>
int main (void)
{
uint64_t x = 5000000000;
uint64_t y = 6000000000;
uint64_t z = x + y;
printf ("%" PRIu64 "\n", z);
return 0;
}
#include <stdio.h>
int main (void)
{
char a[] = "Test";
char *p = "Test";
printf ("a = %s, p = %s\n", a, p);
return 0;
}
#include <stdio.h>
int main (void)
{
char a[] = { 84, 101, 115, 116, 0 };
char *p = "Test";
printf ("a = %s, p = %s\n", a, p);
return 0;
}
#include <stdio.h>
int main (void)
{
char a[] = { 84, 101, 115, 116, 0 };
char *p = "Test";
printf ("a = %s, p = %s\n", &a, &p);
return 0;
}
#include <stdio.h>
int main (void)
{
char *a[] = { "Dies", "ist", "ein", "Test" };
char **p = a;
for (int i = 0; i < 4; i++)
printf ("%s\n", p[i]);
return 0;
}
#include <stdio.h>
int main (void)
{
char *a[] = { "Dies", "ist", "ein", "Test" };
char **p = a;
for (int i = 0; i < 4; i++)
printf ("%s\n", *p++);
return 0;
}
#include <stdio.h>
int main (void)
{
char *a[] = { "Dies", "ist", "ein", "Test" };
char **p = a;
for (int i = 0; i < 4; i++)
printf ("%s\n", p[i]++);
return 0;
}
#include <stdio.h>
int main (void)
{
char *a[] = { "Dies", "ist", "ein", "Test" };
char **p = a;
for (int i = 0; i < 4; i++)
{
char *q;
printf ("%s ", q = p[i]++);
printf ("%s\n", q);
}
return 0;
}
#include <stdio.h>
int main (void)
{
char *a[] = { "Dies", "ist", "ein", "Test" };
char **p = a;
for (int i = 0; i < 4; i++)
{
printf ("%s ", p[i]++);
printf ("%s\n", p[i]);
}
return 0;
}
#include <stdio.h>
int main (void)
{
char *a[] = { "Dies", "ist", "ein", "Test" };
for (char **p = a; p < a + 4; p++)
printf ("%s\n", *p);
return 0;
}
#include <stdio.h>
int main (void)
{
char *a[] = { "Dies", "ist", "ein", "Test", NULL };
for (char **p = a; *p; p++)
printf ("%s\n", *p);
return 0;
}
#include <stdio.h>
int main (void)
{
char a[][5] = { "Dies", "ist", "ein", "Test" };
for (int i = 0; i < 4; i++)
printf ("%s\n", a[i]);
return 0;
}
#include <stdio.h>
int main (void)
{
char a[][] = { "Dies", "ist", "ein", "Test" };
for (int i = 0; i < 4; i++)
printf ("%s\n", a[i]);
return 0;
}
#include <stdio.h>
int main (void)
{
char a[][5] = { "Dies", "ist", "ein", "Test", "" };
for (char *p = a; *p; p++)
printf ("%s\n", *p);
return 0;
}
#include <stdio.h>
int main (void)
{
char a[][5] = { "Dies", "ist", "ein", "Test", "" };
for (char **p = a; **p; p++)
printf ("%s\n", *p);
return 0;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment