回答編集履歴
2
追記
test
CHANGED
@@ -40,7 +40,7 @@
|
|
40
40
|
|
41
41
|
movq -16(%rbp), %rax
|
42
42
|
|
43
|
-
movzbl (%rax), %esi
|
43
|
+
movzbl (%rax), %esi # byteをintに変換
|
44
44
|
|
45
45
|
movb $0, %al
|
46
46
|
|
1
エラー追記
test
CHANGED
@@ -5,3 +5,87 @@
|
|
5
5
|
以下を参考に。
|
6
6
|
|
7
7
|
[整数変換のルールを理解する](https://www.jpcert.or.jp/sc-rules/c-int02-c.html)
|
8
|
+
|
9
|
+
|
10
|
+
|
11
|
+
「追記」
|
12
|
+
|
13
|
+
```asm
|
14
|
+
|
15
|
+
main: # @main
|
16
|
+
|
17
|
+
.cfi_startproc
|
18
|
+
|
19
|
+
# %bb.0:
|
20
|
+
|
21
|
+
pushq %rbp
|
22
|
+
|
23
|
+
.cfi_def_cfa_offset 16
|
24
|
+
|
25
|
+
.cfi_offset %rbp, -16
|
26
|
+
|
27
|
+
movq %rsp, %rbp
|
28
|
+
|
29
|
+
.cfi_def_cfa_register %rbp
|
30
|
+
|
31
|
+
subq $32, %rsp
|
32
|
+
|
33
|
+
movabsq $.L.str.1, %rdi
|
34
|
+
|
35
|
+
movabsq $.L.str, %rax
|
36
|
+
|
37
|
+
movl $0, -4(%rbp)
|
38
|
+
|
39
|
+
movq %rax, -16(%rbp)
|
40
|
+
|
41
|
+
movq -16(%rbp), %rax
|
42
|
+
|
43
|
+
movzbl (%rax), %esi
|
44
|
+
|
45
|
+
movb $0, %al
|
46
|
+
|
47
|
+
callq printf
|
48
|
+
|
49
|
+
xorl %esi, %esi
|
50
|
+
|
51
|
+
movl %eax, -20(%rbp) # 4-byte Spill
|
52
|
+
|
53
|
+
movl %esi, %eax
|
54
|
+
|
55
|
+
addq $32, %rsp
|
56
|
+
|
57
|
+
popq %rbp
|
58
|
+
|
59
|
+
retq
|
60
|
+
|
61
|
+
.Lfunc_end0:
|
62
|
+
|
63
|
+
.size main, .Lfunc_end0-main
|
64
|
+
|
65
|
+
.cfi_endproc
|
66
|
+
|
67
|
+
# -- End function
|
68
|
+
|
69
|
+
.type .L.str,@object # @.str
|
70
|
+
|
71
|
+
.section .rodata.str1.1,"aMS",@progbits,1
|
72
|
+
|
73
|
+
.L.str:
|
74
|
+
|
75
|
+
.asciz "abc"
|
76
|
+
|
77
|
+
.size .L.str, 4
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
.type .L.str.1,@object # @.str.1
|
82
|
+
|
83
|
+
.L.str.1:
|
84
|
+
|
85
|
+
.asciz "%d\n"
|
86
|
+
|
87
|
+
.size .L.str.1, 4
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
```
|