21,459
社区成员
发帖
与我相关
我的任务
分享
assume cs:code
stack segment
dw 100 dup(0)
stack ends
code segment
start:
mov ax, stack
mov ss,ax
mov sp,100
mov ax,code
mov es,ax
mov bx,offset shanqu1
mov al,1
mov ch,0
mov cl,1
mov dl,0
mov dh,0
mov ah,3
int 13h
mov ax,code
mov es,ax
mov bx,offset shanqu2
mov al,2
mov ch,0
mov cl,2
mov dl,0
mov dh,0
mov ah,3
int 13h
mov ax,4c00h
int 21h
shanqu1:
mov ax,0
mov es,ax
mov bx,200h
mov al,2
mov ch,0
mov cl,2
mov dl,0
mov dh,0
mov ah,2
int 13h
;jmp 0:200;为什么报错A2096
shanqu1end:nop
shanqu2:
assume cs:code1
data1 segment
str1 db '1) reset pc',0
str2 db '2) start system',0
str3 db '3) clock',0
str4 db '4) set clock',0
data1 ends
stack1 segment
dw 100 dup(0)
stack1 ends
code1 segment
start1:
mov ax, stack1
mov ss,ax
mov sp,100
mov dh,10;显示的行号
mov dl,15;显示的列号
mov cl,4ah
mov ax,data1
mov ds,ax
mov bx,offset str1
call show_str;调用显示字符串函数
mov dh,11;显示的行号
mov dl,15;显示的列号
mov cl,4ah
mov ax,data1
mov ds,ax
mov bx,offset str2
call show_str;调用显示字符串函数
mov dh,12;显示的行号
mov dl,15;显示的列号
mov cl,4ah
mov bx,offset str3
call show_str;调用显示字符串函数
mov dh,13;显示的行号
mov dl,15;显示的列号
mov cl,4ah
mov bx,offset str4
call show_str;调用显示字符串函数
;显示字符串函数\/
show_str:
push ax
push bx
push cx
push dx
push es
push si
push cx
mov al,160
dec dh
mul dh
push ax
mov al,2
dec dl
mul dl
pop si
add si,ax
mov ax,0b800h
mov es,ax
pop dx
mov ch,0
;pop si
s: mov cl,ds:[bx]
jcxz ok
mov al,ds:[bx]
mov es:[si],al
mov es:[si+1],dl
inc bx
add si,2
jmp short s
ok:
pop si
pop es
pop dx
pop cx
pop bx
pop ax
ret
;显示字符串函数^
code1 ends
end start1
shanqu2end:nop
code ends
end start