Printing out decimal value in x8086 Assembly Langauge

ساخت وبلاگ

Vote count: 0

I am currently working on a project that requires me to prompt a user for three inputs (length, width, & height) and then calculate the volume (lwh). I am having problems printing out the result after the calculations are complete. Is there a way to print out a decimal value? Thanks for your time

.MODEL SMALL .STACK 100h
.DATA
l DB ?
w DB ?
h DB ?
v DB ?
M1 DB 10,13, "Please enter the length: $"
M2 DB 10,13, "Please enter the width : $"
M3 DB 10,13, "Please enter the height: $"
M4 DB 10,13, "The volume is:$" .CODE Main PROC mov ax, @data ; getting data segment address mov ds, ax ; initializing the data segment mov dx, offset M1 ; prompting user for a value mov ah, 09h ; writing string to STDOUT int 21h ; BIOS routines mov ah, 01h ; reading in from STDIN, input stored in al int 21h mov bl, al sub ax,ax ; clearing ax register for the next input sub bl, 30h mov l, bl sub bx,bx mov dx, offset M2 mov ah, 09h int 21h mov ah, 01h int 21h mov bl, al sub ax,ax sub bl, 30h mov w, bl mov al, l mul bl mov v, al sub ax, ax sub bx,bx mov dx, offset M3 mov ah, 09h int 21h mov ah, 01h int 21h sub al, 30h mov h, al sub bx, bx mov bl, v mul bx mov v, al sub ax, ax sub bx,bx mov dx, offset M4 mov ah, 09h int 21h sub dx, dx mov dx, offset v mov ah, 09h int 21h mov ax, 400ch ; retuing control to OS int 21h Main ENDP END Main
asked 4 mins ago

- - , .

back soft...
ما را در سایت back soft دنبال می کنید

برچسب : نویسنده : استخدام کار backsoft بازدید : 234 تاريخ : شنبه 24 بهمن 1394 ساعت: 4:27