如何在8086中显示寄存器或var中的数字

时间:2017-03-31 12:47:07

标签: x86-16

如何从var或寄存器中打印数字? 到目前为止这是我的代码: 我想在数组中打印以厘米或AX保存的数字,其中“= X cm”谢谢。

;
; XXX.asm - feet inches to centimeters
;
    .MODEL SMALL
    .STACK 100h
    .DATA
InputMessage DB 'Enter height in feed inches (e.g. 6.2):',13,10,'$'
ResultStr DB 13,10,'X Feet X Inch = X cm','$'
Multiply_Word DW 3048
Multiply_Word1 DW 254
Divide_Word DW 100
Divide_Ten_Word DW 10
centimeters DW 0

.CODE
ProgStart:
     MOV AX,@DATA     ; print
     MOV DS,AX
     MOV AH,9
     MOV DX,OFFSET InputMessage
     INT 21h
     MOV AH,1    ; klita
     INT 21h
     MOV ResultStr[2],AL
     SUB AL,'0'
     MOV AH,0
     MUL Multiply_Word
     DIV Divide_Word
     ADD centimeters,AX
     MOV AH,1
     INT 21h
     MOV ResultStr[9],AL
     SUB AL,'0'
     MOV AH,0
     MUL Multiply_Word1
     DIV Divide_Word
     ADD centimeters,AX
     MOV AX,centimeters
     ;;;
     MOV AH,9
     MOV DX,OFFSET ResultStr
     INT 21h
     ;;;
     MOV AH,4Ch
     INT 21h
END ProgStart

0 个答案:

没有答案