TriOS-alt/zubehör/sphinx/spinx100225-ori/sphinx1/echo.spn

41 lines
707 B
Plaintext

_clkfreq = 80_000_000
_clkmode = xtal1 + pll8x
obj
term: "isxtv"
f: "sxfile"
pub Main | e
Err( \Echo )
Err( \Bye )
pri Err( e )
ifnot e
return
if e < 0
term.str( string("Error ") )
term.dec( e )
else
term.str( e )
term.out( 13 )
con MAXARGSSIZE = 40
pub Echo | p, n
if f.Open( string("args.d8a"), "R" ) <> 0
return
n := f.ReadByte
term.dec( n )
term.str( string(" args", 13) )
f.Read( @buffer, MAXARGSSIZE )
f.Close
p := @buffer
repeat while byte[p]
term.str( p )
term.out( 13 )
p += strsize(p) + 1
pub Bye
f.Open( string("sphinx.bin"), "R" )
f.Execute( 0 )
var byte buffer[MAXARGSSIZE]