[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports ] [ become a patron ] [ status ]
2023-11: Warosu is now out of extended maintenance.

/sci/ - Science & Math


View post   

File: 61 KB, 400x400, bin.jpg [View same] [iqdb] [saucenao] [google]
4341857 No.4341857 [Reply] [Original]

how to learn assembly

>> No.4341859

assemble

>> No.4341872

1) Realize it isn't that hard and not that different from most other programming languages.

2) Realize it takes an enormous amount of code to do anything neat

3) Realize you'll have to continuously practice it or you'll fall off the wagon

After that it's easy

>> No.4341874

.i486
.model flat,stdcall
.data

.code

theres your template get started
.

>> No.4341877

make sure you're learning nasm on linux and not masm cause masm has shit tools

>> No.4341878

Great online learning guide here:
http://www.cs.utah.edu/dept/old/texinfo/as/as_toc.html

Also, I don't know what your goals are for learning assembly, but it is incredibly invaluable for hacking.

Even if you aren't interested in hacking, I would still recommend reading through some stuff like this:
http://insecure.org/stf/smashstack.html
will teach you all about buffer overflows, they are really fun to do once you get the hang of it, and you can practice them on sites like this:
http://smashthestack.org/
Check out the IO wargame.

You would learn a LOT about assembly just by doing those challenges. But you need to have the basics first, which you can get from the first link in my post.

>> No.4341880

>open a program in OllyDbg
>wait till people are coming
>pretend to type fast on your computer
>click go with out any breakpoints
Look what I programmed in assembly

>> No.4341885

>>4341874
>windows

Anyway OP Assembly isn't that bad.

mov eax,2d
mov ebx,2d
add eax,ebx

Suddenly I have 4 in eax. It's like any other language, only you have to type a lot more shit out yourself.

>> No.4341886

>>4341878
>implying anyone would want to be a hacker
>implying crackers aren't god-tier
>implying everyone doesn't want to be a cracker
>implying a lot of things in a short bit of text

>> No.4341888

>>4341886
my Assembly teacher cracked the copy protection for Kings Quest and got a week off of work for giving a copy to his boss.

He won't teach us how :(

>> No.4341893

>>4341885
>mov eax,4

I optimized your shit for you faggot

>> No.4341898

Does anyone here know NASM assembly?

In MASM you can use =, equ, and textequ for symbolic representation with different uses. In NASM I can only seem to get equ to work. Does NASM have an equivalent to = and textequ?

>> No.4341905
File: 2 KB, 196x171, 1323737809423.png [View same] [iqdb] [saucenao] [google]
4341905

>get masm
>hurr your system can't support it.
>change the compatibility mode to an older os
>nope

>> No.4341911

>>4341910
>64 bit computer

;___;

>> No.4341910

>>4341905
MASM should have a 32 bit mode.

But again
>windows

>> No.4341914

>>4341911
Yes, and MASM should have a 32 bit mode. 64 bit CPUs are backwards compatible with 32 bit. Only 16 bit support was cut from Windows. I compile all my programs in 32 bit for my teacher on a 64 bit machine

>> No.4341917

>Not Programming in Real-Address mode
good idea

>> No.4341918

>>4341917
>Real-Address mode
Oh boy, back to DOS we go

>> No.4341926

>>4341917
>using a 48 bit FWORD
>1998

>> No.4341934

After learning a bit of assembly I've come to realize that before C was invented I just wouldn't have been able to use computers.

C and UNIX are the greatest inventions known to man. God bless you Dennis Ritchie. Rest in peace

>> No.4341942

Everyday I wish we never invented graphical user interfaces

>> No.4341941
File: 33 KB, 540x370, 1326871507.dennis_ritchie000.jpg [View same] [iqdb] [saucenao] [google]
4341941

>>4341934

>> No.4341946
File: 30 KB, 355x342, 1264577798660.jpg [View same] [iqdb] [saucenao] [google]
4341946

>>4341941

>> No.4341947
File: 31 KB, 550x438, manly tear.jpg [View same] [iqdb] [saucenao] [google]
4341947

>>4341941

Holy shit. That fucking picture, man.

>> No.4341950
File: 84 KB, 355x342, 1293804883602.jpg [View same] [iqdb] [saucenao] [google]
4341950

>>4341946

>> No.4341962

>>4341941
This

>> No.4341977

>>4341859

tookenated

>> No.4341980
File: 60 KB, 511x599, 511px-Grace_Hopper[1].jpg [View same] [iqdb] [saucenao] [google]
4341980

>not learning Plankalkul

>> No.4341991

It is the worst. I started with C and it was somewhat of a challenge, but it was at least interesting and reasonable. Assembly is just retarded and annoying as hell to write. Unless you are trying to write firmware or optimize some algorithm for hardware, my advice is don't.

>> No.4342013

Problem with learning assembly is that every processor has a slightly or completely different version since its mapped directly to machine code. You learn it like any other language though. Pick something you want to program in assembly, sleep only when it's done, somewhere in between you learned what to do.

>> No.4342016

>>4342013
>every processor has a slightly or completely different version
It all works the same though.

A mov is a mov no matter what you call it

>> No.4342024
File: 78 KB, 500x525, 306459_2684151511392_1484514177_2844560_827073728_n.jpg [View same] [iqdb] [saucenao] [google]
4342024

There's no real point in programming in x86, unless you want to optimize C/C++ code. I recommend using a simulator like MIPS (http://en.wikipedia.org/wiki/MIPS_architecture))

>> No.4342036

>>4342016 It all works the same though.
Except the number of bytes moved varies from system to system. The registers and addresses you can mov to and from vary from system to system. The result of an invalid address causes completely different behavior. The number of ticks to complete the operation varies between processors, etc.

>> No.4342041

>>4342024

My book on MIPS is from 1993, and the actual spimsal simulator is like from 1989 or something.

>> No.4342044

>>4342036
yes but thats all mostly trivial once you know about them on at least once system.

It's like when you learn spanish or something. You don't relearn everything about speaking, you say "how do I say X word in Spanish"

Once you know x86 Assembly, when moving to, oh PowerPC for example you'll ask "how do I define a byte, what are the 32 bit registers" ect ect and once those questions are quickly answered you can get moving right away. It's not as though you're starting over every time

>> No.4342055
File: 24 KB, 427x427, 1325208632701.jpg [View same] [iqdb] [saucenao] [google]
4342055

While we're kinda at it, has anyone here ever taken a computer architecture course or something similar? If so, how difficult did you think it was?

>> No.4342071

>>4342055
Lots of memorization for the exams. Implementing an RTOS as a class project. The way pipelines can sort of handle multiple instructions at once is like trying to imagine a hypercube at first, but it gets better.

>> No.4342076
File: 174 KB, 500x532, 9426970.jpg [View same] [iqdb] [saucenao] [google]
4342076