[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
Is learning Assembly before C a good idea? I only use Java at
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 38
Thread images: 3
File: niew3.jpg (86 KB, 647x337) Image search: [Google]
niew3.jpg
86 KB, 647x337
Is learning Assembly before C a good idea? I only use Java at work and know smattering of a few other high level languages.
>>
>>54227567
Yes but only after you learn brainfuck
>>
>>54227676
I'd say the correct course of action is:
Befunge -> Brainfuck -> ASM -> C

Would you agree?
>>
>>54227729
I'd say Whitespace all the way before ASM
>>
>>54227676
>brainfuck
nice meme
>>
i tried doing that. asm feels different to c and you might get confused if you learn asm before it. theres a lot more that goes on in c. learn c first and then asm after, you may not even use asm again, but you might find its really fun. two big concepts you would take away from asm is pointers and the stack. have fun
>>
No, anon.
>>
>>54227567
no
>>
>>54227567
first you must learn the basics of microarchitecture
>>
>>54227798
Do it in order of complexity.
Whitespace first, because nothing could be simpler, it's all white.
Move up to Brainfuck to learn something with more operations.
Then Befunge, train yourself to think in more than one dimension.
Finally move to things that a real computer can run natively.
Start with raw machine code, the absolute lowest level.
Once you're decent at small programs in that, learn Assembly.
After Assembly, move to C and then progressively more high level languages -- C++, Java, C#, Python, PHP, Javascript.
Then finally move to something so high level it starts to become similar to human language, such as lolcode.
>>
>>54224531
>Not using Ruby>>54227729
Switch Brainfuck and Befunge
>>
>>54227567
First learn VHDL, then assembly, then C.
>>
>>54227567
NO.
Learn C first, then learn basic assembly.
>>
>>54228315
:/
>>
File: smile2.webm (2 MB, 1280x640) Image search: [Google]
smile2.webm
2 MB, 1280x640
>>54227567
Fuck all this dumb answers OP, I will tell you what to do.

Get K&R book, get intel x86 pdf manual ( smaller ver, 3toms where x86 instruction are described), install VC C++ express, ollydbg and ida and tet editior of your choice, vim/notepad/sublime whatever.

Now you are learning reading K&R and learning C, run every example. Write code of each example and save it as *.c file, now use visual studio express command prompt and compile each C program with /Fa option to create ASM listing.
Like
cl.exe hw.c /Fa

Now it will generate clean assemble listing of your C code.
1. First read C code example and understand it.
2. Read asm listing of this c code and understand it.
3. Run program in olly to understand workflow and how it works live (like you can see live how register changes, where is IP pointing, differece between OF and CF.
4. Now run it in IDA and lurk again in code.

This way you will learn both at same time. (it is dumb to learn one without another).

Second, after few days you will be able to eaisly spot C structures in ASM code and you will be able to write one or another.

You will have clear pictre of C and actually understand why do you need pointers or why do you have to use malloc and how it works.

You will gain knowledge.


I would suggest to install windows xp on vm and do all stuff there

gnu asm syntax is much less comfy so do not bother with it at the beginning.

If you look for more info on x86, check lena151 tutorial and goppit Portable Executable Format (PE).


Learning it this way will give you more knowledge you will be able to look at files from binary point. ie you can write simple program to write data from file header.

it is freedom op
>>
>>54228980
>get intel x86 pdf manual ( smaller ver, 3toms where x86 instruction are described)
Have you SEEN those things? They're fucking huge! What's wrong with you?
>>
>>54229047
I said smaller version, its not a novel you are not suppoused to read whole 3k pages.

If you are going thorugh asm listing and you find instruction that you do not understand, then open manual and use search to find definition and example
>>
>>54229116
That's fine, but not nearly necessary for starting up with x86 assembly.
>>
>>54227567
You can learn it if you want, but if you don't plan on doing OS development, I wouldn't bother, since the only time you actually need to use assembly is in OS dev, and that's usually in the form of inline assembly in C.
Just stick with C.
>>
>>54227567
For what it's worth OP, I'm an electrical engineering major who hated programming until I learned assembly. You'll have a deeper understanding of what's happening behind the scenes if you learn assembly. I don't know that I can recommend learning one or the other first but I feel like they both have their uses.
>>
Learn C then computer architecture (cmos, memory, registers etc..) then MIPS assembly then x86 instruction set.
>>
>>54228315
No Malbolge?

Hello World!:
(=<`#9]~6ZY32Vx/4Rs+0No-&Jk)"Fh}|Bcy?`=*z]Kw%oG4UUS0/@-ejc(:'8dc
>>
>>54228980
>get meme book
>now you are learning meme c
>code from half a century ago
>>
>>54230047
>but muh idols
>>
>>54227567
Assembly is cool as fuck, especially if you do it for something like a Pi or other ARM board. Decent dev programs exist and you can do stuff like step through the program and watch your registers and code work in real time. It's a great way to get a really good understanding of what it is your computer does at its most basic without stepping into the gate level itself. And programming a piece of legacy gear by manually entering in hex instructions in incrementing address locations by the 0-9 A-F keypad only feels like being some sort of god.

That said, unless you're developing embedded systems, there isn't much point to assembly. You might be able to then slightly optimize compiled code, but the performance improvement is rarely worth it, and maintaining and porting assembly is a massive pain in the ass since you may have to rewrite most of it. C at least is PDP-11 assembly dressed up a bit versus regular assembly and with some added abstraction, it's more worth your time. Assembly has less utility than COBOL unless you're building embedded systems or low level software for embedded systems, and even then most everything I encounter on those systems is C, albeit C for embedded applications, which has some weird shit at times.
>>
if you learn assembly first then you're a dumbass. learn higher level programming concepts before you learn how they work, not the other way around.
>>
>>54227567
Fuck no. Learn C at a basic level, then learn how C code is represented in assembly. And learn program structure like how the stack, heap, etc. works. The book "Computer Systems: a Programmer's Perspective" has a couple really good chapters on this, you may want to pirate it and take a look at it.
>>
>>54231324
I've been programming in a high level language for years, but I don't know much about memory management and computer architecture. I only some basics of C++ and how pointers work
>>
>>54227567

If you intend to be an Assembly programmer, you want to learn it early and thoroughly and eat, breathe, sleep and shit Assembly every day. C will be interesting and you will also use it, but will not be the priority that Assembly is.

On the other hand, if you want to be an Assembly hobbyist & casual, then study it as one of your main hobby's while focusing on C.

This whole "Which one first?" is bullshit, which reveals that you have a long way to go yet. If you're going to be a programmer as a career, there will be pretty much no time on your life that you are not studying three languages simultaneously. Pretending there is a linear progression of languages that you pick up indicates that you don't understand what it means to be a programmer. Even after you pick up your first ten languages, you will still be studying all of them to keep up on new versions as well as apply your skills in each of them in new, subtle and powerful ways.

If you cannot study C and Assembly simultaneously, you should consider a different career. In fact, you should be thinking about the third language (such as Perl, for one possible, complimentary language) that you should be picking up at the same time.
>>
>>54228980
this is pretty accurate.

just get this free pdf

http://www.drpaulcarter.com/pcasm/

and then get the code you need to run it and go through the examples and read the book. learn nasm because that is what shit is going to look like when you disassemble.

assembly is probably the most fun language to learn
>>
>>54230279
i wish all of /g/ posted like this
>>
>>54227567
>Is learning Assembly before C a good idea?
You understand C's memory model and pointers much easier this way. I don't know how hard it is to learn assembly in a recent platform though. I learned assembly at DOS times in real mode, it was easy as fuck.
>>
>>54228980
>>54231468

Not OP, but love you, thanks. <3
>>
>>54231454
Would read again/10 post
>>
>>54227567
not at all, the best course of actions is always going from higher lvl languages to lower lvl.
for instance: C# or Java (where u dont have to care about memory allocation), to C or Pascal where u need to care about every single byte you allocate to assembly where it's necessary to care about stack and register states/values.
>>
>>54235654
I would say the other way is better. If you start with low level, then after asm and c you are able to truly admire simplicity and comfiess of hll like python
>>
>>54236419
This, everything will seem like a toy language.
>>
Grab a copy of Computer Systems-A Programmer's Perspective and learn both at the same time, OP. The knowledge of one will compliment the other and you will learn both in a deeper way. This textbook is designed around this approach and is very good.
Thread replies: 38
Thread images: 3

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.