1extern void print( char color, char * text );
2int i;
3int main()
4{
5 print(0xf,"neocs: loader\n\r");
6
7 print(0xf,"it's written by C!\n\r");
8
9 return 0;
10
11}
1extrn _main:near
2.model tiny
3.code
4
5public _halt, main, _print,
6
7main proc near
8 mov dx,ax
9 mov ax,cs
10 mov ds,ax
11 mov es,ax
12 mov ss,ax
13 mov ax,0fff0h
14 mov sp,ax
15 mov ax,dx
16 call _main
17 call _halt
18main endp
19
20_halt proc near
21hl:
22 hlt
23 jmp short hl
24_halt endp
25
26_print proc near
27 push bp
28 mov bp,sp
29 push si
30 mov si,word ptr ss:[bp+6]
31 mov bl,byte ptr ss:[bp+4]
32_loop:
33 mov al,byte ptr ds:[si]
34 test al,al
35 jz _break
36 mov bh,0
37 mov ah,0eh
38 int 010h
39 inc si
40 jmp short _loop
41
42_break:
43 pop si
44 mov sp,bp
45 pop bp
46 ret
47_print endp
48
49end main
50
Click here to download
posted on 2007-05-20 00:26
shaker(太子) 阅读(1605)
评论(23) 编辑 收藏 引用 所属分类:
C++