用8086汇编语言编写程序,接受从键盘上输入的一个两位十进制数字,这个数经过BCD码处理,以十六进制显示出 8086汇编语言中BCD码怎么转换?
8086\u5c06\u7ed9\u5b9a\u7684\u4e8c\u8fdb\u5236\u65701234\u3002\u8f6c\u6362\u6210\u4e8c\u8fdb\u5236\u7f16\u7801\u7684\u5341\u8fdb\u5236bcd\u7801\u4e8c\u8fdb\u5236\u7f16\u7801\u7684\u5341\u8fdb\u5236\u6570\uff0c\u7b80\u79f0BCD\u7801(Binarycoded Decimal). \u8fd9\u79cd\u65b9\u6cd5\u662f\u75284\u4f4d\u4e8c\u8fdb\u5236\u7801\u7684\u7ec4\u5408\u4ee3\u8868\u5341\u8fdb\u5236\u6570\u76840\uff0c1\uff0c2\uff0c3\uff0c4\uff0c5\uff0c6 \uff0c7\uff0c8\uff0c9 \u5341\u4e2a\u6570\u7b26\u30024\u4f4d\u4e8c\u8fdb\u5236\u6570\u7801\u670916\u79cd\u7ec4\u5408\uff0c\u539f\u5219\u4e0a\u53ef\u4efb\u9009\u5176\u4e2d\u768410\u79cd\u4f5c\u4e3a\u4ee3\u7801\uff0c\u5206\u522b\u4ee3\u8868\u5341\u8fdb\u5236\u4e2d\u76840\uff0c1\uff0c2\uff0c3\uff0c4\uff0c5\uff0c6\uff0c7\uff0c8\uff0c9 \u8fd9\u5341\u4e2a\u6570\u7b26\u3002\u6700\u5e38\u7528\u7684BCD\u7801\u79f0\u4e3a8421BCD\u7801\uff0c8.4.2.1 \u5206\u522b\u662f4\u4f4d\u4e8c\u8fdb\u6570\u7684\u4f4d\u53d6\u503c\u3002 \u70b9\u51fb\u6b64\u5904\u5c06\u7ed9\u51fa\u5341\u8fdb\u5236\u6570\u548c8421BCD\u7f16\u7801\u7684\u5bf9\u5e94\u5173\u7cfb\u8868\u3002
\u628a30H\u7684\u6570\u53d6\u51fa\u6765
\u5206\u914d\u5728bx\u4e2d
bh\u548cbl\u4e24\u4e2a\u90fd\u90fd\u52a0\u4e0a3
\u628a
\u628abh\u7684\u503c\u8d4b\u7ed9\u5730\u5740\u4e3a41H\u4e0a\uff0cbh\u7684\u503c\u8d4b\u7ed940H
DISP_STR MACRO X ;宏定义.
MOV DX, OFFSET X
MOV AH, 9
INT 21H
ENDM
;----------------------
DATA SEGMENT ;数据段.
MSG1 DB 13, 10, 'Please Input : $'
MSG3 DB 13, 10, 'The HEX is : $'
x DW ? ;存放新输入数据.
DATA ENDS
;----------------------
CODE SEGMENT ;代码段.
ASSUME CS: CODE, DS: DATA
START:
MOV AX, DATA
MOV DS, AX
;--------------------------------
IN_LOOP:
DISP_STR MSG1 ;宏调用,提示 Please Input :
;--------------------------------
MOV x, 0 ;数据清零.
_INX:
MOV AH, 1 ;输入字符.
INT 21H
;--------------------------------
CMP AL, 13 ;回车?
JE _IN_END ;是则结束输入.
CMP AL, '0'
JB IN_LOOP ;小于'0',不是数字.
CMP AL, '9'
JA IN_LOOP ;大于'9',不是数字.
SUB AL, '0'
MOV CL, AL
MOV CH, 0
MOV AX, x
MOV BX, 10 ;老数据乘以10
MUL BX
ADD AX, CX ;加上新数据.
MOV x, AX ;保存.
CMP AX, 99
JA IN_LOOP
JMP _INX
;--------------------------------
_IN_END:
DISP_STR MSG3 ;宏调用,提示 The HEX is :
MOV AX, x
MOV BX, 16
MOV CX, 0
D_1:MOV DX, 0
DIV BX
ADD DL, '0'
CMP DL, 3AH
JB ZZZ
ADD DL, 7
ZZZ:
PUSH DX
INC CX
CMP AX, 0
JNE D_1
MOV AH, 2
D_2:POP DX
INT 21H
LOOP D_2
;--------------------------------
MOV AH, 4CH
INT 21H
;--------------------------------
CODE ENDS
END START
;=====================
学汇编,要用到哪些软件
绛旓細鐢8086姹囩紪璇█缂栧啓绋嬪簭,鎺ュ彈浠庨敭鐩樹笂杈撳叆鐨勪竴涓袱浣嶅崄杩涘埗鏁板瓧,杩欎釜鏁扮粡杩嘊CD鐮佸鐞,浠ュ崄鍏繘鍒舵樉绀哄嚭 10 闇鍏ㄨ繃绋 yihaoxiaoniao | 娴忚1779 娆 |涓炬姤 鎴戞湁鏇村ソ鐨勭瓟妗堟帹鑽愪簬2017-12-16 15:21:12 鏈浣崇瓟妗 ;===DISP_STR MACRO X ;瀹忓畾涔. MOV DX, OFFSET X MOV AH, 9 INT 21HENDM;---DATA SEGM...
绛旓細;鎺ユ敹杈撳叆缂撳啿鍖,BUFF[0]瀛樺偍缂撳啿鍖哄ぇ灏,BUFF[1]瀛樺偍瀹為檯杈撳叆鏁,BUFF[2]寮濮嬩负杈撳叆鐨勬暟鎹甛x0d\x0aSHEXDB'0123456789ABCDEF$'\x0d\x0aMSG1db13,10,'space:$'\x0d\x0aMSG2db13,10,'number:$'\x0d\x0aMSG3db13,10,'alpha:$'\x0d\x0aMSG4db13,10,'other:$'\x0d\x0aMSG5db'inputyour...
绛旓細assume cs:csegcseg segment hextab db '0123456789ABCDEF' A dd 11118888H b dd 33339444H c dd 0start: mov ax, cseg mov ds, ax mov ax, word ptr a add ax, word ptr b mov word ptr c, ax mov ax, word ptr a+2 adc ax, word ptr b+2 mov word ptr ...
绛旓細; 鐩稿姞鐨勪袱涓暟浠ュ強鍏跺拰涓嶅緱瓒呰繃6.5浜匡紝鍚﹀垯鍑虹幇闄ゆ硶婧㈠嚭; 杈撳叆鐨勪袱涓暟瀛樺叆鏁扮粍x 涓 锛堣緭鍏ユ椂锛屼袱涓暟浠ョ┖鏍奸棿闅旓紝浠ュ洖杞︾粨鏉熻緭鍏ワ級; 鐩稿姞鐨勭粨鏋滃瓨鍏 涓紝鎴杁x銆乤x涓璫ode segment assume cs:code org 100hSTART: JMP BBBX DD 10 dup(?)num dw ?Y DD ?cc db ...
绛旓細;绋嬪簭鍚嶇О:HEX2TOASCII ;鍔熻兘:2浣嶅崄鍏繘鍒舵暟杞珹SCII鐮 ;鍏ュ彛鍙傛暟:AL ;鍑哄彛鍙傛暟:AX ;涓存椂绌洪棿:CH:鏆傚鏁版嵁锛孋L:绉讳綅娆℃暟 ;璋 鐢:HEX1TOASCII锛氫竴浣岺EX杞崲ASCII鐮 ;浣 鑰:;鍒涘缓鏃ユ湡:2009-11-06 ;鍒涘缓鏃堕棿:23:12 ;绋嬪簭鐗堟湰锛;--- HEX2TOASCII PROC MOV CH, AL ;鏆傚瓨鏁版嵁 ...
绛旓細AH, 9INT 21HJMP LOOP1LOOP3:; 鍒ゆ柇 SHIFT 閿甅OV DL, ALCMP DL, 0EHJNE LOOP2MOV DX, OFFSET SPACESMOV AH, 9INT 21HJMP LOOP1LOOP2:; 鍒ゆ柇 ESC 閿甅OV DL, ALCMP DL, 1BHJE EXIT; 鏄剧ず瀛楃MOV DL, ALMOV AH, 02HINT 21HJMP LOOP1EXIT:MOV AH, 4CHINT 21HCSEGENDSEND BEGIN ...
绛旓細SSEG SEGMENT STACK STK DB 20 DUP(?)SSEG ENDS DSEG SEGMENT BUFF DW -5,56,45,-96,5,2,457,8,7,-8 MAX DW ?MIN DW ?DSEG ENDS CSEG SEGMENT ASSUME CS:CSEG,DS:DSEG,SS:SSEG START: MOV AX,DSEG MOV DS,AX LEA BX,BUFF MOV CX,10 MOV ...
绛旓細30h int 10h loop b0 mov al,'B' int 10h retprintBin endpprintDec proc near push bx xor cx, cx mov bx, 10d0: xor dx, dx div bx xor dx, 0e30h push dx inc cx cmp ax, 0 jnz d0d1: pop ax int 10h loop d1 ...
绛旓細lea dx, buf mov ah,0ah int 21h; xor cx, cx mov cl, buf+1 mov si, 0Loop1: mov al, buf[si+2] cmp al, '#' jz lopend cmp al, 20h jz space cmp al,
绛旓細浣犵煡閬撶殑锛屾妸鏁版嵁娈典腑鐨勭鍙e湴鍧鏀逛负浣犵殑璁$畻鏈哄彲璇嗗埆鐨8255A鐨勭鍙e湴鍧 ;浠庨敭鐩樻帴鏀舵暟瀛楋紝鍦ㄤ竷娈垫暟鐮佺涓婃樉绀 data segment ioport equ 2400h-0280h io8255a equ ioport+288h io8255b equ ioport+28bh led db 3fh,06h,5bh,4fh,66h,6dh,7dh,07h,7fh,6fh mesg1 db 0dh,...