User guide

10.1. THE SIAL SPECIFICATION 173
call *%eax
# L K0
xorl %ebx,%ebx
# RTN
movl 4(%ebp),%eax
movl 0(%ebp),%ebp
jmp *%eax
# STRING M9001 K6 C72 C101 C108 C108 C111 C10
.data
.align 4
MA9001:
.byte 6
.byte 72
.byte 101
.byte 108
.byte 108
.byte 111
.byte 10
.text
# GLOBAL K1
.globl prog
.globl _prog
prog:
_prog:
movl 4(%esp),%eax
# G1 L1
movl $LA1,4(%eax)
# G94
ret
# MODEND
0.020>
Sial was designed as an experiment in the compact representation of algorithms
that can be just-in-time compiled easily into code for any target machine. Its sec-
ondary purpose was to allow an easy way to generate native code translat i ons of BCPL
programs givin g typically a ten fold speedup over the Ci ntcode interpretive version. An
experienced programmer can normally modify an existing Sial translator to generate
reasonable code for a new target in one or two days.
The following sections give a spe c i fic ati on of Sial and an outline of how the trans-
lator sial-386 works.
10.1 The Sial Specification
Sial consists of a stream of dire ct i ves and instructions each starting with an opcode
followed by operands. Both opcodes and operands and encoded using integers e ach
prefixed by a letter specifying what kind of value it represents. The prefixe s are as
follows: