Skip to content

Instantly share code, notes, and snippets.

@SkylarPlayz348
Last active April 23, 2023 15:17
Show Gist options
  • Save SkylarPlayz348/3a2dc4911f6f5760fe1b1581c2ba3846 to your computer and use it in GitHub Desktop.
Save SkylarPlayz348/3a2dc4911f6f5760fe1b1581c2ba3846 to your computer and use it in GitHub Desktop.

Dockerfile

FROM ubuntu:18.04

WORKDIR /asm

RUN apt-get update

RUN apt-get install nasm

RUN apt-get install binutils

COPY ./asm/. .

RUN nasm -f elf64 main.asm

RUN ld main.o -o main 

CMD ["./main"]

./asm/main.asm

global _start

section .data
  hello: db "Hello World", 0x0a
  hellolen: equ $ - hello
section .text
  _start:
    mov   eax, 4
    mov   ebx, 1
    mov   ecx, hello
    mov   edx, hellolen
    int   0x80
    
    mov   eax, 1
    mov   ebx, 0
    int   0x80
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment