flat assembler
Message board for the users of flat assembler.

Index > Main > [SUG] @@@:, jcc @@f, & jcc @@b

Goto page 1, 2  Next
Author
Thread Post new topic Reply to topic
Posetf



Joined: 01 Mar 2004
Posts: 35
Location: London
Posetf
As we all know, the @@: and jcc @f/@b are very handy.

What I often find myself coding is:
cmp <case 1>
jne @f
.....
jmp ???
@@:
cmp <case 2>
... etc

The suggestion is to have a second version, @@@:, which is completely independent of @@:
Just an idea, comments?
Post 27 Feb 2006, 02:00
View user's profile Send private message Visit poster's website Reply with quote
okasvi



Joined: 18 Aug 2005
Posts: 383
Location: Finland
okasvi

_________________
When We Ride On Our Enemies
support reverse smileys |:
Post 27 Feb 2006, 03:25
View user's profile Send private message MSN Messenger Reply with quote
RedGhost



Joined: 18 May 2005
Posts: 444
Location: BC, Canada
RedGhost
okasvi wrote:
i suggest reading this:
http://board.flatassembler.net/topic.php?t=4716


just post there and show that more people have an interest for it, and maybe if we get on tomasz case he will add it!

_________________
redghost.ca
Post 27 Feb 2006, 06:14
View user's profile Send private message AIM Address MSN Messenger Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7108
Location: Slovakia
vid
well, this seems better idea than @FF. But still somwhat confusing
Post 27 Feb 2006, 08:28
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
tom tobias



Joined: 09 Sep 2003
Posts: 1320
Location: usa
tom tobias
Posetf wrote:
As we all know, the @@: and jcc @f/@b are very handy.
What I often find myself coding is: .....
Hmm. Where shall I begin? To commence, allow me to repudiate your FIRST error. "we all know"
NO, I don't know. Worse, I don't WANT to know. When I see nonsense like @@ this or @@ that, I simply cease examining THE CODE, and move on to the next topic. If you are uncomfortable with the Roman alphabet, I have sympathy for your situation, but you claim to live in LONDON (a terrific city!), so I imagine you possess a profound facility to communciate using English, in other words, I deem improbable the likelihood of your being an autistic savant (mathematical genius, but one who cannot drive an automobile, or discern right from left)
http://www.guardian.co.uk/weekend/story/0,3605,1409903,00.html

Second, you, AND EVERYONE ELSE who "codes" like this, is MISUSING punctuation. You are literally creating code, instead of writing programs. Code, as in, UNREADABLE:
http://www.english.uiuc.edu/maps/poets/a_f/cummings/cummings.htm
You solicited suggestions, here's one: stop using punctuation in lieu of conventional Roman letters--preferably arranged in a linear sequence so as to be READABLE (as opposed to E.E. Cummings' poetry).
Crying or Very sad
Post 27 Feb 2006, 10:35
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7108
Location: Slovakia
vid
hey tom, post some your code so we can finally see how readable program (not code!!!) looks like. Wink Twisted Evil
Post 27 Feb 2006, 11:43
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
tom tobias



Joined: 09 Sep 2003
Posts: 1320
Location: usa
tom tobias
Excuse me Vid, was it your intention to write, "please submit an excerpt from one of your programs so we can read one person's method of solving a particular problem by programming, rather than "coding"?"
If so, then, may I humbly suggest that, rather than struggling to understand tom's ARCANE, convoluted, disorganized, illogical, and misinformed mind, you instead READ one of the late Dr. Dandamudi's excellent textbooks on Assembly Language Programming. Dr. Dandamudi, who died unexpectedly a couple of months ago, taught computer architecture and assembly language programming at Carleton University in Ottawa, and wrote, in my opinion, some of the best books out there on Assembly language programming. Here's a link:
http://www.scs.carleton.ca/~sivarama/
Crying or Very sad
Post 27 Feb 2006, 12:35
View user's profile Send private message Reply with quote
dead_body



Joined: 21 Sep 2005
Posts: 188
Location: Ukraine,Kharkov
dead_body
jz @@B
jmp @@F
;will be a good idea, maybe...
Post 27 Feb 2006, 19:23
View user's profile Send private message Reply with quote
gunblade



Joined: 19 Feb 2004
Posts: 209
gunblade
It's not a bad idea, only problem is where to stop, people will find that they need a @@@F, then @@@@F, where will it stop Wink
Although, if it only requires a small change in the code, it would be a handy thing to have, in case you have to use it.
Only problem is, once you use something like a @@@f, if you go to change your code, you will have to make sure you make all the necessary changes.
One suggestion would be to use local variables, even if you give them single-letter names.. just .a, .b, etc.. doesnt take up any extra memory, and is a bit easier to deal with when changing code.

Anyway, back to studying Rolling Eyes
Post 27 Feb 2006, 23:28
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7108
Location: Slovakia
vid
tom: i just wanted to see if you are really the one here to correct us all in our coding / programming styles. I'd read it but i am not going to pay for it.
Post 28 Feb 2006, 00:36
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
RedGhost



Joined: 18 May 2005
Posts: 444
Location: BC, Canada
RedGhost
tom tobias wrote:
Posetf wrote:
As we all know, the @@: and jcc @f/@b are very handy.
What I often find myself coding is: .....
Hmm. Where shall I begin? To commence, allow me to repudiate your FIRST error. "we all know"
NO, I don't know. Worse, I don't WANT to know. When I see nonsense like @@ this or @@ that, I simply cease examining THE CODE, and move on to the next topic. If you are uncomfortable with the Roman alphabet, I have sympathy for your situation, but you claim to live in LONDON (a terrific city!), so I imagine you possess a profound facility to communciate using English, in other words, I deem improbable the likelihood of your being an autistic savant (mathematical genius, but one who cannot drive an automobile, or discern right from left)
http://www.guardian.co.uk/weekend/story/0,3605,1409903,00.html

Second, you, AND EVERYONE ELSE who "codes" like this, is MISUSING punctuation. You are literally creating code, instead of writing programs. Code, as in, UNREADABLE:
http://www.english.uiuc.edu/maps/poets/a_f/cummings/cummings.htm
You solicited suggestions, here's one: stop using punctuation in lieu of conventional Roman letters--preferably arranged in a linear sequence so as to be READABLE (as opposed to E.E. Cummings' poetry).
Crying or Very sad


i code in the style i am comfortable with, i can read @@/@f/@b as clear as any other code i write!

i personally would rather see anonymous labels for small subfunctions for just loops and comparisons and what have you then naming everything, and not using them is a waste of a good feature of FASM, so you can see my friend we are all entitled to our oppinions but should not insult other peoples without a valid argument besides "well i dont like it", if i wanted supreme readable code i would be using visual basic

_________________
redghost.ca
Post 28 Feb 2006, 04:23
View user's profile Send private message AIM Address MSN Messenger Reply with quote
okasvi



Joined: 18 Aug 2005
Posts: 383
Location: Finland
okasvi
RedGhost wrote:
if i wanted supreme readable code i would be using visual basic


its far from being readable Shocked

_________________
When We Ride On Our Enemies
support reverse smileys |:
Post 28 Feb 2006, 11:50
View user's profile Send private message MSN Messenger Reply with quote
RedGhost



Joined: 18 May 2005
Posts: 444
Location: BC, Canada
RedGhost
okasvi wrote:
RedGhost wrote:
if i wanted supreme readable code i would be using visual basic


its far from being readable Shocked


i always found it easy to read If Then ' End If etc, never did get why they called procedures 'sub' though Mad, and the lack of pointer access was pretty terrible

_________________
redghost.ca
Post 28 Feb 2006, 14:47
View user's profile Send private message AIM Address MSN Messenger Reply with quote
Borsuc



Joined: 29 Dec 2005
Posts: 2468
Location: Bucharest, Romania
Borsuc
tom tobias wrote:
Second, you, AND EVERYONE ELSE who "codes" like this, is MISUSING punctuation. You are literally creating code, instead of writing programs. Code, as in, UNREADABLE:
http://www.english.uiuc.edu/maps/poets/a_f/cummings/cummings.htm
You solicited suggestions, here's one: stop using punctuation in lieu of conventional Roman letters--preferably arranged in a linear sequence so as to be READABLE (as opposed to E.E. Cummings' poetry).
Crying or Very sad

whoa, wait wait wait...

Who says I'm misusing punctuation? If you like long-name-instructions-and-english-style-code like:
Code:
move register eax in register ecx    
so be it, but don't claim we MAKE a mistake.

I, for example, prefer short-names, and I don't like literature very much.. and computers have NOTHING to do with literature anyway, just logic. And being a programmer requires that you understand at least the idea of a computer's internals (this is valid especially for assembly programmers).
So don't expect a teacher who teaches a language (like english) and knows nothing about the computer logic to really understand a program, because not everyone codes, anyway.. especially not in asm.

Asm is a language where you come closer to the computer, and not extra-layers of abstraction just because humans think that way. I prefer to think in low-level terms (dunno, I think I just got used to it), and sometimes I really think about memory as in hexadecimal, and bits. And I like special-symbols also, and not long-name-english-style (or any other human language for that matter).

Conclusion: don't say we ARE mistaken 'cause we all have different styles/preferences, and in the end, I think those who 'abstract' themselves from how the computer works are actually making a big mistake, or claiming a computer-language should be similar to a human-language. If you really like human-languages so much, by all means use a higher-level language (seriously, asm is not the way to go for that purpose).

since computers do not think like humans (they have a different logic), it's not so surprising computer-languages are different from human-languages. Anyway, it depends on styles, and what I wanted to say, is: don't claim you are on the right path, and we are wrong, 'cause in the end, you're the guy who's wrong because you assume such things! We all have different likes, and it's wrong to consider something wrong for such a subject. that depends on the programmer/coder
Post 28 Feb 2006, 16:51
View user's profile Send private message Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7489
Location: Kraków, Poland
Tomasz Grysztar
The_Grey_Beast wrote:
since computers do not think like humans (they have a different logic)

You mean quantum computers? Wink
Post 28 Feb 2006, 17:33
View user's profile Send private message Visit poster's website Reply with quote
Borsuc



Joined: 29 Dec 2005
Posts: 2468
Location: Bucharest, Romania
Borsuc
of course Laughing
Post 28 Feb 2006, 17:42
View user's profile Send private message Reply with quote
Borsuc



Joined: 29 Dec 2005
Posts: 2468
Location: Bucharest, Romania
Borsuc
gunblade wrote:
It's not a bad idea, only problem is where to stop, people will find that they need a @@@F, then @@@@F, where will it stop Wink

That's a common problem in that you have to know your limits. I, personally, may suggest something like @F3 or @F4..
sure, I don't use anonymous labels too often, but I understand they are quite handy for certain situations and others' styles/likes.

gunblade wrote:
Only problem is, once you use something like a @@@f, if you go to change your code, you will have to make sure you make all the necessary changes.
One suggestion would be to use local variables, even if you give them single-letter names.. just .a, .b, etc.. doesnt take up any extra memory, and is a bit easier to deal with when changing code.

yeah, but if you use locals and modify code, you can end up like:
Code:
.a:
; ...
.c:
; ...
.b:
; ...
.e:    

because you will, for example, add 'c' before 'b' (modify some code), and that tends to confuse the reader.
At least, (in my opinion) such a thing as making sure you make all the necessary changes is a good thing.. it forces me to 'reexamine' and 'rewrite' my code better. And it also does not confuse the reader (for example, like an old comment which explains something I removed for some reason, yet I forgot to delete/modify that comment, and it can confuse the reader a lot).. at least that forces me to modify my code
Smile

Sure, it's quite a pain to modify everything, I know Sad

BTW: tom: nice book (really Smile ).. too bad it's not openly available Sad (at least the preface/introduction/epilogue/review/whatever is pretty interesting).. i don't think it can even respect all the promises (as most books fail), but still it's nice to see an asm book around Wink
Post 28 Feb 2006, 21:12
View user's profile Send private message Reply with quote
Posetf



Joined: 01 Mar 2004
Posts: 35
Location: London
Posetf
tom tobias wrote:
Code, as in, UNREADABLE:

I am probably far more concerned with code readability than you.
What I want to avoid is something like this:

ProcessOption:
cmp al, 'a'
jne ProcessOptionOtherThana
...
jmp ProcessOptionDone
ProcessOptionOtherThana:
cmp al, 'f'
jne ProcessOptionOtherThanaorf
.
.
.
To read such code, all I really need is the header "ProcessOption", not, for the sake of uniqueness, the same 'phrase' repeated two dozen times.

Readable English uses "it", "itself", "such", "the same", etc - and that is what @@ etc emulate.

Regards,
Pete


Last edited by Posetf on 05 Mar 2006, 04:03; edited 1 time in total
Post 04 Mar 2006, 01:39
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7108
Location: Slovakia
vid
Quote:
Readable English uses "it", "itself", "such", "the same", etc - and that is what @@ etc emulate

Great argument!
Post 04 Mar 2006, 09:06
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
tom tobias



Joined: 09 Sep 2003
Posts: 1320
Location: usa
tom tobias
sure, and one can add loop counters, i,j,k, or indices, m,n,...
single letters do not convey any meaning, they simply are understood to represent something, in this case, quantities of integers. One need not write out LoopCounter, i alone suffices.
Readability, as has been noted by several authors, ostensibly repudiating my argument, is in the eye of the beholder.
As is the case with "misuse" of boolean operators to clear a register, experienced people have their own idea as to what an instruction, or group of instructions signifies. My point was this:
USE PUNCTUATION for documentation, rather than haphazardly sticking these symbols into a program to represent constants, variables, functions, memory locations, or assembler directives, if you seek to create a readable program, rather than some sort of secret code that naive persons can not hope to comprehend. Punctuation symbols HAVE a predefined meaning, unlike the alphabetic symbols, so using !%^* instead of Hello, creates potential confusion, except for those few persons who have been informed of the decision to CHANGE the meaning of the punctuation symbols. So, when you see @@this or @@that, there is a meaning conveyed to you, but not to me. For me, punctuation symbols are not to be confounded with roman letters. I feel the same way about @@this that I would feel about ++this, or --that. (hint, I do not particularly like the C programming language!) I suppose for non-native speakers of English, this point may seem quite arcane, distant, obtuse, and irrelevant. From the point of view of someone who uses Arabic or Chinese or Hindi or Russian symbols in their daily life, the whole Roman alphabet, numbers, punctuation, all of them, are alien, all of them are EQUALLY obscure, equally meaningless, therefore equally applicable to a programming task. Maybe I should abandon the goal of convincing people to use letters arranged as meaningful words, afterall, what is meaningful to a native English speaker may well be nothing more than @#$% to someone not proficient with the language. Ok. I yield. Smile
Post 04 Mar 2006, 12:53
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page 1, 2  Next

< 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-2019, Tomasz Grysztar.

Powered by rwasa.