flat assembler
Message board for the users of flat assembler.
![]() Goto page Previous 1, 2, 3, 4 Next |
Author |
|
Jeronimus Linuxius 05 Jul 2007, 21:45
vid wrote: Also note that CMOVcc r32, r32 in 64bit mode clears upper 32 bits of destination operand even if condition is false ;) What? JJ |
|||
![]() |
|
LocoDelAssembly 05 Jul 2007, 22:01
Quote: What? Code: and r64Dest, $ffffffff ; Done internally cmovcc r32Dest, {r32Src|m32Src} |
|||
![]() |
|
kohlrak 06 Jul 2007, 01:44
Quote: What didn't work, exactly? Take care that you need to configure it explicitly if you use a proxy or something like that... Didn't work as in the thing didn't even attempt to connect to a website. Quote: Local labels are an useful feature, but it isn't an absolute solution for every naming problem... You still havn't explained why. Quote: You can avoid your problems for long and long, but it won't necessarily correct them... Elaborate. |
|||
![]() |
|
Jeronimus Linuxius 06 Jul 2007, 19:33
LocoDelAssembly wrote:
JJ |
|||
![]() |
|
Jeronimus Linuxius 06 Jul 2007, 19:49
kohlrak wrote:
Quote:
If you look at the nature of local labels, you will understand the problem. It's simple. Using local labels, you manage to have your symbols split in namespaces, so that you can have more than one symbol with the same name, as long as they are in different namespaces. But if you want to define more than one symbol with the same name in the same namespace, you'll still have problems. Quote:
In this case, splitting the labels among namespaces is a way to avoid your problem (because it's much less likely to find two similar names in a single function than in an entire program), but it's still possible that the namespace problems hadn't completely vanished. JJ |
|||
![]() |
|
kohlrak 07 Jul 2007, 00:10
Quote: What about... error messages... I believe it was firefox's equivalent to a default 404 page. Quote: I haven't explained why, because it's obvious! Don't have to write the same name in the same namespace. Quote: I cannot elaborate much more and still avoid to go into examples. That's just that: you can always rearrange the way you do things in order to avoid problematic conditions. But there are still many ways to run into this conditions. Well then, don't avoid going into examples. Quote: In this case, splitting the labels among namespaces is a way to avoid your problem (because it's much less likely to find two similar names in a single function than in an entire program), but it's still possible that the namespace problems hadn't completely vanished. I would love to know what the heck you're doing that would cause you to run out of possible names. For 1 letter lables, you have 26 choices. For 2 character examples, you haver your 26*36 (numbers) choices for names, 3 it goes up even more 26*36^2... 4 = 26*36^3... 5 = 26*36^4... And i think you get the idea. Now of course, you're wanting semi-meaningful names, but with 6656 examples for just 5 letter variable names, i'm sure you can make something creative by the time you got to 20 characters.... which would be 26*36^19 possibilities. |
|||
![]() |
|
Jeronimus Linuxius 07 Jul 2007, 23:53
Jeronimus Linuxius wrote:
It consists in simulating loops by issuing the instructions that the loop would normally do, but with no loops. For example: Code: xor eax, eax mov ecx, 6 @@: add eax, ecx dec ecx jnz @b Code: xor eax, eax add eax, 6 add eax, 5 add eax, 4 add eax, 3 add eax, 2 add eax, 1 Perhaps, you could optimize it even more if you still had the number to add in a register but without looping... JJ |
|||
![]() |
|
r22 08 Jul 2007, 01:44
( (N)*(N+1) )/ 2 = N + N-1 + N-1 ... N-(N-1)
;//static __________//generic MOV ecx,6 ;______ MOV ecx,[var] ;;=(n) MOV eax,7 ;______ LEA eax,[ecx+1] ;;=(n+1) MUL ecx ;______ MUL ecx ;;(n)(n+1) SHR eax,1 ;______ SHR eax,1 ;;DIVIDE BY 2 BUT this has NOTHING to do with the topic of this thread. Which is (in case you've forgotten ![]() ALSO I found it funny that no one even touched my idea about making JavaScript the standard MACRO language for compilers ![]() Last edited by r22 on 08 Jul 2007, 16:48; edited 1 time in total |
|||
![]() |
|
LocoDelAssembly 08 Jul 2007, 04:45
Code: ( (N)*(N+1) )/ 2 = N + N-1 + N-1 ... N-(N-1) ;//static __________//generic MOV eac,6 ;______ MOV ecx,[var] ;;=(n) MOV eax,7 ;______ LEA eax,[eax+1] ;;=(n+1) MUL ecx ;______ MUL ecx ;;(n)(n+1) SHR eax,1 ;______ SHR eax,1 ;;DIVIDE BY 2 haha, I was going to post the same thing but the first "xor eax, eax" unmotivated me because the source could be simplified into "mov eax, 6*(6+1)/2" which doesn't seems to be an unrolling anymore ![]() About JavaScript (first known as LiveScript), is not standard enough, there are slight variations between browsers. Still, you are always welcomed to write a guide of how to use JavaScript with fasm ![]() PS: Check again your generic algorithm and the typo error at first instruction of the static algorithm. |
|||
![]() |
|
kohlrak 08 Jul 2007, 07:54
Quote: I found it funny that no one even touched my idea about making JavaScript the standard MACRO language for compilers I'll leave it at this, "Be afraid. Be very afraid." Quote: BUT this has NOTHING to do with the topic of this thread. Exactly, which makes me wonder why he keeps bringing it up. It's not like using annonymous lables unravles loops. But if he really wanted to simplify his algorithem to specifically go from 6 to 1 and add them together (rather than starting from a random number), he can easily do the following. Code: mov eax, 6+5+4+3+2+1 Or he could do the math himself then put it in. The assembler dosn't mind it so much. |
|||
![]() |
|
Furby 08 Jul 2007, 10:15
I don't use any of @ because I don't how to use them
![]() |
|||
![]() |
|
r22 08 Jul 2007, 17:03
kohlrak, I just assumed he picked something simple just to represent an algorithm, more of an unrealistic example just for the sake of representation.
LocoDelAssembly, the only parts of JavaScript that would really be needed for a macro language are the argument passing, write and writeln, string, integer and float handling etc.. all of which are very standardized. The browser specific portions of javascript like HTTPRequest, some DOM handling, and event handling are totally unneeded for the purpose of creating macros. I thought of JS because it has an easy to learn, simplistic and standardized syntax. |
|||
![]() |
|
Jeronimus Linuxius 08 Jul 2007, 22:59
LocoDelAssembly wrote: haha, I was going to post the same thing but the first "xor eax, eax" unmotivated me because the source could be simplified into "mov eax, 6*(6+1)/2" which doesn't seems to be an unrolling anymore :P Quote: About JavaScript (first known as LiveScript) Quote: , is not standard enough, there are slight variations between browsers. Quote: Still, you are always welcomed to write a guide of how to use JavaScript with fasm ;) JJ |
|||
![]() |
|
Jeronimus Linuxius 08 Jul 2007, 23:01
r22 wrote: kohlrak, I just assumed he picked something simple just to represent an algorithm, more of an unrealistic example just for the sake of representation. JJ |
|||
![]() |
|
Jeronimus Linuxius 08 Jul 2007, 23:03
Furby wrote: I don't use any of @ because I don't how to use them ;) is there any tutorial how tu use and undetstand them ? JJ |
|||
![]() |
|
Jeronimus Linuxius 08 Jul 2007, 23:04
kohlrak wrote:
JJ |
|||
![]() |
|
Jeronimus Linuxius 08 Jul 2007, 23:24
r22 wrote: BUT this has NOTHING to do with the topic of this thread. Which is (in case you've forgotten :D) anonymous labeling is USELESS Quote: except to those who a) write sloppy code Instead of creating a label called, for example, ".we_dont_need_to_swap_registers_cause_they_are_already_in_the_correct_order" (which, let me say, is a very stupid name) to jump over a xchg, it's much better to use an anonymous label and comment what we are doing (for example, with the above sentence). Quote: b) don't take the time to think about or research the algorithm they are using Quote: c) refuse to use the simplest of macros (for say: repeated ELSE IF blocks) because making their code clear and standardized would be a burdon to them. And I don't like to include code in macros, As I've already said. I have my own opinions on this: it obfuscates code because macros containing code often corrupt the CPU context without it being obvious for anyone who doesn't have the time to read all the macros. JJ |
|||
![]() |
|
LocoDelAssembly 09 Jul 2007, 00:05
Quote:
First or latter? And according to Wikipedia it was first known as Mocha (name that didn't appear in the book I read). The creators of this scripting language was the guys at Netscape (this appeared in the book as well). And about standarization apparently the browsers are not aware of it because you still need sometimes to use special code to make possible the script to run correctly with all browsers. Anyway, r22 already explained the parts that are really needed and those AFAIK behaves the same on all browsers. About unrolling, I think you should tell that to r22. The quoting you did from me already says "which doesn't seems to be an unrolling anymore". |
|||
![]() |
|
Jeronimus Linuxius 10 Jul 2007, 23:29
LocoDelAssembly wrote:
Quote: About unrolling, I think you should tell that to r22. The quoting you did from me already says "which doesn't seems to be an unrolling anymore". JJ |
|||
![]() |
|
Goto page Previous 1, 2, 3, 4 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.