質問編集履歴
4
訂正
test
CHANGED
File without changes
|
test
CHANGED
@@ -218,7 +218,7 @@
|
|
218
218
|
|
219
219
|
msg: .ascii "%s\0";
|
220
220
|
|
221
|
-
msg2: .ascii "Repeat 1
|
221
|
+
msg2: .ascii "Repeat 1 times\n\0";
|
222
222
|
|
223
223
|
.globl _main
|
224
224
|
|
3
訂正
test
CHANGED
File without changes
|
test
CHANGED
@@ -214,10 +214,12 @@
|
|
214
214
|
|
215
215
|
```s
|
216
216
|
|
217
|
-
|
217
|
+
.text
|
218
218
|
|
219
219
|
msg: .ascii "%s\0";
|
220
220
|
|
221
|
+
msg2: .ascii "Repeat 10 times\n\0";
|
222
|
+
|
221
223
|
.globl _main
|
222
224
|
|
223
225
|
|
@@ -226,20 +228,36 @@
|
|
226
228
|
|
227
229
|
|
228
230
|
|
229
|
-
subl $
|
231
|
+
subl $20,%esp
|
230
|
-
|
232
|
+
|
231
|
-
leal 8(%esp), %eax
|
233
|
+
leal 8(%esp), %eax #12bytes can be input.
|
232
|
-
|
234
|
+
|
233
|
-
movl %eax,
|
235
|
+
movl %eax, 4(%esp)
|
234
|
-
|
236
|
+
|
235
|
-
movl $msg,
|
237
|
+
movl $msg,(%esp)
|
236
238
|
|
237
239
|
call _scanf
|
238
240
|
|
241
|
+
|
242
|
+
|
243
|
+
subl $15,%esp
|
244
|
+
|
245
|
+
movl $msg2,4(%esp)
|
246
|
+
|
247
|
+
movl $msg,(%esp) #printf("%s",sample);
|
248
|
+
|
249
|
+
call _printf
|
250
|
+
|
239
|
-
add
|
251
|
+
add $15,%esp
|
252
|
+
|
253
|
+
|
254
|
+
|
240
|
-
|
255
|
+
call _printf
|
256
|
+
|
241
|
-
|
257
|
+
add $20,%esp
|
242
258
|
|
243
259
|
ret
|
244
260
|
|
261
|
+
|
262
|
+
|
245
|
-
```
|
263
|
+
```
|
2
追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -205,3 +205,41 @@
|
|
205
205
|
|
206
206
|
|
207
207
|
どこなのかについて教えてください。
|
208
|
+
|
209
|
+
|
210
|
+
|
211
|
+
以下解決コード
|
212
|
+
|
213
|
+
|
214
|
+
|
215
|
+
```s
|
216
|
+
|
217
|
+
.text
|
218
|
+
|
219
|
+
msg: .ascii "%s\0";
|
220
|
+
|
221
|
+
.globl _main
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
_main:
|
226
|
+
|
227
|
+
|
228
|
+
|
229
|
+
subl $12,%esp
|
230
|
+
|
231
|
+
leal 8(%esp), %eax
|
232
|
+
|
233
|
+
movl %eax, 8(%esp)
|
234
|
+
|
235
|
+
movl $msg,4(%esp)
|
236
|
+
|
237
|
+
call _scanf
|
238
|
+
|
239
|
+
add $12, %esp
|
240
|
+
|
241
|
+
|
242
|
+
|
243
|
+
ret
|
244
|
+
|
245
|
+
```
|
1
タイトル修正
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
アセンブリ言語でscanfを
|
1
|
+
アセンブリ言語でscanfを使いたいです。
|
test
CHANGED
File without changes
|