flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > Why not using line num for Jmp jnz?

Author
Thread Post new topic Reply to topic
Roman



Joined: 21 Apr 2012
Posts: 1081
Roman
Posible to implement for Fasmw line number Jmp?
For example
Code:
 Inc edx ;line 1
 Cmp edx, 10 ;line 2
 Jnz 1 ;Jmp to line 1
    

We get code without labels!
Some time its helpful.


Last edited by Roman on 01 Jul 2021, 10:39; edited 1 time in total
Post 01 Jul 2021, 09:45
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 18198
Location: In your JS exploiting you and your system
revolution
Easy to implement. It is just some code to write to make a fasm version of your own that you like.

One method might be to have the preprocessor construct automatic labels and insert them before each line. Or maybe some other method if there is a better way to do it.

And if you post your changes here, maybe others will like it also and use it. Doesn't hurt to try.
Post 01 Jul 2021, 10:15
View user's profile Send private message Visit poster's website Reply with quote
ProMiNick



Joined: 24 Mar 2012
Posts: 642
Location: Russian Federation, Sochi
ProMiNick
what if line(from where jump happened) would be defined in macro? Where should go jump then? to line in that macro, to line in file where macro defined, to line in file where macro used?
It will bring in syntax more complexes.
Post 01 Jul 2021, 12:11
View user's profile Send private message Send e-mail Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1081
Roman
Its good for smal peaces code.
Like as procs.
And Used only in non-macro.
Post 01 Jul 2021, 15:25
View user's profile Send private message Reply with quote
ProMiNick



Joined: 24 Mar 2012
Posts: 642
Location: Russian Federation, Sochi
ProMiNick
Roman wrote:
And Used only in non-macro.

proc is a typical macro for exampe.

But if thou mean this feature needed only inside of procs - thou could extend macro proc (but in fasmg) so each line of proc would be autolabeled.
Maybe when thou will see how compilation will be slowed after that thou will agree that convinience of autolabeling cost too much.

_________________
I don`t like to refer by "you" to one person.
My soul requires acronim "thou" instead.
Post 01 Jul 2021, 16:14
View user's profile Send private message Send e-mail Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 3301
Location: vpcmipstrm
bitRAKE
Line number seems arbitrary unless it's relative and even then it's not anchored to any text - so, would need frequent edits - the opposite of what one wants to achieve, imho.

Betov (of SpAsm/RosAsm* fame) liked a method which actually worked well in practice - cut-n-paste of code rarely required editing: it consisted of using <> characters to select the label - one < would mean the previous label, and two < would mean the label before the previous label.

[*] 32-bit assembler still active, very different from standard x86 syntax.

_________________
¯\(°_o)/¯ unlicense.org
Post 01 Jul 2021, 16:36
View user's profile Send private message Visit poster's website Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1081
Roman
Post 31 Jul 2021, 14:46
View user's profile Send private message 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.