Assembly language?

Dooling37

Senior member
Jun 7, 2000
488
0
0
I'm just wondering if people in here actually know assembly language, and if so -- how incredibly difficult is it to learn (relative to other languages such as C)??

I've heard it would be a good thing to learn, but I've never been much of a programmer, so I don't know if it's worth trying at all, or if I shouldn't even bother...

Would it be reasonable to assume that one should know several programming languages before attempting it?
Isn't it the purpose of compilers/interpreters so that we don't need to know assembly language? ;)

My understanding is that it is only one step above machine language (i.e. -- 0s and 1s), so I would imagine it's pretty abstract stuff.

No one here can actually read/write machine code, right? Just the thought of doing something like that blows my mind...

Alright well thanks for any help -- I'm curious to see how hopeless my situation actually is!
 

notfred

Lifer
Feb 12, 2001
38,241
4
0


<< I'm just wondering if people in here actually know assembly language, and if so -- how incredibly difficult is it to learn (relative to other languages such as C)?? >>



I know some. It's easy to learn, it's just hard to write.



<< I've heard it would be a good thing to learn, but I've never been much of a programmer, so I don't know if it's worth trying at all, or if I shouldn't even bother... >>



It's a good thing to learn only because it helps you understand how high level languages work. There's almsot no need for it in modern computer programming (if you're writing an OS or a MP3 player or something, that's a different story)



<< Would it be reasonable to assume that one should know several programming languages before attempting it?
Isn't it the purpose of compilers/interpreters so that we don't need to know assembly language? ;)
>>



You don't have to know any programming to start assembly, but an understanding of for loops, if statements, subroutines, etc would be helpful. And yes, the point of compilers/interpreters is so you don't need to know assembly language



<< My understanding is that it is only one step above machine language (i.e. -- 0s and 1s), so I would imagine it's pretty abstract stuff. >>



it looks like this (for MIPs, but I'd bet they're all similar in thier simplicity):

add $s0, $s1,$s2
sub $t0,$t1,$t2
lw $t3, 8(t0)
bne $t3, $t2



<< No one here can actually read/write machine code, right? Just the thought of doing something like that blows my mind... >>



nope, can't do that. Although... my dad used to be able to do it for the Z80 :)


Alright well thanks for any help -- I'm curious to see how hopeless my situation actually is![/i] >>



Assembly sucks. :p Keep in mind, it's not portable at ALL.
 

Ameesh

Lifer
Apr 3, 2001
23,686
1
0
i know sparc assembly pretty well, there is no need to learn it. converting from assembly <edit>to machine code </edit> is an easy task if your not a programmer then why do you care to learn it, it wont serve any practical use. I wrote a compiler in college and we had to output the assembly.
 

BA

Diamond Member
Dec 3, 1999
5,004
1
0
I've sorta learned 6800 assembly.
It's not that hard to learn, but actually doing stuff with it is another story...
 

tigerbait

Diamond Member
Jan 8, 2001
5,155
1
0
in our EE curriculum, we are required to take a Microprocessor class (8086)
3750 Microprocessor Systems (2) Theory and design of microprocessors; semiconductor technologies, architectures, assembly language, software development, input/output design, applications, and interfacing.

It pretty much turned out to be an assembly programming class. I didn't really get much out of it. I had taken two C classes already, but I don't think they helped too much with the basic assembly stuff we did. Definitely doesn't seem like it should be required for EE. I have to take the lab for it this semester which I heard was really hard.

only thing I liked...on my tests, I'd write MOV ZIG when I didn't have a clue what to do.... ended up getting a B, so maybe the teacher liked it :p



<< No one here can actually read/write machine code, right? Just the thought of doing something like that blows my mind >>



we had to write the machine code for some instructions on our exams... you have to reference a bunch of charts and stuff and it's a real pain
 

I know x86 ASM and some ARM ASM. It's really fun and the best way to understand the computer and programming languages at an atomic level.
 

heartsurgeon

Diamond Member
Aug 18, 2001
4,260
0
0
ah the good ol days.. anyone hear remember entering machine code directly into memory by setting toggle switches on the faceplate of the computer (each switch represented a bit in a given word) and depositing the code in memory, and then executing it? the answer is yes, you can code programs in machine language. compilers were originally written to allow you to directly convert assembly language into machine code. my theory (i'm a purist, but not a very practical sort) is that you don't really understand what your doing unless you have some experience programming in an assembly language.

the down side of assembly language is that it is unique for each different processor, it can be a nightmare to modify/debug if not extensively documented, and that it is time intensive (software equivalent of building a computer by soldering together the individual resistors, capacitors, transistors, etc, rather than getting a motherboard, sound card. etc and plugging them in a case).

the up side is that you can write incredibly "tight" code that accomplishes a task literally a 1000 faster than code written in a higher language.

it's not difficult to learn - on the contrary, very simple to learn..you should definitely giver it a try..

besides, you can write hybrid programs - which use a higher language for the general activities of the program (running a printer, managing the screen output, etc) but call subroutines you have written in assembly language to carry out computationally intensive or time sensistive (a.k.a. real time programming) tasks at lightning speed! go for it!
 

fjorner

Senior member
Oct 4, 2000
619
1
0
it's not that difficult, but i had a horrible teacher. it sure isn't easy, believe me, but it's no C++.
 

Jzero

Lifer
Oct 10, 1999
18,834
1
0


<< it's not that difficult, but i had a horrible teacher. it sure isn't easy, believe me, but it's no C++. >>


It's one of those things where the basic concept is quite simple, but actually doing it is another story.
It's not that it's even that HARD to do as much as it is just plain TEDIOUS. I was mad b/c we had a "Computer Architecture" course which was SUPPOSED to be about the hardware design of computers. Previous classes actually designed a simulated 16-bit x86 processor from the ground-up in logic works. It was really cool.
For some reason when I got there they decided to change it up and it was entirely Sparc assembly programming. The teacher was horrendous, although at the time I thought it was me. I was mad--if I wanted to take an assembly class I would have registered for one.
When I retook the class, it was with another teacher. It was still assembler heavy, this time using IJVM, which is like a simulated java virtual machine....oddly enough, I had no problems with that.
I took compilers with the first teacher, and surprise surprise I did terribly, too. Worst thing was that he admitted to not knowing Java and being unable to accurately grade our assignments.
 

EagleKeeper

Discussion Club Moderator<br>Elite Member
Staff member
Oct 30, 2000
42,589
5
0
heartsurgeon

Did my grad work on an HP1000 using switches, paper/mylar tape.

One project was to read a tape and puch out the Ascii equivalent of it at the same time.
Then read in the Ascii tape and generate a binary.

Hold the original binary tape up to the light and compare it to the one that your program punched.
Passed the course if they were identical.
 

cipher00

Golden Member
Jan 29, 2001
1,295
0
76
Back in my 8086/80186/80286 days I found that assembly-written programs were smaller and faster than my (few) C or FORTRAN programs....but usually not by enough to matter. I stuck with the higher stuff 'cuz it was easier to debug as well as port. For the vast majority of purposes the old adage "fast, large memory machines breed sloppy, inefficient programmers" is true but irrelevant: today the machines are usually fast enough and large enough to get the job done. If you need machine level instructions, fine. Otherwise.....
 

Descartes

Lifer
Oct 10, 1999
13,968
2
0
I know x86 assembly, and mostly use masm/nasm. MASM has some macros that makes the tedious process of pushing/popping parametes on the stack easier, along with other primitive HLL constructs like conditionals, etc.. I still use MASM's linker with VC++ to get a smaller binary.
 

heartsurgeon

Diamond Member
Aug 18, 2001
4,260
0
0
Eaglekeeper -

remember the vicious paper cuts you could get loading a large binary with a fast paper tape reader!

the machine actually threatened your life back then.

the only "sound card" back then was the ding-ding-ding of the teletype.

you could lose your hearing if you sat next to a high speed "chain" printer (mpact of the print heads - sounded like really loud popcorn).

things are vastly better, nicer, easier now - i wonder what my kids are going to be using 30 years from now, and what the AT's then are going to saying?
 
Aug 16, 2001
22,505
4
81
I know some 6502 assembly ( remember C64) from the old days. It's not hard to learn but it is a pain to make something useful with it.
I wish someone could rewrite Windows in assembler. WWOOOAaa!! That'll be fast.