flat assembler
Message board for the users of flat assembler.

Index > Heap > WTF

Goto page 1, 2, 3  Next
Author
Thread Post new topic Reply to topic
typedef



Joined: 25 Jul 2010
Posts: 2913
Location: 0x77760000
typedef
Post 10 Aug 2011, 14:56
View user's profile Send private message Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4238
Location: 2018
edfed
what about asm++, asm#, asm++0x, asm.net, visual-asm, visual asm++, etc...

no, asm is only asm. that's all.
Post 10 Aug 2011, 15:06
View user's profile Send private message Visit poster's website Reply with quote
Overflowz



Joined: 03 Sep 2010
Posts: 1046
Overflowz
offtopic:
WTF = Welcome To Facebook Laughing
Post 10 Aug 2011, 15:09
View user's profile Send private message Reply with quote
Enko



Joined: 03 Apr 2007
Posts: 678
Location: Mar del Plata
Enko
I dont see a big change. It seems like they will expand the STL and some minor changes.
Better hardware access? common... its already what it needed to be.
Post 10 Aug 2011, 15:25
View user's profile Send private message Reply with quote
typedef



Joined: 25 Jul 2010
Posts: 2913
Location: 0x77760000
typedef
I hope it doesn't reach the "managed code" point because I will stop coding and work at a sewer company.
Post 10 Aug 2011, 15:32
View user's profile Send private message Reply with quote
Enko



Joined: 03 Apr 2007
Posts: 678
Location: Mar del Plata
Enko
I didnĀ“t see uglier code than managed c++. It just look like shit.
Post 10 Aug 2011, 15:35
View user's profile Send private message Reply with quote
AsmGuru62



Joined: 28 Jan 2004
Posts: 1412
Location: Toronto, Canada
AsmGuru62
I work right now on creating ASM++ - it will be a simplest OO concept with no bloat.
Post 10 Aug 2011, 16:38
View user's profile Send private message Send e-mail Reply with quote
typedef



Joined: 25 Jul 2010
Posts: 2913
Location: 0x77760000
typedef
AsmGuru62 wrote:
I work right now on creating ASM++ - it will be a simplest OO concept with no bloat.

If you become the change that you claim you'll be.

+1

But still, I like to make my own code and not rely on a compiler. Thanks to ASM.
Post 10 Aug 2011, 17:38
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
AsmGuru62 wrote:
I work right now on creating ASM++ - it will be a simplest OO concept with no bloat.

give us some small example
Post 10 Aug 2011, 18:14
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
AsmGuru62



Joined: 28 Jan 2004
Posts: 1412
Location: Toronto, Canada
AsmGuru62
Code:
... declaration files ...

#
# Base Class
#
class Base : vtbl
{
       data
        {
              HWND    Handle
              RECT    ClientArea
          UINT    Identifier
          BYTE    chType
              TCHAR   DocPath [MAX_PATH] @4  # <-- alignment option
    }

  code
        {
              virtual         OnMsg (EDX:msg, ESI:wparam, EDI:lparam)
         static          Copy (EAX:buffer, ECX:bytes)
                callback        DoThread (params)
           callback        WndProc (hwnd, msg, wp, lp)
         method          Save () @32 # <-- alignment of proc label
        }
}
#
# Derived class
#
class Child : Base
{
   data
        {
              #
           # In addition to data in 'Base'
           #
           PBYTE   Buffer1
     }

  code
        {
              override        OnMsg (EDX:msg, ESI:wparam, EDI:lparam)
 }
}

... in the code file ...

override Child::OnMsg (EDX:msg, ESI:wparam, EDI:lparam)
{
       local =0 @16 # <-- optional alignment and clear to zero state
    {
              TCHAR   buf [32]
            RECT    rect1
       }

  vcall   base.OnMsg (msg, wparam, lparam)

        lea     esi, loc.rect1
      mov     eax, "... this code is weird !.."
 api.SendMessage (this.Handle, WM_SETTEXT, 123, "MY TEXT")
}

etc.
    

The code generator runs through all the script and generates FASM code. Some options are set by default, like profiling - CodeGen can generate the profiling code for every function - pretty cool! Or locals can be based on EBP or ESP - optional.

Anyhow, it is all half-way done. I also want to make a nice form editor for dialogs. The stuff, like types (HANDLE, WCHAR, PBYTE) defined in other files. Same for constants, like MAX_PATH.
Post 10 Aug 2011, 19:20
View user's profile Send private message Send e-mail Reply with quote
typedef



Joined: 25 Jul 2010
Posts: 2913
Location: 0x77760000
typedef
^^As much as I hate to see C++ classes, I find this to be very confusing.

I mean, I'm good dude, if I want ASM, I'll code in ASM, if I want to code in C++, I'll happily do so, but seeing this in Assembly is not for me. that = this.that.callThis(); { This_too(); Or_This(){ Hello_I_am_X=0;}} becauseThisCannotAccess_Hello_I_am_X(){}

WTF Evil or Very Mad Twisted Evil
Post 10 Aug 2011, 20:54
View user's profile Send private message Reply with quote
AsmGuru62



Joined: 28 Jan 2004
Posts: 1412
Location: Toronto, Canada
AsmGuru62
There is no complex stuff, like in your example.

this.Handle

simply replaced with:

[ebx + <generated struct here>.Handle]

Not only it is shorter than typing it all by yourself, but "this." will pop up the Auto-Complete with all members including fields in base class. Same goes for "loc." - it will be replaced with [ebp (or ESP) + <generated locals structure>.member]
Post 10 Aug 2011, 22:15
View user's profile Send private message Send e-mail Reply with quote
typedef



Joined: 25 Jul 2010
Posts: 2913
Location: 0x77760000
typedef
Well, the thing is that I don't trust you to generate my Assembly code. If FASM is what you are going to use as the compiler then at least maybe I can try to use it. But meeeh..
Post 10 Aug 2011, 23:22
View user's profile Send private message Reply with quote
Enko



Joined: 03 Apr 2007
Posts: 678
Location: Mar del Plata
Enko
AsmGuru, in the example you posted, the syntax looks preaty clean, just like vcl of delphi or the .net of the c#.
But if someone ask me, what language is it, I don't think in asembly
:really mov eax, 'string' is far far away from assembly.

But if you manage to complete it, it would be very nice and interesting to try it and use it.

Very interesting project Smile
Post 11 Aug 2011, 01:03
View user's profile Send private message Reply with quote
typedef



Joined: 25 Jul 2010
Posts: 2913
Location: 0x77760000
typedef
AsmGuru62 wrote:
Code:

   mov     eax, "... this code is weird !.."
 
    



lol Very Happy
Shocked Laughing

hahahahahahahahahahahahahahahahahahahahahahahahahahahahahaha
Post 11 Aug 2011, 01:21
View user's profile Send private message Reply with quote
AsmGuru62



Joined: 28 Jan 2004
Posts: 1412
Location: Toronto, Canada
AsmGuru62
So, in other words, you would like to create that string somewhere in data section and then
load that address into a register, why not let that code be generated by someone else (IDE) for you?

All it does, it creates the next text constant like that:

Code:
txt_const_8376 db 'my crazy stuff.',0    


and then uses that name instead of text, when generating code line:

Code:
mov eax, txt_const_8376    


Also, there is a check on "sameness" of text, to decrease the bloat in data section.
This way you can use 'my crazy stuff' a lot of times, but it only be defined once as data.
Same for passing that thing on stack to APIs and such.

Code:
api.MessageBox (this.Handle, "Hello, World!", "Click me!", MB_ICONEXCLAMATION)    
Post 11 Aug 2011, 14:03
View user's profile Send private message Send e-mail Reply with quote
Enko



Joined: 03 Apr 2007
Posts: 678
Location: Mar del Plata
Enko
I'll see it more like Delphi/Pascal stuff.
There are lots of programmers that program using Delphi. But they don't understand OOP and still able to use it. Becouse you make a Form, put a button, doubleclick the button and the IDE make you land in the part of the button event click.
Thats why it's a RAD. In your case I think could happen the same thing,
The problem would be, that those who programm assembly do it for a reason... and it's not becouse of Rappid App Devvelopment...

but if you succed your project, this aproach could change, like an utopic world where assembly is used as much as php/java/cpp.


Other thing, is good you didn't take the Borland aproach of embeded strings, how I hate them...
Code:
jmp  .next
string db 10,'the string'
.next
mov eax, string
    

The good thing was that thew are size started (fist byte string size). The bad thing, not null terminated, not windows api compatible....
Post 11 Aug 2011, 14:13
View user's profile Send private message Reply with quote
typedef



Joined: 25 Jul 2010
Posts: 2913
Location: 0x77760000
typedef
AsmGuru62 wrote:


Code:
api.MessageBox (this.Handle, "Hello, World!", "Click me!", MB_ICONEXCLAMATION)    


So, does the api object class automatically import libraries ? Very Happy
Post 11 Aug 2011, 14:42
View user's profile Send private message Reply with quote
AsmGuru62



Joined: 28 Jan 2004
Posts: 1412
Location: Toronto, Canada
AsmGuru62
No. Imports are defined by a programmer - I'll put most of it into the system. Anyone can add more as needed - there is a GUI for that (and for other stuff).

it is defined like so:
Code:
import KERNEL32
{
        PVOID HeapAlloc (HANDLE allocator, UINT flags, UINT bytes);
}
    

Smile Why do more if all already done - copy/paste from Windows header files? When you select that name (HeapAlloc) from Auto-complete list - it will print the following:
Code:
api.HeapAlloc (allocator, flags, bytes)
    

Now, you can replace the parameter names with real parameters.
Post 11 Aug 2011, 17:24
View user's profile Send private message Send e-mail Reply with quote
typedef



Joined: 25 Jul 2010
Posts: 2913
Location: 0x77760000
typedef
So, what about something like this:

Code:
pointer = api.GetProcAddress( api.GetModuleHandle(api.LoadLibrary("my_DLL.dll")),"my_fucntion"))


;Maybe you could also add this
Handle x = api.addCustom(pointer);
api.callCustom(x,param1,param2);

    

Which one get's called first ? According to your compiler. ? Does it call the other methods and then allocate bytes for the strings ?

About data and data pointers:

Get a value not a pointer.

in pure assembly we would normally do it like this:
Code:
call [GetLastError]
mov [err],eax
    


so would it be

Code:

err dd 0

err = api.GetLastError()
    

or
Code:
[err] = api.GetLastError();
    


or maybe
Code:
err = &api.GetLastError();
    


or even maybe

Code:
[err] = &api.GetLastError();
    


If so, how would you know the user want's the pointer not the actual value.

If your answer is You can obtain it from eax, then there's no point for ASM++, because you can already do that in pure Assembly.


Is that valid code according to your compiler's grammar?

Yes I'm trying to intimidate you and if it is not working, then I might just have even more questions to ask you. Very Happy
Post 11 Aug 2011, 19:26
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page 1, 2, 3  Next

< 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 can attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.