Click here to Skip to main content
15,884,177 members
Please Sign up or sign in to vote.
4.00/5 (2 votes)
See more:
hi i am writing a program(in 16 bit assembly) that calculates two 8 byte number and save them in a another 8 byte variable,but i don't know how can i show the result on the screen and i didn't find anything on the internet about it.
please help me

number1 dq 12345678
number2 dq 87654321
sum dq ?
Posted
Updated 17-Nov-11 20:14pm
v2
Comments
Sergey Alexandrovich Kryukov 18-Nov-11 2:15am    
This is output. So, it totally depends on your platform.
--SA
Al Moje 18-Nov-11 2:24am    
Please show use you code...
Amir Mahfoozi 18-Nov-11 3:17am    
It is important to specify that you should use 64bit registers or 32bit registers ?
Reza Oruji 18-Nov-11 6:30am    
i should use 16 bit registers

1 solution

You need to write some code that extracts each digit and converts it to a displayable value and adds it to a string or array. It's a long time since I wrote any assembler, but in pseudo-code it would be something like:
C++
String = ""
DO
    Digit = number1 % 10 ; % is the "get remainder" operator
    Digit = Digit + '0' ; the zero character
    String = digit + string ; prepend this digit to the string
    number1 = number1 / 10 ;
WHILE number1 != 0 
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900