From: randyhyde@earthlink.net on 15 Mar 2006 11:49 o//annabee wrote: > > Talk is cheap Master PDF. And so is your code. Note the problems below: > > > [n: 10000] > > TestProc: > Align 16 > cpuid > rdtsc | push eax > Align 16 It was nice of you to align the *outer* loop on a 16-byte boundary, but... > mov ecx 10000 > xor eax eax The innermost loop, where most of the real work is done is not so aligned. > while ecx > 0 > add eax ecx > dec ecx > End_While > rdtsc | pop ebx > sub eax ebx > int 3 > ;755F > > Align 16 > cpuid > rdtsc | push eax > Align 16 > Because the number of bytes of instructions are different in these two examples, you get completely different alignment on the inner most loop (which is the thing you're trying to measure). There is no question that branches to misaligned targets produce different execution times on different processors. > mov ecx D§n > xor eax eax > jecxz L0> > whlLoop: > add eax ecx > dec ecx > jnz whlLoop > L0: > > rdtsc | pop ebx > sub eax ebx > int 3 > Closer, but still no cigar. Care to try again? Cheers, Randy Hyde P.S., oh, and btw, you need a serializing instruction before the last rdtsc instruction in these sequences, too. And it would also help if you moved the rdtsc *after* the align operation, as you don't particularly want to measure a varying number of NOPs between the two sequences.
From: randyhyde@earthlink.net on 15 Mar 2006 15:37 o//annabee wrote: > > > > And still you push the *horrible* versions of these macros onto your > > users. So instead of fixing the problem, you keep carrying around the > > old baggage version after version. Oh well, at least you can claim that > > all the old programs still compile version after version in RosAsm :-) > > So, backwards compabilty is not a design parameter of HLA ? Users may > expect it to break. Absolutely users may expect it to break. It says so in the first chapter of the HLA reference manual where it explains what a "prototype" is all about. And although it's *rarely* the case that I change something that will break existing source code, I don't have a problem at all if this make HLA a better language. BTW, it has been a *real* long time since anything in the actual HLA language has broken existing source code. Most of the "broken" code over the past couple of years has occurred because of changes to the stdlib, not because of changes to the HLA compiler or language. But as I said, if I can make the language signficantly better, I don't have a problem breaking existing code. After all, that is the purpose of a prototype -- to get the rough edges out before commiting to a version in which legacy support is important. And you better believe that when HLA v2.0 comes out, a lot of code will break. Will this matter? Hardly at all. People who feel it's too much work to translate their existing source code can continue to compile under HLA v1.x. Cheers, Randy Hyde
From: Betov on 15 Mar 2006 15:59 "randyhyde(a)earthlink.net" <randyhyde(a)earthlink.net> ?crivait news:1142455065.096458.270010(a)i40g2000cwc.googlegroups.com: >> So, backwards compabilty is not a design parameter of HLA ? Users may >> expect it to break. > > Absolutely users may expect it to break. Nice: How could the victims of your "Idiot Parser" complain? :]]]]] Betov. < http://rosasm.org >
From: o//annabee on 15 Mar 2006 15:37 P? Wed, 15 Mar 2006 11:48:55 +0100, skrev Frank Kotler <fbkotler(a)comcast.net>: > o//annabee wrote: > > > I'm not sure this is right... ....insert scream here.. > > ; nasm -f obj hwcons.asm > ; alink -oPE hwcons.obj > > extern WriteFile > import WriteFile kernel32.dll > > extern ExitProcess > import ExitProcess kernel32.dll > > section _TEXT use32 class=CODE > ..start Why two "." here ? > > push dword 0 > push dword num_chars > push dword MSGLEN > push dword msg > push dword -11 ; ??? - works IIRC > call [WriteFile] > > exit_ok: > push dword 0 > exit: > call [ExitProcess] > > section _DATA use32 class=DATA > num_chars dd 0 > msg db 'Hello, Console.', 13, 10 > MSGLEN equ $ - msg > ;-------------------- > > Another, more "modern" option would be to use "-f win32". Link with > polink, or... no, you wouldn't like that one :) > > An option I think you'd like is to use "-f bin" mode and get your > executable directly - no linker.It involves include files - unless you > wanna spell out the whole thing like Herbert does. Too much cruft to > post. No. POST IT! You plain text ng-terrist! > RosAsm has all this stuff built in ("Nice work, Guga!") , Nice Work? Its an incredible work. Easy of use comes at hard work on programmers. Gugas work is the kind of work that would kill me. Its tedious reading and gathering and corrections made to a huge, HUGE collections of docs, then a tedious translation of them, one by one from the perverted C language to assembly. Its immensly admirable what they have done. I need to get my daily coding kick, and dont get it from dealing in faulty drugs. > Nasm doesn't. The only thing I've got using that is Numit_or's > "shutdown", with the "dos stub" altered to shut down, instead of > claiming we need Windows to do it! :) ... nerds! :) > I'll try to remember to tar that up - zip, I mean Yes. Thanks. > - and upload it. Too tired right now - remind me. If you feel like > joining a !Yahoo! group, I hate joining groups. I hate everything. I prefer you upload it. But if I must.... I saw Yeohhs name there. Does he have any NASM skeleton perhaps? > <http://groups.yahoo.com/group/win32-nasm-users> > > There are a few demos of various kinds in the "files" section... Ok. I join up if you cant find another way. I am wondering why you all play so "hard to get". Most people be willing to kill someone at this point. Here is what it gave back: (-f bin) skeleton1.asm:5: error: parser: instruction expected skeleton1.asm:8: error: symbol `import' redefined skeleton1.asm:8: error: parser: instruction expected skeleton1.asm:11: error: unrecognised special symbol `..start' The only remotefully useful error here is the last one. Anyway, the section declaratons look a little better than I seen elsewhere. Outside of RosAsm of couse that doesnt have this sickness at all. and now its says skeleton1.asm:5: error: parser: instruction expected skeleton1.asm:8: error: symbol `import' redefined skeleton1.asm:8: error: parser: instruction expected Now I know why Betov is so found or useful error messages. Sorry if I sound grumpy. I havent gotten any coffie yet. > > Later, > Frank
From: Betov on 15 Mar 2006 17:15
o//annabee <fack(a)szmyggenpv.com> ?crivait news:op.s6g183xace7g4q(a)bonus: > I hate joining groups. I hate everything. I prefer you upload it. But > if I must.... I saw Yeohhs name there. Does he have any NASM skeleton > perhaps? > >> <http://groups.yahoo.com/group/win32-nasm-users> >> >> There are a few demos of various kinds in the "files" section... > > Ok. I join up if you cant find another way. I am wondering why you all > play so "hard to get". Most people be willing to kill someone at this > point. :)) Indeed. I never understood this either. Recalls me of the very first action of Frank with the LuxAsm Project: Very first step: Giving it to an "organization", not even having any ethical and Political white sheet. Incredible... Amaizing... > Here is what it gave back: (-f bin) > skeleton1.asm:5: error: parser: instruction expected > skeleton1.asm:8: error: symbol `import' redefined > skeleton1.asm:8: error: parser: instruction expected > skeleton1.asm:11: error: unrecognised special symbol `..start' > skeleton1.asm:5: error: parser: instruction expected > skeleton1.asm:8: error: symbol `import' redefined > skeleton1.asm:8: error: parser: instruction expected > > Now I know why Betov is so found or useful error messages. I know of a better one: "Unexpected error encounted". The subtil grace of "SEH". :)) > Sorry if I sound grumpy. I havent gotten any coffie yet. You did not slept long enough: Go back to bed. ;) Betov. < http://rosasm.org > |