Jump to content

x86 Assembly

Human1235234

How easy would it be to start x86 assembly? Is it even practical? What tools would I use?

Link to comment
Share on other sites

Link to post
Share on other sites

Being able to write assembly still has its occasional use but at this point its more beneficial to be able to read assembly. Being able to understand what is happening in a C/C++ assembly is beneficial for understanding what operations are going on when analyzing performance sensitive code. More often than not you won't actually write any assembly since modern compilers are highly intelligent when it comes to translating higher level source code. Still worth while to learn though. 

 

With that said when you create a C++ project with Visual studio it includes the assembly tools (MASM) and you can add assembly files to the solution as well. 

https://docs.microsoft.com/en-us/cpp/assembler/masm/masm-for-x64-ml64-exe?view=msvc-160

CPU: Intel i7 - 5820k @ 4.5GHz, Cooler: Corsair H80i, Motherboard: MSI X99S Gaming 7, RAM: Corsair Vengeance LPX 32GB DDR4 2666MHz CL16,

GPU: ASUS GTX 980 Strix, Case: Corsair 900D, PSU: Corsair AX860i 860W, Keyboard: Logitech G19, Mouse: Corsair M95, Storage: Intel 730 Series 480GB SSD, WD 1.5TB Black

Display: BenQ XL2730Z 2560x1440 144Hz

Link to comment
Share on other sites

Link to post
Share on other sites

8 minutes ago, Human1235234 said:

How easy would it be to start x86 assembly? Is it even practical? What tools would I use?

I was an assembly programmer.

It took years of therapy to expunge that crap from my brain.

 

I'm only partially kidding.

 

Assembly was needed when you wanted to squeeze every last drop of performance out of a single-core several hundred MEGAHERTZ CPU. Now that we have multi-core Gigahertz, it's less critical.

 

Assembly is a monumental PITA to program, what do you need it for?

NOTE: I no longer frequent this site. If you really need help, PM/DM me and my e.mail will alert me. 

Link to comment
Share on other sites

Link to post
Share on other sites

16 minutes ago, Radium_Angel said:

I was an assembly programmer.

It took years of therapy to expunge that crap from my brain.

 

I'm only partially kidding.

 

Assembly was needed when you wanted to squeeze every last drop of performance out of a single-core several hundred MEGAHERTZ CPU. Now that we have multi-core Gigahertz, it's less critical.

 

Assembly is a monumental PITA to program, what do you need it for?

PITA?

 

 

I just want to learn as a project.

Link to comment
Share on other sites

Link to post
Share on other sites

17 minutes ago, trag1c said:

Being able to write assembly still has its occasional use but at this point its more beneficial to be able to read assembly. Being able to understand what is happening in a C/C++ assembly is beneficial for understanding what operations are going on when analyzing performance sensitive code. More often than not you won't actually write any assembly since modern compilers are highly intelligent when it comes to translating higher level source code. Still worth while to learn though. 

 

With that said when you create a C++ project with Visual studio it includes the assembly tools (MASM) and you can add assembly files to the solution as well. 

https://docs.microsoft.com/en-us/cpp/assembler/masm/masm-for-x64-ml64-exe?view=msvc-160

Thanks for your help

Link to comment
Share on other sites

Link to post
Share on other sites

The only time I'd consider assembly is when I can save a few cents a piece on an order of 100k units of a microcontroller, as assembly code MAY use less memory and therefore may fit in a cheaper microcontroller that has less built in memory.

 

For small quantities, it's not worth it... it takes more time for a developer to code something, it takes more time (and money) for another developer to pick up where another left off, all for very small improvements.

 

These days you'll find hand written x86 assembly mostly in very tight and critical paths of programs and in optimizations, like for example in audio video codecs.

For anything else, it's not worth it.

 

If you want to learn something, go learn Go (golang) and then do some web assembly from there,  or maybe play with freepascal  and decompile the programs it generates and see the assembly code.

Link to comment
Share on other sites

Link to post
Share on other sites

10 minutes ago, Human1235234 said:

PITA?

 

 

I just want to learn as a project.

Pain In The A....

NOTE: I no longer frequent this site. If you really need help, PM/DM me and my e.mail will alert me. 

Link to comment
Share on other sites

Link to post
Share on other sites

I highly encourage learning even though it's impractical in 99.99% cases. The importance of understanding it supersedes the impracticality. Also do well to emit ASM from some language and compare, optimized vs not optimized etc. Keep in mind that a modern x86 instruction set (with extensions and stuff) is huge and you will not learn all of it anyway. Consider starting of with Intel 8088 (you can use DosBox and Turbo Assembler) for a start, or even going ARM or RISC-V.

Link to comment
Share on other sites

Link to post
Share on other sites

FASM is a mostly sane compiler which comes with a built-in linker and allows one to write (theoretically) portable ASM code.

Write in C.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×