EmbeddedRelated.com
Forums

Atmel AVR assembler

Started by Herbert Kleebauer July 21, 2005
Herbert Kleebauer wrote:
> Have to write some AVR code and therefore have read the > AVR Instruction Set manual and tried the assembler included > in AVR studio. I think the used syntax is completely > unusable, so I decided to write my own assembler.
I've written ten of thousands of lines of 68K assembler in my time. I think it's a very easy to use instruction set format. I've also written Z80, 6509, 6809, ARM, PIC, 8501, 80x86 and PowerPC. They all have unique qualities and assembly format. I can see the appeal of wanting a prettier assembly language for AVR than the standard one. I think it's great that you've taken it on, and if you enjoy working with it then that's marvellous. But if this is for a work project, don't use it. Use the standard syntax. Regardless of your sense of aesthetics, you would be a POOR ENGINEER if you impose a non-standard language on your company. Sooner or later someone may have to support your work and you would be creating a barrier for them. It's simply not your place to declare, in a professional environment, that the standard used by all AVR programmers is "unclean" and unilaterally implement something else. For your own personal hobby, it's great - do whatever is easier for you. Be happy. Share you work, as you're doing. For work, you're being paid as a professional engineer. Behave like one. Regards, Paul.
randyhyde@earthlink.net �crivait news:1122321505.586953.82790
@g49g2000cwa.googlegroups.com:

> Now it's *your* life so you're welcome to spend the time creating any > syntax you want for an AVR assembler, and I encourage you to do what > *you* want to do; but by virtue of your post you're asking if people > around here think it's a good idea and overwhelmingly, the vote is > "no"! Ever noticed that when you post your x86/faux-68K code that > people get confused reading it? (Indeed, I remember the first time *I* > saw it, I thought it was 68K code.) You make a big point about claiming > that the syntax is just for you, but then you post your code to a > public newsgroup and people just don't follow what you're doing. As > someone else in this thread has pointed out, seeing this type of > "personal syntax" is dreadful when they're asked to support the code > later in life (or simply comment on it when posted to a newsgroup).
Very funny paragraph, once we know that the individual who wrote the above, is also the one who developed the most absurd and awfull Syntax every seen, for x86. Of course, "it's Master Pdf life", even though nobody ever "encouraged him to do that", and if he succuded to make an impressive complete unanimity of all the Assembly Programmers whose "vote was 100% "no"!". :))))) Betov. < http://rosasm.org >
If I recall correctly, many many years ago, there was an effort by the
IEEE towards a &#4294967295;standard&#4294967295; framework for assembly languages.  What 
happened to this effort?

Despite the particular instruction sets of various processors, there 
is a lot of similar things that assemblers have to express: comments, 
constants, data declaration and definitions, macros, types of memory, 
etc.

Whatever the processors, there are similarities between instructions: 
all processors copy data from one place to another, they execute 
arithmetic instructions; so why not have the same mnemonic for the 
same instruction.

One of the first assembly languages that I learned was that of the 
IBM's System/360. It is not perfect but it has interesting features 
like LD (load) to denote a copy from a memory location to a register, 
and ST (store)to denote the reverse operation. A suffix to the 
instruction denotes not only the length of the operand but also its 
nature: STE means copy from a memory location to a floating-point 
register.

It is much easier to learn than the Intel x86 family assembler where 
the mnemonic MOV is used and where one has to look at the declaration 
of an operand to assess its size.
-- 
Jean Castonguay
&#4294967295;lectrocommande Pascal


Betov wrote:
> > Very funny paragraph, once we know that the individual > who wrote the above, is also the one who developed the > most absurd and awfull Syntax every seen, for x86.
See point (2) below.
> > Of course, "it's Master Pdf life",
Yep, as per my comments, *I* provided documentation, tutorials, and support tools.
> even though nobody > ever "encouraged him to do that", and if he succuded > to make an impressive complete unanimity of all the > Assembly Programmers whose "vote was 100% "no"!". >
See point (4) below. Cheers, Randy Hyde There's no need to respond point-by-point to any Rene ("Betov") Tournois post. His posts are all repetitive, saying the same nonsense over and over again. Therefore, we'll just use "canned" responses to answer his nonsense. Here's the key to use: (1) Rene's continued personal attacks on people and name-calling, (2) Rene's continued attacks on products, (3) Rene making unsubstantiated (and ridiculous) claims about RosAsm. (4) Rene making ridiculous statements about other products or situations, of which he has no knowledge.

Betov wrote:
> Ben Bradley <ben_nospam_bradley@frontiernet.net> =E9crivait > news:va58e1l9h89a21plnjbqkb606v184c3ni5@4ax.com: > > > It's my > > decades of having written a significant amount of assembly myself that > > makes me do it... > > > > ----- > > http://www.mindspring.com/~benbradley > > :) > > A man who builds guitars cannot be completely bad, but > i see no Asm thingie, there. Are you one more of these > guy with a big mouth, about Assembly, without anything > to show?
See point (4) below.
> > Not even a small real life Application, with Sources, > to show, after _decades_ of activities?
See point (4) below. Cheers, Randy Hyde There's no need to respond point-by-point to any Rene ("Betov") Tournois post. His posts are all repetitive, saying the same nonsense over and over again. Therefore, we'll just use "canned" responses to answer his nonsense. Here's the key to use: (1) Rene's continued personal attacks on people and name-calling, (2) Rene's continued attacks on products, (3) Rene making unsubstantiated (and ridiculous) claims about RosAsm. (4) Rene making ridiculous statements about other products, of which he has no knowledge.

Jean Castonguay wrote:
> > It is much easier to learn than the Intel x86 family assembler where > the mnemonic MOV is used and where one has to look at the declaration > of an operand to assess its size.
The Intel x86 assembly language syntax was designed to provide additional semantic information to the assembler in order to help it catch programming errors that would otherwise slip past. I think I could agree with your assessment that the Intel syntax is more difficult to learn, but that expense has a benefit -- it helps catch errors that would otherwise slip past the assembler. I've used lots of assemblers (i.e., most non-Intel assemblers) where the assembler doesn't bother checking things like operand sizes (indeed, the assembler has no concept of "variable size" in memory). Once I got used to the "overhead" of the Intel syntax, I came to appreciate the fact that it does catch a lot of stupid mistakes that would otherwise slip through the cracks. Given how rarely one should be coercing a memory object to some other size (other than its declared size), I can live with "<type> PTR" in those rare instances when you really do need to coerce a memory object to some other size. And given the presence of TEXT equates and functional macros in assemblers like MASM, TASM, and HLA, it's easy to create a shorthand symbol when you wind up doing an excessive amount of coercion. Of course, for those who just *have* to use mnemonics like MOVB, MOVW, and MOVD, you *can* create your own instructions using an assembler that has decent macro facilities. Much easier than writing your own assembler, though the problems of having other people read your code still exist (though, arguably, because the macros are present in the source code they *are* documented). Cheers, Randy Hyde
On Mon, 25 Jul 2005 22:35:42 -0000, "Jean Castonguay"
<jcastong@riq.qc.ca> wrote:

<snip>
>One of the first assembly languages that I learned was that of the >IBM's System/360. It is not perfect but it has interesting features >like LD (load) to denote a copy from a memory location to a register, >and ST (store)to denote the reverse operation. A suffix to the >instruction denotes not only the length of the operand but also its >nature: STE means copy from a memory location to a floating-point >register.
I think you mean L to match ST, or STD to match LD. LH is 16bit integer load. STH is 16bit integer store. L is 32bit integer load. ST is 32bit integer store. LE is a floating point load, short. STE is floating point store, short. LD is a floating point load, long. STD is floating point store, long. It's mostly the floating point instruction that have the size suffix, and then it's not always the last character. Had to consult the green card for the floating point info. :-) -- ArarghMail507 at [drop the 'http://www.' from ->] http://www.arargh.com BCET Basic Compiler Page: http://www.arargh.com/basic/index.html To reply by email, remove the garbage from the reply address.
Betov wrote:
> "Randall Hyde" <randyhyde@earthlink.net> &#4294967295;crivait > news:QgOEe.3092$0C.1369@newsread3.news.pas.earthlink.net: > > >>assemblers like >>NASM, FASM, GoAsm, TASM, MASM, Gas/ATT, Gas/Intel, and HLA all have >>fairly decent followings (numbering in the thousands of users, each) > > > * HLA is not an Assembler...
Your posts are generally offensive, and are certainly of no consequence in this particular discussion. I'm not (before you decide to flame me) a user of HLA, nor will I *ever* be a user of RosASM (whether it works or not), as I have seen all I wish to of your flaming, and will not subsidize it. If you've nothing of substance to contribute to the ongoing debate on what constitutes a "real" implementation of an X86 assembly language tool, I'm sure I am not alone in hoping you will merely observe. Bill
CBFalconer wrote:
> > What he could do, without raising hackles everywhere, is write a > set of macros for m4 to process his version of assembly language > into the generally accepted source. m4 is generally known, and > available.
And it would be a much more responsible approach to the issue than running off into left field and inventing an "improved" syntax. Bill
Paul Marciano wrote:
> > I've also written Z80, 6509, 6809, ARM, PIC, 8501, 80x86 and PowerPC. > They all have unique qualities and assembly format.
And none of them particularly difficult to learn.
> I can see the appeal of wanting a prettier assembly language for AVR > than the standard one. I think it's great that you've taken it on, and > if you enjoy working with it then that's marvellous. > > > But if this is for a work project, don't use it. Use the standard > syntax. Regardless of your sense of aesthetics, you would be a POOR > ENGINEER if you impose a non-standard language on your company. Sooner > or later someone may have to support your work and you would be > creating a barrier for them.
Very well said.
> It's simply not your place to declare, in a professional environment, > that the standard used by all AVR programmers is "unclean" and > unilaterally implement something else.
And again. For any commercial work, it's unprofessional to overlook the likelihood that someone other than yourself may have to perform maintenance.
> For your own personal hobby, it's great - do whatever is easier for > you. Be happy. Share you work, as you're doing. > > For work, you're being paid as a professional engineer. Behave like > one.
Perfect summation! Bill