Skip to content

Instantly share code, notes, and snippets.

@denzuko
Last active February 17, 2021 05:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save denzuko/2ab4fa240c3dc076d89bc5af1f12f492 to your computer and use it in GitHub Desktop.
Save denzuko/2ab4fa240c3dc076d89bc5af1f12f492 to your computer and use it in GitHub Desktop.
int main(int i){for(;i-5000;i++,puts("I will not use classes"));}
@denzuko
Copy link
Author

denzuko commented Feb 17, 2021

nasm version:

BITS 32
GLOBAL _start
SECTION .text

_start:
	or edx, 15     ;message length
	mov	ecx, msg    ;message to write
	or  ebx,ebx
	inc ebx         ;stdout
	or  eax, 4	    ;sys_write
	int	0x80        ;call kernel
	sub eax, 3      ;sys_exit
        xor bl,bl
	int	0x80        ;call kernel

SECTION	.data
msg:
    db	'Hello, world!',0xa

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment