assemblynasm

More to nasm assembly than just calling the kernel?


when it comes to me and nasm assembly, I've just recently started last week and I'm in quite a good position when it comes to the knowledge of this type of assembly, but now I have a question, is there more nasm than just int 0x80, let me explain.

When it comes to nasm, overall I know it's algorithim, different instructions like move eax, 4 stores a value of four in the eax register, and then once int 0x80 is executed, the kernel is called, sees the register, and then manipulates other registers based on the eax value, but as I've seen more code examples I've seen people call other parts using the int keyword, instead of just calling the kernel by doing int 0x80, here's an example: what I do: int 0x80 what I see when I go to other stack overflow questions having to do with nasm: int 0x13

so is there more areas than just the kernel that nasm has to offer, and do those areas just inspect the normal registers when being called or do you have to use different registers instead of the basic every day eax, ebx, ecx, and edx registers.

thanks for answering the question I really appreciate it, also please tell me if there's anything I need to edit to make this more understandable


Solution

  • NASM is the tool that you use to create programs that can run in an environment like Linux in your case (judging by the int 80h).
    It is not NASM that offers you that 80h interrupt, Linux does that, and outside of Linux that int 80h could be pretty meaningless! The DOS environment uses int 21h to provide some of the same services as int 80h does in Linux, but DOS and Linux and others are totally different environments, many of which couldn't even exist together.

    So, you are confounding the tool NASM, with the environment that runs the programs that NASM creates.

    NASM is the pen that writes on the paper, but the letter could go to your best friend or the tax collector... The pen doesn't care, but you should.