是Windows exe文件汇编......? [英] Are Windows exe files assembly...?

查看:121
本文介绍了是Windows exe文件汇编......?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨!

这是我关于CodeProject的第一个问题(我离开了Stackoverflow)。

我一直在考虑为Windows制作自己的编程语言,但我不喜欢甚至知道exe文件实际上是什么(!)。前段时间,有人告诉我他们是二进制文件,但肯定是错误的,因为相同的exe文件不能在另一个操作系统上运行。并且不同的处理器有不同的二进制文件,但是同一个exe文件运行多个处理器。这些是我的问题:



Windows exe文件是用汇编语言编写的吗?如果没有,那么用什么语言?



从哪里可以学习编写exe文件的语言?



如果有人可以帮我这些,我真的很感激他们的帮助。

Hi!
It's my first question on CodeProject (I left Stackoverflow).
I've been thinking about making my own programming language for Windows but I don't even know what the exe files actually are(!). Sometime ago, somebody told me that they are binary, but that for sure is wrong, because the same exe files don't run on another OS. And there is different binary for different processors, but the same exe files run of multiple processors. These are my questions:

Are Windows exe files written in assembly? If no, then in what language?

From where can I learn the language in which exe files are written?

If someone can help me with these, I'd really appreciate their help.

推荐答案

除了它之外,实际上没有单一类型的EXE(大多数)经常)是一个可执行文件。程序的实际类型在文件的标题中定义。它可以是一个直接可执行文件,我相信你的意思是二进制,或者它可以是一个文件,它是一些中间语言,如MSIL,它在运行时解释。



请查看:

- .exe [ ^ ]

- MSIL [ ^ ]



关于编写程序的语言,有很多。像C甚至汇编程序这样的语言已经用了很长时间来编写程序。现在,可以选择的语言种类更多,如C#,Java等。使用汇编程序或C编译器源代码通常会编译为本机(从操作系统的角度来看),二进制exe,而用C#编写的代码由编译器生成解释代码。
There's actually no single type for an EXE other than it (most often) is an executable file. The actual type of the program is defined in the header in the file. It can be a directly executable file which I believe you mean with binary or it can be a file that is some intermediate language such as MSIL which is interpreted at the run time.

Have a look at:
- .exe[^]
- MSIL[^]

About the language to wrote programs, there are many. Languages like C or even Assembler have been used for a long time to write programs. These days there's much more variety in languages to choose from like C#, Java and so on. Using an Assembler or a C compiler source code from those languages would have often been compiled to a native (from the OS point of view), binary exe whereas code written in C# results to an interpretative code by the compiler.


是的,exe文件(像所有文件一样)是二进制文件。但是,二进制内容的结构采用特殊格式,Windows操作系统可以读取并加载到要运行的内存中。谷歌将找到解释中间.obj文件结构的论文,这些文件是从源代码创建的。此外.exe文件是从.obj和.lib文件创建的,以生成最终的可执行文件。如果您打算发明一种新语言,那么您还需要了解编译器如何将源语言转换为可重定位目标代码。
Yes, exe files (like all files) are binary. However, the structure of the binary content is in a special format that the Windows OS can read and load into memory to be run. Google will find you papers that explain the structire of intermediate .obj files, which are created from source code. Also .exe files which are created from .obj and .lib files to make the final executable. If you are planning to invent a new language then you also need to understand how compilers turn source language into relocatable object code.


Windows exes使用多种语言编写:如果编译为一个EXE文件,它已被使用。

所以...汇编程序,C,C ++,C#,VB,Pascal,Fortran,Cobol,BrainF * ck,可能还有几十个其他人使用过。甚至Windows本身也是用C,C ++,C#编写的。有些部分可能还在装配中!



学习 a 语言。熟练掌握它。我建议你自己开始使用C#,但有些人会建议使用VB或C ++。没有人会建议你这些天开始使用汇编程序!



所以得到一本书 - Addison Wesley和Wrox做的很好 - 或者继续学习。不要试图通过随时随地学习来学习,你会错过太多重要的事情。从Microsoft获取Visual Studio的副本 - 它们可以免费使用 - 并按照课程或书籍从头到尾进行所有练习。
Windows exes are written in a range of languages: if it compiles to an EXE file, it's been used.
So...assembler, C, C++, C#, VB, Pascal, Fortran, Cobol, BrainF*ck, and probably a couple of dozen others have been used. Even Windows itself is written in C, C++, C#. Some parts probably still in assembler!

Learn a language. Get skilled in it. I'd suggest you start in C# myself, but there are those who will suggest VB, or C++. No-one will suggest you start with assembler these days!

So get a book - Addison Wesley and Wrox do good ones - or go on a course. Don;t try to learn by picking it up as you go, you will miss too many important things. Get a copy of Visual Studio from Microsoft - they do free editions - and follow the course or book from beginning to end, doing all the exercises.


这篇关于是Windows exe文件汇编......?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆