You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
567 B

  1. #!/bin/bash
  2. # script requires the assembly program name without the .asm extension
  3. # example: hello_world.asm is passed using the script as so -> runasm hello_world
  4. NAME=$1
  5. # I write 32-bit assembly with nasm, hence the use of macho32, if using 64-bit use macho64. There are many different options for this parameter
  6. # this line generates object file from assembly
  7. nasm -f macho32 "$NAME.asm"
  8. # specifiy os version, I use mac osx
  9. # this line links object file:
  10. ld -macosx_version_min 10.7.0 -o "$NAME" "$NAME.o"
  11. # run resultant executable file
  12. "./$NAME"