Comment

Comment by jdswain

Always stayed away from Intel assembly, but thought I'd have a go at running this. First issue was this is I think, Intel format, whereas I was using GNU as, so I had to make a few changes:

  .global _start

  .text
  _start:
    mov $1,%rax        # write(
    mov $1,%rdi        #   STDOUT,
    mov $msg,%rsi       #   msg,
    mov $len,%rdx      #      sizeof(msg)
    syscall            # );

    mov $60,%rax       # exit(
    mov $0,%rdi        #   EXIT_SUCCESS
    syscall           # );

  .data
    msg: .ascii "RIP Tony, Father of Assembly Language\n"
    len = . - msg
Then you can run with:

  gcc -c src.s && ld src.o && ./a.out
parent jdswain 7 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton