The Assembly Language Debate

boriz

Senior Member
[ This thread was originally part of the Programming Editor Wishlist thread, so the opening post, now out of context, appears more strongly put and more provocative than it would in context ]

Learning Machine Code / Assembly language (of any flavor) is fundamental to any serious computer programming education. If the Picaxe system is ever to be more than a toy, it really needs to deal with this somehow.
 
Last edited by a moderator:

Aresby

New Member
Learning Machine Code / Assembly language (of any flavor) is fundamental to any serious computer programming education. If the Picaxe system is ever to be more than a toy, it really needs to deal with this somehow.
Harsh! I don't think PICAXE is a toy. I've used it to create a small number of real world projects. It introduced me nicely into the world of PIC programming.

Neither do I consider assembler essential to programming the PIC. I'll concede that a basic understanding of simple assembler code might make you understand better what is going on inside the chip, it won't make you a better programmer, IMHO.

Surely the whole point about high level languages is that they are, well, high level and thus protect you from vagaries of registers, bit settings and exactly how the language gets turned into assembler code. When you can write one line of Basic or C to do what would take 20 lines of assembler then it must be more productive?

Just before you (or anyone else) shoots me down in flames for defending the PICAXE system, I actually went down the assembler route first just to get to understand what it was all about. I found it interesting but ultimately exhausting to write reams of code to do the most basic things - like making a series of 4 LEDS flash in a "Knight Rider" way. So having acquired my "appreciation" of what assembler was all about for PICs, I gratefully used the PICAXE Basic development environment to actually get something done!

As it happens I use another compiler for bigger projects (Swordfish) but this is a whole world away from what PICAXE is trying to present to schools and beginners.

I do think that PICAXE should allow string variables and negative numbers as this can be a bit of a show-stopper sometimes. It's OK having workarounds but it just complicates the coding.
 

hippy

Technical Support
Staff member
If the Picaxe system is ever to be more than a toy, it really needs to deal with this somehow.
To characterise the PICAXE as a mere toy for lack of an ability to cater for assembly language is to seriously undervalue and misrepresent what it is.

Even if knowledge and understanding of assembler language is to be considered fundamental or essential for serious programming education it does not follow that the PICAXE ( nor any system or specific programming language ) has to provide for that.
 

boriz

Senior Member
Agreed. And perhaps the word toy was indeed too harsh. Apologies.

I have nothing against Picaxe BASIC. The Picaxe system does indeed allow for rapid prototyping. And it's fun to play with. All I'm saying is a programming education is far from complete without at least a basic understanding of assembly language and how software interacts with hardware on a logic-gate level. In this respect, Picaxe the educational tool, is fundamentally lacking. Anyone trying to fill out there education by dabbling in assembly language has no choice but to move on to a rival/competing microcontroller system.
 

BillyGreen1973

Senior Member
..Picaxe the educational tool, is fundamentally lacking. Anyone trying to fill out there education by dabbling in assembly language has no choice but to move on to a rival/competing microcontroller system.
Not so i'm afaraid. Use of the BAS800 programmer will allow users to convert their Picaxe Basic program into assembler and compile into a .hex file if needed.
I do like this feature because it allow you to directly compare asm with bas files to see 'how asm works'
I understand the required programmer (BAS8000) can be a little had to find sometimes, so I would like to see the 'convert' function enabled in the PE without the need for extra hardware. THis could be a 'paid for' option within the program.
I know the bas/asm convert function is fairly basic and doesn't produce over optimised code, but it is still invaluable for someone making the leap in Pic asm.
 

srnet

Senior Member
Anyone trying to fill out there education by dabbling in assembly language has no choice but to move on to a rival/competing microcontroller system.
I education terms I would suggest that getting experiece of 'another' system is a very good thing, and to be encouraged.

The tools for this, MPLAB, PIC programmers and the like are all cheap enough .........
 

hippy

Technical Support
Staff member
The PICAXE does support Assembler as used in teaching OCR and AQA A-Level Electronics. We perhaps don't highlight that widely because it's primarily of interest to those on such courses and it has limited use beyond the syllabus requirements.

http://www.picaxe.com/docs/picaxe_ocr.pdf
 

SD70M

Senior Member
I understand the required programmer (BAS8000) can be a little had to find sometimes, so I would like to see the 'convert' function enabled in the PE without the need for extra hardware. THis could be a 'paid for' option within the program.
I know the bas/asm convert function is fairly basic and doesn't produce over optimised code, but it is still invaluable for someone making the leap in Pic asm.
I agree. I have seen asm files but I have no idea how the commands relate to pic basic. Given the option of converting to asm and then being able to compare the two to see the relationships would speed any learning of asm. It would, in my opinion, enhance the learning opportunities of many picaxe users.

Before taking the leap into the dark I'd like to see how easy it would be to self-teach myself asm.

Angie
 

srnet

Senior Member
I have seen asm files but I have no idea how the commands relate to pic basic.
They dont directly, PICAXE Basic is a series of commands that only the built in firmware understands.

So for PICAXE Basic to make sense, in relation to assembly language, REV Ed would need to reveal the contents of the PICAXE firmware, and that is not going to happen.
 

Aresby

New Member
We're getting off topic

Unless we (as a user group) are proposing that Assembler is somehow incorporated into the PICAXE editor we're starting a religious war on whether knowing assembler makes for a better coder.

As the PICAXE basic is not even compiled into hex in the conventional sense it seems at odds to expect RevEd to introduce support for it now; if the project I'm working on demands embedded assembler then I move to a different non-PICAXE versioned chip (e.g. the 18F25K22) and a different compiler that supports such things (Swordfish). And that happens only occasionally.

Anyway, I can't believe it's going to make for better programmers.

I know many people who can drive a car and yet have absolutely no idea of what / how a piston is /works never mind valves, camshafts and the rest. But they drive the car just fine. Knowing how something works doesn't necessarily affect how well you operate the product.

I've used this real-world analogy because I used to take car engines apart (and, much to my surprise, successfully put them back together) as well as gearboxes, clutch plates, thrust bearings and the like - but it doesn't make me one jot a better driver! Interesting yes, agreed, but of limited interested to "average car users".

Risking divorce, I can say that my wife can barely find the fuel filler cap but still manages to drive the car well. Would she drive better if she knew how to change the oil? Or what 5 degrees BTDC means for the valve timing? (This is rhetorical, don't answer!).

I think there are better things that RevEd could introduce into the PICAXE system: string handling, named variables rather than symbols, negative numbers, following the PEMDAS order of execution on maths, automatic collision of word/byte variable detection [mentioned earlier in this thread - caught me out this week!] and several more.

All these (and several more already raised by others) would appeal to a much wider (including the beginners' or school) audience than understanding what MOVLW means in assembler and why you might want to use it. IMHO, obviously.
 

boriz

Senior Member
Unless we (as a user group) are proposing that Assembler is somehow incorporated into the PICAXE editor we're starting a religious war on whether knowing assembler makes for a better coder.

As the PICAXE basic is not even compiled into hex in the conventional sense it seems at odds to expect RevEd to introduce support for it now; if the project I'm working on demands embedded assembler then I move to a different non-PICAXE versioned chip (e.g. the 18F25K22) and a different compiler that supports such things (Swordfish). And that happens only occasionally.

Anyway, I can't believe it's going to make for better programmers.

I know many people who can drive a car and yet have absolutely no idea of what / how a piston is /works never mind valves, camshafts and the rest. But they drive the car just fine. Knowing how something works doesn't necessarily affect how well you operate the product.

I've used this real-world analogy because I used to take car engines apart (and, much to my surprise, successfully put them back together) as well as gearboxes, clutch plates, thrust bearings and the like - but it doesn't make me one jot a better driver! Interesting yes, agreed, but of limited interested to "average car users".

Risking divorce, I can say that my wife can barely find the fuel filler cap but still manages to drive the car well. Would she drive better if she knew how to change the oil? Or what 5 degrees BTDC means for the valve timing? (This is rhetorical, don't answer!).

I think there are better things that RevEd could introduce into the PICAXE system: string handling, named variables rather than symbols, negative numbers, following the PEMDAS order of execution on maths, automatic collision of word/byte variable detection [mentioned earlier in this thread - caught me out this week!] and several more.

All these (and several more already raised by others) would appeal to a much wider (including the beginners' or school) audience than understanding what MOVLW means in assembler and why you might want to use it. IMHO, obviously.
Be fair. Compare like with like. A 'car driver' is equivalent to a 'computer user'. I don't expect an office worker, perhaps very competent at using apps in windows, to know the first thing about programming. But when I get my car serviced, I certainly do expect the mechanic to have a full understanding of the vehicles mechanisms and construction. Right down to the nuts, bolts and gaskets. And employers who interview young programmers will usually expect the equivalent in programming expertise.

I'm happy to concede most of the other points. And where did that little OCR gem come from? I've never heard of that before. I take it that it's interpreted in chip, like BASIC, and that's why it's not fast like true assembler?
 

Paix

Senior Member
Where I programmed a few years ago now using DEC Basic and later in Ingres ABF 4GL I found very few of my application programming colleagues that could or had any interest in writing CLI scripts in RSX or shell scripts of any sort under Unix, although it was an improvement over the RSX situation.

So whilst writing shell script might come up at interview, it would likely be volunteered information rather than being asked. Assembler, some might realise that the early compilers might use it (hardly recogniseable as the hand written stuff on DEC PDP-11) as an interim step, but no one ever asked me if I had any assembly programming skills. It might be a bit different in a specialised technical role, but not generally. Roles tend to be a bit specific in their requirements.
 

boriz

Senior Member
It's been a long time since I interviewed for a programming position, and yes, there was little mention of assembly language. But then again, I was primarily writing bespoke business software, in BASIC on desktop machines. My reference above was of course to microcontroller / embedded systems programming. Sorry. I mustn't have made myself clear.
 

Aresby

New Member
So there's no pause command in assembly language? or for...next etc?Angie
Correct!

If you want a "pause" in assembler you just execute round a loop doing "nothing" a few (hundred) thousand times, which in turn is usually in an outer loop, also doing "nothing". Some very precise timing loops can be constructed this way, as each assembler command's execution time is well known (depending on clock speed). But there is no "pause" command in assembler (please don't mention "sleep" or idle-mode chaps, that's not what is being asked here).

The same goes for For/Next loops and all other logical constructs in high level languages. That's why assembler is such a pain in the proverbial to get anything done. It neither supports those high-level language concepts and you need to write a lot of code to do anything meaningful.

So now you know this, that is why high level languages were invented. Initially they were all a bit basic (with a small 'b') but have evolved to some superb brain-challenging products that allow us, as humans, to "do stuff" with computers without worrying too much how it's being done at the machine level.

Modern day compilers (probably not PICAXE Basic) optimise the assembler generated from your program. They sort out inefficiencies and utilise memory more efficiently than you probably set out in your program. So the resultant code you actually download to the chip is as compact and efficient as can be reasonably expected without actually hand-coding it yourself in assembler!

As a real world example away from the PIC world, Microsoft have stated that their C++ compiler actually generates assembler at least as good as, or better than, a human being could. That's why their developers all use C++ (for the most part, let's not start another religious war!).
 
Last edited:

Aresby

New Member
... But when I get my car serviced, I certainly do expect the mechanic to have a full understanding of the vehicles mechanisms and construction. Right down to the nuts, bolts and gaskets....
Please let me know the name of your mechanic. I bet he doesn't work for Kw---fit! Such a mechanic is, disappointingly, a rare breed. As are many plumbers, electricians and decorators who all purport to have a level of competence but all too often it is absent.

Seriously, though, I accept that a car driver is more akin to a computer user.

If I were recruiting for a PIC programmer, however, and the question was asked "Do you know PIC assembler?" I'd probably expect some sort of fundamental knowledge that would be essential to programming the chip anyway, such as memory map layout, special function registers, compiler directives and the like. The level of knowledge would depend on the what the coding was for.

But then again, they wouldn't be using PICAXE Basic either, which is what we're discussing here.

I wonder if RevEd are actually reading this forum and shaking their heads in disbelief at what we're discussing?
 

Dippy

Moderator
Post #204 and #205 (Arseby): exactly.

Most industry requires a good knowledge of C. Love it or hate it , C is a standard.
Learn C and the Micro World is there waiting for you.
And all the compilers (C and BASIC) I've seen allow routines in ASM for those 'special' occasions.
In most non-specialist commercial Apps there simply isn't the time to write completely in ASM.

I only know of one PIC ASM-only programmer. He is very clever, good at tennis and completely insane.
Everyone else is C (all learnt with BASIC, though many have turned into C Snobs).

But programming is very much about planning and structure to obtain function and efficiency.
So 'cutting your teeth' in PICAXE BASIC is a very economical and educational way of doing it.

Learning ASM is an excellent idea, but learn the fundamental coding skills in BASIC.
I'm as rusty as the Titanic (topical name drop).
Then on to compiled BASIC and C and do ASM in your lunch-breaks.
I'm certainly not de-valuing ASM as it does open the eyes as to the internal workings and this can improve your coding efficieny in the higher-level language.
Many modern compilers/optimisers are simply excellent. The only time I've had to touch ASM in years is a quick nop and clear the watchdog, but being able to understand the 'previous bloke' is handy.

As to whether you'll be asked about ASM in an interview: I suspect it's down to the nature of product and the age of the interviewers.

Looking at Manufacturer's snippets should give a clue.



I would imagine if Rev-Ed are reading this they will be thinking "Here we go again!" , but saying "We very much value your interesting input. Your feedback will help us take the product forward." - a very diplomatic bunch you know! ;)

Sorry, what was the title of this thread again....?
 

Aresby

New Member
Sorry, what was the title of this thread again....?
Well, we got our own thread now, that's what happens when you hijack another!

Agree with all your points.

Apart from one.

Post #204 and #205 (Arseby): exactly.
It's Ar-es-by, as in R-S-B. Geddit? :) Nothing to do with one's posterior! So much for my username...

This morning I implemented a tiny PICAXE project into my house burglar alarm. Without a single line of assembler. Woo Hoo!

(That wasn't intended to inflame others, just a tongue-firmly-in-cheek comment).

I've done with discussing Assembler (typical, now that we have our own thread). It's all been said!
 

Dippy

Moderator
Sorry, fniger silp.

I think the ASM debate is on Lap 4 by now. Like Arnie ... it'll be back. :)
If people want to learn ASM then tools are already out there for zero quid.

Like most things in life: Horse For Courses.
And to all you Car Mechanics out there: I don't expect you to know the function of all the nuts in my car - just the one behind the wheel.
 

SD70M

Senior Member
Correct!
If you want a "pause" in assembler you just execute round a loop doing "nothing" a few (hundred) thousand times, which in turn is usually in an outer loop, also doing "nothing".
Ok, think of me as a little thick here then, assembler is therefore not the same as C++, or a variant thereof?

In C++ there are for..next loops etc.

If that's the case, then C++ is more powerful in what it can produce. So why would anybody bother with assemly language? It doesn't seem to do a lot but does cause a headache. I thought assemly was the next step in moving to C++.

As said, think of me as thick here ;)
Angie
 

hippy

Technical Support
Staff member
If that's the case, then C++ is more powerful in what it can produce. So why would anybody bother with assemly language? It doesn't seem to do a lot but does cause a headache.
One analogy is that a high level language is like going to a shop and buying cakes for a tea party, while assembler is more akin to buying the ingredients and making your own cakes for the party. With shop bought cakes you have to take what they have but in making your own you have full control over what you get.

The downside is that you have to know what the ingredients needed are, need to know how to put them together and how to make a cake, need to get skilled in doing that, and it all takes effort. The plus side is you have far greater control over everything.

To fit with the earlier debate on necessity of knowledge, the two questions are; is delivering a successful tea party dependant on having an ability to make your own cakes, and does being able to make your own assist in that ? There's no definitive answer.
 

Aresby

New Member
...assembler is therefore not the same as C++, or a variant thereof?
<snip>
... then C++ is more powerful in what it can produce. So why would anybody bother with assembly ...Angie
No you're not thick, just not in possession of the facts (yet).

Assembler is definitely not a variant of Basic, C, C++ or any other high level language.

Assembler is the human readable (and [slightly more] meaningful) format of machine code, also referred to as HEX code, that the PIC chip understands. We would never work directly in HEX but we do work sometimes in Assembler. Assembler is a low level language.

When you write a Basic (or C, or C++ or any other program) for the PIC the English-like commands get translated first into Assembler. Then the compiler converts the assembler into HEX which is downloaded into the chip as a series of 1s and 0s. (The PICAXE system is a bit different but let's not confuse the issue.)

So in PIC Basic, to configure PortA 0, 1 and 3 as outputs and Port A.2 as input you might write:

Code:
TRISA = %00000100     ;Set PORTA.2 as INPUT
To do the same job in assembler you would have to write:

Code:
[FONT=courier new]BSF STATUS, 5        ;point to TRIS register
MOVLW 00000100b      ;Set PORTA,2 as INPUT
MOVWF PORTA          ;Configure the port
BCF STATUS,5         ;Back to Page 0[/FONT]
Which would you rather write?

It is unlikely that you would want to "progress" to Assembler. It's not something to aspire to know if you can program the chip by a high level language. As discussed at length here, a working knowledge may assist you but unless you're doing something pretty low level it's unlikely.

When you say "C++ is a more powerful language" then you are correct inasmuch that it allows us humans to write code that is conceptually complex but which doesn't worry about what the PIC really needs to execute those complex thoughts.

C++ is no walk in the park though. Even experienced C programmers have a job moving to C++. That's a reason why the Basic language was invented. To allow us to create programs that do things without hitting brick walls just trying to get past the language barrier.

Have I thoroughly confused you now?
 

SAborn

Senior Member
Is not the answer rather simple.......... if you want to work with ASM.......then bugger off and go join a Pic Forum, and not bother us here on the "Picaxe forum".
 

Aresby

New Member
Is not the answer rather simple.......... if you want to work with ASM.......then bugger off and go join a Pic Forum, and not bother us here on the "Picaxe forum".
Well, that might be the sentiment of TechEd too, although your rather (Antipodean) directness may come across as a bit dismissive by some! It's always useful to air these things; some people may even get to learn a thing or two.

It's highly unlikely that TechEd would support any form of Assembler within the PICAXE system, IMHO. It's just not what PICAXE is all about. I know how difficult it is to get people engaged in programming of any kind so throwing in anything about assembler would get an immediate switch off by most.

PICAXE is all about getting people involved in controlling their environment by using these wonderful devices called microcontrollers; the fact that you control the devices with PICAXE Basic is almost incidental. It's getting people to realise that PIC chips (or iPhones for that matter) will sit there mute and unresponsive until someone takes it upon themselves to program the chip.

Perhaps that's why robots (on wheels) are so popular amongst school kids: it becomes a real driving force to be able to detect obstacles (or move about a maze) better than the other kids. And all the while they are learning something about programming.

Anyway, I'm with you on this one. There's no room in the PICAXE world for assembler!
 

SD70M

Senior Member
@Aresby
No you're not thick, just not in possession of the facts (yet).
Thanks, I feel better now :D

Have I thoroughly confused you now?
Nope, I learnt ASP, javaScript and html and had an online fully interactive website built in two weeks so the language isn't the problem, it's understanding where everything 'sits' so to speak. For example if I wanted to move forward I wouldn't use assembler, I'd go to C or C++?

Now I know I can think about my future progression.

Thanks
 

SD70M

Senior Member
Is not the answer rather simple.......... if you want to work with ASM.......then bugger off and go join a Pic Forum, and not bother us here on the "Picaxe forum".
Or another way to look at it is you're rude and I want to learn. So starting with the PICAXE, an educational device that is cheaper than starting out with a more complicated language and all that it encompasses is a better way to learn the basics.

Not sure here but did Lewis Hamilton or Jenson Button (topical) learn in an F1 car or start with go-karts?
Angie
 

womai

Senior Member
>One analogy is that a high level language is like going to a shop and buying cakes for a tea party,
>while assembler is more akin to buying the ingredients and making your own cakes for the party.
>With shop bought cakes you have to take what they have but in making your own you have
>full control over what you get.

I politely disagree with that comparison.
Buying the cake is like buying a ready made toy / instrument / circuit.
Baking your own cake is using Basic, C, etc.
Assembler is like going to grow your own wheat, prodcuig your own sugar, and so on. Interesting to know how things are made but you'll be working for a full year before you have your first cake. And it may not even be a very good cake.

I've been in the electronics and software industry for more years than I'd like to admit. Let me tell you, close to nobody is using assembler anymore. Most use C/C++/C#, some Basic or Delphi, there are many out using Python, Perl, you name it, but no assembler. It' just not very productive and in addition, a good optimizing modern compiler produces better, tighter, faster code than an average assembly language programmer - in a fraction of the time and with a fraction of the effort. Assembly on its own does NOT produce good, fast, tight programs. It does produce inflexible, hard-to-understand, hard-to-change ones in most cases. Then comes the fact that assembly language is different (oftern VERY different) from one processor to the next, while C stays largely the same. So my recommendation would be, know what assembly language is and then move on to a modern high level language as quickly as you can!

Official industry estimate - for anything more than a trivial program the effort (time spent) to do it assembler is around 10x compared to a high-level language. If speed or memory is an issue, just use the next larger/faster processor or microcontroller. The times where every byte or every microsecond processing time counted have ended at least a decade ago.

end of rant :)
 

Aresby

New Member
... if I wanted to move forward I wouldn't use assembler, I'd go to C or C++?
If your talking about the PIC world then there's absolutely no need to move to C++ at all, not least because it's quite a leap to move into an object oriented world.

There are several Basic compilers out there, some free if you buy the specific hardware (same as PICAXE really) that are in a totally different league to PICAXE Basic.

That's not to denigrate PICAXE Basic at all; but as I've mentioned it addresses a particular sector so RevEd have simplified the programming aspect of PIC chips.

As an example, I use Swordfish, which can be downloaded free to try (and use forever, if you only ever deal with small programs) and which is a proper "grown up" multi-pass (ie optimising) compiler that is about as close to programming in the .net world as you can get for PICs. That's why I use it.

Unfortunately there is a great deal of C++ snobbishness out there; I've programmed in ASP VB and C# and quite frankly it's six of one and half a dozen of the other. As we're talking assembler, both these produce EXACTLY the same run-time code in the asp dot net world so I have no time for such eliteness.

If you like Basic as a language, stick with it.
 

Dippy

Moderator
What do you want your "future progression" to be? Hobby or employment?


Personally speaking, for PIC self-education programming, I'd do:- PICAXE BASIC > Compiled BASIC > C with a coffe-break study of ASM.
Start with PICAXE BASIC. Walk before running.
Simply 'knowing' C doesn't automatically make you a good programmer.
Just like knowing how to play a piano doesn't automatically make you a great composer.(HASM)


However, learning C gives you the option of not being limited to (generally) 8-bit PICs.
Then you can choose Micros that are more appropriate to the task. OK, there are a few exceptions.
Like I said before, ASM is unlikely to be used in most commercial projects. Time.
And, as Womai points out, you can often (not always) let the Compiler compile specific ASM for various different processors with the same high-level code.


Or is your future to simply have a good income?
There are many Industrial apps that use a flow method e.g. LABVIEW and C lies behind it.
LABVIEW writers can make pots of money.


One or two compiled BASICs are very C-like in structure, so the change to C is not too painful.

Alternatively, if you are comfortable with C then other compilers with ponsy names (e.g. Eclipse for Android) won't addle your brain so much.


So, after all that, what do you want your future to be?
So many paths to take and so many long posts and I'm starting to repeat myself again :)


I see you've had a pile of replies so I'll wave goodbye on this topic now and get on with my Android programming in Logicator.
 

boriz

Senior Member
Many excellent arguments. I especially liked the 'bugger off' argument. At the risk of becoming a pariah, I still think Picaxe would be much better with an inline assembler, or some other method of calling machine code subroutines. But I guess I'm alone on this one. Good luck everyone. I'm off for a drink.
 

srnet

Senior Member
Many excellent arguments. I especially liked the 'bugger off' argument. At the risk of becoming a pariah, I still think Picaxe would be much better with an inline assembler, or some other method of calling machine code subroutines. But I guess I'm alone on this one. Good luck everyone. I'm off for a drink.
Think about it, once you allow in-line assembler, how long would it be before the firmware was dumped and copied, and PICAXE clones started appearing ?
 

srnet

Senior Member
The Mikrobasic compiler allows in-line assembler, although my use of it so far is limted to;

ASM 'start assembly routine

Sleep

END ASM


It was needed as Mikrobasic does not have a 'Sleep' command like PICAXE does .......
 

Dippy

Moderator
Mikrobasic isn't as good as others sadly in many respects. I dumped it years ago.
I can't quite follow #34...

Hey, Boriz, mine's a Carlsberg.

Wait a moment though....

Say, Boriz, you've been asking about inline ASM for ages haven't you?
Instead of buying a drink , save the money.
Then you can buy:
Proton
PICBASIC
MikroBasic
Swordfish

All the above will give you your heart's content... inline ASM.
You'll be a happy Boriz :)
 

mrburnette

Senior Member
As a general statement, the higher one goes up the 'language abstraction tree' and away from the core (physical processor) instructions, the less one needs to know about the hardware structure and the more the programmer can think about just the logic of the program. For other programmers using the same high-level language, the logic is often fairly obvious because of the language features designed for portability across various hardware environments provide a kind of self documentation. (Programmer notes are still relevant however.) Consider that one can pour over machine assembler for some long period before noting that the programmer has implemented a numerical array but the DIM() statement in a higher language is a real obvious clue.

Putting this into PICAXE context is that one can write a BASIC program in PE or one can use the flowchart module and 'draw' a PICAXE program that gets converted to BASIC and then tokenized for download to the PICAXE. I have heard no arguments stating that one must be able to code in the PE and not in Logicator since the flowchart removes the programmer from the underlying BASIC. In most beginner programming classes, flowcharting is still a logical step prior to actually writing code; my own college Fortan instructor from 40 years ago almost failed me even with a class 4.0GPA because I would flowchart after writing the program and he insisted it be done the other way.

I sincerely hope that a fair number of programmers still take the plunge to drop down to assembler and learn the chip. My own plunge was 6800, 6502, and 8080 and it did not make me a better programmer, but it surely did give me an appreciation for higher level languages.

Having written a few PICAXE programs, I have seen no need for assembler; although, from an engineering prospective I do think RevEd could do more to provide for manipulation of the inner PIC. But, I will not go so far as to fault their decision since they must live within the defines of their marketplace. Were RevEd to open PE and PICAXE BASIC to being capable of programming naked PIC microcontrollers, I am not certain that they would significant increase their market because they would be joining a rather crowded set of similar products. Niche is good if you can maintain your secrets and I somewhat believe that access to the inner PICAXE interpreter code is the reason that RevEd simply avoids inline assembly - how many of us would be eager to dump the interpreter and try and find ways to increase our control over the environment? Be honest, if only for the fun of doing it, many of us would. With the code public, how many PICAXE clones would be free-shipping from Shanghai undercutting the small lifeblood profit that keeps RevEd financially viable?

I do assembler. I do not need assembler on the PICAXE. I hope young programmers learn assembler because I think it gives an appreciation of what the higher language must do to perform a task; it may even make them better programmers because knowledge has a way of widening ones horizons.

- Ray
 

John West

Senior Member
Agreed. And perhaps the word toy was indeed too harsh. Apologies.

I have nothing against Picaxe BASIC. The Picaxe system does indeed allow for rapid prototyping. And it's fun to play with. All I'm saying is a programming education is far from complete without at least a basic understanding of assembly language and how software interacts with hardware on a logic-gate level. In this respect, Picaxe the educational tool, is fundamentally lacking. Anyone trying to fill out there education by dabbling in assembly language has no choice but to move on to a rival/competing microcontroller system.
I'm not trying to "complete my programming education." I'm trying to effect specific changes in the world about me as quickly and easily as possible so I can get on with the next change, or simply relax and enjoy myself, knowing that the things I wanted done are being done by my dedicated electronic creations, and not by me. The PICAXE fills the bill quite well.

Giving anyone the ability to relatively easily get exactly what they want from a device, instead of settling for whatever is commercially available (and without having to become an engineer,) is an enormous step forward in the quality of life for all interested humans. PICAXE chips are the glue that dreams are put together with to bring them to life.
 

Aresby

New Member
PICAXE chips are the glue that dreams are put together with to bring them to life.
Wow! RevEd might be tempted to use this as a quote from "A satisfied customer, JW, Colorado".

And I think it does, for a lot of us, encapsulate exactly why we're all doing this. Certainly thinking about the projects I've completed recently I can subscribe to this school of thought, anyway.

I'm a amazed (and delighted) that RevEd have so many fans world wide. Given that their products are beautifully presented on their website and their documentation a model of clarity they certainly should be a yardstick that others measure themselves by.

Yes, I believe John's hit the nail on the head.
 

mrburnette

Senior Member
@Aresby
and their documentation a model of clarity
... well, maybe after WestAust55 and others members produce some fine explanation documents or Hippy generates some Fab example code. "Clarity" is a word best left as an adjective for bottled drinking water... I fear it is an oxymoron when applied to computer source code.

- Ray
 
Last edited:
Top