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 :(
Posted on 2003-03-26 14:42:44 by Forginforcer
Do you mean something like this?

mov eax 0 | mov ebx 0 | add eax ebx
Posted on 2003-03-26 14:49:49 by Odyssey

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!
Posted on 2003-03-26 15:16:13 by bazik

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 );
Posted on 2003-03-26 15:46:36 by Odyssey

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". :)
Posted on 2003-03-26 15:50:31 by bazik


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 ...
Posted on 2003-03-26 16:02:09 by Odyssey
The only basics I know about are QB and VB.
Posted on 2003-03-26 16:10:11 by Odyssey

The only basics I know about are QB and VB.


And the both handle spaghetti code :grin:
Posted on 2003-03-26 16:11:53 by bazik
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.
Posted on 2003-03-26 16:12:24 by kairon
SpAsm is a unique product indeed. I don't see what you find so horrible. I think SpAsm offers a pleasant coding experience.
Posted on 2003-03-26 16:21:58 by Odyssey

I think SpAsm offers a pleasant coding experience.


*cough* *cough* :grin:
Posted on 2003-03-26 16:25:48 by bazik

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
Posted on 2003-03-26 16:28:24 by kairon

*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.
Posted on 2003-03-26 16:36:56 by Odyssey
save the assembler wars for crusades please. If odyssey wishes to use and/or promote spasm that's his choice and right.
Posted on 2003-03-26 16:38:51 by Hiroshimator
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.
Posted on 2003-03-27 00:29:14 by Forginforcer

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.
Posted on 2003-03-27 00:53:09 by bazik
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.


; --------------------------------------------------
; 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
Posted on 2003-03-27 01:07:21 by hutch--
Thanks a lot.
but you explain your macro a little bit ?
I'm not htat good.
Im just learning...:stupid:
Posted on 2003-03-27 01:11:09 by Forginforcer
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
Posted on 2003-03-27 01:15:47 by hutch--
*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:
Posted on 2003-03-27 01:21:16 by Forginforcer