Hi,
Happy beginning of week (this post could eventually not help...).
I would share some think after some weeks on the assembly (and NASM) stuff and hope this could start a reasoning in a large view.
Also if there are some books on the topic they are few, mainly introductory and somehow "one to any one different assembler", nasm fasm, masm, if any.
I understand the need to link assembly to the ability to use C glibc, but the departure starts too early.
Unless one needs to examine the code produced by gcc, the main reason to use AT&T syntax is in a job perspective, as there is no more stuff on that than on others (quite few).
Given the flat nature of the stuff any attempt to go into C should show the strategy more than I/O examples. I got a minimal mmap in less code than an example using some machinery in C that supposes I am interested in the toy purpose of the writer.
So it could be better to teach to fish, and use some better part of the library.
It is possible both embed the asm in C and use glibc in asm with call, it seems to me that the second is a better solution as the partition between the two stays floating, inside the single source or time by time and with no "brute" separation _asm {}.
About this, the statement from Duntemann : "However, one of the major ways you’ll end up learning many of the standard C library calls is by using them in short C programs and then inspecting the .s assembly output files that gcc generates".
>If this means playing with function to experiment, good, it this means that one needs to try a function to discover how and where the results of the call will have to be found, not so quite good
, which would favor the _asm {} , that at least, will rely on the C layer prototypes about usage of the C partition.
Someone with more knowledge, about all of this?
I find NASM quite neat and clean and that makes interesting to use it so thanks to developers.
Thanks
Fabio D'Alfonso
PS. It is sad that we study assembly to plan where and when to abandon it on the highway.
PPS. Duntemann says "Complexity kills, programs at least" , I would add "Emphasis kills , learners at least" . There is nothing special about some things but the preceding big announce will let you wonder what you are missing after that. 1 is just 1 and lea is just that: load the effective address...