<meter id="pryje"><nav id="pryje"><delect id="pryje"></delect></nav></meter>
          <label id="pryje"></label>

          新聞中心

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

          匯編:輸入一位十六進(jìn)制數(shù)將其轉(zhuǎn)化為2進(jìn)制數(shù)

          作者: 時(shí)間:2016-12-01 來源:網(wǎng)絡(luò) 收藏
          這是匯編考試的題目輸入一位十六進(jìn)制數(shù)并且將其轉(zhuǎn)化為2進(jìn)制數(shù)

          data segment
          tital1 db INPUt: ,$
          tital2 db OUTPUT:,$
          tital3 db The input is error,please input again : ,$
          tital4 db Do you want to have a try again(yes:y,no:n) ,$
          tital5 db Welcome to use this program ,It is made by WQ ,$
          kongzi db 0dh,0ah,$
          yushu db 5 dup(00)
          duandian db jianche dian,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 ;輸出抬頭1please input 1234
          mov ah,09h
          int 21h

          mov ax,0 ;初始化al
          mov bx,0

          mov ah,01h ;輸入并回顯
          int 21h
          mov bl,al
          cmp bl,30h
          jae n0 ;>=
          jmp tishi
          n0:cmp bl,39h
          jbe n1 ;<=39
          cmp bl,41h ;>=41
          jae n2
          jmp tishi
          n2:cmp bl,46h ;
          jbe n3
          cmp bl,61h
          jb tishi
          cmp bl,66h
          jbe n4
          jmp tishi
          n1: sub bl,30h ;轉(zhuǎn)化為十進(jìn)制數(shù)
          jmp o

          n3:sub bl,37h
          jmp o
          n4:sub bl,57h
          o:
          lea dx,kongzi ;換行回車
          mov ah,09h
          int 21h

          lea dx,tital2 ;輸出抬頭2
          mov ah,09h
          int 21h

          上一頁 1 2 下一頁

          評(píng)論


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

          關(guān)閉
          看屁屁www成人影院,亚洲人妻成人图片,亚洲精品成人午夜在线,日韩在线 欧美成人 (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })();