06/09/22 21:13:04
スペースが無視されたみたいなので、もう一回送ります。
section .data ; データセクションの定義
message db ' Hello, World ', 0Ah
length equ $ -message ; 文字の長さ
section .text
global _start
_start:
mov edx, length ; 文字列の長
mov ecx, [message] ; 以下の3行でmsgとmsg+1の内容を入れ換える
xchg ecx, [message+1] ;
mov [message], ecx ;
mov ecx, message ; 出力する文字の指定
mov ebx, 1 ; ファイルハンドル(1=標準出力)
mov eax, 4 ; 出力(sys_wrigte)
int 0x80 ; システムコール,出力する
mov eax, 1 ; sys_exit
mov ebx, 0 ; 終了ステータスコード
int 0x80 ; システムコール,終了する
eHllo, World としたいのですけど Helelo, World と表示されます!