It is currently Sun Dec 17, 2017 6:30 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 11 posts ] 
Author Message
PostPosted: Sun Nov 02, 2014 3:44 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19354
Location: NE Indiana, USA (NTSC)
In this post, koitsu wrote:
P.S. -- Nitpicky terminology thing (take with grain of salt), but: assembly code is assembled, not compiled. :)

These words have precise accepted definitions:

  • Preprocess: Perform lexical macro substitution on a source code file to produce a translation unit
  • Compile: Translate a translation unit in a high-level language to a low-level language, usually assembly language
  • Assemble: Translate a translation unit in assembly language to an object code file
  • Link: Resolve references from one object code file to another and produce a larger object code file
  • Source code: "The preferred form of a work for making modifications to it" (GPLv2; GPLv3)

In order to target multiple object code formats, many compilers produce assembly language as their output instead of object code directly. These compilers ship with a "driver program" that calls the preprocessor, compiler, assembler, and linker in turn. For example, GCC includes gcc which calls cpp (the preprocessor), cc1 (the compiler proper), as (the assembler), and ld (the linker), and cc65 includes cl65 that does analogous things. But because the compiler uses the most CPU cycles of the bunch, people started to refer to the whole toolchain as the "compiler":

  • Compile (colloquial): source code goes in, object code comes out.

This process also happens to cover what an assembler does. Is there a better verb than "compile" to refer to translating a program whose source code is in either C or assembly language to object code?


Top
 Profile  
 
PostPosted: Mon Nov 03, 2014 2:31 am 
Offline
User avatar

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7320
Location: Chexbres, VD, Switzerland
I have also been scolded by someone on 6502.org because I said I was "compiling 6502 assembly code" or something like that. But for me compile is a more generic term, while "assemble" is a specific term. Therefore for me both are correct.

Saying you assemble a high level language would definitely be wrong, though.


Top
 Profile  
 
PostPosted: Mon Nov 03, 2014 10:39 am 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 5899
Location: Canada
There is a time and a place where compile needs to mean just one specific thing, like the "compile" stage when building a C++ project. It is usually quite clear by the context when this meaning is required.

Otherwise, yes it's fine to "compile" assembly code. It's fine to "compile" a build (compile and link, assemble and link). It's fine to "compile" a CHR file (process a PNG into CHR data). It is a very broad and useful term this way.


Top
 Profile  
 
PostPosted: Mon Nov 03, 2014 11:28 am 
Offline
User avatar

Joined: Sun May 27, 2012 8:43 pm
Posts: 1312
I don't know, I think discarding specific meaning of a technical term in favor of having something "easier" to say colloquially isn't a great thing. I think a lot of situations where "compile" is used to describe the general process of "source and resources in, binary out" can be better generalized with "build".


Top
 Profile  
 
PostPosted: Mon Nov 03, 2014 12:16 pm 
Offline
Formerly 65024U

Joined: Sat Mar 27, 2010 12:57 pm
Posts: 2257
When talking about assembly, the only difference is the semantics are exactly what is defined by the processor. I would say both are correct for assembly code. Only when I talk about C am I strict about calling it assembling from the people I help out with this stuff.


Top
 Profile  
 
PostPosted: Fri Nov 07, 2014 2:10 pm 
Offline
User avatar

Joined: Sat Feb 16, 2013 11:52 am
Posts: 236
I'm joining binary program data and character data in one binary file, plus information about target hardware and sometimes even a second ROM chip (character ROM), you could say it's a very extensive compilation of data :P


Your description of being scolded on 6502.org sounded like people that go nuts if you say "Linux" instead of "GNU/Linux" :lol:

_________________
This is a block of text that can be added to posts you make. There is a 255 character limit.


Top
 Profile  
 
PostPosted: Fri Nov 07, 2014 4:17 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19354
Location: NE Indiana, USA (NTSC)
"Linux" is correct when referring to GNU/Linux, Android, and embedded stuff put together.

If you happen to be in Finland in July and August, I challenge you to go to Assembly and say it should be called "High Level Language" because PC demos aren't written in 100% asm anymore.


Top
 Profile  
 
PostPosted: Sat Nov 08, 2014 2:00 pm 
Offline
User avatar

Joined: Mon Feb 07, 2011 12:46 pm
Posts: 941
The name "Linux" correctly refers to the kernel, although a GNU/Linux system is still a kind of Linux system (although sometimes it is abbreviated when it is made clear otherwise).

Also, some compilers directly convert from high-level into binary codes, and don't use an assembler. Also, there is some "high level assembler" programs, too. Furthermore there are assemblers that may include macros. A few programs may be written directly in hexcodes, and therefore don't have any source-codes. Some systems have "dependent macros", where it isn't possible to do preprocessing separately from the rest of the program. Some compilers use intermediate codes, such as LLVM. At least one assembler even allows the program to contain a custom postprocessor, which is assembled like the rest of the program but into a separate memory space, and then is executed just before writing out the data to the target file.

_________________
.


Top
 Profile  
 
PostPosted: Sat Nov 08, 2014 10:04 pm 
Offline
User avatar

Joined: Sun May 27, 2012 8:43 pm
Posts: 1312
Punch wrote:
I'm joining binary program data and character data in one binary file, plus information about target hardware and sometimes even a second ROM chip (character ROM), you could say it's a very extensive compilation of data :P


I still think of this as your build process of which assembly is one component.


Top
 Profile  
 
PostPosted: Sun Nov 09, 2014 6:48 pm 
Offline
User avatar

Joined: Sun Sep 19, 2004 9:28 pm
Posts: 3192
Location: Mountain View, CA, USA
mikejmoffitt wrote:
Punch wrote:
I'm joining binary program data and character data in one binary file, plus information about target hardware and sometimes even a second ROM chip (character ROM), you could say it's a very extensive compilation of data :P

I still think of this as your build process of which assembly is one component.

I'm in agreement here, although I would describe that process as either "generation" (you're creating something), or for the first step, concatenation.


Top
 Profile  
 
PostPosted: Mon Nov 10, 2014 2:38 am 
Offline
User avatar

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7320
Location: Chexbres, VD, Switzerland
Quote:
Your description of being scolded on 6502.org sounded like people that go nuts if you say "Linux" instead of "GNU/Linux" :lol:

No, it was more like "Youngs guys have no respect for nothing, they don't know how to use the proper terms, etc, etc..."

And by the way I've checked the doccumentation of WLA-DX, and it says everywhere "compilation", even though it's just an assembler.

Pehaps if there was a more appropriate word for the fact to transform high level language into it's low level equivalent, "compile" wouldn't be ambigious anymore and would refer to the generic transformation of any program into another form unambigiously.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group