The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: Posit on May 11, 2005, 06:45:19 PM

Title: difference between chr$ and SADD
Post by: Posit on May 11, 2005, 06:45:19 PM
Greetings all. I am a CS grad student, and have decided that learning masm will a good summer project (among others, of course). These forums certainly look like the place for discussion of all things masm, and I'm sure to have a limitless supply of questions, although a lot of them have been answered by the great resource pages that Hutch and others here have put together.

My first question is this: What is the difference between chr$ and SADD when using the print macro? Playing around with the 'hello world' console examples, I can see no difference.

Title: Re: difference between chr$ and SADD
Post by: Nilrem on May 11, 2005, 07:09:37 PM
I'm not too sure but just by looking at the name wouldn't SADD only do string address (i.e. variables)? chr$ been able to do text outside of a variable.
Title: Re: difference between chr$ and SADD
Post by: hutch-- on May 11, 2005, 11:22:48 PM
Posit,

It is close to a duplication. The SADD (string address) macro was written first but later I did a lot more work on string macros and tried to ensure that the naming was consistent across the string macros and rather than modify an existing one that was already in use, I near duplicated the new one instead so there was no conflict.

Ypou can have a look at both macros in the macros.asm file in the macros directory of MASM32. This is the virtue of providing the source code so everyone knows how it works.