This paper discusses a method for developing efficient and portable software for 8-bit microprocessors used in real-time applications. The technique used is to design an 'intermediate level language' (ILL) which defines low-level primitives to support the real-time application programming and the constructs of high level languages. Thus, the high level language (HLL) program goes through two stages of translation; first to the ILL code and then to the machine code of a microprocessor. The ILL instruction set developed bridges the gap between high level languages and the poor instruction set of microprocessors. This allows the development of optimized and portable code for the microprocessors. The ILL operations, data types, data organization, control structures, synchronization, communication and multi-tasking facilities are described. The effectiveness of this technique is shown by comparing the code generated by the ILL approach with the code available for a sample real-time application written directly in assembly level language. could be Ada, Concurrent Pascal or some similar language. In the ILL design approach the high level language (HLL) program is not directly translated to the target microprocessors' code. Rather, it goes through two steps in compilation. It is first compiled to ILL code and then translated to machine code. The compilation to intermediate code allows portability of the software. Using the two ste compilation process, the N*M compiler problem is reduced to the A:+M problem.'Also, microprocessor independent optimization can be done during translation from H L L to ILL, thus keeping the I L L to machine code translators fairly simple.In the design of an ILL it is useful to have an abstract machine which helps to clarify the concepts and reduces the number of design decisions that would otherwise be required.' The abstract machine presented here possesses the characteristics of the class of 8-bit microprocessors. The emphasis is on the fundamental handling, allocation and accessing of data in the ILL.The paper is organized as follows. First, the abstract machine is defined in terms of its registers and the possible addressing modes for accessing data from the memory.Secondly, the basic ILL data operations are described. Four I L L data types presented are sufficient to represent any simple or structured H L L data types. Thirdly, the data organization issues of static and dynamic allocation of program data are discussed. Special attention has been given to the activation records for procedures. Fourthly, the multi-tasking organization of application programs is investigated. The issues discussed are the information contained in process descriptors, efficient implementation of queuing and serving, and general H L L synchronization and communication primitive implementation. A three priority level ready queue and two I L L synchronization primitives are proposed. Lastly, a comparison analysis and evaluation of the technique is given for a sample application.
ABSTRACT MACHINEThe P-code impleme...