Compile with -a parameter
#1

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:
Код:
Params=-r -a
I pressed F5 to compile this and I strill getting .AMX file instead of .AMS.
What is the problem?

Thanks.
Reply
#2

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.
Reply
#3

Quote:
Originally Posted by ******
Посмотреть сообщение
That file doesn't work. You need a file called "pawn.cfg" with this contents:

Код:
-a
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!
Reply
#4

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!
Reply
#5

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?
Reply
#6

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?
Reply
#7

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
Код:
#emit ADD.C     4
Why 4? What It means?
Reply
#8

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?
Reply
#9

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.
Reply
#10

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!
Reply


Forum Jump:


Users browsing this thread: