关于 王爽的汇编语言的课程设计2 小弟不懂请教各位大侠指教!
以下是小弟写的汇编,关于王爽的汇编语言的课程设计2我还没把时间的设置写出来!想先调试一下大致的程序可以下小弟写的代码怎么也不能转换成EXE格式!用 masm的link 转换 提示说 LINK warning L4021: no stack segment 网上查了资料说没有设置堆栈!我在后来的调试中也尝试加进堆栈,可无论加在哪儿都是一样的问题!请教各位大侠指点一下!程序中那些地方错误和不足也麻烦能指出来!小弟我刚学汇编!如果那位有 王爽的汇编语言的课程设计2 的正确答案 麻烦能告诉我! 小弟在此拜谢了!
assume cs:code
code segment
start:lea ax,acc
mov es,ax
mov bx,0
mov al,1
mov dh,0
mov ch,0
mov cl,2
mov dl,0
mov ah,3
int 13h
mov ax,4c00h
int 21h
acc:
mov ax,cs
mov ds,ax
mov si,offset int9
mov ax,0
mov es,ax
mov di,204h
mov cx,offset int9end-offset int9
cld
rep movsb
mov ax,es:[9*4]
mov es:[200h],ax
mov ax,es:[9*4+2]
mov es:[202h],ax
cli
mov word ptr es:[9*4],204h
mov word ptr es:[9*4+2],0
sti
s: in al,60h
cmp al,2
je resetpc ;重起
cmp al,3
je startsystem ;引导现有的操作系统
cmp al,4
je clock ;时钟显示
jmp short s
resetpc:
mov ax,0ffffh
push ax
mov ax,0
push ax
retf
startsystem:
mov ax,0
mov es,ax
mov bx,7c00h
mov dh,0 ;磁盘面
mov ch,0 ;磁道号
mov cl,1 ;扇区号
mov al,1 ;扇区数
mov ah,0 ;读
mov dl,80h ;驱动器号(C盘)
int 13h
pushf
mov ax,0
push ax
mov ax,7c00h
push ax
iret
clock:
push si
push bp
push dx
mov si,0
mov dl,4
mov dh,9
mov bp,18
mov cx,3
s1: push cx
mov al,dh
out 70h,al
in al,71h
mov ah,al
mov cl,4
shr ah,cl
and al,00001111b
add ah,30h
add al,30h
mov bx,0b800h
mov es,bx
mov byte ptr es:2000[si],ah
mov byte ptr es:2000[si+2],al
mov al,dl
out 70h,al
in al,71h
mov ah,al
shr ah,cl
and al,00001111b
add ah,30h
add al,30h
mov byte ptr es:2000[bp+si],ah
mov byte ptr es:2000[bp+si+2],al
add si,6
sub dl,2
sub dh,1
pop cx
loop s1
pop dx
pop bp
pop si
mov byte ptr es:[2004],'/'
mov byte ptr es:[2010],'/'
mov byte ptr es:[2022],':'
mov byte ptr es:[2028],':'
in al,60h
cmp al,0 ;esy键的扫描码
je quit
jmp clock
;以上4句为动态获取系统时间的关键
quit: jmp near ptr s
int9: push ax
push bx
push es
in al,60h
pushf
call dword ptr cs:[200]
cmp al,3bh
jne int9ret
mov ax,0b800h
mov es,ax
inc byte ptr es:[2005]
inc byte ptr es:[2011]
inc byte ptr es:[2023]
inc byte ptr es:[2029]
inc byte ptr es:[1971]
inc byte ptr es:[1973]
inc byte ptr es:[1975]
inc byte ptr es:[1979]
inc byte ptr es:[1981]
inc byte ptr es:[1983]
inc byte ptr es:[1987]
inc byte ptr es:[1989]
inc byte ptr es:[1991]
int9ret:pop es
pop bx
pop ax
iret
int9end:nop
accend:nop
code ends
end start