Hello guys !
I would like to have more than one commands in one line.
How to realize that ?
Most of my ASM knowlegde I forgot. To many years away :(
I would like to have more than one commands in one line.
How to realize that ?
Most of my ASM knowlegde I forgot. To many years away :(
Do you mean something like this?
mov eax 0 | mov ebx 0 | add eax ebx
mov eax 0 | mov ebx 0 | add eax ebx
How to realize that ?
AFAIK there is no assembler which supports this. You could write a pre-parser for your source files tough, which splits your "one liners" up into several lines before it passes the source file to the assembler.
Do you mean something like this?
mov eax 0 | mov ebx 0 | add eax ebx
Eeeep! That almost looks as ugly as SPASM syntax!
Eeeep! That almost looks as ugly as SPASM syntax!
Guess what? :grin:
It is SpAsm syntax!
There are two assemblers I know that will do what Red wants. SpAsm is one and HLA is the other. Multiple instructions on one line is used all the time is SpAsm code but with HLA it is not recommended. The HLA version of the example is
mov ( 0, eax ); mov ( 0, ebx ) ; add ( eax, ebx );
With HLA you can also embed one instruction in another. For example
mov ( add ( eax, ebx ), ecx );
This will expand to
add ( eax, ebx );
mov ( ebx, ecx );
There are two assemblers I know that will do what Red wants. SpAsm is one and HLA is the other.
I dont see these two programs as "assemblers". :)
I dont see these two programs as "assemblers".
I think most people agree that HLA is not really an assembler yet but if SpAsm is not an assembler I don't know what is.
What would be the point of multiple commands on a line anyway, just makes the code look sloppy and hard to debug.
I think this is true in HLA's case but with SpAsm I think if used properly it can make the code easier to read. For example placing related instructions on the same line llike
cmp ... | jxx ...
The only basics I know about are QB and VB.
The only basics I know about are QB and VB.
And the both handle spaghetti code :grin:
SpAsm, what a horribly strange assembler. It's nor professional, or nice. Who wants bloated exe's full of source anyways?I'll take actual .ASM files that can be compiled any-time.
SpAsm is a unique product indeed. I don't see what you find so horrible. I think SpAsm offers a pleasant coding experience.
I think SpAsm offers a pleasant coding experience.
*cough* *cough* :grin:
SpAsm is a unique product indeed. I don't see what you find so horrible. I think SpAsm offers a pleasant coding experience.
Well, five reasons why:
The strange syntax (B$ D$)
Exe's full of bloated source
The icons spasm makes your exe have
Sourcekiller crashed on an exe
Some dialogs do not make much sense, like the exe icon editor
*cough* *cough* :grin:
I guess you can't please everyone. If SpAsm satisfies the coding needs of some one then its existence is justified. It's nice to have choice , something original , something revolutionary instead of a clone of an existing product.
save the assembler wars for crusades please. If odyssey wishes to use and/or promote spasm that's his choice and right.
I doesnt work with MASM32:
INVOKE GetKeyState, VK_SHIFT
.IF EAX > 1
INVOKE lstrcpy, ADDR buffer, ADDR wParam
.ELSE
ADD wParam, 20h
INVOKE lstrcpy, ADDR buffer, ADDR wParam
.ENDIF
This code i want to get in one line.
INVOKE GetKeyState, VK_SHIFT
.IF EAX > 1
INVOKE lstrcpy, ADDR buffer, ADDR wParam
.ELSE
ADD wParam, 20h
INVOKE lstrcpy, ADDR buffer, ADDR wParam
.ENDIF
This code i want to get in one line.
This code i want to get in one line.
Thats _not_ possible with MASM.
Maybe there is a way to do it through a Macro but I doubt it.
Guys,
Hiro is right, lets not turn this thread into a Spasm bashing match, someone can open a thread in the "crusades" forum if they can be bothered.
MASM the modest and beautiful strikes again. Muhahahaha.
Regards,
hutch@movsd.com
Hiro is right, lets not turn this thread into a Spasm bashing match, someone can open a thread in the "crusades" forum if they can be bothered.
; --------------------------------------------------
; Macro for placing an assembler instruction either
; within another or within a procedure call
; --------------------------------------------------
ASM MACRO parameter1,source
LOCAL mnemonic
LOCAL dest
LOCAL poz
% poz INSTR 1,<parameter1>,< > ;; get the space position
mnemonic SUBSTR <parameter1>, 1, poz-1 ;; get the mnemonic
dest SUBSTR <parameter1>, poz+1 ;; get the first argument
mnemonic dest, source
EXITM <dest>
ENDM
MASM the modest and beautiful strikes again. Muhahahaha.
Regards,
hutch@movsd.com
Thanks a lot.
but you explain your macro a little bit ?
I'm not htat good.
Im just learning...:stupid:
but you explain your macro a little bit ?
I'm not htat good.
Im just learning...:stupid:
Red,
something like this,
mov ebx, ASM(add edx, ecx)
It helps with some "invoke" calls where you need a register and it will not be overwritten by a later parameter.
It only works on 2 parameter instructions.
Regards,
hutch@movsd.com
something like this,
mov ebx, ASM(add edx, ecx)
It helps with some "invoke" calls where you need a register and it will not be overwritten by a later parameter.
It only works on 2 parameter instructions.
Regards,
hutch@movsd.com
*cry cry cry* :mad: :mad: :mad:
I thought there was a way ? Such it could be done, when you want put several parameters vor an instruction in 2 lines ("/").
:( :mad:
I thought there was a way ? Such it could be done, when you want put several parameters vor an instruction in 2 lines ("/").
:( :mad: