Author Topic: Some intermediate/advanced book based on NASM?  (Read 16552 times)

Offline dalfonso01

  • Jr. Member
  • *
  • Posts: 44
Some intermediate/advanced book based on NASM?
« on: May 23, 2014, 10:02:33 PM »
Hi,
I am going on with NASM, following the Duntemann book, together with other material to fill a better knowledge on foundations as arithmetic and architecture,(mainly the relevant parts of "X86 Assembly Language and C Fundamentals"), and I am at about the end of this trip, and and would start a skeleton for a nasm code formatter as a concrete project (all this is part of a trip to compilers in C++, so there is also a match in perspective).


The very good book by Duntemann helped (I think as many others beginners) to break the entry barrier, but it stops early and migrates to usage of C glibc a little sooner.
As a result already file read/write is out of scope, in favor of simple i/o redirection.

There are some intermediate books based on gas, but as I can see no one focused on nasm. I expect to overcome quickly the discomfort with  multiform nature of syntax in assembly from different assemblers but would delay if possible, meanwhile getting some extension to facilities as I/O and storage management, that , given the current rumination intent, I do not want to delegate to a library.

If there is no other solution, I will take the chapter 16 of Wrox, Professional Assembly Language, the only one that is explicitly devoted to  file handling , among the material I have (but cannot see much in TOCs from Amazon searches).

Could also suggest a path to go on , anyway, based on your experiences?

Thanks
Fabio D'Alfonso

Offline encryptor256

  • Full Member
  • **
  • Posts: 250
  • Country: lv
  • Win64 .
    • On Youtube: encryptor256
Re: Some intermediate/advanced book based on NASM?
« Reply #1 on: May 25, 2014, 07:20:42 PM »
Hi!

Well, I think assembly is assembly, there is no such thing as intermediate/advanced or professional.
Also there are not only one way or only professionals way, how to solve certain problem.
There are N problems and N solutions for each of them.
It's all about you, your creativity and YOUR experience and how much time you are willing to spend learning new things.
Storage handling and I/O - they are general terms, you can handle storage and i/o in your own way.
One knowledge leads to another, one experience leads to another.

I currently sometimes read and consult pdf books like "Intel® 64 and IA-32 Architectures",
for example, one from the books is: "Intel® 64 and IA-32 Architectures Software Developer’s Manual".
There is also good reference for instructions, Streaming SIMD Extensions and so on.

Bye, Encryptor256!


Encryptor256's Investigation \ Research Department.

Offline dalfonso01

  • Jr. Member
  • *
  • Posts: 44
Re: Some intermediate/advanced book based on NASM?
« Reply #2 on: May 25, 2014, 08:52:17 PM »
Hi,
thanks for your time to answer.
There is some peculiarity in the way assembly language goes the path that makes a great value in its own to learn about it (also only making in the least, experiments)

That said I think that good references always matter and, given the ten galaxies of details that come in the trade, some effort to expose to the relevant parts at relevant stages, can make the difference and smooth the barriers to successive milestones.
This could not be true for all of us,  but I do not find the   64-ia-32-architectures-software-developer-manual-325462 with its 3355 pages, together with some unguided effort, the best way to get knowledge in the pocket.

I am new in the assembly field, but the shortage in good bibliography especially in advanced topics , apart of long references, is a major issue. Behind a good book there is great effort to supply a framework and an anticipated list of topics to form a consistent subset of knowledge , relying on previous (if any) blocks of the whole body.

What is advanced and what is not is obviously questionable, but there are always things that can be safely ignored while starting something, and become relevant later. Up to now I only know a subset of the instruction set and concepts and am able to write some useful thing, later this will no long suffice as the perception of being able to get something bigger in the pocket will arise.

Curiosity without a plan won't work.
 
Saying that bibliography does not matter is the same to say the colleges do not matter. One starts to really learn when starts to play with his/her own instructions and problems, but this is quite facilitated by efforts in providing good material and orientation, as both colleges and books do (aware that both will only help, some time in substance).

Starting alone again, with a cpu and a brick of a-z ordered reference material  can be fun,  but sure not efficient .

Hi!

Well, I think assembly is assembly, there is no such thing as intermediate/advanced or professional.
Also there are not only one way or only professionals way, how to solve certain problem.
There are N problems and N solutions for each of them.
It's all about you, your creativity and YOUR experience and how much time you are willing to spend learning new things.
Storage handling and I/O - they are general terms, you can handle storage and i/o in your own way.
One knowledge leads to another, one experience leads to another.

I currently sometimes read and consult pdf books like "Intel® 64 and IA-32 Architectures",
for example, one from the books is: "Intel® 64 and IA-32 Architectures Software Developer’s Manual".
There is also good reference for instructions, Streaming SIMD Extensions and so on.

Bye, Encryptor256!
« Last Edit: May 25, 2014, 09:30:20 PM by dalfonso01 »

Offline encryptor256

  • Full Member
  • **
  • Posts: 250
  • Country: lv
  • Win64 .
    • On Youtube: encryptor256
Re: Some intermediate/advanced book based on NASM?
« Reply #3 on: May 27, 2014, 11:02:01 AM »
Hi!

Here is one educational trick, just for you!

Yesterday I found an assembly trick - how to swap without temporary variable.
Well, it wasn't me, who found it -  I was programming OpenGL, was doing some research, about bmp images - how to reverse them, on web and accidentally found this cool swap trick.

Trick uses xor's.
It's for x64, but should work for other architectures too.

Code: [Select]

        mov r8,55
mov rdx,177

xor r8,rdx
xor rdx,r8
xor r8,rdx

; RDX now is 55
; R8 now is 177


How it works, I don't know, yet, haven't spent time to look at it with "magnifying glass" with my "transparent/opacity eye". :D
But what's more important - that it works!

Bye, Encryptor256.
Encryptor256's Investigation \ Research Department.

Offline HD1920.1

  • Jr. Member
  • *
  • Posts: 40
Re: Some intermediate/advanced book based on NASM?
« Reply #4 on: May 29, 2014, 05:08:25 AM »
Hi!

Here is one educational trick, just for you!

Yesterday I found an assembly trick - how to swap without temporary variable.
Well, it wasn't me, who found it -  I was programming OpenGL, was doing some research, about bmp images - how to reverse them, on web and accidentally found this cool swap trick.

Trick uses xor's.
It's for x64, but should work for other architectures too.

Code: [Select]

        mov r8,55
mov rdx,177

xor r8,rdx
xor rdx,r8
xor r8,rdx

; RDX now is 55
; R8 now is 177


How it works, I don't know, yet, haven't spent time to look at it with "magnifying glass" with my "transparent/opacity eye". :D
But what's more important - that it works!

Bye, Encryptor256.

I´ve got a better "trick", same result:
Code: [Select]
mov r8, 55
mov rdx, 177

xchg r8, rdx

Offline encryptor256

  • Full Member
  • **
  • Posts: 250
  • Country: lv
  • Win64 .
    • On Youtube: encryptor256
Re: Some intermediate/advanced book based on NASM?
« Reply #5 on: May 29, 2014, 10:07:53 AM »
I´ve got a better "trick", same result:
Code: [Select]
mov r8, 55
mov rdx, 177

xchg r8, rdx

That's not a trick, thank you.
Encryptor256's Investigation \ Research Department.

Offline dalfonso01

  • Jr. Member
  • *
  • Posts: 44
Re: Some intermediate/advanced book based on NASM?
« Reply #6 on: May 31, 2014, 09:29:44 AM »
Hi,
after some time on the stuff then able to see what is missing and who could answer, I would suggest a book for people looking for some concrete understanding of the sea in which their programs swim.

CRC Press ,  X86 Assembly Language and C Fundamentals , Joseph Cavanagh, 2013.

I was already using this for first chapters on number systems, but now, I can see within this a precious resource to cover all the foundations that arise at some point in time. A peculiar feature is that >>the code comments the text , and not the text comments the code<< . So it uses flat assembler, but the real value is the text, covering in depth any ground, that makes any one able to write the examples if the case also in Arabic.
For example there is a 45 pages chapter 10 on BCD arithmetic, with minimal code and all the sides of the room (+,/,-,*), motivated (you need a reason to solve a problem)  and then explained, but all the book works in this way.

My goal is going from intuition to comprehension , and this stuff instruments the (a bit long) journey. But the party starts there.

Hope this helps.

PS. It is an 800 pages book, so C does not steal the space, and as told, could use also Arabic, it would not  matter

Thanks
Fabio D'Alfonso
« Last Edit: May 31, 2014, 11:57:12 AM by dalfonso01 »