in [ASM]

From: //o//annabee on 11 Sep 2007 09:38 P� Tue, 11 Sep 2007 06:51:14 +0100, skrev Evenbit <nbaker2328 (a)charter.net>:> > [sarcasm] > That's the number one problem with RosAsm -- the user must actually > type-in the mnemonics "push" and "call" (or copy-n-paste them into > macros) to be able to execute system functions. A "real (tm)" > assembler would have features that allow the programmer to avoid using > any CPU instructions and still be able to compile a program. > > program yesno; > #include( "w.hhf" ) > > begin yesno; > repeat > w.MessageBox( 0, "Is the world flat?", "Objectivity Lesson", > w.MB_YESNO ); > until( eax = w.IDYES ); > end yesno; > > [/sarcasm] :)) I may have finally understood one of your jokes. > > Nathan. >
From: //o//annabee on 11 Sep 2007 10:05 P� Tue, 11 Sep 2007 09:17:29 +0100, skrev hutch-- <hutch (a)movsd.com>:> Will you help poor Wannabee chew his hat now ? What relation is there between you encouraging users to break piracy laws, and my hat?
From: //o//annabee on 11 Sep 2007 10:06 P� Tue, 11 Sep 2007 09:34:51 +0100, skrev hutch-- <hutch (a)movsd.com>:> Will you help poor Wannabee chew his hat now ? So it is illegal to download MASM from your site, but what has this got todo with my hat?
From: Wolfgang Kern on 11 Sep 2007 10:45 "�a\/b" answered: [..] >> I first scan the string to get its size, a possible decimal point, >> the sign and also check for valid numbers and if there is an exponent. >> Now I know the power of the MSD given by the LSD position in the string. > i should follow the specification <spaces><+><digits> > eg error for "-3444"; " a"; ".u988"; etc > then convert the number in the digits format using the base > and the table. > it is for that i use mult because the base can be all 2-->36 > and i have to mult by the base value > if error => i return it in CF > so that program should return the number of base 20 from " gh23z" What do you mean by base 20 here ? it the case of: " gh23z" I will see only '23 dec' and convert just this two digits, but my input functions wont accept non-numerics anyway. In case where a number within any string should be detected it searches for the first numeric character [sign,num,DP,exp] and count until the first not-numeric is found. In my example only Numbers are accpted, so esi points to the first digit in string while ecx is the precision. > but if some C program would use that function i think it is possible > find errors if *pos==string or if eax==-1 (so in this case it should > be not possible detect overflow from 0xFFFFFFFF > (if carry flag is not seen) ) Yeah, C will need eax= 0/-1 for true/false instead of CY. >>ie: >>(DEC.ASCII to unsigned 32 bits w/o DP and exponent yet) >>typed it out of my head, and no guaranty for any typos. >>_______________ >>;esi = stringptr ;adjusted to MSD >>;ecx = LSDpos ;relative to esi, got from the above scan >> ;ecx is also the power10 of the MSD >>xor eax,eax ;clear result register >>cmp ecx,+0a ;2^32 can't have more than 10 digits >>jnc err_input >>L1: >>;imul edx,ecx,0a ;edx=current power10*10 (power offset in table) >>lea edx,[ecx+ecx*4] ;replaced by *5 >>add edx,edx ; *2 > it seems to me at last > 10*10*9*10*8*10*7*10*6*10 etc > (because my calculator say shl==(a<<=5)) ?? I only calculate the table offset of the current digit by its power10 given in ecx starting with MSD (which is also the 'relative to esi' LSDpos) and decrement until zero in the loop. But Yes, this out of head typed line is wrong anyway. Because my table contains only nine entries per decade (no zeros) the power10-offset is actually calculated this way: lea edx,[ecx+ecx*8] ;edx=ecx*9 > edx never overflow here? it can't because ecx is limited to 10dec in above 'cmp ecx,+0a' > >movzx ebx,byte[esi] ;get digit MSD is first > >and bl,0f ;make it BCD > who do you say that "bl" is a digit? esi points to the first valid digit, I didn't post the scan code as it is a bit large and complex by covering sign,DP and exponent. So bl is the low byte of ebx :) > >jz L2 ;skip if 0 > >add edx,ebx ;add digit offset to power offset > >shl edx,5 ;table entry interval is 32 byte > none of these operations can overflow? Can't overflow: (decimal yet) edx is maximal 9*10 = 90 (for 32-bit integers now) ebx is maximal 9 so (90+9)* 32 = 3168 [0c60h] == maximum used table offset yet and even if I use all 256 bits: edx = maximal 9*77 = 693 (2^256 = 1.1579...*10^77) so (693+9)*32 = 22464 [57c0] == total table size but then the following 'ADD to result' works on a 'result buffer'. >>add eax,[edx+LUT] ;add table entry to result >>jc err_overflow ;too large, needs a 33th bit. >>L2: >>inc esi ;next digit >>dec ecx ;next lesser power10 ; >>jns L1 ;include 10^0 yet jnz L1 ;replaced the useless add eax,ebx ;does the 10^0 faster >>_______ My actual used code is a bit larger as it contains also options for signed, fixpoint and included exponents for a whole set of numeric variable types from signed byte to 256+32 bit figures. My favorite 'small float' is a 32 bit varable, where 24 bits hold the value and the remaining byte an 10^n valued exponent. This is different to the FPU-SP as it allowes a range of +-8388607 E+-127 without weird rounding issues. __ wolfgang
From: �a/b on 11 Sep 2007 12:39
On Mon, 10 Sep 2007 07:21:32 -0700, hutch-- wrote: >smile, > >> > Same place as it has been since before you cobbled your toy together, >> >www.masm32.com >> >> Sorry, but this is not the challenge, that *you* have taken. >> Please, show us, so that Half could eventually eat his hat. > >This is the challenge I accepted. > >=========================================== >7 Feb 2005 06:09:17 -0800 > >Come up with 10-20 diffrent examples of _complete_ (short) MASM >programs, and I will write the RosAsm equivalents. And lets compare ^^^^^^^^^^ >them. All called code must be present, except for Win32 API code. why "programs" and not "routines"? if we have to show that our assembler (or assembly language) is better is enough the word "routines" >If I cannot wrote more the 70% of the examples source code, shorter, >and easier to comprehend and read in RosAsm, I do you the favor of >eating my hat in public, and leave this NG permanently, and pubilicly >applogize for calling you an retarded demented old fagot. > >Do you take the challenge Hutch ? >=========================================== > >Which one did you have in mind. Wannabee refuses to download masm32 at >www.masm32.com so he loses as he has not done what he claims. > >When will you start chewin Wannabee's hat ? |