News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

GoAsm SDK Release!(Not offical)

Started by ecube, April 03, 2009, 02:22:34 AM

Previous topic - Next topic

ecube

Sorry i'm a day late, I was working on adding .if,.elseif,.else,.endif support to GoASM by having a little interceptor exe read the source before GoASM does and replace the statements with code GoASM understands in a temp file, and pass that on. I'm not quite done yet, but i'll upload it when I am, in anycase!

SDK Release Notes v1.0 Beta
- The Latest versions of GoAsm binaries
    -GoAsm 0.56.5h
    -GoLink 0.26.10 beta5
    -GoRC 0.90.3f
- The Latest versions of GoAsm docs
- The Latest Verisons of Donkey's headers(2.0)
- Various 32bit/64bit examples showing things like
COM,Unicode,Networking,.Libs,.Dll's,.Exe's,Code timing etc..


-=How To Install=-(download size 1.9mb, install size 7.02mb)
Download from
http://d01.megashares.com/dl/07f83ce/GoAsm.exe

1)Run the SFX exe and let it extract to C:\GoASM or if you have WinRar install right click and extract there that way.

Lot of examples didn't get in yet, but they're coming! if you want to contibute anything post it! Enjoy!

mitchi

Hey, hey what a nice package. This is a lot better than your MASM64 package.
Make it official, this is good enough ! Excellent even.

UtillMasm


ecube

Heh, thankyou, i'm glad you guys like it, I think GoASM is amazing, Jeremy did a fantastic job, and Donkey did aswell.
And yeah my MASM64 SDK was a disaster, I felt like I trying to revive a dead horse :\ Microsoft just crippled ml64 too bad for it to be taken seriously, which is why i'm glad I found GoASM!

BlackVortex

Cool package ! I'm dropping masm like a hot potato and switching to goasm.

I'll take a better look at the docs and examples tomorrow and adapt my gobuild.bat to the new folders, hehe. Now the main problem is complex nested comparisons. I don't want to create a ton of labels everywhere, it's spaggheti code.

I hope we get a solution to the runtime conditionals. As a temporary solution, do you think your preprocessor can/will produce effective code ? (like masm's .if)

ecube

Thanks BlackVortex, and yeah the runtime conditionals are a problem, my preprocessor code seems to be working so far, i'll have a release by tommorow. It lets you specify any naming you like(.if can be .when etc...)  as far as it being reliable, i'll have to test on larger projects

     
         .if D[val] > ecx ; can be .if (D[val] > ecx) too
               invoke MessageBox,0,'test',NULL,MB_OK
              .if edx != 0
                   invoke MessageBox,0,'nested if',NULL,MB_OK
              .endif
        .elseif D[val] < 3
               invoke MessageBox,0,'test2',NULL,MB_OK
        .else
              invoke MessageBox,0,'test3',NULL,MB_OK
        .endif

would translate to

cmp D[val], ecx
jle > @randomlabelname
invoke MessageBox,0,'test',NULL,MB_OK

cmp edx,0
je > @randomlabelsubname
invoke MessageBox,0,'nested if',NULL,MB_OK

@randomlabelsubname:
;if no theres no more elseifs, this would point to the .else code, if theres no .else code this would just go to the .endif
jmp > @random_end_if_label

@randomlabelname:

cmp D[val],3
jge > @randomlabelname2
invoke MessageBox,0,'test2',NULL,MB_OK
etc code...
jmp > @random_end_if_label

@randomlabelname2:
;if no theres no more elseifs, this would point to the .else code, if theres no .else code this would just go to the .endif
invoke MessageBox,0,'test3',NULL,MB_OK
etc code...

@random_end_if_label:



label names are randomly generated and stored in an array and checked against new entries to make sure ones not already being used, note is taken on the order  labels are inserted aswell. So yeah the above looks messy but it works. There won't be a lot of error checking but it does check ahead to make sure the .endif count matches the .if count and make sure theres not more than 1 .else within a single .if, .endif block, complains if there is. This comes with full source so you can edit at will.

mitchi

Mr. Gordon really needs to give us these conditionals :)

Mark Jones

It's very strange... to see all of these requests for conditionals. It took quite awhile to find this, but when I brought this topic up before, THIS is what was said about the idea:

http://www.masm32.com/board/index.php?topic=7700.0

:P
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

ecube

Quote from: Mark Jones on April 03, 2009, 04:13:29 PM
It's very strange... to see all of these requests for conditionals. It took quite awhile to find this, but when I brought this topic up before, THIS is what was said about the idea:

http://www.masm32.com/board/index.php?topic=7700.0

:P

Yeah reading that reminds me of people telling me things like "hardcore programmers only code in binary" ... that kind of thing IMO is very silly and counter productive, I myself never been a fan of cmp and jmp's, it's like BlackVortex mentioned "spaggheti code". In any case my pre processor program will be ready today, It takes a look all include files and generates for any it finds conditionals in, the editable conditionals are


IF_STATEMENT     db '.if',0
ELSEIF_STATEMENT db '.elseif',0
ELSE_STATEMENT   db '.else',0
ENDIF_STATEMENT  db '.endif',0

;can can edit the comparisons too
LESS_THAN        db '<',0
GREATER_THAN     db '>',0
EQUALTO          db '==',0
EQUALTO2         db '=',0
LESSTHANEQUAL    db '<=',0
LESSTHANEQUAL2   db '=<',0 
GREATERTHANEQUAL db '>=',0
GREATERTHANEQUAL2 db '=>',0
NOTEQUALTO        db '!=',0
NOTEQUALTO2       db '=!',0

so
.if D[bird] <= 10

is the same as
.if D[bird] =< 10

can edit to

.when D[bird] LESS= 10


the parser is also case and space insensitive.

mitchi

When we do :

.if eax == 0

It translates to cmp eax, 0 or test eax, eax ?

ecube

just cmp, it doesn't generate optimized code yet, everything's cmp and jmp's. I want to make sure everything works well with that before optimizing. It comes with full source so you can edit however you like to.

Vortex


mitchi

When are you releasing your macros E^Cube ?

donkey

Hi E^cube,

Finally had some time to begin to look through your SDK this weekend. Great work !!! A note about the Invoke_power.asm example, you have underestimated the power of invoke, a definition is non-recursive so you can use the same name for the definition as the label...

;define it in a pretty way
GetTickCountx = kernel32:GetTickCount

;call it in a pretty way
invoke GetTickCountx


Could just as well be

;define it in a pretty way
GetTickCount = kernel32:GetTickCount

;call it in a pretty way
invoke GetTickCount


No need to append an x to distinguish it.

Thanks for including my headers, they should hopefully stabilize fairly soon as should GoAsm (though that is Jeremy's ball) at that point a fixed release of the SDK will be not only very possible but necessary to expand the community. The switch to 64/Vista completely destabilized the header project and it is still in a state of flux for the next couple of weeks but I can't see many changes on the horizon for it or GoAsm (with the exception of run-time conditionals).

Also, I have made a change to the CInvoke macro that will change it to a normal invoke if the WIN64 switch is defined, after thinking about it I opted for this since it is normally used for API functions and it will allow for transparent conversion to 64 bit.

Edgar
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

ecube

Hi Donkey,

Thanks, i'm glad you got a chance to look at the SDK and enjoy it, and yeah I know they're a couple bugs I spotted and updated for next release. My preprocessor is pretty much finished, which adds .if etc.. and also now supports .while and .endw. And I added some more examples, the big things i'm working on for the GoASM SDK atm are

- easy FPU support, so you can do things like

DATA SECTION
buff db 1024 dup ?
CODE SECTION
;to do the math,convert to string and put in the buffer
buff = Mst(10.9 + 5.31 * 5 - 3 / 2)

invoke MessageBox,addr buff,'test results',mb_ok


i'm using Raymonds very nice FPULIB to do the math


- Masm to/From GoASM source converter(detects API functions via dll exports, detects declared variables and sizes etc... I think besides the macro stuff which I skip, sources can be converted almost perfect without any forseeable issues.)

- header switch support to the preprocessor
so can use the same build.bat on all sources and they'll build correctly, for example if #define win64 is read in the source by the preprocessor it automatically(unless otherwise specified in the build switches) tells the compile to build for 64. same for console etc etc...


I look forward to your header update, Jeremy said he was working on the import thing, I kind of wanted to include your verison of the headers with the includeall support in the next SDK I release but if it takes to long i'll just use the last one you uploaded.