Raised This Month: $51 Target: $400
 12% 

Solved Coding with assembler in SourcePawn


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
2010kohtep
Junior Member
Join Date: Aug 2017
Old 08-19-2017 , 00:40   Coding with assembler in SourcePawn
Reply With Quote #1

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.

Last edited by 2010kohtep; 08-20-2017 at 06:23.
2010kohtep is offline
Lux
Veteran Member
Join Date: Jan 2015
Location: Cat
Old 08-19-2017 , 01:08   Re: Coding with assembler in SourcePawn
Reply With Quote #2

You can use assembler opcodes in the older compiler 1.6.4v however you won't beable to compile the new syntax with it.
__________________
Connect
My Plugins: KlickME
[My GitHub]

Commission me for L4D
Lux is offline
2010kohtep
Junior Member
Join Date: Aug 2017
Old 08-19-2017 , 02:25   Re: Coding with assembler in SourcePawn
Reply With Quote #3

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?
2010kohtep is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 08-19-2017 , 03:21   Re: Coding with assembler in SourcePawn
Reply With Quote #4

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.
__________________

Last edited by asherkin; 08-19-2017 at 03:22.
asherkin is offline
2010kohtep
Junior Member
Join Date: Aug 2017
Old 08-20-2017 , 06:22   Re: Coding with assembler in SourcePawn
Reply With Quote #5

Got it, thanks for help everyone.
2010kohtep is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 18:00.


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