27.08.2016, 22:15
Look into the Pawn Implementer's Guide
http://y-less.com/uploads/pawn-imp-3.0.3367.pdf (2005 version)
(Or in the rar file from the first post - 2007 version)
and search for Instruction reference (should be either page 94ff or 99ff)
funcidx returns the index in the public table, see the implementer's guide
you needs to use load.s.alt because arrays are always passed by reference (only the address is passed)
const.pri/alt doesn't load anything, it just puts the given value into pri/alt
Doing load.s.alt cmdtext would load the address where content of cmdtext is saved
however doing const.alt cmdtext would only transfer the relative address into alt
const.pri/alt 5 // pri/alt = 5
const.pri/alt global_variable // gets address relative to DAT section
const.pri/alt local_variable // gets address relative to FRAME
const.pri/alt function // gets address relative to COD
also add.c cmdtext is the same as add.c 16
http://y-less.com/uploads/pawn-imp-3.0.3367.pdf (2005 version)
(Or in the rar file from the first post - 2007 version)
and search for Instruction reference (should be either page 94ff or 99ff)
Quote:
About getting address of function: I think funcidx returns id only for public(and count only publics)
|
Quote:
And why we are using LOAD.S.alt(it stores content, not address)? But CONST.pri loads addreess?!?!!?!?
|
const.pri/alt doesn't load anything, it just puts the given value into pri/alt
Doing load.s.alt cmdtext would load the address where content of cmdtext is saved
however doing const.alt cmdtext would only transfer the relative address into alt
const.pri/alt 5 // pri/alt = 5
const.pri/alt global_variable // gets address relative to DAT section
const.pri/alt local_variable // gets address relative to FRAME
const.pri/alt function // gets address relative to COD
also add.c cmdtext is the same as add.c 16