Re: Re[2]: argv



1) It uses the 64-bit Linux libraries whereas I am using the 32-bit
Win
Should not really matter

2) GCC assembly language sucks :^)
It uses AT&T syntax which many think is not nice to read.

3) Despite #2 above, I noticed something very peculiar about the
disassembly
code. For argv, GCC uses a 32-bit register, whereas for the argc, GCC
uses a
64-bit register. This isn't documented anywhere. Does this apply to
32-bit Win
code as well, i.e. -- argv would use a 32-bit register and argc would
use a
16-bit register? This disassembly example violates the 64-bit code
convention
used by the C standard and by the Win and Linux OSes as well.
You might have come across the nightmare of which calling convention to
use. Things vary between OS and compiler! This document might be of
interest http://agner.org/optimize/calling_conventions.pdf  .

4) The documentation implies argc and argv are consecutive
This is the C convention.

5) It uses the Gtk+2 libraries whereas I am using Gtk+3. It appears
that the
Gtk+2 libraries pass parameters in the registers and there is no
stack
cleanup, whereas the Gtk+3 libraries pass parameters on the stack and
stack
cleanup is required. Again, not documented. This may not matter
unless I
wanted to convert my application later on to 64-bit, so this is good
to know
beforehand.
See 3. This is again the problem of calling convention.

The majority of people will use GTK from a high level language so
questions on assembly would not be second nature.

When replying to the mailing list only reply to the list and do not
include the personal e-mail address of others in the mailing list. They
will get two copies of your message and will probably (and possible
have) get a little bit fed up to put it nicely.

Your original posting was fairly terse which lead to others assuming
that you did not know much on the subject. To many it looks like you
had only got to the parsing the augments stage and no further :-/ . If
the others on the list are still reading, play nicely now there is no
need to start a flame war. :o)

Back to your original problem :-) You may have done this already. Have
you tried making a test application using the libraries you are using
in C, C++ or D. You will need to make sure that you are using the same
memory model etc..... as your assembly. All this needs to do is get the
command line arguments, print them to the terminal (or where ever you
want) and then display a dialog window where you click on a button to
exit. This would make sure that you have GTK compiled in, test that you
can get the arguments and see what code is actually generated for the
GUI application.

Always look on the bright side of life....


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]