PDA

View Full Version : PASM issues


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.

kornalius
12-29-2009, 04:54 PM
Will look into this, thanks.

Nicknack
12-29-2009, 07:21 PM
I'm not sure if I have used it correctly, but I think DoAsm has also flaws.

kornalius
12-30-2009, 08:36 PM
I'm not sure if I have used it correctly, but I think DoAsm has also flaws.

Please give me a sample piece of code I can test with.

(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!

Fixed both issues.