Section 2: Compiler
85
TI
-
89 / TI
-
92 Plus Sierra C Assembler Reference Manual
Not for Distribution
Beta Version February 2, 2001
double area, radius;
void circle( void )
{
area = 3.14159* radius * radius;
}
68000 C Compiler 3.2h Copyright 1987-99 by Sierra Systems. All rights
reserved.
.opt
proc=68000
.file
"test.c"
.comm
_area,10,2
.comm
_radius,10,2
; 4 double area, radius;
; 5 void circle( void )
.text
.align
2
.globl
_circle
.def _circle\ .val _circle\ .scl 2\ .type 0xd0020\
.endef
_circle:
link
a6,#-36
; 6 {
; 9 area = 3.14159* radius * radius;
;
fmove.d
_radius,fp0
move.l
a0,-(sp)
lea
_radius,a0
move.l
(a0)+,-10(a6)
move.l
(a0)+,-6(a6)
move.w
(a0)+,-2(a6)
movea.l
(sp)+,a0
;
fmul.d
_radius,fp0
pea
_radius
jsr
__bcd_math
.short
0x3930
;
fmul.d
#3.1415900000000000,fp0
jsr
__bcd_math
.short
0x3900
.short
0x4000
.long
0x31415900
.long
0x0
;
fmove.d
fp0,_area
lea
_area,a0
move.l
-10(a6),(a0)+
move.l
-6(a6),(a0)+
move.w
-2(a6),(a0)+
; 12 }
unlk
a6
rts
.def _circle\ .val .\ .scl -1\
.endef