×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
• Talk With Other Members
• Be Notified Of Responses
• Keyword Search
Favorite Forums
• Automated Signatures
• Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

#### Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

# Hello , I am a newbie for the fo

## Hello , I am a newbie for the fo

(OP)
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.

Replies continue below

### RE: Hello , I am a newbie for the fo

Hello, My first question for you is what assembler are you using?  Are you working on an IBM clone pc?

Rod

### RE: Hello , I am a newbie for the fo

(OP)
Yes I am using IBM PC with MASM 6.11.

Thanks.

Korhan

### RE: Hello , I am a newbie for the fo

Korhan, tell me what you see when you add 1 + 1? Do you get 02 or 32?

Rod

### RE: Hello , I am a newbie for the fo

(OP)
I get 02 ascii, symbols.

Korhan

### RE: Hello , I am a newbie for the fo

if you are dealing with decimal numbers, just add 30h to every value to display:
ASCII "0" ...."9" have hex values 30h ... 39h

### RE: Hello , I am a newbie for the fo

(OP)
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

### RE: Hello , I am a newbie for the fo

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."

### RE: Hello , I am a newbie for the fo

(OP)
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

only IP, but CS as well. i tried many things, still I am stuck.

Korhan

### RE: Hello , I am a newbie for the fo

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

### RE: Hello , I am a newbie for the fo

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."

#### Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

#### Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Close Box

# Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

• Talk To Other Members
• Notification Of Responses To Questions
• Favorite Forums One Click Access
• Keyword Search Of All Posts, And More...

Register now while it's still free!