by@__dAi00
WA
481ms
extern printf ; 2: printf関数を持ってくる
; データセクション
section .data
fmt: db "x=%d", 10, 0 ; 6: printfで使うフォーマットを定義
; コードセクション
section .text
global _start ; 10: _startを指名
; スタート
main:
; printfに使うレジスタの値を指定のレジスタに移動
mov edi, fmt ; 16: printfのフォーマットをレジスタに置く
mov esi, 1234567890 ; 17: 出力する数値の指定
mov eax, 0 ; 19: 返り値を0にする
callq printf ; 21: printfをコール
; 後処理
mov eax, 1 ; 24: 返り値を1にする
mov ebx, 0 ; 25: 終了ステータスコード
int 0x80 ; 26: システムコール29 74 69 85 89 79 63 35 02 15 99 97
/tmp/code.asm:20: error: parser: instruction expected gcc: error: /tmp/code.o: No such file or directory gcc: fatal error: no input files compilation terminated. /bin/script: 16: /bin/script: /tmp/code: not found rm: cannot remove '/tmp/code.o': No such file or directory rm: cannot remove '/tmp/code': No such file or directory