How to write hello world in assembler under Windows?

前端 未结 8 1062
情书的邮戳
情书的邮戳 2020-11-22 12:01

I wanted to write something basic in assembly under Windows, I\'m using NASM, but I can\'t get anything working.

How to write and compile hello world without the he

8条回答
  •  萌比男神i
    2020-11-22 12:43

    Unless you call some function this is not at all trivial. (And, seriously, there's no real difference in complexity between calling printf and calling a win32 api function.)

    Even DOS int 21h is really just a function call, even if its a different API.

    If you want to do it without help you need to talk to your video hardware directly, likely writing bitmaps of the letters of "Hello world" into a framebuffer. Even then the video card is doing the work of translating those memory values into VGA/DVI signals.

    Note that, really, none of this stuff all the way down to the hardware is any more interesting in ASM than in C. A "hello world" program boils down to a function call. One nice thing about ASM is that you can use any ABI you want fairly easy; you just need to know what that ABI is.

提交回复
热议问题