您是否尝试过这个文档,标题为 “Linux的大会教程”
http://docs.cs.up.ac.za/programming/asm/derick_tut/
它,例如,一个 “Hello World” 曰(逐字复制):
section .data
hello: db 'Hello world!',10 ; 'Hello world!' plus a linefeed character
helloLen: equ $-hello ; Length of the 'Hello world!' string
; (I'll explain soon)
section .text
global _start
_start:
mov eax,4 ; The system call for write (sys_write)
mov ebx,1 ; File descriptor 1 - standard output
mov ecx,hello ; Put the offset of hello in ecx
mov edx,helloLen ; helloLen is a constant, so we don't need to say
; mov edx,[helloLen] to get it's actual value
int 80h ; Call the kernel
mov eax,1 ; The system call for exit (sys_exit)
mov ebx,0 ; Exit with return code of 0 (no error)
int 80h
(谷歌查询我得到这个从:https://www.google.co.uk/search?q=how+to+write+drivers&oq=how+to+write+drivers)
有一个原因,你不写机器代码 - 它是非常具体的个别处理器。快速谷歌出现:http://www.programmersheaven.com/mb/pharabee/344751/344751/how-to-write-a-assembler/ – 2013-02-08 23:50:07
根据你想要去的方向,我建议或者osdev wiki或Linux内核模块接口教程。 – Dougvj 2013-02-09 00:13:26