C Board  

Go Back   C Board > Community Boards > Tech Board

Reply
 
LinkBack Thread Tools Display Modes
Old 06-14-2009, 01:43 PM   #1
Registered User
 
Join Date: Jan 2009
Posts: 151
Thinking of learning assembler, ARM?

Hi,

I've been thinking of learning assembler I have looked at options like x86, older computer, 68000, z80 or ARM. Now I have seen that there are some new ARM based netbooks comming based on Nvidia Tegra chipset and Snapdragon. Could this be a good choice for this purpose? Thoughts.
Subsonics is offline   Reply With Quote
Old 06-14-2009, 02:33 PM   #2
and the hat of vanishing
 
Salem's Avatar
 
Join Date: Aug 2001
Location: The edge of the known universe
Posts: 21,214
A long time ago:
- processors were simpler, making it feasible to learn all about them.
- processors were less powerful, making the necessity to program in asm to get the best.
- compilers were less able to optimise the code, ditto getting the best.
- processor design evolved slowly, making the return on your learning investment.

Now, none of that is true.
What with co-processors, pipelines, instruction reordering, branch prediction (and a whole bunch of other tweaks), it might take you a week just to write a few instructions in the most optimal manner. Then by the time you have learnt it, the processor is long out of date.

Reading the generated code of your compiler is useful.

Sure, if you're writing an OS, you need access to certain specific registers on the processor. Most of the time, you would write simple wrapper functions around the hardware specifics. You don't need to be an ASM wizard to manage that much.
__________________
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
Up to 8Mb PlusNet broadband from only £5.99 a month!
Salem is offline   Reply With Quote
Old 06-14-2009, 04:27 PM   #3
Senior software engineer
 
brewbuck's Avatar
 
Join Date: Mar 2007
Location: Portland, OR
Posts: 5,379
Quote:
Originally Posted by Subsonics View Post
Hi,

I've been thinking of learning assembler I have looked at options like x86, older computer, 68000, z80 or ARM. Now I have seen that there are some new ARM based netbooks comming based on Nvidia Tegra chipset and Snapdragon. Could this be a good choice for this purpose? Thoughts.
ARM is a pretty ubiquitous chip. But even in embedded environments, most code is compiled from a higher level language these days. If you want to learn an assembly language, it's a good choice because of its restricted instruction set. But in terms of being a marketable skill... Not sure.

(I think you should go for it.)
__________________
"Congratulations on your purchase. To begin using your quantum computer, set the power switch to both off and on simultaneously." -- raftpeople@slashdot
brewbuck is online now   Reply With Quote
Old 06-14-2009, 04:37 PM   #4
Kernel hacker
 
Join Date: Jul 2007
Location: Farncombe, Surrey, England
Posts: 15,686
Learning to program assembler is, in my opinion, never a bad thing. I haven't written ARM assembler, but I have debugged compiler generated code on ARM. It's not very different from other RISC assemblers - a 3-operand assembler syntax, 16 registers that are essentially orthogonal. Easy to write, easy to follow, I'd say.

Once you know how to program in assembler, it shouldn't be very difficult to switch from one assembler form to another - after all, most things are pretty much the same.

I have (professionally) written code in x86 (32- and 64-bit, including code for Virtual Machine monitoring in Xen), 29K, 68K.

Non-professional programming also covered PDP-11, 6502, Z80 and 8031. In 8031, I didn't know ANY of it, when I wrote code to program EPROMs. A friend of mine built the hardware. I wrote the software. 8 hours from start to finish, we had the EPROM's programmed.

--
Mats
__________________
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
matsp is offline   Reply With Quote
Old 06-15-2009, 11:58 AM   #5
Registered User
 
Join Date: Jan 2009
Posts: 151
Thanks for your input on this.


I realize that the practical use of assembly today might be limited, but my motivation for wanting to explore it is to get a more thorough understanding of what's going on at the processor level. I think that understanding might be useful even when programming in C. But mainly it's for the fun and challenge of doing it.

So far the only experience I have is a basic hello world program and some inline assembler on x86, but very limited. I have had the feeling of wanting something simpler than x86 to start out with, as well as perhaps a more lightweight OS. I'm not sure what OS I can expect to install on these netbooks but I think linux and windows mobile was the options so far. But i guess that there should be a few OS'es for ARM that I could potentially use at least.

Another option might be something even simpler like a pic such as AVR Butterfly or something.
Subsonics is offline   Reply With Quote
Old 06-15-2009, 12:09 PM   #6
subminimalist
 
MK27's Avatar
 
Join Date: Jul 2008
Location: NYC
Posts: 3,944
Quote:
Originally Posted by Subsonics View Post
a more lightweight OS.
If you are interested in these kinds of things, consider installing a stripped down customized linux, ie, not a major disto install from disc or anything. This used to be a more popular activity ten years ago, when people commonly made their own rescue disks. I've made a bootable linux that fit on 2 3.5" floppy disks, which is like 3mb** (there was no GUI of course...)

If mostly what you want to do is program in assembler (I'd like to too, kind of, for I think similar "curiosity" and comprehension type reasons), these two projects would go well together methinks because it is not as if you need more than a bare minimal system to do that. What a "bare minimal" linux system is will certainly shed some light on the nature of whatever major distro monstrosity* you are running right now.

Google "Linux From Scratch". If it was me, this is when I'd want to start learning about FreeBSD, but that has nothing to do with anything...

*just kidding, they're very nice
** the 3 disk version actually had networking and a text browser (lynx), so I could rummage on line docs in a rescue.
__________________

Accuracy and integrity mean nothing if you don't make it past the censors...PYTHAGORAS

Last edited by MK27; 06-15-2009 at 12:13 PM.
MK27 is offline   Reply With Quote
Old 06-15-2009, 12:27 PM   #7
and the hat of vanishing
 
Salem's Avatar
 
Join Date: Aug 2001
Location: The edge of the known universe
Posts: 21,214
> But mainly it's for the fun and challenge of doing it.
Go for it, and enjoy
__________________
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
Up to 8Mb PlusNet broadband from only £5.99 a month!
Salem is offline   Reply With Quote
Old 06-15-2009, 12:45 PM   #8
Registered User
 
Join Date: Jan 2009
Posts: 151
Quote:
Originally Posted by MK27 View Post
If you are interested in these kinds of things, consider installing a stripped down customized linux, ie, not a major disto install from disc or anything. This used to be a more popular activity ten years ago, when people commonly made their own rescue disks. I've made a bootable linux that fit on 2 3.5" floppy disks, which is like 3mb** (there was no GUI of course...)

If mostly what you want to do is program in assembler (I'd like to too, kind of, for I think similar "curiosity" and comprehension type reasons), these two projects would go well together methinks because it is not as if you need more than a bare minimal system to do that. What a "bare minimal" linux system is will certainly shed some light on the nature of whatever major distro monstrosity* you are running right now.

Google "Linux From Scratch". If it was me, this is when I'd want to start learning about FreeBSD, but that has nothing to do with anything...

*just kidding, they're very nice
** the 3 disk version actually had networking and a text browser (lynx), so I could rummage on line docs in a rescue.
Interesting, that is definitely something to consider. I'm currently reading a book on basic (more or less standard I guess) operating systems approaches and implementations, so it could be a worthwile exercise for more reasons I think. I have looked into FreeBSD as well and I think they have a distro for ARM, but it seems like it's not thoroughly tested, but it might be enough for a really small install though. Will check out Linux from scrach, thanks.

Ok, I might have to change what I said, what it said on the FreeBSD site is that it's not offical and don't come in pre built packages but it's activly supported so it seems like it should fit for the purposes here.

From the freeBSD site:

"ARM is officially a Tier 2 architecture, as the FreeBSD project does not provide official releases or pre-built packages for this platform due to it primarily targeting the embedded arena. However, FreeBSD/ARM is being actively developed and maintained, is well supported, and provides an excellent framework for building ARM-based systems."

Last edited by Subsonics; 06-15-2009 at 12:55 PM.
Subsonics is offline   Reply With Quote
Old 06-15-2009, 04:30 PM   #9
Registered User
 
valaris's Avatar
 
Join Date: Jun 2008
Location: RING 0
Posts: 462
I would say learn ASM for sure. I could care less about actually understanding some x86 assembler language (although it is sometimes nice), but the most valuable things I learned came from learning what is going on within the machine and compiler.
valaris is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Learning to write Windows Apps johnson_a Windows Programming 8 05-31-2004 04:17 PM
Thinking of Modding Xbox. Don't know about Linux Stan100 Linux Programming 4 05-30-2004 04:51 PM
Problem building Quake source Silvercord Game Programming 14 01-25-2003 10:01 PM
Fluid Thinking kermi3 A Brief History of Cprogramming.com 27 11-20-2002 03:29 PM
MAINFRAME Assembler. sean A Brief History of Cprogramming.com 3 12-05-2001 05:32 PM


All times are GMT -6. The time now is 07:20 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0 RC2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22