Request: Asm keyword abbreviation

General discussion for topics related to the FreeBASIC project or its community.
Post Reply
Vortex
Posts: 118
Joined: Sep 19, 2005 9:50

Request: Asm keyword abbreviation

Post by Vortex »

Hello,

A small request : Could it be possible to add a symbol like ! ( or another one ) as an abbreviation of the keyword asm?

Instead of :

Code: Select all

asm inc eax
This one :

Code: Select all

! inc eax
MrSwiss
Posts: 3910
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: FreeBASIC 1.08.1 and 1.09.0 Development

Post by MrSwiss »

Vortex wrote:Could it be possible to add a symbol like ! ( or another one ) as an abbreviation of the keyword asm?
There is already the ASM-Block statement, therefore another short-cut makes little sense.
(also notable: short-cuts impact negatively on code's readability, aka: being more cryptic)

Code: Select all

' ... (FB code)
Asm
	' ... all your asm mnemonics
	mov rax, rcx	' first parameter
	mov rcx, r8	' third parameter
	' ... more ...
	mov qword ptr [Function], rax
End Asm
' ... (FB code, again)
Vortex
Posts: 118
Joined: Sep 19, 2005 9:50

Re: FreeBASIC 1.08.1 and 1.09.0 Development

Post by Vortex »

Hi MrSwiss,

Why cryptic? PowerBASIC is already providing this feature.
fxm
Moderator
Posts: 12081
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: FreeBASIC 1.08.1 and 1.09.0 Development

Post by fxm »

Vortex wrote:Could it be possible to add a symbol like ! ( or another one ) as an abbreviation of the keyword asm?
In any case, this symbol ('!') Is already used like many others. I don't send many more that are available (and easily accessible).
Vortex
Posts: 118
Joined: Sep 19, 2005 9:50

Re: FreeBASIC 1.08.1 and 1.09.0 Development

Post by Vortex »

Hello,

Just a small suggestion, two consecutive %% symbols or the # symbol ~ could do the job. No problem and not an important request. Thanks.
Last edited by Vortex on Jul 02, 2021 5:26, edited 1 time in total.
marcov
Posts: 3454
Joined: Jun 16, 2005 9:45
Location: Netherlands
Contact:

Re: FreeBASIC 1.08.1 and 1.09.0 Development

Post by marcov »

Vortex wrote:Hello,

Just a small suggestion, two consecutive %% symbols or the tilde symbol ~ could do the job. No problem and not an important request. Thanks.
To save one whole letter relative to asm? What is the point of this?
Vortex
Posts: 118
Joined: Sep 19, 2005 9:50

Re: FreeBASIC 1.08.1 and 1.09.0 Development

Post by Vortex »

Hello,

As I said, not an important request. The one whole letter relative exists in real life. For example something similar : the equivalent of DOS ren ( rename ) command in Linux is mv.
deltarho[1859]
Posts: 4292
Joined: Jan 02, 2017 0:34
Location: UK
Contact:

Re: FreeBASIC 1.08.1 and 1.09.0 Development

Post by deltarho[1859] »

Even ! in PowerBASIC is a pain for medium to large blocks.

I use:

Code: Select all

Prefix "!"
...
...
End Prefix
and, as MrSwiss pointed out, here we use

Code: Select all

Asm
...
...
End Asm
jj2007
Posts: 2326
Joined: Oct 23, 2016 15:28
Location: Roma, Italia
Contact:

Re: FreeBASIC 1.08.1 and 1.09.0 Development

Post by jj2007 »

I've got used to Asm ... end asm, but not to

Code: Select all

mov qword ptr [Function], rax
In MASM syntax, that's

Code: Select all

mov Function, rax
deltarho[1859]
Posts: 4292
Joined: Jan 02, 2017 0:34
Location: UK
Contact:

Re: FreeBASIC 1.08.1 and 1.09.0 Development

Post by deltarho[1859] »

Similarly, with PowerBASIC

Code: Select all

!mov Function, eax
I'm using eax as an example because PowerBASIC does not have a 64-bit compiler.
erik
Posts: 39
Joined: Dec 28, 2020 17:27
Location: Krasnoyarsk
Contact:

Re: Request: Asm keyword abbreviation

Post by erik »

Bekause BASIC have a verbose sintaxis (asm) instead of ASCII-art or pseudographics (!).
marcov
Posts: 3454
Joined: Jun 16, 2005 9:45
Location: Netherlands
Contact:

Re: Request: Asm keyword abbreviation

Post by marcov »

Yes. But even if you are an language cryptographer/interpunction freak, it is better to save the tokens for commonly used high volume operations.
Post Reply