Make a program that will ask the user to input two letters, compare them, and display which of the two letters come first based on the alphabet (A to Z).
http://www.masm32.com/board/index.php?topic=31.msg123#msg123
http://www.masm32.com/board/index.php?action=dlattach;topic=15882.0;id=8764
Quote from: dedndave on January 26, 2011, 12:25:46 AM
http://www.masm32.com/board/index.php?action=dlattach;topic=15882.0;id=8764
LMFAO!!! That is a good one Dave... Not you I hope :toothy :toothy
:bg
hiyas Rob
well - if he looks at the code, there is enough info there to accomplish his task :U
Put your two characters in AL and AH respectively, and compare them.
CMP AL,AH
JZ thesame
JC AHbigger
Google for an ASCII character chart, but A is decimal 65, Z is decimal 90. Things get problematic if you have mixed case, in which case you should pick upper or lower and convert to that before the comparison.
How to use 16-bit linker in masm32? I already have the link16.exe file. I have use this command,
c:\masm32\link32 compare.asm
Run File [compare.exe] compare
List File [nul.map]: compare
Libraries [.lib]: compare
Definitions File[nul.def]: compare
LINK : fatal error L1092: cannot open module-definition file - compare.def
Is there any way to modify this code in MASM32 32-bit syntax?
ml -c compare.asm
link16 compare,compare;
If you have uppercase and lowercase characters, do some "and" or "or" with 20h.
A==41h a==61h
Z==5Ah z==7ah
regards.
Quote from: j053f on January 25, 2011, 11:14:01 PM
Make a program that will ask the user to input two letters, compare them, and display which of the two letters come first based on the alphabet (A to Z).
which comes first 'a' or 'Z' :P even in small programs it pays to think about boundary cases