What I don't like about assembler...

Thread Starter

takao21203

Joined Apr 28, 2012
3,702
Thank you THE_RB for providing a very good analogy. The discussion shouldn't be about Assembly Language vs. C, but rather having the knowledge and wisdom to know when to use one or the other (or both).
Yes I appreciate his input too.

Maybe the thread subject is misunderstood. Assembler has areas where it is beneficiary to use it.

But I would like to see warning messages/disclaimers, explaining the issues that will arise from using assembler, where how and why NOT to use it, and what NOT to do.

Some years ago I wrote various programs for 80x86, including a GUI, and some small games using graphics.

It was not too bad given the compatiblity between different 80x86 CPUs, but on the PIC micro platform, all are different for banking, and there are at least 5 or 6 different architectures. Using assembler on the PIC32 would be rather ridiculous, especially using it exclusively for all of the program.

I understand that there can be time critical tasks, where assembler well makes sense to use.

That is not the point, that I would hate assembler, and would like to see it disappear into a museum.

I only say, there are numerous things about assembler, and/or using assembler (the issues that arise), which I strongly don't like.

And I also mean I don't like, if people use assembler exclusively for all of the program, then do things like spelling register address numerically, comment every line, or mix up capitalization so there will be 5 or 5 different methods of using capitalization inside such an assembler source.

Most professional programs which use structured approach, somehow will be professional (as in the titulation), and will avoid spaghetti code and mixing it all together in one large main sequence.

When I was younger I did not find it so easy to learn machine-near programming. There was no internet. We had C compiler installed in our school, but it was messed up, so even the examples were not possible to try. Actually among using BASIC, I wrote my first larger programs in 80x86 assembler.

Then I also used it for PIC micro, it is beneficiary for using C, but to some degree I regret the effort that I put into larger programs. They are a bit hard for myself to understand now.

I rewrote some in C already, and typically this took me 1/10 of the time!

If someone would have explained it to me, including the advice to use C, not assembler, that would have been highly useful to me!
 
Last edited:

Thread Starter

takao21203

Joined Apr 28, 2012
3,702
Please tell us why you feel "buggered"? That was not my/our intention. And I apologize because I really am having trouble understanding your use of language.

Regards, Mike
I must apologize too for typing posts without thinking, it is rather some kind of textual processing. Sometimes the grammar would suffer a little, not that I am not able to use it correctly.

Sometimes there is simply just one original idea for a thread, some kind of thing that buggers me. Like here, assembler and the various troubles that will arise from using it.

Then with the help of input from others, the situation can become more clear!

As for me, after reading the various replies + processing them for counter-replies, I can understood the original problem more sharply, as well I am able to pin it down into it's exact sub-issues.

The result is already clear- the descision was already made- not to use assembler if any possible. I am well able to use it! What "buggers" me is mainly the wasted time and efforts.

As for me, I can be far more productive if I use C (as for PIC micro). To some degree also due to new technology...The new XC is more similar to Visual Studio, I find it easier to use than for instance Hitech C.

I used assembler, but then examining the PIC32 documentation, I saw myself forced to change over to C!

Then actually I downloaded one of the USB examples, and modified it for a smaller PIC than originally intended. It did not work at first, tried around hours, then simply changed the 6MHz ceramic osc. to 12 MHz canned oscillator...

After that I mainly did not use assembler anymore. This is only some months ago.

I had to make all the exerience myself, and to encounter all the issues that I have tried to outline. No advice actually on websites/forums, NOT to use assembler, the opposite, many assembler sources can be seen on websites, and are shown on forums.

I don't think all my sentences are grossly grammatically incorrect to a degree that it would not be possible to understand them.

You can of course always write that you don't understand, if there is some minor difference, just for the purpose because you figured out.

If I read it again and really take an hour to write it very carefully, maybe there would be some minor difference.

I could say I see people on television or in a movie, but what they say, well they are idiots, just that. Or they are just highly affectional. If it is a good movie, then the illusion will work, I can feel all the time as if it would happen for real, not just talking from a script, and having people with cameras that you just normally don't see when you watch the movie.

When they are not intelligible enough, well let's have some explosions, some dramatic scene, some sexy clothing, to distract from that :D

No one really will say in a movie script "As if it would happen", but should I talk like in a movie, when I write a forum post?

Or should I become assertative, like many people actually do? Seems to be useless to me. So I would stick to being hypothetical. I never really think as well, I simply write down what appears in my mind. If this will be bad, then it needs to be improved later on. Don't shoot the messenger, so to say.
 
Last edited:

Thread Starter

takao21203

Joined Apr 28, 2012
3,702
Perhaps you're partly responsible for some of the misunderstanding when earlier you have said;
You take it literally like if it would be put into stone forever with no chance to edit and/or revise it, and with tremenduos consequences for forthcoming generations over centuries. Kind of.

Yes it is a waste of time, and people should stop to use it, except...when it is particualary needed for some purpose, and if the MCU in question must be maxed out.

FLASH memory is cheap these days...so why save all these bits and bytes?

You can have 8 Mbit Flash for 80 cents.
 

MMcLaren

Joined Feb 14, 2010
861
So you're saying it's a waste of time and people should stop using it, except when it's beneficial to use it?

You do recognize the fallacy of the statement, don't you?
 

Thread Starter

takao21203

Joined Apr 28, 2012
3,702
So you're saying it's a waste of time and people should stop using it, except when it's beneficial to use it?

You do recognize the fallacy of the statement, don't you?
People maybe don't always have a good judgement if it is beneficial.
Or they are misguided for what would be beneficial.

For me involved in small scale PCB projects with max. 100 pcs.,
what's the matter to use $1 MCU or $2 MCU?

If it will be maybe 10% or less of the total cost.

And I have seen on the internet PCBs with BOM of less than $10, sold for $50 and more.

Trying to save cents for a product with a buyer-price of USD 50, is misguided, in my opinion.

If you have concerned volume 50,000 pcs, it could make sense to try to port it down to a smaller MCU.

Who is really involved with 50k pieces designs? Not so many people after all.

As mentioned digital camera's would largely use C, I can imagine maybe 5% of the code eventually are written in assembler because they are time critical.

For small-scale users, it is misguided to make big efforts by means of using assembler. Fiddling a device to scram as much as possible into it also is not the right thing to do.

Leave 50% of the FLASH unused, don't care, if you are concerned with mass production, maybe try to port down to smaller MCU.
 

MMcLaren

Joined Feb 14, 2010
861
A simple yes or no answer would have been fine (lol)... It's difficult to keep up with your incoherent in-cohesive ramblings as you move from unrelated subject to unrelated subject while avoiding a simple question...

Cheerful regards, Mike
 

Thread Starter

takao21203

Joined Apr 28, 2012
3,702
A simple yes or no answer would have been fine (lol)... It's difficult to keep up with your incoherent in-cohesive ramblings as you move from unrelated subject to unrelated subject while avoiding a simple question...

Cheerful regards, Mike
1. Forum posts have to be perfect in terms of grammar- as if set into stone and to serve as the one and only reference for humanity.

2. Contributions have to be totally coherent, and the elaborations have to be 100% on topic all the time. All illustrations have to be totally related directly

3. This even applies to the thread creator. Once a subject is chosen everything must adhere to the original topic literally.

:D

NO there is no fallacy. I don't like many things about assembler and that's just that. And I believe, not without reason, as well some people seem to be misguided about the topic (usage of assembler).

YES you can find fallacies everywhere. Consider intended purpose of the communication. What insight should become gained, and what is unclear, and needs more detail? To understand it more?

So if there is a fallacy and my replies are more like rambling and not fully coherent, I violate (unwritten) guidelines about forum posts?

Fact is you seem to believe assembler is good to use.

On the other hand, I can tell you it is quite a hassle for larger programs.

I enojoy somehow to see people defending assembler, because I know better from my experience.

Part of the purpose of the thread is to see and to research, how far misguidance about assembler is widespread.

Maybe you are seasoned professional, and will only use assembler in very rare cases?

Can I read the mind of people?

A public forum, using written communication only, is a very poor means of communcation.

Don't urge people to produce Wikipedia-like articles honing themselves to adhere to tons of bureaucratic rules and thus representing the sum of human knowledge, no matter if the topic is accurate, appreciate or useful.
 

ErnieM

Joined Apr 24, 2011
8,377
Don't urge people to produce Wikipedia-like articles honing themselves to adhere to tons of bureaucratic rules and thus representing the sum of human knowledge, no matter if the topic is accurate, appreciate or useful.
Au contraire, that is precisely where we should strive to be in our posts.
 

Thread Starter

takao21203

Joined Apr 28, 2012
3,702
OK the assembler bed:
http://www.flickr.com/photos/x-ray_delta_one/7524974120

Fully efficient, having exquisite pushbutton controls, rollers to clean the sheet, television + telephone and who knows what else.

In the mind of the assembler programmer this represents state of the art while at the same time could yield $20,000.
If it yields 22,000 it would even be more useful.

The C language bed:
http://www.flickr.com/photos/mcmumpitz/5182641176/

Rather pragmatic. If it ain't broken, don't fix it.

The C programmer knows that some day the whole thing will break.

I know this is quite a rant. I have not uploaded the pictures here.

But somehow this is how I see assembler now.

Take this Atari 2600- it had kind of metal decals with colors but rather useless serving no purpose. So it it was looking quite futuristic.
Programmed in assembler all the way through!

That did not save it from having controls that actually required a hard push.

I saw it's schematics some time. And when people talk about the programming, it goes down to the metal, so to say.

As for the PIC, at first I bought a RS232 programmer kit because one day I saw it in a shop. It was supplied with some assembler sources + datasheets.

It would have been better to have an 18F + a C compiler, and some well meaning message "Don't use assembler for the time being".

I saw this later on in printed form in a small C programming booklet.
Assembler programs would take 10x to 15x the time to write and to maintain them. And virtually no professional program is based on assembler.

With a few exceptions, I have learned...

I bought this kit in the year 2004 but nevermind...It is still being sold as far as I know.

What also yields the question how and why some once great electronics components sellers have diminished to rubbish vendors (in terms of electronic components).

All made in China these days...And components are mainly sold by a few well known professional large vendors.

Thing is in 2004 I did not have professional advice, and what I believe now dealing with any kind of assembler was misguided and unneccessary, even if it is maybe beneficiary for writing C programs.

I am just lucky we have one professional vendor here locally.
And in recent years, internet has become available easily, as well vendors are doing business now on the internet.
 

Thread Starter

takao21203

Joined Apr 28, 2012
3,702
and? Do I plague the forum with dozens of threads like this one?

At some point of time I even wanted to write my own 68000 assembler.
For this purpose I used Visual Basic.

All the opcodes were taken apart, put into tables, then I wrote a parser.
Possible variations for operands were put into a binary tree.

By the time I started with the part that would compute the offsets for address labels, I realized what a big effort it would be to do it properly.

Including hardware, documentation, an operating system...

I would have to dedicate years of work to it to do it properly.

For the purpose to be able to write a good assembler, I have read the 68K user manual many times, including to transform all the opcodes into tables, more than one time...

I was actually searching for some kind of algorithm that could work as assembler with the least possible effort. The 68000 is pretty good for this, since somehow it's a 4-bit state machine.

The original opcodes are 4-bit only. Let say there are 16 main categories of opcodes...But, there are some few exceptions how to "mount" the operands in a proper way, which does not make it easier.

Then something magic happened. The 68K directed me to something else. I built a small serial computer, using some kind of 4-bit opcodes, and transfering them between multiple PICs serially.

Later, I did indeed develope a somehow compact serial LED display.

But no longer interested to put additional efforts into this project. Except I want to get a single board computer working.

As I say, it would take years of efforts to do it properly.

And for what? To become able to program in assembler???

A shoddy dirty assembler that somehow cobbles together stuff, would be possible to put to working condition within a few weeks...if I wanted to.

But I was looking to do it as compact as possible, as clean as possible, using Visual Basic.

So I think...after all...I ended up with somehow creating a piece of software, that would internally work on Microcode. Like the 68000 actually does.

Microcode is about 6 times worse in terms of times it takes to maintain it...I have read this somewhere.
 

MMcLaren

Joined Feb 14, 2010
861
takao21203,

Are the person who went by the names nike6, nikemoto, and hybridpic on the Microchip Forum, with a brief appearance between May and June 2009 on the Electro-Tech Forum?
 
Last edited:

Mickster

Joined Jan 10, 2010
32
I claim responsibility for the above post, #74, by MMcLaren, by reporting my suspicions regarding the person in question.

Alex,

a tidbit of advice if I may intrude...

You appear to have a long-standing interest in electronics and programming, spanning many years, but your continuously-tangential approach toward recognised industry practice and design methods does not help you.

In fact, it generally grates against the sound advice freely offered by certified engineers who have had success in their field and wish to impart their knowlege, in order for others to grow and benefit.

They are the ones making the money and trying to encourage others to do so, by pointing out poor practice and providing remedies & solutions.

Please take into account the advice you have previously been offered on many occasions, from many different forums, and also stop consuming that stuff you are growing in your home. It's not doing you any good and only proves to be detrimental to your posts.

FWIW, I think you have some potential, but need to get some things in order first.

Regards.
 

Thread Starter

takao21203

Joined Apr 28, 2012
3,702
I claim responsibility for the above post, #74, by MMcLaren, by reporting my suspicions regarding the person in question.

Alex,

a tidbit of advice if I may intrude...

You appear to have a long-standing interest in electronics and programming, spanning many years, but your continuously-tangential approach toward recognised industry practice and design methods does not help you.

In fact, it generally grates against the sound advice freely offered by certified engineers who have had success in their field and wish to impart their knowlege, in order for others to grow and benefit.

They are the ones making the money and trying to encourage others to do so, by pointing out poor practice and providing remedies & solutions.

Please take into account the advice you have previously been offered on many occasions, from many different forums, and also stop consuming that stuff you are growing in your home. It's not doing you any good and only proves to be detrimental to your posts.

FWIW, I think you have some potential, but need to get some things in order first.

Regards.
The fact that many of these forums seem to be run by Annonymus, makes such advice semi-professional in the best case.

User handles I have maybe 30 or 40, including I think tetsu-jp on MSDN forums. I have not experienced any problems there.

Some user handles are no longer active for new content.

And why you call me Alex is a riddle to me. I don't grow stuff at home currently, it's not that interesting.
 

Thread Starter

takao21203

Joined Apr 28, 2012
3,702
takao21203,

Are the person who went by the names nike6, nikemoto, and hybridpic on the Microchip Forum, with a brief appearance between May and June 2009 on the Electro-Tech Forum?
Are there any legal regulation if I have to answer this question to you via the means of a public forum?

Are there any regulations if you are entitled for such a question?

Free speech seems to be a crime on some public forums, even if they are rather lawless places.

If there is the option to list 30 to 40 links for websites/profiles/user handles in the profile, maybe I will do so if I think it's appreciate.

I don't think electro-tech online is a legally recognized entity like for instance a company or political party.

While Microchip is a company from Thailand. Or was it America?

I have heard of instances where they banned forum posters because of problems with the law. I don't think I can give details here in a forum post.

But I can think of this Clinton/Lewinsky affair.

This is my website for topics relating to this forum: http://pic.hitechworld.org

Do you see nike6, hybridpic, nikemoto on this website?
So, actually I don't follow the purpose of your question.

And I would like to ask you to keep it outside the thread.

One time I was talking to a guy on MSDN forums, and I outlined my problems that I had when using public forums. When for instance people started to mention language, to attack my posts and all this.

He simply explained it with one line. He said "That is when they are getting anally".

That was some years ago.
 

Thread Starter

takao21203

Joined Apr 28, 2012
3,702
In fact, it generally grates against the sound advice freely offered by certified engineers who have had success in their field and wish to impart their knowlege, in order for others to grow and benefit.
Was that this Hitachi/NEC merger?

I don't treat people as certified engineers, unless they say so, and give information about their name + preferably a real-world profile photo.
 

Mickster

Joined Jan 10, 2010
32
In order for a person to have 30 or 40 different internet personas, there has to be an underlying reason..... perhaps one of continually seeking acceptance and/or recognition.... or simply hiding from something.... somewhere. I only pinged you for about 12 different accounts, so you have the high ground. ;-)

People sometimes leave trails all over the web. Multiple accounts and personas simply make it easier to link them together.

How's the pineapple growing and the spider on the window-sill, Alex?

Cut with the crap and take on the advice of others. You may just benefit from it.

Regards.
 

Thread Starter

takao21203

Joined Apr 28, 2012
3,702
In order for a person to have 30 or 40 different internet personas, there has to be an underlying reason..... perhaps one of continually seeking acceptance and/or recognition.... or simply hiding from something.... somewhere. I only pinged you for about 12 different accounts, so you have the high ground. ;-)

People sometimes leave trails all over the web. Multiple accounts and personas simply make it easier to link them together.

How's the pineapple growing and the spider on the window-sill, Alex?

Cut with the crap and take on the advice of others. You may just benefit from it.

Regards.
Thank you. I don't maintain 30 accounts at once.

They are also covering different regions of the world. Lately I only use takao21203 for new accounts!

I am on cytron.com.my for instance, here, and on flickr, all using takao21203.

Yes pineapple grows well, and spider also maintains her web.

When I take a cheap mass market remote control, and somehow try to use it for PIC 18F circuits, is this useless, or hopeless hobby stuff? Or a tangential approach as outlined above?

I have not received any help or assistance for this project on this forum, even if I asked for it. There are numerous situations to be solved in the software.

And yes I have searched for my user handles myself sometimes.

If I consider photos that I have taken for instance, most of them don't even exist anymore on my computer. Emails are deleted regularily as well. I don't make myself a slave to my computer or the internet. There is no illegal software on my computer as well, for instance warez, ROMS, cracked licences.

I would like to ask you to judge me by what I am currently doing in terms of projects, and the advice I give right now on forums.

I wonder if I am allowed to maintain exactly one thread like this one? Which now has turned into some kind of self-promotion, and defense as well.

I am not aware of any bad advice I have given here on the forum, which for instance was useless, wrong or unwanted.
 

Attachments

Last edited:
Top