匯編:將兩位十進(jìn)制數(shù)轉(zhuǎn)化為十六進(jìn)制數(shù)
data segment
tital1 db Please input shi jin zi shu (example 13): ,$
tital2 db it is transpranted into shi liu jin zi shu :,$
tital3 db Do you want to have a try again (yes "y",no "n"): ,$
tital4 db welcome to use this program It is made by WQ 2012/5/17,$
kongzi db 0dh,0ah,$
data ends
code segment
assume cs:code,ds:data
start:
mov ax,data
mov ds,ax
retry:
lea dx,kongzi ;換行回車
mov ah,09h
int 21h
lea dx,tital1 ;輸出抬頭1
mov ah,09h
int 21h
mov al,0 ;初始化al
mov ah,01h ;輸入并回顯
int 21h
mov bh,al ;放在bx中保存
mov ah,01h
int 21h
mov bl,al
lea dx,kongzi ;換行回車
mov ah,09h
int 21h
lea dx,tital2 ;輸出抬頭2
mov ah,09h
int 21h
評(píng)論