/asm/ - Assembly Language General

Assembly language is awesome!
Discuss.

Other urls found in this thread:

www-ssl.intel.com/content/www/us/en/processors/architectures-software-developer-manuals.html
x86-64.org/documentation.html
ecee.colorado.edu/ecen4553/fall12/asm64-handout.pdf
youtube.com/watch?v=mWeh3_ITG7M
twitter.com/SFWRedditImages

bump because assembly is a topic not much discussed on Sup Forums while it should.
also. tried it on my raspberry and its easier than most people proclaim it to be

Only learned basic LC3 and MIPS for school. What's a good assembler to start learning for srs?

What languages do you know, and what would be a good precursor to assembly, if any?

Is 8086 assembly recommended for a beginner?

"assembly" isn't a language.

It's all pretty much the same principles with the late 70's early 80's era processors so yeah sure.

What is it then?

What's the point of learning assembly when C exists?

A Great assembly architecture to learn is MIPS. Search for Mars Simulator, it's a great tool to test MIPS programs.

A fun thing to do is writing a compiler for a toy language that generates MIPS code.

Anyway, 8086 is usually refereed to as x86 assembly. I don't know if it is easy for a beginner since I first learn MIPS, but give it a shot, it is always something interesting and useful to know,

You can understand what the compiler is doing and know the computer at a deeper b level

I suppose I shouldn't have asked "learned", allow me to restate my question: What's the point of writing assembly when C exists?

I have a question. I know some Python and Java. Not anything amazing but I understand the basics.Made a shitty Swing program, etc.

How the fuck does one learn about assembly without some kind of CS background though?

I have a look at some tutorials and it starts talking about CPU registers as if I already know what the fuck they are. But I dont as I am self taught and mostly do it as a hobby.

I would love to know how to disassemble programs in IDA but I just don't know where the fuck to start learning.

Can someone help an user out?

That's a good question, I guess someone who likes assembly will prefer assembly over C.

Reverse engineering
Application optimization
Direct map to hardware
Zero over-head

You may need it for some very low level operations. Nearly everything today has a library that is better optimised than anything normal people will ever write though.

It's fun to learn something new and to challenge yourself. There.

What a weird question, but usually speed and control over execution flow, since you don't need to work with a higher level compiler.
For example the Linux kernel has a lot of inline assembly code, for certain critical paths that require precision and "unrolling" so to say.

When:
- you have buggy compiler
- use faster new processor instruction (AVX, AVX2, etc)

Anyway, both case are implying you're writing inline asm, not from scratch.

read these:

www-ssl.intel.com/content/www/us/en/processors/architectures-software-developer-manuals.html

x86-64.org/documentation.html

ecee.colorado.edu/ecen4553/fall12/asm64-handout.pdf

Ain't application optimization virtually always better handled by whatever compiler you're using? And C overhead is absolutely negligible. Reverse engineering is understandable, but that requires reading the code, not writing it.

Why ASM though? It's basically C except a dozen times more verbose. It's the opposite of fun.

NASM is good to start out with, and then FASM makes everything like heaven.
youtube.com/watch?v=mWeh3_ITG7M
This guy is what I originally learned assembly from, as well as on tutorialspoint. Pretty informative and easy to follow, simple learning curve

i know Go and C. but a good way to get to any sort of assembly would probably be JS > GO > C++ > C > ASM

See

No, control and ease is the only reason these days.
While the compilers will produce highly optimized code, it just is sometimes too complicated and tedious to run the intermediary step of the compiler. You should think a C compiler as a function, which evolves and has implementations, so there is no set C compiler function that we can compare to. So understanding the results of the function will be hard and require deep knowledge, compared to doing it by hand.
Sometimes using assembly directly is just much simpler.

You are right about C and the optimizations. Modern compilers are very proformant and out do most humans in most cases of optimization.

Although, there are times where the optimizations do not do as you wish. Sometimes it optimises could away something you wish it didn't.

are the rules and syntax still same after all those years? same architecture and stuff?

i don't know much about this low level area but i always knew enough that its the most awesome and important

I would propose the opposite route and starting with assembly, be it x86 or mips.
Languages have a lot of quirks, spending time with them, is less time spend on understanding processors and architectures.

If you want to learn something just get right into it. You don't need to know c++ or even c to get into assembly.

some of us would like some cool shit done after 4 hours. not 4 weeks

Each processor architecture has it's opcodes aka the language the processor speaks, then we have compilers aka assemblers, that turn your assembly to those opcodes.
So each processor/architecture and each assembler to that architecture influence the syntax and rules.

noice thread, i hope it doesn't die.

I played TIS-100 for over 200 hours but somehow still have no idea what your pic related is doing or, more importantly, why it it's coded like that, did I get meme'd?

Would anyone of you recommend C64? I would maybe eventually try and make a demo some day

Why is NASM so fucking annoying with its syntax? I just want TASM for Linux, is that too much to ask?

Never worked with C64 personally, don't really have a use for it since I can do everything in FASM generally; do post a link some time if you ever make something from it. From what I know it's a bit overly complex compared to most other assemblers though, people say it's a lot more difficult to learn but has some advantages

It prints out the first 24 elements of the Fibonacci sequence.

Sorry about my formatting.

But why

Dos box is always a option.. Or I dunno you might try using nasm's -t option.

Master over the hardware.

Intel or AT&T syntax?

I prefer gas AT&T syntax because It seems more explicit about whats going on in the code.

The C64 is amazing to get started with ASM (or the superior stack based alternative). The problem is that the clean ISA of the 6510 will soften your stomach and you might puke your guts out when learning x86_64.

I can't find a book that teaches with AT&T, but it's just a minor inconvenience

Intel

At&t syntax is always painful to read. I see no reason to prefix constants with "$" and registers with "%".

but what if I want a variable named rax? :$)

faggot

>at&t style
absolutely haram

"Professional Assembly Language
Book by Richard Blum"

Its a good book.

It teaches IA-32(32 bit assembly )tho. The vast majority of the teachings translate over to AMD64(64 bit assembly).

When you know how to programming a 32 bit possessor learning 64 bit assembly will only take only a few references to read rather than having to relearn a whole new ISA. AMD64 is fully backwards compatible with IA-32 so everything you learn applies to your modern 64 bit possessor.

LORD FOUR QUADS

mirror mirror on the wall, which syntax is the best of all?

You will probably like the book Computer Systems: A Programmer's Perspective. More specifically the third chapter

Forgot about this book. I used to have the second addition for school. Was EVERY good. Very recommended.

>Sup Forums
>assembly
So meme thread?

>Computer Systems: A Programmer's Perspective
cheers user

Fuck off you shit poster. Go back to your 'battlestation' thread.

Just found this no HockeyNews.

ecee.colorado.edu/ecen4553/fall12/asm64-handout.pdf

you're the shitposter

trying to talk about actual technology topics on a consumertard electronics section of a cambodia puppet craft bbs

what a fucking meme

go back to your pseudo intellectual subreddit

This was covered in my ASM class.
Basically we reviewed the code that single loop in C would generate. I can't remember what exactly was in the loop body but it was something relatively simple. It generated about 355 lines of assembly. I can write the same in about 12 lines of assembly.
So what's the point? Total control and speed.
It's why assembly is still preferred for satellites.

What's wrong with NASM syntax?

> assuming everyone uses reddit

You're the sort of faggot that's completely fucked Sup Forums over the years. I hope you get bladder cancer & end up leaking in to a plastic bag for the rest of your days.

>It's why assembly is still preferred for satellites.
the main reason for this is because the satellite is running hardware that may not have a C compiler made for it

>get bladder cancer & end up leaking in to a plastic bag for the rest of your days.

this is kinda me. ama, i guess.

That's a reason. Not the main reason.

>this is kinda me.
Elaborate. Are you okay, m8?

tfw AT&T will always be better than Intel
go suck a horsedick :)

yeah, i used to be into sounding.
now i piss into a bag

What? More details.

S-So I shouldn't get into sounding?

>more details
i put a straw in and blew through it, kinda got infected. didn't want to go to doctors for it.

>So I shouldn't get into sounding?
feels great, don't do anything stupid though

>didn't want to go to doctors for it.
Did they cut your dick off?

no, i still have my dick.

I did mips at college, it was awesome desu. Normies hated it though. For some reason never made a complier for what i remember, i guess my uni is kinda shit.

So, you lost your bladder? Why are you pissing in a bag?

>tfw when you crack every program you need because you spent all those nights learning reverse engineering when idiots your age went out to listen to some 1 2 3 3 2 1 music

can you /denuvo/?

Teach me your ways, master.

Probably going to start a YouTube channel like terry writing and uploading code to my Allwiener A64 arm board in ASM and making my own meme OS, i'm excited guise

Well, link the channel.

share channel

maybe later xd

You filthy fucking tease.

if you're a good boy maybe i'll indulge later~

I-I'll be good.

What language are you gonna make your memeOS in? Terry made his own language. You gonna do the same?

Writing code in assembly isn't magically faster than writing the same code in some other language. Compilers aren't stupid.

good boys get large large buns and lollipops~

my plan is to make a nanokernel / exokernel in complete ARM64 assembly for performance reasons, and on top of that develop a C kind of an userland where I'll have advanced memory managament networking etc. I don't plan to write my own languages right now. I'll also be doing a 3d cheese pizza mmorpg (hope jewtube doesnt close my channel for that l0l)

Is there a website with assembly programming challenges similar to exercism.io?

Go get arrested, you sick fuck.

I really don't like WROX books, most authors using this publisher like beating around the bush and when they do get to the topic at hand they omit a lot of useful information.

someone's been molested as a child I take it

I usually just look for generic programming challenges and do them in assembly.

It's shit and the reason I dropped out of college.
>class made me use masm
>couldn't afford Windows
>too shy to go to computer lab to do work

>willingly putting things in your cock
You can't possibly be this stupid.

>not pirating
you must be trolling nigger

Wow, you sound just like me.

Failed it twice, CSC 3410

What's the best resource to learn assembly from?

Next you're gonna tell me not to put things into my butt.

lmao
what processor

not plastic things ;o

>what processor
You mean architecture.
M8, wtf? I have a pretty shitty transcript but I can tell you're smart. You just took a sudden downturn one semester. That's a classic symptom of depression, maybe you should talk to someone.