-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkernel.s
101 lines (99 loc) · 2.37 KB
/
kernel.s
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
.text
.file "kernel.c"
.globl print_maybechar # -- Begin function print_maybechar
.p2align 4, 0x90
.type print_maybechar,@function
print_maybechar: # @print_maybechar
.cfi_startproc
# %bb.0:
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset %rbp, -16
movq %rsp, %rbp
.cfi_def_cfa_register %rbp
movb %dil, %al
movb %al, -1(%rbp)
movb -1(%rbp), %al
#APP
movl 753664, %eax
#NO_APP
movl %eax, -8(%rbp)
popq %rbp
.cfi_def_cfa %rsp, 8
retq
.Lfunc_end0:
.size print_maybechar, .Lfunc_end0-print_maybechar
.cfi_endproc
# -- End function
.globl realprint # -- Begin function realprint
.p2align 4, 0x90
.type realprint,@function
realprint: # @realprint
.cfi_startproc
# %bb.0:
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset %rbp, -16
movq %rsp, %rbp
.cfi_def_cfa_register %rbp
subq $16, %rsp
movq %rdi, -8(%rbp)
.LBB1_1: # =>This Inner Loop Header: Depth=1
movq -8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0, %eax
je .LBB1_3
# %bb.2: # in Loop: Header=BB1_1 Depth=1
movq -8(%rbp), %rax
movsbl (%rax), %edi
callq print_maybechar
movq -8(%rbp), %rax
addq $1, %rax
movq %rax, -8(%rbp)
jmp .LBB1_1
.LBB1_3:
addq $16, %rsp
popq %rbp
.cfi_def_cfa %rsp, 8
retq
.Lfunc_end1:
.size realprint, .Lfunc_end1-realprint
.cfi_endproc
# -- End function
.globl kernel # -- Begin function kernel
.p2align 4, 0x90
.type kernel,@function
kernel: # @kernel
.cfi_startproc
# %bb.0:
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset %rbp, -16
movq %rsp, %rbp
.cfi_def_cfa_register %rbp
leaq .L.str(%rip), %rdi
callq realprint
popq %rbp
.cfi_def_cfa %rsp, 8
retq
.Lfunc_end2:
.size kernel, .Lfunc_end2-kernel
.cfi_endproc
# -- End function
.type video_memory,@object # @video_memory
.data
.globl video_memory
.p2align 3
video_memory:
.quad 753664
.size video_memory, 8
.type .L.str,@object # @.str
.section .rodata.str1.1,"aMS",@progbits,1
.L.str:
.asciz "Hello, World!"
.size .L.str, 14
.ident "Debian clang version 14.0.6"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym print_maybechar
.addrsig_sym realprint