Update
This commit is contained in:
parent
3fe12a0939
commit
651f779374
25 changed files with 1986 additions and 1969 deletions
|
@ -14,6 +14,8 @@ To be precise, a typical assembly language is actually more than a set of nickna
|
|||
|
||||
**How will programming in assembly differ from your mainstream high-level programming?** Quite a lot, assembly is extremely low level, so you get no handholding or much programming "safety" (apart from e.g. CPU operation modes), you have to do everything yourself -- for example assembly languages are **untyped**, i.e. no one is going to offer or check your data types, everything is just 1s and 0s. You will also be dealing with things such as function [call conventions](call_convention.md), call stack and call frames, [interrupts](interrupt.md), overflows, [system calls](syscall.md) and their conventions, counting CPU cycles of individual instructions, looking up exact hexadecimal memory addresses, studying opcodes, defining memory segments, dealing with [endianness](endianness.md), raw [goto](goto.md) jumps, manual [memory management](memory_management.md) etc. You have no branching (if-then-else), loops or functions, you make these yourself with gotos. You can't write expressions like `(a + 3 * b) / 10`, no, you have to write every single step of how to evaluate this expression using registers, i.e. something like: load *a* to register *A*, load *b* to register *B*, multiply *B* by 3, add register *B* to *A*, divide *A* by 10. As said, you don't have any [data types](data_type.md), you have to know yourself that your variables really represent let's say a signed value so when you're dividing, you have to use signed divide instruction instead of unsigned divide -- if you mess this up, no one will tell you, your program simply won't work. And so on.
|
||||
|
||||
**Is assembly usable for programming complex programs?** Yes, it's perfectly possible and usable unless you're a retard, games such as Roller Coaster Tycoon or Pokemon Crystal were written in assembly, there is no reason why anything of any complexity couldn't be written in assembly.
|
||||
|
||||
## Typical Assembly Language
|
||||
|
||||
Assembly languages are usually unstructured, i.e. there are no control structures such as `if` or `while` statements: these have to be manually implemented using labels and jump ([goto](goto.md), branch) instructions. There may exist macros that mimic control structures. The typical look of an assembly program is however still a single column of instructions with arguments, one per line, each representing one machine instruction.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue