add LCC - a better C-Compiler for WEGA

This commit is contained in:
Oliver Lehmann 1990-03-14 14:13:52 +00:00
parent db57f7a8b0
commit aafb31fb68
1 changed files with 23 additions and 0 deletions

View File

@ -0,0 +1,23 @@
// Assembler program to implement the following C program
// int
// abs(arg)
// int arg;
// {
// return((arg < 0)? -arg: arg);
// }
.seg
sp := r15
SP := rr14
.psec
.code
_abs::
{
ld r2,|_stkseg+4|(sp)
test r2
ret pl
neg r2
ret
}