the Design of Chasm

Christopher Li chrisl at gnuchina dot org

v0.1, 26 Feb 2001

This document describe some design idea of the Chasm

1. C and Assember

The goal of Chasm is to make writing assember code easie without impairing the power of assember, which make the target code small and fast.

But writing assember is much slower than writing C. Chasm try to fill in the gap here. To retain the power of assember, chasm will following some rules:

1.1 Keep machine status insistent

Avoid generate the instruction which will change the machine status unless it is explicitly told to do so. machine status refer to CPU register,Most condition jmp instruction can fall in this catalog.

1.2 Always left the option for user to optimized by hand

That is something I learn from nasm. Chasm will try to generate optimized code without futher instruction of how to doing it. But the user can always explicitly sepcify the perfer way.

2. Chasm enhanced feature

2.1 flow control

the flow control statment is borrow from C. The flow control is base on the condition jmp instruction, e.g. in i386 that is ja,jz,jcxz, etc. Those instruction did not change any register nor condition flag. So the n condition branch need n condition jmp instuction.

2.2 condition expression compile

2.3 complex macro and local macro

2.4 structure and union

2.5 procedure define and call

3. Other CPU architecture supporting