Created
July 24, 2010 22:29
-
-
Save nixeagle/489042 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;;;; Just copy paste this to the end of your ~/.emacs or ~/.emacs.d/init.el | |
| ;;;; These are not really a "library" yet. | |
| ;;;; | |
| ;;;; Both parts of code in this gist are released into the public domain, | |
| ;;;; assuming any parts of it are even copyrightable. | |
| (require 'asm-mode) | |
| (defun my-asm-mode-function () | |
| (set (make-local-variable 'compile-command) | |
| (concat "make -k -e ASM_FILENAME=" | |
| (file-name-sans-extension | |
| (file-name-nondirectory buffer-file-name))))) | |
| (add-hook 'asm-mode-hook 'my-asm-mode-function) | |
| (define-key asm-mode-map (kbd "C-c C-c") | |
| (lambda () (interactive) | |
| (let* ((file buffer-file-name) | |
| (lst (concat (file-name-sans-extension (file-name-nondirectory file)) ".lst"))) | |
| ;; save all buffers | |
| (save-some-buffers t) | |
| (compile compile-command)))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| all: | |
| nasm -f elf -g -l ${ASM_FILENAME}.lst ${ASM_FILENAME}.asm | |
| ld -melf_i386 ${ASM_FILENAME}.o -o ${ASM_FILENAME} | |
| cat ${ASM_FILENAME}.lst | |
| ./${ASM_FILENAME} | |
| clean: | |
| rm *.o |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment