新聞中心

EEPW首頁 > 嵌入式系統(tǒng) > 設(shè)計應(yīng)用 > 匯編:將兩位十進制數(shù)轉(zhuǎn)化為十六進制數(shù)

匯編:將兩位十進制數(shù)轉(zhuǎn)化為十六進制數(shù)

作者: 時間:2016-12-01 來源:網(wǎng)絡(luò) 收藏
這個是一個把兩位十進制數(shù)轉(zhuǎ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


上一頁 1 2 下一頁

評論


技術(shù)專區(qū)

關(guān)閉