The MASM Forum Archive 2004 to 2012

Miscellaneous Forums => 16 bit DOS Programming => Topic started by: CSEG:LYN on September 21, 2005, 11:29:14 PM

Title: can somebody help me about my program
Post by: CSEG:LYN on September 21, 2005, 11:29:14 PM
     What are the commands used in multiplying as well as dividing two single-digit numbers? For example, 4*4 that will display 16 and for division for example 4/4 will display 1. Thanks and Hope you can help me. Godnless. Thanks.
Title: Re: can somebody help me about my program
Post by: hutch-- on September 22, 2005, 12:56:45 AM
A couple of things,

You don't need to multiple post in this forum, it gets read anyway. You have not told us what assembler you are using, whether it is 16 bit or 32 bit code and whether its homework or not. Let us know and someone may be able to help you.
Title: Re: can somebody help me about my program
Post by: gabor on September 22, 2005, 08:16:08 AM
Hello!

Do you mean to mul and div two integer numbers? I don't know any instructions that mul or div two 1 digit numbers. In your examples 4x4 and 4/4 tells me the way to mul or div numbers by powers of 2 via shl and shr. Is this you are seeking?
Like
   4 shl 2 = 4*2*2 = 16
31 shr 2 = 31/2/2 = 15/2 = 7

Please descibe your problem more precisly!

Greets, Gábor