Jump to content

Assembly

KhakiHat

Like factory?

I hAve an unfinished pc build. Pls dont bully for not having one yet or i cry.

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, KhakiHat said:

@Fruitsnacc 

 

The programming language.

I dont program so srry

I hAve an unfinished pc build. Pls dont bully for not having one yet or i cry.

Link to comment
Share on other sites

Link to post
Share on other sites

Depends where you end up i guess, and for how long you want to live.

Assembly isn't exactly a nice language to program in, most people stop using it after 1-2 years because at that point they basically reached breaking point and give up.

 

You can always learn it if you want, but imo it's more meant for embedded stuff and in that case a language like C or C++ is probably a better one to learn.

If you want my attention, quote meh! D: or just stick an @samcool55 in your post :3

Spying on everyone to fight against terrorism is like shooting a mosquito with a cannon

Link to comment
Share on other sites

Link to post
Share on other sites

13 minutes ago, Technicolors said:

assembly is pretty low-level. mostly relevant for microcontrollers 

 

are you new to programming? 

I didn't know what it exactly was used for. Not new but a beginner.

Link to comment
Share on other sites

Link to post
Share on other sites

14 minutes ago, samcool55 said:

Depends where you end up i guess, and for how long you want to live.

Assembly isn't exactly a nice language to program in, most people stop using it after 1-2 years because at that point they basically reached breaking point and give up.

 

You can always learn it if you want, but imo it's more meant for embedded stuff and in that case a language like C or C++ is probably a better one to learn.

Hmm.

Link to comment
Share on other sites

Link to post
Share on other sites

I think assembly is more suited to things like integrated circuits or drivers to be as efficient and overhead/dependency free as possible, but not much use outside of specialized projects or micro controllers.

Link to comment
Share on other sites

Link to post
Share on other sites

Unless you're ressources starved for your project , then no . Assembly programs aren't portable between ISAs . You make something for x86 , and it stays there. Porting it to ARMv8 requires a complete rewrite . By contrast , even fairly "low level" high level languages like C , just need to be recompiled for the architecture . Compilers for those high level languages have gotten pretty good too , so you generally aren't loosing much performance in C/C++ vs assembly .

 

Also , it's a huge pain . Programming any large app in assembly is a monumental task . And x86 assembly is horrible.

AMD Ryzen R7 1700 (3.8ghz) w/ NH-D14, EVGA RTX 2080 XC (stock), 4*4GB DDR4 3000MT/s RAM, Gigabyte AB350-Gaming-3 MB, CX750M PSU, 1.5TB SDD + 7TB HDD, Phanteks enthoo pro case

Link to comment
Share on other sites

Link to post
Share on other sites

@KhakiHat, assembly language is nice to be aware of, but something you almost never touch in most software development.

 

9 minutes ago, Erik Sieghart said:

There's plenty of assembly programmers out there because a lot of embedded systems use it.

Unless you're working on a really basic 8-bit processor (like something from PIC), most microcontrollers are capable of being programmed in C. Heck, I worked on an MCU with like 10K of ROM and 0.5K of RAM in C. The only time you'd ever need to touch assembly is if you need highly tuned code or you're working in the MCU before it's initialized and jumped into the application itself.

Link to comment
Share on other sites

Link to post
Share on other sites

Using ASM to get your desktop applications done is a good exercise and I can recommend you to have tried it, at least, once. While it is true that your C compiler will probably give you "better" results, low-level optimizing can teach you a lot about what you actually do, inevitably resulting in writing better algorithms in other languages.

Write in C.

Link to comment
Share on other sites

Link to post
Share on other sites

Assembly is commonly used in programming games for vintage systems.

8-bit guy made a game called planet x2 in it for the commadore 64 very recently. 

Link to comment
Share on other sites

Link to post
Share on other sites

4 hours ago, fpo said:

Assembly is commonly used in programming games for vintage systems.

8-bit guy made a game called planet x2 in it for the commadore 64 very recently. 

Even then you can find a C compiler for that :Phttps://www.c64-wiki.com/wiki/C

 

How much more efficient it is over hand written assembly is up for grabs.

Link to comment
Share on other sites

Link to post
Share on other sites

4 hours ago, M.Yurizaki said:

Even then you can find a C compiler for that :Phttps://www.c64-wiki.com/wiki/C

 

How much more efficient it is over hand written assembly is up for grabs.

Might as well code in Binary if you're going to bounce between assembly & C though. haha. 

Link to comment
Share on other sites

Link to post
Share on other sites

Even in microcontrollers nowadays you just use C and let the compiler convert that to assembly code.

Only in high volume things like toys with 100k units or more, sometimes it's worth spending a few hours hand tweaking the generated assembly code or writing the code yourself in order to save a cent or two by using a microcontroller with a few less bytes of memory or something like that.

 

You would want to learn assembly if you want to fine tune various functions in programs to speed them up, for example a video codec would want to use SSE and AVX instructions to process several pixels at a time and in such cases you may not want to rely on the compiler to guess what you're trying to do - writing your own assembly code where you know exactly how many cpu cycles each instruction adds up can be very important.

 

If you just want to start and learn programming, I'd suggest learning C (regular C, not C++), once you have a good C base you can go into C++ .. you could also go into other programming languages like Go or higher level / scripting languages like PHP, Lua, Javascript, Web Assembly etc

 

Link to comment
Share on other sites

Link to post
Share on other sites

I think that GMPLib is a good example of how to properly use assembly in today's software.  The majority of the code is written in regular languages, but they use hand coded assembly for the parts where performance matters in the most, so they don't have to worry how good/bad the compiler is at optimizing code.  In their case, they take it to the extreme by having different versions of the assembly code, tuned to specific cpu architectures O_o.  Bit overboard for my taste, but nevertheless a good example.

 

What's important to remember is that programming languages are generally designed to work on any hardware, meaning they usually only make use of the features that most of the hardware have in common, so there's almost always extra performance left in the cpu that can be exploited.

 

If you want to toy around with it, one good example would be to try inline assembly (inserting assembly into the middle of your code) which avoids some of the hassle of dealing with writing pure assembly, and is probably how you would use assembly in your real code.

 

 

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

×