After studying C language, the story of implementing the CASL II processing system

Introducing my CASL II processing system YACASL2 created in C language.

CASL II is an assembler (assembly language) used in the Basic Information Technology Engineer Examination. Assembler is usually compatible with a particular computer or CPU. However, the CASL II assembler is an assembler designed for non-existent virtual computers in terms of test fairness.

The reason for creating the CASL II processing system was "Nikkei Software", which was published in the February 2009 issue of Kawamata. Akira's article "CPU emulator made in C language" was read. Nikkei Software reporter Kunihiro Saito, who introduced this article, It's always fun to know how computers work Seems to be still readable online (as of August 2020). The source code (C language) introduced in this article did not seem to be available for download now.

Since I took the Ichiou Basic Information Technology Engineer Examination, I thought I knew the outline of CASL II. However, I first learned about the appeal of CASL II as a tool for understanding how computers work in an article by Mr. Kawamata. It also gave me an opportunity to learn about "virtual computers," which were beginning to become a hot topic at that time. Above all, I was shocked to be able to create my own virtual computer system, CASL II.

Significance of CASL II

Is it meaningful to learn from CASL II? I almost never use it in practice. Perhaps this is a question that anyone who has had to come into contact with CASL II in class or exams has.

In response, eel3 gave a vivid answer that "CASL II is a tool for thinking" [FizzBuzz](https:: //ja.wikipedia.org/wiki/Fizz_Buzz) is shown with the code.

I also think that CASL II, a simple assembler, can be a basis for learning other assemblers or a warm-up. Unfortunately, I haven't had a chance to touch other assemblers so far, and I can't prove that it really is ...

Significance of CASL II implementation

For those who are learning C language, there are many people who are worried about the next stage after mastering the introductory book. Many C language technologies (peripheral technologies) can only be realized in value if they are programs of a certain size or larger. Introductory books, including K & R, cover only small programs, so there are many techniques that you cannot acquire even if you read these books. ..

When creating a program of a certain size or larger, it is often difficult to determine (search for) the material, or rather the specifications. In the case of CASL II, there is a highly complete specification prepared for human testing, so the specification It can be said that it is blessed with. With that in mind, I think CASL II (and a relatively simple virtual computer) is the next step in the introductory book.

In implementing the CASL II processing system, I learned how to use the following techniques and tools:

While thinking about the regression test of YACASL2, I also created my own general-purpose test tool Autotest.mk. It is a test framework tool for programs written in C language.

In addition to virtual computers such as CASL II, a self-made text editor seems to be interesting as the next step of the introductory book. For that reason, I have high expectations for Advent Calendar 2016 to create your own editor!

Recommended Posts