汇编语言——利用地址显示文本

来源:互联网 发布:锤子科技 成都 知乎 编辑:程序博客网 时间:2024/06/05 05:59
assume cs:code,ds:datadata segmentp db 0dh,0ah,"Input a number(1~3)",0dh,0ah,'$'pw db "Do you want to exit ?  1/0",0dh,0ah,'$'p1 db 0dh,0ah,"chaptar1: introduction",0dh,0ah,'$'p2 db 0dh,0ah,"chapter2: designing method",0dh,0ah,'$'p3 db 0dh,0ah,"chapter3: experiment",0dh,0ah,'$'table dw p11,p22,p33data endscode segment start1: mov ax,data mov ds,ax mov dx,offset p mov ah,9 int 21h mov ah,1 int 21h cmp al,'1' jb start1 cmp al,'3' ja start1 and ax,000fh dec ax shl ax,1 mov bx,ax jmp table[bx]start2:mov ah,9int 21hmov dx,offset pw    mov ah,9int 21hmov ah,1int 21hcmp al,'1'je start1mov ax,4c00hint 21hp11:mov dx,offset p1jmp start2p22:mov dx,offset p2jmp start2p33:mov dx,offset p3jmp start2code endsend start1

0 0