Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Is Assembly Language worth learning?

Name: Anonymous 2005-04-21 13:58

I've heard that learning assembly language is a good way to become a better computer programmer. Is this true? Is it worth the effort? Does anybody have any suggestions on this subject?

Name: Anonymous 2007-04-16 5:01 ID:fZjSmyjS

>>37
It *IS* a fucking language and you fail.

>>39
Both assembly and machine code are fucking languages and you fail for explaining the obvious.

>>40
dependent on which cpu is used will define what registers you hit in ASM.
Your point being?

Name: Anonymous 2007-04-16 6:22 ID:GUF52zaX

>>41
no point in regard to >>40 thats how asm operates. gee these kids so used to OO scripting lulz

Name: Anonymous 2007-04-16 7:26 ID:X97gOqek

A language is a system of symbols and grammar used to communicate things. So yes, assembler is a language.

Name: Anonymous 2007-04-16 7:36 ID:+V9Q8VM3

LEARN ALGOL 68

Name: Anonymous 2007-04-16 7:58 ID:3BLETy1d

>>44
How is this revelant to the topic? Or is this your way of saying "I've read SICP" ?

Name: Anonymous 2007-04-16 10:05 ID:a3G7aj7k

I took a unit at university which taught some x86 Assembly last semester.
It can be useful to understand the deeper levels of operation of a computer and to explain why and how higher level languages like C work and how to write more efficient code.

Important stuff like floating point 'precision' as it's so laughably called. And signed and unsigned integers.
They're important if you want to be a serious programmer.

The problem is that Assembly language is a very heavy subject and if you are not absolutely committed to learning it you will HATE IT. I know I did.

Name: Anonymous 2007-04-16 10:15 ID:PCwkQA7c

No, asm is not worth it. It is a hassle to write and youll have to write different code depending on the processors. It is however a key component in learning proper C++ Optimization - so pick up a book in that learn that instead, it usually includes ASM code that you can learn in order to understand how the compiler works, and how you can work around its code.

The compiler writes insanely good asm code and has done so since the about mid 90's. Anyone who says writing stuff by yourself in ASM is better has seriously outdated opinions. :)

Name: Anonymous 2007-04-16 10:38 ID:a3G7aj7k

>>47
This is true for larger applications, but for learning the important basics, it's good to pay attention to that loud little Asian man at the front of the lecture theater.

Name: Anonymous 2007-04-17 11:46 ID:5d2UTICM

>>36
DIFFERENCES BETWEEN MOST HIGH-LEVEL LANGUAGES AND ASM

1. No variables.  Actually, you have to make your own.  Either memory locations or registers can be your variables.  Preferably registers, but you only have a couple of those.   So, you have to decide which memory locations are going to serve as your variables, or decide which registers you can use.

2. No IF statements.  You have compare instructions.  And then depending on ther result of that comparison, you can jump(branch) to another address or carry on.

3. No PRINT/printf statement.  You have to make your own using operating system/DOS/BIOS routines or writing to screen memory yourself.

4. No expressions.  Everything boils down to a sequence of instructions.

5. Direct access to hardware.  Ports/IRQs/memory locations, it's all there.  Unless your program is running under protected mode.

6. No data types.  You have signed or unsigned bytes, words, doublewords, quadwords, but they're all really bytes.

7. Flag register.  Generally, after a math operation, the bits in the flag register are set to some values based on what just happened.  You can branch depending on how various bits are set in it, like the carry bit, etc.  Google for information on carry and overflow bits.

Name: Anonymous 2007-04-17 12:52 ID:M0gvK/oy

>>49
you're making it overly complicated, when i read asm, i tend to look at it like c code, unless its highly optimized asm.

>1. No variables.  Actually, you have to make your own.  Either memory locations or registers can be your variables.  Preferably registers, but you only have a couple of those.   So, you have to decide which memory locations are going to serve as your variables, or decide which registers you can use.
True, but you can easily define data if you use an assember(of course unless you write in machine code and generate your executable files from scratch, then you can define your memory layout). Then you have the system's mem allocing functions, you can still define structures in your assembler, even if they are nothing more than offsets ( like .StructMember would be nothing more than +C or whatever offset it was, but it makes writing it easier)


>2. No IF statements.  You have compare instructions.  And then depending on ther result of that comparison, you can jump(branch) to another address or carry on.
Conditional jumps(JCC) ARE if's. If you want if(){}else{} behavior, the macro assembler(masm/ml) actually have such directives, they would translate to the appropriate jumps. MASM also has loops. They are provided to speed up coding, but any masm-knowning person would know exactly what code they would generate. again, nobody is forcing you to use the provided macros, they are only there if you want more rapid development.

>3. No PRINT/printf statement.  You have to make your own using operating system/DOS/BIOS routines or writing to screen memory yourself.
There are OS api's for this usually, and if not you can write your own routines or use msvcrt.dll 's printf or whatever, if none of that suits you, there are some ready made libs made by some people just for linking in masm, oh and it doesnt really matter what the libs where coded in, as you can link obj files regardless of compiler. Assemble(generate code)&Link(generate executable)

>4. No expressions.  Everything boils down to a sequence of instructions.
Already discussed, if you want expressions, there are macros, if not, use instructions.

>5. Direct access to hardware.  Ports/IRQs/memory locations, it's all there.  Unless your program is running under protected mode.
Unless you're coding something for a bootloader or DOS, you are running in protected mode, oh and even in protected mode you can access them if you have the right IOPL priviledges, in Win you can make a driver grant them to you. as for 'memory locations' , you can always access any memory inside your process, if you want other processes memory, then you'll have to use the APIs give to you or have a ring0 driver supply writing/reading to them.

>6. No data types.  You have signed or unsigned bytes, words, doublewords, quadwords, but they're all really bytes.
Yes, if you say that a variable is a signed dword for example, then you'll only use signed operations/jumps on it,thus provind that its signed, you'll only access it as a dword, again providing tis a signed dword.

>7. Flag register.  Generally, after a math operation, the bits in the flag register are set to some values based on what just happened.  You can branch depending on how various bits are set in it, like the carry bit, etc.  Google for information on carry and overflow bits.
True

Again, you can go as low level as you want with asm. Oh you can do that in C almost all the time, except for some more specific stuff. Or you can go quite highlevel in asm as well, some assemblers provide you with macros and directives that allow you near high-level programming experience, there are even templates for building classes in asm. It's quite simple actually. All that you can do in a high level language, you can do in asm, it's a matter of how you organize your data and if you understand how compilers actually generate the code for what you write.

Name: Anonymous 2007-04-17 12:54 ID:Heaven

>>50
again providing tis a signed -> again proving its a signed

Name: Anonymous 2007-04-17 13:00 ID:M0gvK/oy

>>50
i know i just spoke of windowses MASM assembler, and its capabilities. If you are going to code a new OS or code for another OS or DOS or maybe another architecture, then it will be qutie different. But if you are coding for a certain OS , the ruleset and things you can use are already there for you and you dont have to reinvent everything if you code in asm, its not that much different than c, just a little bit more flexible, but you still end up writing more code.

Name: Anonymous 2007-04-17 20:05 ID:UqD7ejTD

>>51
'tis and it's are contractions of the same two words.
Dumbass.

Name: Anonymous 2007-04-17 21:23 ID:E36ORF1w

so has he given up on a programming career yet?

Name: Anonymous 2007-04-18 2:44 ID:8r2s5nK1

Oh the stupidity, you morons, Assembler is not Touring-complete!

Name: Anonymous 2007-04-18 3:51 ID:Heaven

>>55
most Asm's are Turing-complete, if they weren't you woudnt be able to convert languages like C to them? you have your brances, arithimetical ops, data moving ops and so on. You can code anything you can in a procedural language in it. You are probably a troll.

Name: Anonymous 2007-04-18 6:39 ID:Heaven

>>56
I want to interrogate you.  I want to interrogate you using a non-Touring-complete language for roughly an hour.

Name: Anonymous 2007-04-18 8:54 ID:cC9U8kfi

>>55-57
Major lulz

Enjoy your lack ot Touring-completeness, fags

Name: Anonymous 2007-04-18 10:00 ID:9iRgMxJf

>>50
True true true.  Pretty much anything you can do in asm you can do in C. 

However I wrote most of that (>>49) assuming that there IS no OS environment available.  Which is something you CAN'T do in C, which is make a program that functions without an OS.

Name: Anonymous 2007-04-18 11:50 ID:Heaven

>>58
You are probably a troll.

Name: Anonymous 2007-04-18 12:21 ID:cC9U8kfi

>>60
No shit!?

Name: Anonymous 2007-04-18 12:43 ID:Heaven

>>61
I want to interrogate you.

Name: Anonymous 2007-04-18 12:52 ID:Heaven

Oh, the stupidity. Those idiots.

Name: Anonymous 2007-04-19 3:38 ID:iap5HqIt

>>59
yes, you'd have to write your own output functions w/o an OS, probably would need to create some graphical driver before that as well(unless you use BIOS'es routine for text display). However in real-world situations people do have some OS available, unless they are coding some boot-loader/extender or OS themselves. But even with an OS, there are certain things which are easier done with asm than c, for example, API thunks. ( Can be done in c as well, but a bit hard w/o using a buffer you call into, and that would mean inline asm anyways )

Name: Anonymous 2007-04-19 8:56 ID:kBMZZFuY

░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
░░░░░░░░░░░░░░░░░░░░░░░░████████████░░░░░░░░░░░░░░░░░░░░░░░░
░░░░░░░░░░░░░░░░░░░░░░████████████████░░░░░░░░░░░░░░░░░░░░░░
░░░░░░░░░░░░░░░░░░░░████████████████████░░░░░░░░░░░░░░░░░░░░
░░░░░░░░░░░░░░░░░░░░████████████████████░░░░░░░░░░░░░░░░░░░░
░░░░░░░░░░░░░░░░░░░░████░░██████░░██████░░░░░░░░░░░░░░░░░░░░
░░░░░░░░░░░░░░░░░░░░██░░██░░██░░██░░████░░░░░░░░░░░░░░░░░░░░
░░░░░░░░░░░░░░░░░░░░██░░██░░██░░██░░████░░░░░░░░░░░░░░░░░░░░
░░░░░░░░░░░░░░░░░░░░██░░▒▒▒▒▒▒▒▒██░░████░░░░░░░░░░░░░░░░░░░░
░░░░░░░░░░░░░░░░░░░░██▒▒▒▒▒▒▒▒▒▒▒▒▒▒████░░░░░░░░░░░░░░░░░░░░
░░░░░░░░░░░░░░░░░░░░██▒▒▒▒▒▒▒▒▒▒▒▒▒▒██████░░░░░░░░░░░░░░░░░░
░░░░░░░░░░░░░░░░░░░░██░░▒▒▒▒▒▒▒▒░░░░██████░░░░░░░░░░░░░░░░░░
░░░░░░░░░░░░░░░░░░░░██░░░░░░░░░░░░░░████████░░░░░░░░░░░░░░░░
░░░░░░░░░░░░░░░░░░████░░░░░░░░░░░░░░░░██████░░░░░░░░░░░░░░░░
░░░░░░░░░░░░░░░░░░██░░░░░░░░░░░░░░░░░░████████░░░░░░░░░░░░░░
░░░░░░░░░░░░░░░░████░░░░░░░░░░░░░░░░░░██████████░░░░░░░░░░░░
░░░░░░░░░░░░░░██████░░░░░░░░░░░░░░░░░░░░██████████░░░░░░░░░░
░░░░░░░░░░░░░░████░░░░░░░░░░░░░░░░░░░░░░░░████████░░░░░░░░░░
░░░░░░░░░░░░░░████░░░░░░░░░░░░░░░░░░░░░░░░████████░░░░░░░░░░
░░░░░░░░░░░░████░░░░░░░░░░░░░░░░░░░░░░░░░░██████████░░░░░░░░
░░░░░░░░░░░░████░░░░░░░░░░░░░░░░░░░░░░░░░░██████████░░░░░░░░
░░░░░░░░░░██████░░░░░░░░░░░░░░░░░░░░░░░░░░██████████░░░░░░░░
░░░░░░░░░░██████░░░░░░░░░░░░░░░░░░░░░░░░░░██████████░░░░░░░░
░░░░░░░░░░▒▒▒▒██░░░░░░░░░░░░░░░░░░░░░░░░░░██████████░░░░░░░░
░░░░░░░░░░▒▒▒▒▒▒██░░░░░░░░░░░░░░░░░░░░░░▒▒████████▒▒░░░░░░░░
░░░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒██░░░░░░░░░░░░░░░░░░░░▒▒▒▒████▒▒▒▒░░░░░░░░
░░░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒████░░░░░░░░░░░░░░░░░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░░░░░
░░░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒████░░░░░░░░░░░░░░██▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░░░
░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░██▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░
░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░░░░░░░░░░░██████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░░░
░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒████████████████▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░░░░░░░
░░░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒██████████████████▒▒▒▒▒▒▒▒▒▒░░░░░░░░░░
░░░░░░░░░░░░▒▒▒▒▒▒▒▒▒▒░░░░░░░░░░░░░░░░██▒▒▒▒▒▒▒▒░░░░░░░░░░░░
░░░░░░░░░░░░░░░░░░██░░░░░░░░░░░░░░░░░░░░░░██░░░░░░░░░░░░░░░░
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░

Name: Anonymous 2007-04-19 9:25 ID:rUTB8lVc

Well, never mind all that, >>1. This has nothing to do with this thread, but would you just listen to me for a little bit? See, I went to learn assembly today. Right. x86 assembly. And the damn tutorial site was packed so full of people, I couldn't even find an open socket. So I looked around a bit, and I found an error message that said "for newbies". What the hell is wrong with you people? Are you idiots or something? Any other day you wouldn't even think of learning assembly, but if it's "for newbies", you all flock in here? It's just a fucking newbie tutorial! Newbie tutorial! And you're bringing the kids too. Look at that, a family of four going to teach themselves assembly. Con-fucking-gratulations. And now the guy's going, "All right! Daddy's going to optimize his ASFLAGS!" Shit, I can't watch any more of this.

Assembly should be fucking brutal. Two guys sit facing each other across the Internet, and you never quite know if they'll suddenly just start a fight right there. It's stab-or-be-stabbed, and that's what so damn great about the place. Women and kids should stay the fuck away.

Well, I finally managed to get to the tutorial, but then the guy next to me goes, "I'll use gas with extra ASFLAGS!". So now I'm pissed off again. Who the fuck uses ASFLAGS these days? Why are you looking so goddamn proud when you say that? I was gonna ask you, are you really going to fucking make your program go VROOM VROOM? I wanted to fucking interrogate you. For about a fucking hour. You know what? I think you just wanted to say "gas test.S".

Now, take it from the assembly veteran. The latest thing among the assembly pros is this: Self-modifying code. That's the ticket. A large table of code you can write to, and execute. This is what someone who knows his shit wants. They put in more code, in less space. A large table with raw instructions, that's really fucking awesome. Now, you should know, if you keep doing this, there's a risk the OS might write you up. This really is a double-edged sword. I really can't recommend this for amateurs.

And you, >>1, well, you should really just stick to C.

Name: Anonymous 2007-04-19 11:13 ID:qbjX7Z9s

EXTRA GREEN ONIONS

Name: Anonymous 2007-04-19 11:43 ID:+jbLYK9U

>>64
Real world situations where there is no OS available: Processors in embedded devices (microwaves, gas pumps, basically all the non-computer electronic devices that make our modern life possible) and programming your own BIOS.

Name: Anonymous 2007-04-19 11:58 ID:Heaven

>>65
if i see that fucking penguin one more time.

Name: Anonymous 2007-04-19 12:44 ID:tJDYSGAv

░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
░░░░░░░░░░░░░░░░░░░░░░░░████████████░░░░░░░░░░░░░░░░░░░░░░░░
░░░░░░░░░░░░░░░░░░░░░░████████████████░░░░░░░░░░░░░░░░░░░░░░
░░░░░░░░░░░░░░░░░░░░████████████████████░░░░░░░░░░░░░░░░░░░░
░░░░░░░░░░░░░░░░░░░░████████████████████░░░░░░░░░░░░░░░░░░░░
░░░░░░░░░░░░░░░░░░░░████░░██████░░██████░░░░░░░░░░░░░░░░░░░░
░░░░░░░░░░░░░░░░░░░░██░░██░░██░░██░░████░░░░░░░░░░░░░░░░░░░░
░░░░░░░░░░░░░░░░░░░░██░░██░░██░░██░░████░░░░░░░░░░░░░░░░░░░░
░░░░░░░░░░░░░░░░░░░░██░░▒▒▒▒▒▒▒▒██░░████░░░░░░░░░░░░░░░░░░░░
░░░░░░░░░░░░░░░░░░░░██▒▒▒▒▒▒▒▒▒▒▒▒▒▒████░░░░░░░░░░░░░░░░░░░░
░░░░░░░░░░░░░░░░░░░░██▒▒▒▒▒▒▒▒▒▒▒▒▒▒██████░░░░░░░░░░░░░░░░░░
░░░░░░░░░░░░░░░░░░░░██░░▒▒▒▒▒▒▒▒░░░░██████░░░░░░░░░░░░░░░░░░
░░░░░░░░░░░░░░░░░░░░██░░░░░░░░░░░░░░████████░░░░░░░░░░░░░░░░
░░░░░░░░░░░░░░░░░░████░░░░░░░░░░░░░░░░██████░░░░░░░░░░░░░░░░
░░░░░░░░░░░░░░░░░░██░░░░░░░░░░░░░░░░░░████████░░░░░░░░░░░░░░
░░░░░░░░░░░░░░░░████░░░░░░░░░░░░░░░░░░██████████░░░░░░░░░░░░
░░░░░░░░░░░░░░██████░░░░░░░░░░░░░░░░░░░░██████████░░░░░░░░░░
░░░░░░░░░░░░░░████░░░░░░░░░░░░░░░░░░░░░░░░████████░░░░░░░░░░
░░░░░░░░░░░░░░████░░░░░░░░░░░░░░░░░░░░░░░░████████░░░░░░░░░░
░░░░░░░░░░░░████░░░░░░░░░░░░░░░░░░░░░░░░░░██████████░░░░░░░░
░░░░░░░░░░░░████░░░░░░░░░░░░░░░░░░░░░░░░░░██████████░░░░░░░░
░░░░░░░░░░██████░░░░░░░░░░░░░░░░░░░░░░░░░░██████████░░░░░░░░
░░░░░░░░░░██████░░░░░░░░░░░░░░░░░░░░░░░░░░██████████░░░░░░░░
░░░░░░░░░░▒▒▒▒██░░░░░░░░░░░░░░░░░░░░░░░░░░██████████░░░░░░░░
░░░░░░░░░░▒▒▒▒▒▒██░░░░░░░░░░░░░░░░░░░░░░▒▒████████▒▒░░░░░░░░
░░░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒██░░░░░░░░░░░░░░░░░░░░▒▒▒▒████▒▒▒▒░░░░░░░░
░░░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒████░░░░░░░░░░░░░░░░░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░░░░░
░░░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒████░░░░░░░░░░░░░░██▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░░░
░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░██▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░
░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░░░░░░░░░░░██████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░░░
░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒████████████████▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░░░░░░░
░░░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒██████████████████▒▒▒▒▒▒▒▒▒▒░░░░░░░░░░
░░░░░░░░░░░░▒▒▒▒▒▒▒▒▒▒░░░░░░░░░░░░░░░░██▒▒▒▒▒▒▒▒░░░░░░░░░░░░
░░░░░░░░░░░░░░░░░░██░░░░░░░░░░░░░░░░░░░░░░██░░░░░░░░░░░░░░░░
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░

Name: snoɯʎuouɐ 2007-04-19 15:53 ID:P5K4uocW

Name: Anonymous 2007-04-19 21:42 ID:gS1WNk3e

But is it Touring complete?

Name: Anonymous 2007-04-20 9:19 ID:BxnslIGs

>>72
Ducks are Touring complete. They move across a (theoretically) infinite river in either direction. They have memory. In each step, they can catch fish, take a dump, or quack.

Name: Anonymous 2007-04-21 6:26 ID:k0KXmMMK

>>73
have you been copy pasting that answer into every Touring-complete forced-meme copypasta'd thread?

Name: Anonymous 2007-04-21 9:07 ID:FSQQnRdG

>74
Ducks are Touring complete. They move across a (theoretically) infinite river in either direction. They have memory. In each step, they can catch fish, take a dump, or quack.

Name: Anonymous 2007-04-21 16:15 ID:m2ytczmo

Ducks are Touring complete. They move across a (theoretically) infinite river in either direction. They have memory. In each step, they can catch fish, take a dump, or quack.

Name: Anonymous 2007-04-21 19:26 ID:or/gj+PD

>>75-76
I'm so happy I created this meme. I didn't even intend on making a new meme. In fact I shouldn't be credited for memeizing it. I just wrote it, then some Anonymouses started copypasting it.

Name: Anonymous 2007-04-22 15:55 ID:q09FUhLD

I'm so happy I created this meme. I didn't even intend on making a new meme. In fact I shouldn't be credited for memeizing it. I just wrote it, then some Anonymouses started copypasting it.

Name: Anonymous 2007-04-23 5:34 ID:YT8yYPmG

>>78
Turing, you jackass.

Name: Anonymous 2007-04-23 6:33 ID:u0tUcfUr

I'm so happy I created this meme. I didn't even intend on making a new meme. In fact I shouldn't be credited for memeizing it. I just wrote it, then some Anonymouses started copypasting it.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List