4 ms·
I have had a similar experience: compiling my little text adventure in Liberty Basic took almost a minute. When my older brother told me that assembler DOESN'T
by pgsandstrom 14y ago
I have had a similar experience: compiling my little text adventure in Liberty Basic took almost a minute. When my older brother told me that assembler DOESN'T NEED TO COMPILE, I was completely awestruck. I did write a text adventure in assembler, but it didn't have the same slick "windowy" feel that I was so in love with 15 years ago. But I returned to LB as a better programmer.
- grapjas 14y ago>But I returned to LB as a better programmer. In what way? (Not meant to be accusing, just curious)
- VMG 14y agobut assembler does need to compile
- stephencanon 14y agoNo, it needs to be assembled.
- jrajav 14y agoTranslating assembly to machine code is a trivial compilation, but technically it is still compiling. Compiling is just translating source code in one language into code in another.
- vitno 14y agonot really... Assembly is a one-to-one mapping with machine code. 2 (fast) passes, and you are done. Compiling entails far more complex operations. while I understand that you are saying that the action of assembling is just trivial compiling, I think that compiling implies, and perhaps even means, certain operations and steps that just aren't present in an assembler.
- ctdonath 14y agoLong-standing convention is assembling != compiling. You touched on the reason: compiling is translating one language to another. Assembly code is not changing language, just replacing symbols from human-convenient to machine-convenient, more like encryption. You wouldn't consider Pig Latin a different language from English, it's just a straightforward mangling thereof.
- dkersten 14y agojust replacing symbols from human-convenient to machine-convenient Its not quite a one-to-one mapping though. For example, there are assembly instructions which map to more than one opcode, depending on how it is used and opcodes can have various flags that change its encoding (prefixes and such), like the MOV x86 instruction. Beyond that, it is also rare to find assembly code which does not make use of macros or assembler-implemented pseudo instructions. http://stackoverflow.com/questions/2546715/how-to-analysis-how-many-bytes-each-instruction-takes-in-assembly/2761248#2761248 http://stackoverflow.com/questions/2546715/how-to-analysis-h...
- stephencanon 14y agoThere is a one-to-one map between a mnemonic plus its operands and the resulting opcode, which is the relevant criteria. The use of macros doesn’t change this (though the use of pseudo-instructions can, if they force islands to be created for constants or jump tables).
- CountHackulus 14y agoFor nearly any other assembly language, like say System 390 or PowerPC, it's a straightforward 1-1 mapping. Macros and pseudo instructions more fall into the real of text pre-processing than compiling.
- chc 14y agoIt's only barely more 1-1 than C to assembly is without any optimization steps. When you see a C program, you have a very good idea what the assembly will look like.
- ajross 14y agoSemantics. An assembler parses a human-readable representation and emits an executable one. That's a "compiler" in most contexts, and certainly there have been many things called "compilers" that translate simpler things than general purpose assembly code. Obviously the distinction being made is that "assemblers", even in the days of 8 bit CPUs (and earlier!) have always been able to translate at or near the speed of the I/O required to read the data. So there's an intuition that says they're "instantly fast" and thus deserve their own name.
- deleted 14y ago[deleted]