User guide
180 CHAPTER 10. THE DESIGN OF SIAL
LF L2
K P4
ATBLP P3
MUL
RTN
GLOBAL K1
G1 L1
G94
MODEND
10.2 The sial-386 Translator
The source of an unoptimi se d Sial transl ator that gener at e s Intel 386 assembly language
is com/sial-386.b. It is a simple program about 750 lines based on the sial-sasm
program. This version was implemented before the floating point instructions were
added to Sial. It generates the readable version of the Sial source as comments inter-
spersed with the corresponding Intel 386 translations. For the example, program given
above it outputs the following assembly language.
# Code generated by sial-386
.text
.align 16
# MODSTART
# SECTION K4 C102 C97 C99 C116
# Entry to: start
# ENTRY K5 C115 C116 C97 C114 C116
# LAB L1
LA1:
movl %ebp,0(%edx)
movl %edx,%ebp
popl %edx
movl %edx,4(%ebp)
movl %eax,8(%ebp)
movl %ebx,12(%ebp)
# L K1
movl $1,%ebx
# SP P3
movl %ebx,12(%ebp)
# LAB L4
LA4:
# LP P3
movl 12(%ebp),%ebx
# ATB
movl %ebx,%ecx
# LF L2
leal LA2,%ebx
# K P9
movl %ebx,%eax
movl %ecx,%ebx
leal 36(%ebp),%edx
call *%eax