Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hello , I am a newbie for the fo

Status
Not open for further replies.

asterothe

Programmer
Sep 22, 2002
6
US
Hello ,

I am a newbie for the forum and
for the language. I just want to know
how we can display numbers not
ascII codes ?
I add two numbers and when I try to display
them , I see ascII code not the number value.
I have to do a calculator for class and
I don't know where to start.

Thanks in advance.
 
Hello, My first question for you is what assembler are you using? Are you working on an IBM clone pc? Rod
 
Yes I am using IBM PC with MASM 6.11.

Thanks.

Korhan
 
Korhan, tell me what you see when you add 1 + 1? Do you get 02 or 32? Rod
 
I get 02 ascii, symbols.
Thanks for your interest.

Korhan
 
if you are dealing with decimal numbers, just add 30h to every value to display:
ASCII "0" ...."9" have hex values 30h ... 39h
 
I have to do it digit by digit right?
So how can I write a big number?
I am very new so forgive my stupid questions.


Korhan
 
Yes do it digit by digit.

To do big numbers (more than one digit), first divide the number into individual digits. You can just keep dividing by ten, then get the remainder which is the lowest digit. The remainder gets stored somewhere, and the result is divided again until it is zero, in which case all the digits have all been taken already. Then add 030h to each digit, and make sure you put them on screen in proper order.

I guess we all have to start somewhere.... "Information has a tendency to be free. Which means someone will always tell you something you don't want to know."
 
Thank you very much.
Now I have bigger problems.
I have to use subroutines for
multiplaction . Whnever I do
call xxxx

and in xxx
xxx:

.
.
.
ret

I don't return to where I came! Stack changes not
only IP, but CS as well. i tried many things, still I am stuck.

Korhan
 
looks you are in 16-bit mode
to avoid pushing CS on the stack, declare your functions as NEAR

ProcName Proc near
xxxxx

ret
ProcName endp

then you get near call

otherwise keep your functions as far but use RETF (RETurn Far) on exit
 
It is not recommended, BTW, that you use a xxx: type label as the argument for a 'Call' command. Do it properly: use xxx proc/endp. Rets inside a proc/endp will automatically be matched to the expected Call type, near or far.
"Information has a tendency to be free. Which means someone will always tell you something you don't want to know."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top