Wang Shuang-assembly language-comprehensive study one-building a simple C environment

Source: Internet
Author: User

(a) learning process:

The whole process is divided into two parts:

First: Copy the TC2.0 environment to a DOS virtual machine using a virtual floppy disk:

Open Winimage,fileànew, because the TC2.0 environment is extracted after 2.02M, so we choose 2.88M in standard format.

Put the TC folder in. Save.

Load a good floppy disk in a DOS virtual machine. At this time a:\ inside has TC2.0 all files.

The words in the book are quoted here:

after we put a program copy of an empty directory, this directory is only this one program, and then we run it, it can run correctly, we think that the program does not need other files in operation. However, it is possible that it uses other files in the run, not in the current directory, but rather through the system-set search path to find the relevant files.

The solution in the book is to copy all the files to the D:\tc2.0 directory. It is considered that this directory is not likely to be TC2.0 set as the search directory for related files.

That put into the a:\ in theory and into the d:\ effect similar.

My practice is to put it here first, if A:\ is set to the TC related files in the search directory, then continue to follow the book on the steps of the time must encounter different. You can then verify that the directory is set to the search directory for TC-related files. Here I first as a:\ and D:\tc2.0 directory effect is the same, with this problem continue to go down, to obtain verification.

Second: study to see which files the TC compilation link must use

Build the Minic and copy the Tc.exe to the Minic directory.

Run Tc.exe to clear the TC work path.

Writing a program simple.c

After the compilation is complete, there is no error message, Simple.obj can be generated.

When you continue linking

A prompt message appears: "Unable to open input file ' c0s.obj '"

(This can also prove a:\ It's not TC2.0 . Search directory for related files)

Copy the c0s.obj into the c:\minic;

Compile the message again: "Unable to open input file ' Emu.lib '"

(Here the picture is not repeat)

Copy the emu.lib into the c:\minic;

Compile the message again: "Unable to open input file ' Maths.lib '"

Copy the maths.lib into the c:\minic;

Compile the message again: "Unable to open input file ' Graphics.lib '"

Copy the graphics.lib into the c:\minic;

Compile the message again: "Unable to open input file ' Cs.lib '"

Copy the Cs.lib to the C:\minic

Compile successfully again, all the files required to compile the link are gathered up.

(ii) Thinking about the solutions to the problem:

Compile the required files for the link, c0s.obj,emu.lib,maths.lib,graphics.lib,cs.lib
TC Related File Search scopes: If there are settings, the search settings path. If there is no setting, search for the path where TC.EXE is located.

The role of other files in the TC environment (partial): The Include header file is the reference in the folder. TC root directory. c files are examples of TC comes with.

(iii) Think of unresolved issues: the role of numerous. exe files in the TC environment.

(iv) Research experience: We see the TC2.0 compilation environment, after streamlining can only have a limited number of files to achieve basic functionality. Other include files can be omitted. Therefore, what we see is not necessarily necessary. From another aspect, we should add more content into the system after the basic functions of the system can be realized, in order to simplify and guarantee the stability and other considerations. Such a system is complete, stable and efficient. In addition, the similarity between file and memory is that the data and control information or executable code are essentially binary information without any difference. Differentiate between how they are used by the CPU and the program writer. That's what I thought.

Wang Shuang-assembly language-comprehensive study one-building a simple C environment

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.