The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: LAS3R on February 14, 2005, 12:29:16 PM

Title: how does this work?
Post by: LAS3R on February 14, 2005, 12:29:16 PM
found code where guy made it had typed this!

add   al,'A'-'9'-01h

and tasm change it to

add al, 7

just wondering how "add   al,'A'-'9'-01h" can become "add al, 7"!

it's tasm source btw!
Title: Re: how does this work?
Post by: Tedd on February 14, 2005, 12:38:06 PM
'A' = (ascii code for letter A) 65
'9' = 57

65 - 57 - 1 = 7
Title: Re: how does this work?
Post by: LAS3R on February 14, 2005, 12:44:30 PM
oh...lol. to easy to figure out!  :toothy :U