flat assembler
Message board for the users of flat assembler.

Index > High Level Languages > C++ Pointers vs References in Full-Effect!

Author
Thread Post new topic Reply to topic
iic2



Joined: 26 Jun 2008
Posts: 122
iic2 19 Feb 2011, 18:45
No way do I plan to abandon ASM coding but I do plan to understand C++ and JAVA and than try OPP's in ASM for kicks and if it act right, I'll use it.

I google the first half of those key words and got this most interesting link just created and proven under an hour after flames were thrown.

http://www.cplusplus.com/forum/beginner/3958/
Post 19 Feb 2011, 18:45
View user's profile Send private message Reply with quote
typedef



Joined: 25 Jul 2010
Posts: 2909
Location: 0x77760000
typedef 21 Feb 2011, 19:13
Dude use Pelles C for Windows......

it uses the same FASM ASM syntax.

inline ASM is what I'm talking about. It's good I recommend it.

http://www.pellesc.de/index.php?page=download&lang=en&version=6.50

I find GCC assembler shitty and difficult to use because you have to enclose the instructions in qoutes like "MOV EAX,2" and then you get an error saying not enough Memory for "MOV" operaction (LMAO).
Post 21 Feb 2011, 19:13
View user's profile Send private message Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3175
Location: Denmark
f0dder 22 Feb 2011, 09:31
typedef wrote:
Dude use Pelles C for Windows......
If you're going to use C or C++, why use a compiler that doesn't have very good optimization capabilities?

typedef wrote:
I find GCC assembler shitty and difficult to use because you have to enclose the instructions in qoutes like "MOV EAX,2" and then you get an error saying not enough Memory for "MOV" operaction (LMAO).
Use external assembly modules instead of inline asm - it's portable between compilers (and since some compilers don't support inline assembly for x64 targets, it's a good idea to get used to). Besides, if you aren't doing enough assembly to warrant an external module, you really shouldn't be combining assembly and a HLL anyway.
Post 22 Feb 2011, 09:31
View user's profile Send private message Visit poster's website Reply with quote
typedef



Joined: 25 Jul 2010
Posts: 2909
Location: 0x77760000
typedef 22 Feb 2011, 19:17
^That's not the case.

In case you come across a time where inline ASM is critically needed.
Post 22 Feb 2011, 19:17
View user's profile Send private message Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3175
Location: Denmark
f0dder 22 Feb 2011, 19:22
typedef wrote:
In case you come across a time where inline ASM is critically needed.
When?

The only thing I can think of off top of my head would be some extremely specific low-level kernel function... that would probably still be better done as a complete assembly module, or suggest reworking the code that "needs" inline assembly Smile

_________________
Image - carpe noctem
Post 22 Feb 2011, 19:22
View user's profile Send private message Visit poster's website Reply with quote
typedef



Joined: 25 Jul 2010
Posts: 2909
Location: 0x77760000
typedef 22 Feb 2011, 19:24
f0dder wrote:
some extremely specific low-level kernel function.
Post 22 Feb 2011, 19:24
View user's profile Send private message Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3175
Location: Denmark
f0dder 22 Feb 2011, 19:28
...which is probably still better written as an external assembly module, or reworked. I can't come up with any samples where inline assembly is a substantially better solution than external assembly.
Post 22 Feb 2011, 19:28
View user's profile Send private message Visit poster's website Reply with quote
typedef



Joined: 25 Jul 2010
Posts: 2909
Location: 0x77760000
typedef 22 Feb 2011, 20:01
f0dder wrote:
inline assembly is a substantially better solution than external assembly.


Huh?

Code obfuscation, Encryption (Especially when making self unpackers)



Saving bytes of loading an external module and using inline ASM
Post 22 Feb 2011, 20:01
View user's profile Send private message Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3175
Location: Denmark
f0dder 22 Feb 2011, 20:11
I don't see where inline assembly has an advantage for those scenarios, really. For both de/compression and de/encryption, an external assembly module works just fine (do realize I mean a .asm->.obj linked with your .exe and not a .dll).

Yes, "emit" is necessary if you do ancient "mark code blocks for external tool", but who uses that method these days? If you want effective code obfuscation, you work at the .obj level, or write a compiler for a custom VM.
Post 22 Feb 2011, 20:11
View user's profile Send private message Visit poster's website Reply with quote
typedef



Joined: 25 Jul 2010
Posts: 2909
Location: 0x77760000
typedef 22 Feb 2011, 20:25
f0dder wrote:
but who uses that method these days?


Did I say I use it ?

I just said in case of such scenarios that's when they are needed.

Broah ! Laughing
Post 22 Feb 2011, 20:25
View user's profile Send private message Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3175
Location: Denmark
f0dder 22 Feb 2011, 20:27
typedef wrote:
I just said in case of such scenarios that's when they are needed.
Except they aren't, because those scenarios aren't viable anymore Smile

Why restrict yourself to inline assembly when
1) it's not really necessary
2) syntax is limited compared to a full assembler
3) it limits you to one (or a few) C compilers

?
Post 22 Feb 2011, 20:27
View user's profile Send private message Visit poster's website Reply with quote
typedef



Joined: 25 Jul 2010
Posts: 2909
Location: 0x77760000
typedef 22 Feb 2011, 20:29
f0dder wrote:
Why restrict yourself to inline assembly when


Restriction ? Embarassed

How about practice ? Heh
Post 22 Feb 2011, 20:29
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.