Files
30dayMakeOS/04_day/naskfunc.nas
Yourtion 7acac01b40 汉化
2014-09-10 14:59:10 +08:00

22 lines
508 B
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
; naskfunc
; TAB=4
[FORMAT "WCOFF"] ; 制作目标文件的模式
[INSTRSET "i486p"] ; 制定使用486编译
[BITS 32] ; 3制作32位模式用的机器语言
[FILE "naskfunc.nas"] ; 文件名
GLOBAL _io_hlt,_write_mem8
[SECTION .text]
_io_hlt: ; void io_hlt(void);
HLT
RET
_write_mem8: ; void write_mem8(int addr, int data);
MOV ECX,[ESP+4] ; [ESP+4]中存放的是地址将其读入ECX
MOV AL,[ESP+8] ; [ESP+8]中存放的是数据将其读入AL
MOV [ECX],AL
RET