Primoz128 wrote:
I want to know the reasons why wouldi want to learn it, cause im already trying to learn it, but im not really finding examples i need... but i do want to know what all could it be used for big stuff for example a large 3D game, or a 2D game like terraria that uses much computer resources etc... ?
Here are a some reasons taken from the wikipedia entry on assembly language:
Quote:
There are some situations in which developers might choose to use assembly language:
*A stand-alone executable of compact size is required that must execute without recourse to the run-time components or libraries associated with a high-level language; this is perhaps the most common situation. For example, firmware for telephones, automobile fuel and ignition systems, air-conditioning control systems, security systems, and sensors.
*Code that must interact directly with the hardware, for example in device drivers and interrupt handlers.
* Programs that need to use processor-specific instructions not implemented in a compiler. A common example is the bitwise rotation instruction at the core of many encryption algorithms.
* Programs that create vectorized functions for programs in higher-level languages such as C. In the higher-level language this is sometimes aided by compiler intrinsic functions which map directly to SIMD mnemonics, but nevertheless result in a one-to-one assembly conversion specific for the given vector processor.
*Programs requiring extreme optimization, for example an inner loop in a processor-intensive algorithm. Game programmers take advantage of the abilities of hardware features in systems, enabling games to run faster. Also large scientific simulations require highly optimized algorithms, e.g. linear algebra with BLAS[18][23] or discrete cosine transformation (e.g. SIMD assembly version from x264[24])
*Situations where no high-level language exists, on a new or specialized processor, for example. Programs need precise timing such as
real-time programs such as simulations, flight navigation systems, and medical equipment. For example, in a fly-by-wire system, telemetry must be interpreted and acted upon within strict time constraints. Such systems must eliminate sources of unpredictable delays, which may be created by (some) interpreted languages, automatic garbage collection, paging operations, or preemptive multitasking. However, some higher-level languages incorporate run-time components and operating system interfaces that can introduce such delays. Choosing assembly or lower-level languages for such systems gives programmers greater visibility and control over processing details.
*cryptographic algorithms that must always take strictly the same time to execute, preventing timing attacks.
*Situations where complete control over the environment is required, in extremely high security situations where nothing can be taken for granted.
*Computer viruses, bootloaders, certain device drivers, or other items very close to the hardware or low-level operating system.
*Instruction set simulators for monitoring, tracing and debugging where additional overhead is kept to a minimum
* Reverse-engineering and modifying program files such as existing binaries that may or may not have originally been written in a high-level language, for example when trying to recreate programs for which source code is not available or has been lost, or cracking copy protection of proprietary software.
* Video games (also termed ROM hacking), which is possible via several methods. The most widely employed is altering program code at the assembly language level.
*Self modifying code, to which assembly language lends itself well.
*Games and other software for graphing calculators.[25]