hello.asm

Home » 組合語言 » hello.asm
2015-01-30 組合語言 尚無留言
section .data
	hello:     db '哈囉!',10
	helloLen:  equ $-hello

section .text
	global _start
_start:
	; Write 'Hello world!' to the screen
	mov eax,4            ; 'write' system call
	mov ebx,1            ; file descriptor 1 = screen
	mov ecx,hello        ; string to write
	mov edx,helloLen     ; length of string to write
	int 80h              ; call the kernel

	; Terminate program
	mov eax,1            ; 'exit' system call
	mov ebx,0            ; exit with error code 0
	int 80h              ; call the kernel

LEAVE A COMMENT

  ⁄  one  =  six

這個網站採用 Akismet 服務減少垃圾留言。進一步了解 Akismet 如何處理網站訪客的留言資料