結果

問題 No.9000 Hello World! (テスト用)
ユーザー yuki2006yuki2006
提出日時 2016-03-31 01:43:28
言語 Assembler
(nasm 2.16.01)
結果
AC  
実行時間 0 ms / 5,000 ms
コード長 1,120 bytes
コンパイル時間 38 ms
コンパイル使用メモリ 6,944 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-20 04:23:18
合計ジャッジ時間 436 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 0 ms
6,816 KB
testcase_01 AC 0 ms
6,940 KB
testcase_02 AC 0 ms
6,944 KB
testcase_03 AC 0 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

; ref http://cs.lmu.edu/~ray/notes/nasmtutorial/
; ----------------------------------------------------------------------------------------
; Writes "Hello, World" to the console using only system calls. Runs on 64-bit Linux only.
; To assemble and run:
;
;     nasm -felf64 hello.asm && ld hello.o && ./a.out
; ----------------------------------------------------------------------------------------

        global  _start

        section .text
_start:
        ; write(1, message, 13)
        mov     rax, 1                  ; system call 1 is write
        mov     rdi, 1                  ; file handle 1 is stdout
        mov     rsi, message            ; address of string to output
        mov     rdx, 13                 ; number of bytes
        syscall                         ; invoke operating system to do the write

        ; exit(0)
        mov     eax, 60                 ; system call 60 is exit
        xor     rdi, rdi                ; exit code 0
        syscall                         ; invoke operating system to exit
message:
        db      "Hello World!", 10      ; note the newline at the end
0