KPL 语言

编译过程

编译 package Hello 生成 Hello.s

kpl Hello

编译 Hello.s 生成 Hello.o

asm Hello.s

combine all of the ".o" object files into an executable file

lddd System.o Hello.o Runtime.o -o Hello

with the "-o" option , the new file will be named "Hello" or will be "a.out"

To run the package "Hello"

blitz -g Hello

"-g" means run it directly

After execution completes,enter "q" to quit

The Header and Code Files

A program is made of several packages and each package is described by a header file and a code file

The header file is the specification for the package. It provides the external interface to that package,giving all information other packages will need about what is in the package. In the Hello-World example, the file “Hello.h” specifies the package will contain a function called “main” and tells what parameters this function takes and returns. (The main function takes no parameters and returns no results.)

The code file contains the implementation details for the package. All executable code appears in the code file. In the Hello-World example, the “Hello.c” file contains the actual code for the main function

编译过程

直接输入 make,在文件夹内会根据 makefile 中的规则编译所有文件
再次输入 blitz -g os 运行所有代码

https://github.com/ayushishri/OS-Blitz-Labs

赞赏