; This places line numbers in the file when debugging ~1,$I&\N) ; -------------------------------------- ; Can you guess what language this is. ; -------------------------------------- / program tst gbl1: .word 5,6 gbl2: .word 377,-1 optimize using r2 auto int,base,a ;note `a' it's not the same `a' as in ;the fact function below. extern gbl1,gbl2 ;this puts these in the symbol table ;mostly for the debugger function main[argc,argv] if argc le 1 printf "usage: factorial n" ;if no value given ret 4 ;severe error fi a := 20 ;lets compute the base base := a / 2 ;just for this example int := val[.argv[1],base] ;get 2nd cmd line arg r3 := 15 r4 := a + base ;and convert to binary printf "factorial of %d = %d" int,fact[int] ;does all work here ;with call to fact ret 1 ;successful exit status ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - auto a e%s r0 10 function fact[i] r3 := 1 a := i ;lets just use a local if i le 1 ret 1 else ret i * fact[] fi .end