AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   Solved Coding with assembler in SourcePawn (https://forums.alliedmods.net/showthread.php?t=300493)

2010kohtep 08-19-2017 00:40

Coding with assembler in SourcePawn
 
Good day.

Is there any way to code in SourcePawn using assembler opcodes? As far as I know, you have ability to write asm code in Pawn by using "#emit" compiler directive, but SourcePawn compiler doesn't know about it (no matter what I tried, always the same error "unknown directive"). Any ideas about this? Thanks.

Lux 08-19-2017 01:08

Re: Coding with assembler in SourcePawn
 
You can use assembler opcodes in the older compiler 1.6.4v however you won't beable to compile the new syntax with it.

2010kohtep 08-19-2017 02:25

Re: Coding with assembler in SourcePawn
 
Lux,
It's helpful information, thank you, but here's another question, if you don't mind. Can memory of SourcePawn plugins interact with memory of DLL/SO libraries? For example, I want to put address of global variable of my plugin in x86 assembly code as argument of "push" or "call" instructions. Is it possible?

asherkin 08-19-2017 03:21

Re: Coding with assembler in SourcePawn
 
No, SourcePawn by itself is sandboxed into its own memory space - you need to use natives provided by SourceMod to access the outside world.

SourcePawn is a VM language, the assembly you write for it is using SourcePawn opcodes, not x86 assembly.

2010kohtep 08-20-2017 06:22

Re: Coding with assembler in SourcePawn
 
Got it, thanks for help everyone.


All times are GMT -4. The time now is 23:16.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.