Well we can certainly do that much.
Code:
steven@riemann:~/src/PLASMA-opc6$ cat hello.pla
word i
asm putc
pop r10, restk
push r10, restk
out r10, r0, charout
mov pc, rlink
end
asm putln
EQU charout, 0xfe09
mov r10, r0, 10
out r10, r0, charout
mov r10, r0, 13
out r10, r0, charout
;* We must return a value; we just return zero.
push r0, restk
mov pc, rlink
end
def puts(str)
byte len, c
len = ^str
while len > 0
str++
putc(^str)
len--
loop
end
def puti(i)
if i < 0; putc('-'); i = -i; fin
if i < 10
putc(i + '0')
else
puti(i / 10)
putc(i % 10 + '0')
fin
end
def hello(i)
word j
puts("Hello AnyCPU! ")
for j = i to i + 5
puti(j)
putc(' ')
next
putln()
end
for i = 1 to 10
hello(i)
next
done
steven@riemann:~/src/PLASMA-opc6$ ./doit.sh hello.pla
[...]
steven@riemann:~/src/PLASMA-opc6$ python output.py emuout.txt
Hello AnyCPU! 1 2 3 4 5 6
Hello AnyCPU! 2 3 4 5 6 7
Hello AnyCPU! 3 4 5 6 7 8
Hello AnyCPU! 4 5 6 7 8 9
Hello AnyCPU! 5 6 7 8 9 10
Hello AnyCPU! 6 7 8 9 10 11
Hello AnyCPU! 7 8 9 10 11 12
Hello AnyCPU! 8 9 10 11 12 13
Hello AnyCPU! 9 10 11 12 13 14
Hello AnyCPU! 10 11 12 13 14 15
I must admit I'm quite chuffed to have got this far.
Thanks to you all for your help...