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

Lehrmaterialien und Beispiele 29.6.2019

parent 7f3f1f3f
Branches
No related tags found
No related merge requests found
Showing with 315 additions and 0 deletions
File added
blink-1.elf: file format elf32-avr
Disassembly of section .text:
00000000 <__vectors>:
0: 0c 94 34 00 jmp 0x68 ; 0x68 <__ctors_end>
4: 0c 94 3e 00 jmp 0x7c ; 0x7c <__bad_interrupt>
8: 0c 94 3e 00 jmp 0x7c ; 0x7c <__bad_interrupt>
c: 0c 94 3e 00 jmp 0x7c ; 0x7c <__bad_interrupt>
10: 0c 94 3e 00 jmp 0x7c ; 0x7c <__bad_interrupt>
14: 0c 94 3e 00 jmp 0x7c ; 0x7c <__bad_interrupt>
18: 0c 94 3e 00 jmp 0x7c ; 0x7c <__bad_interrupt>
1c: 0c 94 3e 00 jmp 0x7c ; 0x7c <__bad_interrupt>
20: 0c 94 3e 00 jmp 0x7c ; 0x7c <__bad_interrupt>
24: 0c 94 3e 00 jmp 0x7c ; 0x7c <__bad_interrupt>
28: 0c 94 3e 00 jmp 0x7c ; 0x7c <__bad_interrupt>
2c: 0c 94 3e 00 jmp 0x7c ; 0x7c <__bad_interrupt>
30: 0c 94 3e 00 jmp 0x7c ; 0x7c <__bad_interrupt>
34: 0c 94 3e 00 jmp 0x7c ; 0x7c <__bad_interrupt>
38: 0c 94 3e 00 jmp 0x7c ; 0x7c <__bad_interrupt>
3c: 0c 94 3e 00 jmp 0x7c ; 0x7c <__bad_interrupt>
40: 0c 94 3e 00 jmp 0x7c ; 0x7c <__bad_interrupt>
44: 0c 94 3e 00 jmp 0x7c ; 0x7c <__bad_interrupt>
48: 0c 94 3e 00 jmp 0x7c ; 0x7c <__bad_interrupt>
4c: 0c 94 3e 00 jmp 0x7c ; 0x7c <__bad_interrupt>
50: 0c 94 3e 00 jmp 0x7c ; 0x7c <__bad_interrupt>
54: 0c 94 3e 00 jmp 0x7c ; 0x7c <__bad_interrupt>
58: 0c 94 3e 00 jmp 0x7c ; 0x7c <__bad_interrupt>
5c: 0c 94 3e 00 jmp 0x7c ; 0x7c <__bad_interrupt>
60: 0c 94 3e 00 jmp 0x7c ; 0x7c <__bad_interrupt>
64: 0c 94 3e 00 jmp 0x7c ; 0x7c <__bad_interrupt>
00000068 <__ctors_end>:
68: 11 24 eor r1, r1
6a: 1f be out 0x3f, r1 ; 63
6c: cf ef ldi r28, 0xFF ; 255
6e: d8 e0 ldi r29, 0x08 ; 8
70: de bf out 0x3e, r29 ; 62
72: cd bf out 0x3d, r28 ; 61
74: 0e 94 40 00 call 0x80 ; 0x80 <main>
78: 0c 94 57 00 jmp 0xae ; 0xae <_exit>
0000007c <__bad_interrupt>:
7c: 0c 94 00 00 jmp 0 ; 0x0 <__vectors>
00000080 <main>:
80: 81 e0 ldi r24, 0x01 ; 1
82: 8a b9 out 0x0a, r24 ; 10
84: 58 9a sbi 0x0b, 0 ; 11
86: 2f ef ldi r18, 0xFF ; 255
88: 89 e6 ldi r24, 0x69 ; 105
8a: 98 e1 ldi r25, 0x18 ; 24
8c: 21 50 subi r18, 0x01 ; 1
8e: 80 40 sbci r24, 0x00 ; 0
90: 90 40 sbci r25, 0x00 ; 0
92: e1 f7 brne .-8 ; 0x8c <main+0xc>
94: 00 c0 rjmp .+0 ; 0x96 <main+0x16>
96: 00 00 nop
98: 58 98 cbi 0x0b, 0 ; 11
9a: 2f ef ldi r18, 0xFF ; 255
9c: 89 e6 ldi r24, 0x69 ; 105
9e: 98 e1 ldi r25, 0x18 ; 24
a0: 21 50 subi r18, 0x01 ; 1
a2: 80 40 sbci r24, 0x00 ; 0
a4: 90 40 sbci r25, 0x00 ; 0
a6: e1 f7 brne .-8 ; 0xa0 <main+0x20>
a8: 00 c0 rjmp .+0 ; 0xaa <main+0x2a>
aa: 00 00 nop
ac: eb cf rjmp .-42 ; 0x84 <main+0x4>
000000ae <_exit>:
ae: f8 94 cli
000000b0 <__stop_program>:
b0: ff cf rjmp .-2 ; 0xb0 <__stop_program>
File added
cassini/home/peter/bo/2019ss/bs/20190628> ln hello-1.c hello.c
cassini/home/peter/bo/2019ss/bs/20190628> ls -l
insgesamt 148
-rw-r----- 2 peter peter 83 Jun 27 15:59 hello-1.c
-rw-r--r-- 1 peter peter 442 Jun 27 22:51 hello-1.s
-rw-r--r-- 1 peter peter 110 Jun 27 16:08 hello-2.c
-rw-r--r-- 1 peter peter 85304 Jun 27 16:11 hello-2.o
-rw-r--r-- 1 peter peter 90 Jun 27 15:59 hello-3.c
-rw-r--r-- 1 peter peter 112 Jun 27 16:28 hello-4.c
-rw-r--r-- 1 peter peter 1640 Jun 27 16:29 hello-4.o
-rw-r--r-- 1 peter peter 880 Jun 27 22:54 hello-5.o
-rw-r--r-- 1 peter peter 386 Jun 27 22:54 hello-5.s
-rw-r--r-- 1 peter peter 104 Jun 27 22:56 hello-6.c
-rw-r--r-- 1 peter peter 1640 Jun 27 22:56 hello-6.o
-rw-r--r-- 1 peter peter 560 Jun 27 22:57 hello-6.s
-rw-r----- 2 peter peter 83 Jun 27 15:59 hello.c
lrwxrwxrwx 1 peter peter 2 Jun 28 10:26 pruzzel -> ..
-rw-r--r-- 1 peter peter 1033 Jun 27 16:26 SCRATCH
-rw-r--r-- 1 peter peter 1056 Jun 28 10:25 symlinks-1.log
-rw-r--r-- 1 peter peter 750 Jun 28 10:26 symlinks-2.log
-rw-r--r-- 1 peter peter 1436 Jun 28 10:28 symlinks-3.log
cassini/home/peter/bo/2019ss/bs/20190628> rm hello-1.c
cassini/home/peter/bo/2019ss/bs/20190628> ls -l
insgesamt 148
-rw-r--r-- 1 peter peter 1112 Jun 28 10:29 hardlinks-1.log
-rw-r--r-- 1 peter peter 442 Jun 27 22:51 hello-1.s
-rw-r--r-- 1 peter peter 110 Jun 27 16:08 hello-2.c
-rw-r--r-- 1 peter peter 85304 Jun 27 16:11 hello-2.o
-rw-r--r-- 1 peter peter 90 Jun 27 15:59 hello-3.c
-rw-r--r-- 1 peter peter 112 Jun 27 16:28 hello-4.c
-rw-r--r-- 1 peter peter 1640 Jun 27 16:29 hello-4.o
-rw-r--r-- 1 peter peter 880 Jun 27 22:54 hello-5.o
-rw-r--r-- 1 peter peter 386 Jun 27 22:54 hello-5.s
-rw-r--r-- 1 peter peter 104 Jun 27 22:56 hello-6.c
-rw-r--r-- 1 peter peter 1640 Jun 27 22:56 hello-6.o
-rw-r--r-- 1 peter peter 560 Jun 27 22:57 hello-6.s
-rw-r--r-- 1 peter peter 83 Jun 27 15:59 hello.c
lrwxrwxrwx 1 peter peter 2 Jun 28 10:26 pruzzel -> ..
-rw-r--r-- 1 peter peter 1033 Jun 27 16:26 SCRATCH
-rw-r--r-- 1 peter peter 1056 Jun 28 10:25 symlinks-1.log
-rw-r--r-- 1 peter peter 750 Jun 28 10:26 symlinks-2.log
-rw-r--r-- 1 peter peter 1436 Jun 28 10:28 symlinks-3.log
cassini/home/peter/bo/2019ss/bs/20190628> cat hello.c
#include <stdio.h>
int hello (void)
{
printf ("Hello, world!\n");
return 0;
}
cassini/home/peter/bo/2019ss/bs/20190628> ln hello.c hello-1.c
cassini/home/peter/bo/2019ss/bs/20190628> ln hello.c hello-1a.c
cassini/home/peter/bo/2019ss/bs/20190628> ln hello.c hello-1b.c
cassini/home/peter/bo/2019ss/bs/20190628> ls -l
insgesamt 164
-rw-r--r-- 1 peter peter 1112 Jun 28 10:29 hardlinks-1.log
-rw-r--r-- 1 peter peter 1247 Jun 28 10:31 hardlinks-2.log
-rw-r--r-- 4 peter peter 83 Jun 27 15:59 hello-1a.c
-rw-r--r-- 4 peter peter 83 Jun 27 15:59 hello-1b.c
-rw-r--r-- 4 peter peter 83 Jun 27 15:59 hello-1.c
-rw-r--r-- 1 peter peter 442 Jun 27 22:51 hello-1.s
-rw-r--r-- 1 peter peter 110 Jun 27 16:08 hello-2.c
-rw-r--r-- 1 peter peter 85304 Jun 27 16:11 hello-2.o
-rw-r--r-- 1 peter peter 90 Jun 27 15:59 hello-3.c
-rw-r--r-- 1 peter peter 112 Jun 27 16:28 hello-4.c
-rw-r--r-- 1 peter peter 1640 Jun 27 16:29 hello-4.o
-rw-r--r-- 1 peter peter 880 Jun 27 22:54 hello-5.o
-rw-r--r-- 1 peter peter 386 Jun 27 22:54 hello-5.s
-rw-r--r-- 1 peter peter 104 Jun 27 22:56 hello-6.c
-rw-r--r-- 1 peter peter 1640 Jun 27 22:56 hello-6.o
-rw-r--r-- 1 peter peter 560 Jun 27 22:57 hello-6.s
-rw-r--r-- 4 peter peter 83 Jun 27 15:59 hello.c
lrwxrwxrwx 1 peter peter 2 Jun 28 10:26 pruzzel -> ..
-rw-r--r-- 1 peter peter 1033 Jun 27 16:26 SCRATCH
-rw-r--r-- 1 peter peter 1056 Jun 28 10:25 symlinks-1.log
-rw-r--r-- 1 peter peter 750 Jun 28 10:26 symlinks-2.log
-rw-r--r-- 1 peter peter 1436 Jun 28 10:28 symlinks-3.log
cassini/home/peter/bo/2019ss/bs/20190628> ls -li
insgesamt 156
2156751 -rw-r--r-- 1 peter peter 1112 Jun 28 10:29 hardlinks-1.log
2156754 -rw-r--r-- 1 peter peter 1247 Jun 28 10:31 hardlinks-2.log
2156752 -rw-r--r-- 1 peter peter 1470 Jun 28 10:32 hardlinks-3.log
2156732 -rw-r--r-- 1 peter peter 442 Jun 27 22:51 hello-1.s
2156715 -rw-r--r-- 1 peter peter 110 Jun 27 16:08 hello-2.c
2156585 -rw-r--r-- 1 peter peter 85304 Jun 27 16:11 hello-2.o
2156704 -rw-r--r-- 1 peter peter 90 Jun 27 15:59 hello-3.c
2156725 -rw-r--r-- 1 peter peter 112 Jun 27 16:28 hello-4.c
2156712 -rw-r--r-- 1 peter peter 1640 Jun 27 16:29 hello-4.o
2156728 -rw-r--r-- 1 peter peter 880 Jun 27 22:54 hello-5.o
2156745 -rw-r--r-- 1 peter peter 386 Jun 27 22:54 hello-5.s
2156744 -rw-r--r-- 1 peter peter 104 Jun 27 22:56 hello-6.c
2156743 -rw-r--r-- 1 peter peter 1640 Jun 27 22:56 hello-6.o
2156742 -rw-r--r-- 1 peter peter 560 Jun 27 22:57 hello-6.s
2156714 -rw-r--r-- 2 peter peter 83 Jun 27 15:59 hello.c
2156748 lrwxrwxrwx 1 peter peter 2 Jun 28 10:26 pruzzel -> ..
2156711 -rw-r--r-- 1 peter peter 1033 Jun 27 16:26 SCRATCH
2156746 -rw-r--r-- 1 peter peter 1056 Jun 28 10:25 symlinks-1.log
2156522 -rw-r--r-- 1 peter peter 750 Jun 28 10:26 symlinks-2.log
2156750 -rw-r--r-- 1 peter peter 1436 Jun 28 10:28 symlinks-3.log
cassini/home/peter/bo/2019ss/bs/20190628> ls -li /tmp/hello-1.c
2156714 -rw-r--r-- 2 peter peter 83 Jun 27 15:59 /tmp/hello-1.c
cassini/home/peter/bo/2019ss/bs/20190607> ls -la
insgesamt 1044
drwxr-xr-x 3 peter peter 4096 Jun 14 08:57 .
drwxr-xr-x 13 peter peter 4096 Jun 28 10:50 ..
drwxr-xr-x 4 peter peter 4096 Jun 7 11:57 Abgabe
-rw-r--r-- 1 peter peter 17 Okt 9 2016 crash.c
-rw-r--r-- 1 peter peter 169 Jun 7 10:43 fak-1.c
-rw-r--r-- 1 peter peter 1369 Jun 7 11:02 fak-1.s
-rw-r--r-- 1 peter peter 2660 Jun 7 10:37 gdb-hello-1.log
-rw-r--r-- 1 peter peter 82 Jun 7 10:26 hello-1.c
-rw-r--r-- 1 peter peter 717 Jun 7 10:27 hello-1.s
-rw-r--r-- 1 peter peter 156772 Jun 7 13:30 photo-20190607-133025.jpg
-rw-r--r-- 1 peter peter 156199 Jun 7 13:32 photo-20190607-133131.jpg
-rw-r--r-- 1 peter peter 147075 Jun 7 13:32 photo-20190607-133241.jpg
-rw-r--r-- 1 peter peter 163742 Jun 7 13:33 photo-20190607-133301.jpg
-rw-r--r-- 1 peter peter 145606 Jun 7 13:34 photo-20190607-133353.jpg
-rw-r--r-- 1 peter peter 163808 Jun 7 13:35 photo-20190607-133443.jpg
-rw-r--r-- 1 peter peter 2472 Jun 7 14:11 SCRATCH
-rw-r--r-- 1 peter peter 67598 Jun 7 11:24 segments-1.png
-rw-r--r-- 1 peter peter 124 Jun 7 11:38 strings-1.c
-rw-r--r-- 1 peter peter 125 Jun 7 11:41 strings-2.c
-rw-r--r-- 1 peter peter 132 Jun 7 11:44 strings-3.c
-rw-r--r-- 1 peter peter 195 Jun 7 11:46 strings-4.c
cassini/home/peter/bo/2019ss/bs/20190607> cd ..
cassini/home/peter/bo/2019ss/bs> ls
20190329 20190405 20190412 20190426 20190503 20190510 20190607 20190614 20190628 common script
File added
File added
#include <stdio.h>
int main (void)
{
printf ("Hello, world!\n");
return 0;
}
File added
#include <stdio.h>
int hello (void)
{
printf ("Hello, world!\n");
return 0;
}
.file "hello-1.c"
.section .rodata.str1.1,"aMS",@progbits,1
.LC0:
.string "Hello, world!"
.text
.globl hello
.type hello, @function
hello:
.LFB11:
.cfi_startproc
subq $8, %rsp
.cfi_def_cfa_offset 16
leaq .LC0(%rip), %rdi
call puts@PLT
movl $0, %eax
addq $8, %rsp
.cfi_def_cfa_offset 8
ret
.cfi_endproc
.LFE11:
.size hello, .-hello
.ident "GCC: (Debian 6.3.0-18+deb9u1) 6.3.0 20170516"
.section .note.GNU-stack,"",@progbits
#include <unistd.h>
#include <stdlib.h>
int hello (void)
{
write (1, "Hello, world!\n", 14);
exit (0);
}
#include <unistd.h>
int hello (void)
{
write (1, "Hello, world!\n", 14);
return 0;
}
#include <unistd.h>
#include <stdlib.h>
void _start (void)
{
write (1, "Hello, world!\n", 14);
exit (0);
}
msg:
.string "Hello, world!\n"
.globl _start
_start:
movq $1, %rax # use the write syscall
movq $1, %rdi # write to stdout
movq $msg, %rsi # use string "Hello World!\n"
movq $14, %rdx # write 14 characters
syscall # make syscall
movq $60, %rax # use the _exit syscall
movq $0, %rdi # error code 0
syscall # make syscall
#include <unistd.h>
void _start (void)
{
syscall (1, 1, "Hello, World!\n", 14);
syscall (60, 0);
}
.file "hello-6.c"
.section .rodata.str1.1,"aMS",@progbits,1
.LC0:
.string "Hello, World!\n"
.text
.globl _start
.type _start, @function
_start:
.LFB0:
.cfi_startproc
subq $8, %rsp
.cfi_def_cfa_offset 16
movl $14, %ecx
leaq .LC0(%rip), %rdx
movl $1, %esi
movl $1, %edi
movl $0, %eax
call syscall@PLT
movl $0, %esi
movl $60, %edi
movl $0, %eax
call syscall@PLT
addq $8, %rsp
.cfi_def_cfa_offset 8
ret
.cfi_endproc
.LFE0:
.size _start, .-_start
.ident "GCC: (Debian 6.3.0-18+deb9u1) 6.3.0 20170516"
.section .note.GNU-stack,"",@progbits
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment