Assembly Language Made Easy

General programming chat and advice for beginners

29 posts   Page 1 of 2   1, 2
by Freddie570 » Thu Dec 20, 2012 2:41 am
Anyone who wants to learn ARM programming on the Raspberry Pi could do worse than to look at a great new book by Bruce Smith – Raspberry Pi Assembly Language Beginners. I picked up a copy from Amazon a few days ago and have done more programming on my Pi since then, than in the six months I have had the computer. What I didn’t realise was that I had all the tools right there in front of me for free.
The book uses the BBS BASIC Assembler that comes with RISC OS as its teaching environment. It was easy to write and run the assembler programs and correct mistakes I made on the fly. [In fact I have almost become a convert to RISC OS since using it.] No linkers, no files to mess around with. Just type in the program and run the machine code it generates.
Plenty of examples and some good stuff on his website as well – http://www.brucesmith.info
Would recommend anyone interested in programming the Raspberry Pi to check it out, because if I can learn to do it, anyone can!
Posts: 12
Joined: Thu Dec 20, 2012 2:33 am
by Burngate » Thu Dec 20, 2012 11:48 am
Just ordered it!

He's half of DABS?
Wyszkowski's Second Law: Anything can be made to work if you fiddle with it long enough.
Brain surgery is easier than psychoanalysis
User avatar
Posts: 2774
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK
by malakai » Thu Dec 20, 2012 12:25 pm
OK I'm getting sold what are your thoughts on 2 kids 12 and 14 think they could do it.
http://www.raspians.com - always looking for content feel free to ask to have it posted. Or sign up and message me to become a contributor to the site. Raspians is not affiliated with the Raspberry Pi Foundation. (RPi's + You = Raspians)
User avatar
Posts: 1383
Joined: Sat Sep 15, 2012 10:35 am
by RaTTuS » Thu Dec 20, 2012 12:27 pm
malakai wrote:OK I'm getting sold what are your thoughts on 2 kids 12 and 14 think they could do it.

yes - it's a good age to start ;)
1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX - Prosliver FTW
"That's not right, the badgers have moved the goalposts."
User avatar
Posts: 5018
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK
by malakai » Thu Dec 20, 2012 12:30 pm
Awesome thanks well 5 more days til they unwrap the Raspberry Pi Christmas care packages :) if they don't enjoy them they're going up for adoption because obviously that would mean they are the milk mans kid.
http://www.raspians.com - always looking for content feel free to ask to have it posted. Or sign up and message me to become a contributor to the site. Raspians is not affiliated with the Raspberry Pi Foundation. (RPi's + You = Raspians)
User avatar
Posts: 1383
Joined: Sat Sep 15, 2012 10:35 am
by pygmy_giant » Thu Dec 20, 2012 12:45 pm
unless the milk man likes to program

I'm tempted to get this - the author has got a face you can trust and he is an Arsenal supporter - what better testamonial could there be.

How advanced does it get?
Posts: 1569
Joined: Sun Mar 04, 2012 12:49 am
by neilf » Thu Dec 20, 2012 1:55 pm
You can take a look for yourself at Amazon http://www.amazon.co.uk/Raspberry-Pi-Assembly-Language-Beginners/dp/148112790X/ref=sr_1_1?s=books&ie=UTF8&qid=1356011438&sr=1-1

They have a 'look inside' version that let's you inspect the first 80 pages, including the chapter index. Looks like a very useful reference to have on the shelf for £12.99 with free delivery.

I've ordered mine - something to play with over the Christmas hols :)
Posts: 70
Joined: Sun Nov 11, 2012 8:14 am
by Freddie570 » Thu Dec 20, 2012 10:23 pm
RaTTuS wrote:
malakai wrote:OK I'm getting sold what are your thoughts on 2 kids 12 and 14 think they could do it.

yes - it's a good age to start ;)


I have been working through the book with my 11-year old son. he now understands hexadecimal numbers. We have been working to change one of the programs in the book to act as a number convertor. If I didn't have the RPi I doubt he would have shown an interest. So 12 and 14 year olds are well capable if you can capture their interest. The big thing for me is just how easy it is to experiment.
Posts: 12
Joined: Thu Dec 20, 2012 2:33 am
by Freddie570 » Thu Dec 20, 2012 10:33 pm
pygmy_giant wrote:unless the milk man likes to program

I'm tempted to get this - the author has got a face you can trust and he is an Arsenal supporter - what better testamonial could there be.

How advanced does it get?


I found it all pretty straightforward. There were a few chapters later on that I had to take my time with, and my son was able to help me out. 11 year olds!
Posts: 12
Joined: Thu Dec 20, 2012 2:33 am
by pygmy_giant » Thu Dec 20, 2012 10:50 pm
Hats off to the author for being methodical and thorough and to your son for learning a valuable skill that could serve him well in later life.

If I could erase my memory and learn programming again I might start with assembler as then I would be learning about how computers work at the same time. I think it would make me appreciate higher level languages more later on whilst giving direct access to harware when needed.
Posts: 1569
Joined: Sun Mar 04, 2012 12:49 am
by MonitorMan » Fri Dec 21, 2012 1:19 am
Thank you for the interest in the book, and for the sales - much appreciated!
I am happy to answer any questions regarding content or suitability.
As mentioned in an earlier post if you go to Amazon you can actually see quite a few pages and get a feel for the style and pace. You can also find a detailed contents list on my website. I will be posting more details, programs and hints & tips there in due course. Will add some here too if there is interest.
Regards, Bruce
Raspberry Pi Assembly Language now available in book and eBook formats.
For details, go to www.brucesmith.info - examples and programming hints and tips.
Check out the Raspberry Pi Resources page on the website for more information.
User avatar
Posts: 16
Joined: Tue Jan 03, 2012 1:31 am
by rurwin » Fri Dec 21, 2012 2:22 am
It is a little too dedicated to RiscOS for my liking. In my view the chapter on Linux misses the point. Yes you can use the SWI API, but you can also use the libC API, I disagree that doing so would be selling out to the C world. A library is a library, and assembler code of any complexity should use them. Why re-invent the wheel?

Maybe I have been misled by the small amount I browsed, but it seems that the book is too heavily dedicated to RiscOS for it to be useful for learning any other platform. Maybe I'm looking for a different book; after all I am no beginner at writing assembler, just ARM assembler. I would have welcomed a book that explained ARM assembler in gory detail and left discussion of particular platforms for a later section. It might be even more interesting if it contrasted and compared multiple platforms from the point of view of their assembler APIs. But of course this book is introducing assembler to people who have no knowledge of it, and the simple monolithic approach is probably right for them. As is integrating the platform API into the initial discussion. After all examples have to have input and output. Any more detailed and complex handling is probably best held back for the second volume.
User avatar
Forum Moderator
Forum Moderator
Posts: 2904
Joined: Mon Jan 09, 2012 3:16 pm
by MonitorMan » Fri Dec 21, 2012 4:13 am
rurwin wrote:It is a little too dedicated to RiscOS for my liking. In my view the chapter on Linux misses the point. Yes you can use the SWI API, but you can also use the libC API, I disagree that doing so would be selling out to the C world. A library is a library, and assembler code of any complexity should use them. Why re-invent the wheel?

Maybe I have been misled by the small amount I browsed, but it seems that the book is too heavily dedicated to RiscOS for it to be useful for learning any other platform. Maybe I'm looking for a different book; after all I am no beginner at writing assembler, just ARM assembler. I would have welcomed a book that explained ARM assembler in gory detail and left discussion of particular platforms for a later section. It might be even more interesting if it contrasted and compared multiple platforms from the point of view of their assembler APIs. But of course this book is introducing assembler to people who have no knowledge of it, and the simple monolithic approach is probably right for them. As is integrating the platform API into the initial discussion. After all examples have to have input and output. Any more detailed and complex handling is probably best held back for the second volume.


Thanks Rurwin – thoughtful comments.
This is a beginner book, thus I think your summing up in the second para is very apt. It is also a book about learning and trying to make it easy and digestible.
What is learnt is readily transferable to any other platform – the functions of the operators do not change – so I would disagree with your comment about transferability. To me that says more about the platform being transferred too.
Calling and integration of external libraries assumes a degree of knowledge that is above where this book is aimed. By using some of the RISC OS to do simple input and output, I hope would lead the advancing user to ask the question, “But how can I do that myself..”.
I think the book is more BBC BASIC centric than RISC OS focused as a tried and tested working environment. And I take your point about C libraries. I will come to you for more info when I get going on Volume 2!
Raspberry Pi Assembly Language now available in book and eBook formats.
For details, go to www.brucesmith.info - examples and programming hints and tips.
Check out the Raspberry Pi Resources page on the website for more information.
User avatar
Posts: 16
Joined: Tue Jan 03, 2012 1:31 am
by neilf » Fri Dec 21, 2012 11:33 am
Hi Bruce, nice to have the author involved in the thread.

I have a copy of your book arriving tomorrow (hopefully - according to Amazon). I haven't delved too far into the 'look inside' facility as I don't want to spoil the experience of reading the real thing, but I'm assuming all the code and copy is 32-bit compliant?

All the older ARM programming books I have are from the 26-bit era and are full of pitfalls for anyone adapting code for present day purposes on current ARM chips.
Posts: 70
Joined: Sun Nov 11, 2012 8:14 am
by MonitorMan » Fri Dec 21, 2012 9:52 pm
neilf wrote:Hi Bruce, nice to have the author involved in the thread.

I have a copy of your book arriving tomorrow (hopefully - according to Amazon). I haven't delved too far into the 'look inside' facility as I don't want to spoil the experience of reading the real thing, but I'm assuming all the code and copy is 32-bit compliant?

All the older ARM programming books I have are from the 26-bit era and are full of pitfalls for anyone adapting code for present day purposes on current ARM chips.



Hi Neilf
Absolutely re 32-bit.
The book is a beginners guide but if you go through to the end you should have a pretty good grasp of all the concepts and the ability to write some useful programs.
The plan is to follow on with a more advanced book later in the year that gets into the nitty gritty so-to-speak.
Don't forget to check the website out as I will be adding more programming examples and hope to add a bit about transferring code from one environment to another. Please let me know what you think of the content too.
Raspberry Pi Assembly Language now available in book and eBook formats.
For details, go to www.brucesmith.info - examples and programming hints and tips.
Check out the Raspberry Pi Resources page on the website for more information.
User avatar
Posts: 16
Joined: Tue Jan 03, 2012 1:31 am
by Gerry-VE4GKS » Fri Dec 21, 2012 10:51 pm
I learned Assembler by doing it by hand on older Z80 & Motorola 6800 systems with "hex'n'LED" terminals. For text work, what's wrong with assembler? It's faster than GUI & bloatware, especially what is shipped out by the Redmond virus factory. I might port an old ham radio app over, & if I get my hands on the source code for some rather sophisticated apps, (it's available for Linux), I might recompile for the "little beastie". I understand that Pis are available in "Winterpeg" & I'm thinking of getting one (not that I need another computer). I might add that I have a CP/M system under construction.
Gerry Sherman, VE4GKS
Posts: 3
Joined: Fri Dec 21, 2012 5:09 am
by pygmy_giant » Fri Dec 21, 2012 11:08 pm
rurwin said:

It is a little too dedicated to RiscOS for my liking.


I think the worlds too Linux-centric - why should they get all the books? I'm attracted to this one partly because of its RISC OS bias.

The other reason is that my understanding is that once you're proficient in assembler you can do away with an OS all together... but thats more advanced...
Posts: 1569
Joined: Sun Mar 04, 2012 12:49 am
by Freddie570 » Sat Dec 22, 2012 12:05 am
pygmy_giant wrote:rurwin said:

It is a little too dedicated to RiscOS for my liking.


I think the worlds too Linux-centric - why should they get all the books? I'm attracted to this one partly because of its RISC OS bias.

The other reason is that my understanding is that once you're proficient in assembler you can do away with an OS all together... but thats more advanced...



I had never used RISC OS before. My kids love it now.
The bbc basic assembler was easy to use - that's what I liked best. I could concentrate on the assembly language itself. I am still learning but I am going to download one of the free development environments this weekend, as suggest in the book, and have a go at using it. Now I know what the programs are doing I think it will be very easy to use them elsewhere. That's probably the point you are making!
Posts: 12
Joined: Thu Dec 20, 2012 2:33 am
by Burngate » Sat Dec 22, 2012 11:52 am
Burngate wrote:Just ordered it!

And today it's arrived, so I'm going off-grid for a bit. Happy New Year
Wyszkowski's Second Law: Anything can be made to work if you fiddle with it long enough.
Brain surgery is easier than psychoanalysis
User avatar
Posts: 2774
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK
by speculatrix » Sat Dec 22, 2012 8:03 pm
Hi Bruce,

Good to see you here. Haven't seen you since the old Acorn User days. Also glad to see you're still in the book business. You always did have a knack of explaining technical issues well.

All the best,

Steve Mansfield
User avatar
Posts: 48
Joined: Thu Apr 05, 2012 8:29 am
Location: France
by MonitorMan » Sun Dec 23, 2012 11:24 pm
speculatrix wrote:Hi Bruce,

Good to see you here. Haven't seen you since the old Acorn User days. Also glad to see you're still in the book business. You always did have a knack of explaining technical issues well.

All the best,

Steve Mansfield


Long time indeed - and I'm still in touch with a few. Thanks for the kind comments.
I'll drop you a mail in the New Year.
Have a great Christmas one and all!
Bruce
Raspberry Pi Assembly Language now available in book and eBook formats.
For details, go to www.brucesmith.info - examples and programming hints and tips.
Check out the Raspberry Pi Resources page on the website for more information.
User avatar
Posts: 16
Joined: Tue Jan 03, 2012 1:31 am
by Burngate » Mon Dec 24, 2012 11:40 am
Burngate wrote:
Burngate wrote:Just ordered it!

And today it's arrived, so I'm going off-grid for a bit. Happy New Year

Okay, I've read through that, when's the next installment out - Advanced HOG?
Wyszkowski's Second Law: Anything can be made to work if you fiddle with it long enough.
Brain surgery is easier than psychoanalysis
User avatar
Posts: 2774
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK
by Heckles » Wed Dec 26, 2012 1:34 pm
Purchased this book based on the recommendations of the others here. Just wondering whether there's an easy way to use or port this code to an assembler available within Raspian as that's what I'm currently using for learning Python....

Suppose I could just get another SD card and bang RISC OS on that after all I suppose that's what the PI is all about trying new things and I've no used RISC since the old A3000 days at school :)
Posts: 7
Joined: Sat Dec 22, 2012 11:37 pm
by Burngate » Wed Dec 26, 2012 4:45 pm
To a certain extent code is code, whichever environment you use it in, so you should be able to transfer what you learn here to a Linux environment. Lots of the Bare Metal forum is using assembler under Linux
However it is easier to follow the book using RISC OS, and move onto Linux when you feel ready

So yes, get another SD card and drop RISC OS on it. That way you can keep things tidy, one card for assembler on RISC OS, another for that robot you want to build, a third for ...
Of course you may find you end up using RISC OS for everything ...
Wyszkowski's Second Law: Anything can be made to work if you fiddle with it long enough.
Brain surgery is easier than psychoanalysis
User avatar
Posts: 2774
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK
by Mobius » Wed Dec 26, 2012 5:06 pm
Thanks for the reviews. I may have to get this after I get my feet a little wetter with Linux. Before I retired I was working on a project that also used the ARM 11 family of processors but we used Simulink (think Etch-A-Sketch) that translated to C++ and compiled to ARM assembly. I started in SW with assembly so this would get me back to my roots.
Posts: 238
Joined: Thu Aug 30, 2012 1:07 am
Location: San Angelo, Texas USA