汇编语言实现文本浏览器

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

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

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

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

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

 

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

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值