汇编语言实现文本浏览器

运行程序后,屏幕显示“input number (1-3):”

键入“1”后,显示“chapter1: introduction”

键入“2”后,显示“chapter2: designing method”

键入“3”后,显示“chapter3: experiment”

键入其他数字后,返回屏幕提示状态 。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
 data segment
str db 'please input number(1-3):','$'
str1 db 'chapter1: introduction','$'
str2 db 'chapter2: designing method','$'
str3 db 'chapter3:experimenr','$'
table dw A1,A2,A3
data ends
code segment
assume cs:code,ds:data
start: mov ax,data
mov ds,ax
begin:mov dx,offset str
mov ah,9
int 21h
mov ah,01h
int 21h
cmp al,'1'
jb finish
cmp al,'3'
ja finish
and ax,000FH
dec ax
shl ax,1
mov bx,ax
jmp table[bx]
A1: mov dx,offset str1
mov ah,9
int 21h
jmp enter
A2: mov dx,offset str2
mov ah,9
int 21h
jmp enter
A3: mov dx,offset str3
mov ah,9
int 21h
jmp enter
finish: mov dl,0dh
mov ah,2
int 21h
mov dl,0ah
int 21h
jmp begin
enter: mov ax,4c00h
int 21h
code ends
end start