Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision

Target

Select target project
  • pgerwinski/hp
  • bwildenhain/hp
  • Daniel.Eisi/hp
  • aahrens/hp
4 results
Select Git revision
Show changes
Commits on Source (71)
Showing with 16 additions and 220 deletions
#include <stdio.h>
int main (void)
{
int a = 13;
int b = 137;
printf ("Die Antwort lautet: %X oder vielleicht auch %x\n", a, b);
return 0;
}
File deleted
#include <stdio.h>
int main (void) { int a = 360; printf ("a = %d\n", a); int b; printf
("Bitte b eingeben: "); scanf ("%d", &b); if (b == 0) { printf
("Bitte nicht durch 0 teilen.\n"); printf ("Das macht man nicht.\n");
} else printf ("a / b = %d\n", a / b); return 0; }
#include <stdio.h>
int main (void)
{
int a = 360;
printf ("a = %d\n", a);
int b;
printf ("Bitte b eingeben: ");
scanf ("%d", &b);
if (b == 0)
{
printf ("Bitte nicht durch 0 teilen.\n");
printf ("Das macht man nicht.\n");
}
else
{
printf ("a / b = %d\n", a / b);
}
return 0;
}
.file "init-01.c"
.text
.section .rodata.str1.1,"aMS",@progbits,1
.LC0:
.string "a = %d\n"
.LC1:
.string "b = %d\n"
.text
.globl main
.type main, @function
main:
.LFB11:
.cfi_startproc # #include <stdio.h>
subq $8, %rsp #
.cfi_def_cfa_offset 16 # int main (void)
movl $42, %esi # {
leaq .LC0(%rip), %rdi # int a = 42;
movl $0, %eax # int b;
call printf@PLT # b = 137;
movl $137, %esi # printf ("a = %d\n", a);
leaq .LC1(%rip), %rdi # printf ("b = %d\n", b);
movl $0, %eax # return 0;
call printf@PLT # }
movl $0, %eax
addq $8, %rsp
.cfi_def_cfa_offset 8
ret
.cfi_endproc
.LFE11:
.size main, .-main
.ident "GCC: (Debian 8.3.0-6) 8.3.0"
.section .note.GNU-stack,"",@progbits
#include <stdio.h>
int main (void)
{
int a = 42;
int b;
printf ("Bitte b eingeben: ");
scanf ("%d", b);
printf ("a * b + a + b = %d\n", a * b + a + b);
return 0;
}
.file "init-02.c"
.text
.section .rodata.str1.1,"aMS",@progbits,1
.LC0:
.string "a * b + a + b = %d\n"
.text
.globl main
.type main, @function
main:
.LFB11:
.cfi_startproc
subq $8, %rsp # #include <stdio.h>
.cfi_def_cfa_offset 16 #
movl $5933, %esi # int main (void)
leaq .LC0(%rip), %rdi # {
movl $0, %eax # int a = 42;
call printf@PLT # int b = 137;
movl $0, %eax # printf ("a * b + a + b = %d\n", a * b + a + b);
addq $8, %rsp # return 0;
.cfi_def_cfa_offset 8 # }
ret
.cfi_endproc
.LFE11:
.size main, .-main
.ident "GCC: (Debian 8.3.0-6) 8.3.0"
.section .note.GNU-stack,"",@progbits
#include <stdio.h>
int main (void)
{
int a = 42;
int b;
printf ("Bitte b eingeben: ");
scanf ("%d", b);
printf ("a * b + a + b = %d\n", a * b + a + b);
return 0;
}
#include <stdio.h>
int main (void)
{
int a = 42;
int b;
printf ("Bitte b eingeben: ");
scanf ("%d", &b);
printf ("a * b + a + b = %d\n", a * b + a + b);
return 0;
}
.file "init-04.c"
.text
.section .rodata.str1.1,"aMS",@progbits,1
.LC0:
.string "Bitte b eingeben: "
.LC1:
.string "%d"
.LC2:
.string "a * b + a + b = %d\n"
.text
.globl main
.type main, @function
main:
.LFB11:
.cfi_startproc
subq $24, %rsp
.cfi_def_cfa_offset 32 # #include <stdio.h>
leaq .LC0(%rip), %rdi #
movl $0, %eax # int main (void)
call printf@PLT # {
leaq 12(%rsp), %rsi # int a = 42;
leaq .LC1(%rip), %rdi # int b;
movl $0, %eax # printf ("Bitte b eingeben: ");
call __isoc99_scanf@PLT # scanf ("%d", &b);
movl 12(%rsp), %eax # printf ("a * b + a + b = %d\n", a * b + a + b);
leal 1(%rax), %esi # return 0;
imull $42, %esi, %esi # }
addl %eax, %esi
leaq .LC2(%rip), %rdi
movl $0, %eax
call printf@PLT
movl $0, %eax
addq $24, %rsp
.cfi_def_cfa_offset 8
ret
.cfi_endproc
.LFE11:
.size main, .-main
.ident "GCC: (Debian 8.3.0-6) 8.3.0"
.section .note.GNU-stack,"",@progbits
#include <stdio.h>
int main (void)
{
double a;
printf ("Bitte eine Zahl eingeben: ");
scanf ("%lf", a);
printf ("Ihre Antwort war: %lf\n", a);
return 0;
}
#include <stdio.h>
int main (void)
{
double a;
printf ("a = %lf\n", a);
printf ("Bitte eine Zahl eingeben: ");
scanf ("%lf", a);
printf ("Ihre Antwort war: %lf\n", a);
return 0;
}
#include <stdio.h>
int main (void)
{
double a = &a;
printf ("a = %lf\n", a);
printf ("Bitte eine Zahl eingeben: ");
scanf ("%lf", a);
printf ("Ihre Antwort war: %lf\n", a);
return 0;
}
#include <stdio.h>
int main (void)
{
double a = (double) (long long unsigned) &a;
printf ("a = %lf\n", a);
printf ("Bitte eine Zahl eingeben: ");
scanf ("%lf", a);
printf ("Ihre Antwort war: %lf\n", a);
return 0;
}
#include <stdio.h>
int main (void)
{
long long unsigned a = (long long unsigned) &a;
printf ("a = %llu\n", a);
printf ("Bitte eine Zahl eingeben: ");
scanf ("%llu", a);
printf ("Ihre Antwort war: %llu\n", a);
return 0;
}
../common/gitlab.png
\ No newline at end of file
File moved
#include <stdio.h>
int main (void)
{
printf ("Hello, world!\n");
return 0;
}
cassini/home/peter/bo/2024ws/hp/20241010> gcc hello-01.c -o hello-01
cassini/home/peter/bo/2024ws/hp/20241010> ls -l hello-*
-rwxr-xr-x 1 peter peter 15952 10. Okt 12:02 hello-01
-rw-r--r-- 1 peter peter 82 10. Okt 12:00 hello-01.c
-rw-r--r-- 1 peter peter 1261 8. Okt 2023 hello-gtk.c
cassini/home/peter/bo/2024ws/hp/20241010> ./hello-01
Hello, world!
cassini/home/peter/bo/2024ws/hp/20241010>
File moved
File moved