flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > english language macros possiblity

Author
Thread Post new topic Reply to topic
shism2



Joined: 14 Sep 2005
Posts: 248
shism2
How would someone code something like this .. So you could have kinda like ENGLISH ASM


I'm not very familiar with the macro system so...


Pseudo format:

macro @xor , register with number/register
{

Xor register with number or another register

}

Kinda like you can do


Xor eax with 9

Xor eax with eax


macro @move number(or register contents) into register

{


mov number( or register contents ) into register

}

@move 20 into eax
Post 11 Nov 2005, 00:47
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7796
Location: Kraków, Poland
Tomasz Grysztar
Code:
macro xor [params]
 { common
    match dest =with src, params \{ xor dest,src \} }

macro move [params]
 { common
    match src =into dest, params \{ mov dest,src \} }

xor eax with eax
move 20 into eax    
Post 11 Nov 2005, 02:03
View user's profile Send private message Visit poster's website Reply with quote
shism2



Joined: 14 Sep 2005
Posts: 248
shism2
WOW fasm is extremely powerful...

Also with numbers... How can you set numbers like 20 to automatically 20h

move 20 into eax

becomes

mov eax,14

Btw do you think this is useful Thomas?
Post 11 Nov 2005, 03:21
View user's profile Send private message Reply with quote
comrade



Joined: 16 Jun 2003
Posts: 1137
Location: Russian Federation
comrade
This is extemely useful. I predict every asm programmer will adapt that style
Post 11 Nov 2005, 05:43
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
shism2



Joined: 14 Sep 2005
Posts: 248
shism2
Really???? or are you just being sarcastic?
Post 11 Nov 2005, 05:47
View user's profile Send private message Reply with quote
shism2



Joined: 14 Sep 2005
Posts: 248
shism2
SysInvoke NTTerminateProcess, -1,0,2

The -1 and 0 are the parameters and the 2 is the number of parameters

macro SysInvoke proc,[parameters,numbers] ; indirectly call STDCALL procedure

{ local blah1,blah2
push eax


reverse
pushd parameters


jmp blah2
blah1:
mov eax, proc
mov edx, esp
dw 340Fh ;sysenter 0F34h
blah2:
call blah1
add esp, (numbers*4) + 4 ; + 1 dummy EIP
}

What am I missing?
Post 11 Nov 2005, 06:48
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
comrade wrote:
This is extemely useful. I predict every asm programmer will adapt that style

Smile just like RSA-encrypting part of source. But it is nice example for how easily can you solve complex problem with fasm macros.
Post 11 Nov 2005, 09:19
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7796
Location: Kraków, Poland
Tomasz Grysztar
shism2 wrote:
Btw do you think this is useful Thomas?

Useful? No, I think it's just a form of amusement.

As vid once said, writing fasm macros is on a good way to become a kind of wicked humor. Wink
Post 11 Nov 2005, 12:38
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
if i am right, someone here was using fasm macros to create HTML code. And don't forget about BMP drawing interface created with macros.

How about some FASM macro humor thread?
Post 14 Nov 2005, 15:55
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17663
Location: In your JS exploiting you and your system
revolution
It all seems too verbose for my tastes
Code:
move address of PlainTextString into register EAX please
move a value equal to the length of PlainTextString into register ECX please
save current instruction pointer and jump to subroutine PrintString please
exit this program please

declare a subroutine with the name PrintString please
place register EAX onto the stack please
place register ECX onto the stack please
save current EIP and jump to subroutine APIScreenPrint please
return to the caller of this subroutine please

declare a text string with the handle PlainTextString and put the following text there: "Hello world!" please

Thank you and goodbye    
Post 15 Nov 2005, 02:09
View user's profile Send private message Visit poster's website Reply with quote
shism2



Joined: 14 Sep 2005
Posts: 248
shism2
What with all the please???

I really don't think it would be that bad...... I don't get why it's funny to you guys Sad .

It looks alot easier than normal asm to me .....

Look at the advantages :

1. You already know the english language

2. Easier to understand

3. Gain better typing skills Wink

ONLY 2 disadvantages :

1.Alot more typing

2. Fasm program would take more time to compile ... I'm guessing


Last edited by shism2 on 15 Nov 2005, 06:22; edited 1 time in total
Post 15 Nov 2005, 03:41
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17663
Location: In your JS exploiting you and your system
revolution
Quote:
What with all the please???
I was just being polite to the assembler.
Quote:
You already know the english language
If I talk English to someone then there are a lot of assumptions implicit in the language. eg. "Please go to the shop and buy a newspaper". But I don't say "Lift your left leg 4cm, move you left leg forward 70cm, lower you left leg, lift your right leg 4cm, ... etc." It is all just too verbose.
Quote:
I really don't think it would be that bad
Okay, maybe you are correct, make some proof of concept code/macros and post it here. If everyone likes it then perhaps they will change.
Post 15 Nov 2005, 05:50
View user's profile Send private message Visit poster's website Reply with quote
shism2



Joined: 14 Sep 2005
Posts: 248
shism2
Well, I only see this being of any use to beginners... Because almost everyone here already has adapted to normal asm... I might try and code some of the macros and post a macro include file here..
Post 15 Nov 2005, 06:21
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17663
Location: In your JS exploiting you and your system
revolution
I think it would be great if I could talk to my computer like this:
    ME: "Computer, make an OS for me that has no security holes or bugs and can sell for lot$ of do$h".
    Computer: "Ta da, here it is, have fun with your new Rolls Royce."
Post 15 Nov 2005, 06:36
View user's profile Send private message Visit poster's website Reply with quote
shism2



Joined: 14 Sep 2005
Posts: 248
shism2
LOL
Post 15 Nov 2005, 21:56
View user's profile Send private message Reply with quote
Slai



Joined: 11 Jan 2006
Posts: 40
Location: NY/Bulgaria
Slai
"move 20 into eax" doesnt seem really practical, but for example
eax=20
seems easyer than mov eax,20
.. and an IF statement instead of cmp xxx,xx ; je xxx
Post 12 Mar 2006, 03:01
View user's profile Send private message Reply with quote
eVAPor8



Joined: 03 Nov 2006
Posts: 12
Location: UK
eVAPor8
hmmm.... just my personal opinion on the "let's make asm english" idea...

...Why not simply take up COBOL/VB6/any other HLL?

ASM is complex. It would not have is power, size and speed otherwise. Yeah It's hard to get into (believe me I know this! I'm a noob) BUT think about what you're doing. You are almost directly controlling the voltages within wires in the CPU (and other chips) that are microscopic and bending the overall machine to your will.

This is "powerful magic" and needs to learnt with patience, and one step at a time, IMHO.

Also, I don't speak Russian/Eastern European languages... How about the devel's work on a "Russian" language? How can I interpret the source? The whole point of ASM is that we are talking "directly" to the chip. Once I've learned to do this, I'll be able to "converse" with any other programmer, and language barriers will be removed since we ALL use the same terms.

As I understand it, Flat Assembly is supposed to be just that. And it's a massive achievement. If you want to create a new programming language yourself, well, go ahead. Post the fora when you've finished. Oh, and BTW, don't forget that Americans don't actually speak English.

They spell "colour" "color", (because it's easier) They use "fawcetts" instead of "taps" (*cough* easier?), and I was like really not enjoying when I wrote this.

To an American that last paragraph would make perfect sence and compile correctly. To an Englishman, It's a load of gibberish and fail immediately (pun intended).

Oh, and BTW, sorry for the rant, as a noob, I should probably stay quiet.

Anyway, all the best,

eVAP
Post 04 Nov 2006, 10:35
View user's profile Send private message Visit poster's website Reply with quote
llaurrentt



Joined: 02 Nov 2006
Posts: 13
Location: Liège / Belgium
llaurrentt
comrade wrote:
This is extemely useful. I predict every asm programmer will adapt that style


Just keep in mind that I will not! Asm is asm just like C is not pascal!!! Would you agree with someone asking this kind of thing just because they feel better (read 'it will less introduce change in their life'):

Code:
#define BEGIN {
#define END }

int foo( int arg )
BEGIN
   return arg*2;
END
    


I shall not forbid anyone to (ab)use of this non-sense but for my life I shall not agree with them! Be an asm programmer or be someting else!
Post 04 Nov 2006, 10:53
View user's profile Send private message MSN Messenger 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-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.