现在的位置: 首页 > 综合 > 正文

一个Boot Sector

2013年09月18日 ⁄ 综合 ⁄ 共 385字 ⁄ 字号 评论关闭

用openwatcom编译测试过微笑

boot.asm文件:

            .186
            .MODEL SMALL

            .DATA
            .CODE

            ORG     0

            JMP     Start

hello       DB      'Hello, World', 13, 10, 0

Start:
            MOV     AX, 07C0H
            MOV     DS, AX
            MOV     ES, AX
            CLD
            MOV     SI, OFFSET hello
            CALL    PrintStr

Hang:
            JMP     Hang

PrintStr:
            LODSB
            OR      AL, AL
            JZ      PrintStrEnd
            MOV     AH, 0EH
            MOV     BX, 0007
            INT     10H
            JMP     PrintStr
PrintStrEnd:
            RET

            ORG     510
            DW      0AA55H

            END

Makefile文件:

ASM = wasm
CL = wcl

boot.bin: boot.asm
	$(ASM) boot.asm
	$(CL) boot.obj
	exe2bin boot.exe boot.bin

clean:
	del *.exe
	del *.obj

抱歉!评论已关闭.