kornalius
08-25-2006, 01:47 AM
Let me be the first one to share a little piece of code to show you the power of the PASM (PPL Assembler).
This sample piece of code was written some time ago to test the power of the PASM. Remember the PASM is cross-platform, any piece of code you write with it is compatible between the PC and PocketPC, no compiling required, it's dynamically compiled.
The code creates a string variable that can hold 10 characters. The assembly code moves some ASCII values into the variable and then the result is printed to the console.
#include "console.ppl"
func WinMain;
InitConsole;
ShowConsole;
sdim(StrVal$, tbyte, 10);
asmCall$ = asm(1024, {
#DEASM
:main
mov r0, StrVal$
mov WORD r2, 255
mov BYTE r1, 10
mov BYTE [R0], 65
mov BYTE [R0+1], 66
mov BYTE [R0+2], 67
mov BYTE [R0+3], 0
pplpush StrVal$
ppl ptr
ppl Writeln
});
callasm(asmCall$, 20, 30);
writeln("Test3 " + StrVal$);
freeasm(asmCall$);
return(true);
end;
This sample piece of code was written some time ago to test the power of the PASM. Remember the PASM is cross-platform, any piece of code you write with it is compatible between the PC and PocketPC, no compiling required, it's dynamically compiled.
The code creates a string variable that can hold 10 characters. The assembly code moves some ASCII values into the variable and then the result is printed to the console.
#include "console.ppl"
func WinMain;
InitConsole;
ShowConsole;
sdim(StrVal$, tbyte, 10);
asmCall$ = asm(1024, {
#DEASM
:main
mov r0, StrVal$
mov WORD r2, 255
mov BYTE r1, 10
mov BYTE [R0], 65
mov BYTE [R0+1], 66
mov BYTE [R0+2], 67
mov BYTE [R0+3], 0
pplpush StrVal$
ppl ptr
ppl Writeln
});
callasm(asmCall$, 20, 30);
writeln("Test3 " + StrVal$);
freeasm(asmCall$);
return(true);
end;