ThMstr
12-29-2009, 03:58 PM
A very nice feature of PPL seemed to me the possibility of coding some parts in PASM. That would give you the speed when and where it's needed.
As suggested by the "Help" I played a bit with the PASM and made this simple code:
//Make a TInt variable
Var(Test$,TInt);
//Make the assembly-code
AsmCode$=Asm(Small,{
:Main
mov r0, 1
jmp Label
add r0, 1
:Label
mov Test$, r0
});
//Execute the assembly-code
CallAsm(AsmCode$);
Showmessage(Test$);
//Free the assembly-code from memory
FreeAsm(AsmCode$);
I see the following issues.
(1) The "Help" suggests that the format of the Asm command is: Asm(asmscript$,buffersize$). I think it's the other way around: Asm(buffersize$,asmscript$).
(2) Running the code gives the error: [Label (LABEL) not found!].
But the label is clearly present!
Theo.
As suggested by the "Help" I played a bit with the PASM and made this simple code:
//Make a TInt variable
Var(Test$,TInt);
//Make the assembly-code
AsmCode$=Asm(Small,{
:Main
mov r0, 1
jmp Label
add r0, 1
:Label
mov Test$, r0
});
//Execute the assembly-code
CallAsm(AsmCode$);
Showmessage(Test$);
//Free the assembly-code from memory
FreeAsm(AsmCode$);
I see the following issues.
(1) The "Help" suggests that the format of the Asm command is: Asm(asmscript$,buffersize$). I think it's the other way around: Asm(buffersize$,asmscript$).
(2) Running the code gives the error: [Label (LABEL) not found!].
But the label is clearly present!
Theo.