Compile with -a parameter -
Swimor - 24.05.2013
Compile with -a parameter
Hello,
I read ******es tutorial about #emit and I trying to compile my pawn code with -a but nothing happens,
I opened "settings.ini" in my pawno directory and added -a to Params just like this one:
I pressed F5 to compile this and I strill getting .AMX file instead of .AMS.
What is the problem?
Thanks.
Re: Compile with -a parameter -
Vince - 24.05.2013
Compiler options don't work unless you put them in a specific file. Create a file called pawn.cfg in the Pawno directory and put the options in there.
Re: Compile with -a parameter -
Swimor - 24.05.2013
Quote:
Originally Posted by ******
That file doesn't work. You need a file called "pawn.cfg" with this contents:
Or in your case "-r -a". I personally use "-r -d0 -O2" (and -l or -a as appropriate).
Edit: Vince posted as I was writing - well played!
|
Thnaks,
From your comment I got two questions:
1. If I will compile my gamemode with -r -a the .AMX file won't change, Right?
2. Why you are using -r -d0 -O2? What I will get if I will use it too?
Thanks again!
P.S
Vince thank you two!
Re: Compile with -a parameter -
Swimor - 24.05.2013
Quote:
Originally Posted by ******
"-r" means "report" and generates documentation from special comments in your mode.
"-d0" means "debug level 0" and removes a lot of run-time checks from the mode. Obviously this makes finding problems harder, but makes your code smaller.
"-O2" (possibly "-O1", one level doesn't work correctly) means "optimisation level 2" and again produces slightly better code.
|
I got it, Thanks!
I will ask you one more question for not producing spam topics:
In your tutorial you said that I "can loop through the public function list and check all their names" but I still not understand how I can do it?
Thank you very very much!
Re: Compile with -a parameter -
Swimor - 24.05.2013
Quote:
Originally Posted by ******
pawn Код:
new idx, buffer[32]; while ((idx = AMX_GetPublicName(idx, buffer))) { printf("%s", unpack(buffer)); }
|
That isn't what I mean, here you done it with y_amx but I want to do this without your include (only emit).
Is it possible?
Re: Compile with -a parameter -
Swimor - 24.05.2013
Quote:
Originally Posted by ******
Yes, but with a lot more code. If you want to know how to do it with assembly, read the source code of y_amx as there's quite a lot involved.
|
Can you give me simple example such as how to get first pubic name?
Re: Compile with -a parameter -
Swimor - 24.05.2013
Quote:
Originally Posted by ******
Not really, just getting the first one involves 90% of the code - and you already know where to get all the code. Zeex's amx library also does this, but I'm less familiar with how it does it (given that I've never needed that part of it - there aren't that many variations though).
|
Ok thanks.
Sorry I'm driving you crazy but why RyDeR used in this
code Why 4? What It means?
Re: Compile with -a parameter -
Swimor - 24.05.2013
Quote:
Originally Posted by ******
4 is a number, it means 1 greater than 3.
|
I know that 4 is a number, But why he added 4 to the address?
AW: Compile with -a parameter -
BigETI - 24.05.2013
I guess it's because variables in PAWN are 4 bytes long (32 bit), so doing "ADD WITH CARRY" 4 on an address jumps to the next address.
Re: AW: Compile with -a parameter -
Swimor - 24.05.2013
Quote:
Originally Posted by BigETI
I guess it's because variables in PAWN are 4 bytes long (32 bit), so doing "ADD WITH CARRY" 4 on an address jumps to the next address.
|
Thanks!