Hey I can program in C,little bit in Python and Pascal and I really want to learn assembly. I'm 18 and finishing high school, programming is my hobby because school work sure isn't much of a challenge.
I've downloaded a few books on Assembly they are: The Art of Assembly,Assembly for Beginners, Assembly for Complete Beginners and Wrox Professional Assembly Language. I also downloaded a FASM, MASM and HLA compiler.
Now a few questions.
The examples in the Assembly for Complete Beginners are for MASM, should I run them in an emulator,someone told me that I can damage my pc if I don't use one, and if yes which emulator should I use?
Also how do developers make their assembly code portable? The only info I've found on this topic are on writing viruses, since viruses written in assembly have to be portable.
What exactly is HLA and is it the real thing or just a HLL disguised as assembly to help teach beginners assembly?
And where is the assembly community, except for on the obvious vxheaven and cracker websites?
I am reading a lot lately but I feel like someone who's learning Latin, but will never make it to the Vatican to meet others who speak Latin. My friends all program in Java, but don't seem to care about C or C++, they think they can use Java for everything. I'm running Windows 7 and Ubuntu 10.0.10 on an Intel. I've only been programming for about a year now... am I diving into assembly too soon? My reasons for wanting to learn assembly:
Thanks. T
1) You can't really "damage" your system more from running an assembly program than you can from, say, C. On a modern OS, the worst you'll usually end up is crashing your process. It might be a bit easier to crash your process from assembly code inadvertantly, though. If you want to get something useful out of an emulator, check out Bochs or QEMU - rather than just providing a sandbox, they have helpful debugging tools. You'll be fine without a vm, though, writing+testing code on your regular OS with your regular debugger.
2) You don't, really. You can make portable across OSes (but with same CPU) like you do it for C, but cross-cpu assembly just doesn't make sense (if you want to do that, you might as well use C or .NET or Java bytecode).
3) The subject of many a flamewar. Depends on how you look at it... an Assembler is really just a compiler that deals with assembly language. There's a lot of flavors of assembly, some higher than others; most of the ones available for x86 has macro support. HLA adds a lot of macro support and a syntax that a lot of people don't like, plus a big standard library. Not my cup of tea (I'd rather use a "real" HLL), but in my book it's still assembly language.
4) http://www.asmcommunity.net/board/ , http://board.flatassembler.net :) - stay away from IRC channels. Also, stay away from usenet alt.lang.assembly, it's been all but destroyed by a few mean individuals.
As for a couple of your reasons for learning assembly:
6.If I master assembly, learning more HLL would be easier.
Not necessarily, and it could even be harder if you "do too much" before digging into HLLs. I find that some machine architecture knowledge can lead to writing better software, but only if you learn not to obsess over tiny irrelevant details all the time.
7.Want to have something to offer when applying for a job that others won't have.
Won't necessarily help you, as assembly is utterly irrelevant in most positions. Heck, you risk prejudice of the "oh, he'll never get things done, getting lost in useless microoptimizations" kind.
Here goes...
lea
is usually used as 3-op add IIRC). I like 3-op instructions.Most CS courses tend to use something RISCy (ARM, MIPS, SPARC). I started on M68K, picked up a bit of PPC at some point, and learned ARM at university. ARM is reasonably clean and potentially useful if you want to work with phones/embedded devices, or for ARM; for fun things you can do on ARM, try the SheevaPlug or similar.
I've never done anything on a microcontroller, but it sounds similar to using ARM dev boards (possibly the most fun I had in my entire CS course).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With