Skip to content

thomasN4/tasm-mode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

tasm-mode

An Emacs major mode for editing Turbo Assembler (TASM) x86 assembly code. Supports both MASM-compatible mode and TASM Ideal mode.

Based on masm-mode by YiGeeker.

Features

  • Syntax highlighting for x86 instructions, registers (16-bit and 32-bit), directives, types, labels, macros, structs, and numeric constants
  • Support for both MASM-compatible and TASM Ideal mode directives
  • Automatic indentation and label handling (typing : removes indentation when it forms a label)
  • Context-sensitive comment insertion with mark ring integration for jumping between code and comment gutter
  • Built-in compile, link, and build commands via compilation-mode
  • Imenu support for navigating labels, procedures, and macros
  • Configurable assembler variant (tasm or tasm32), arguments, and paths

Requirements

  • Emacs 25.1 or later

Installation

Clone the repository and add it to your load-path:

(add-to-list 'load-path "/path/to/tasm-mode")
(require 'tasm-mode)

Or with use-package:

(use-package tasm-mode
  :load-path "/path/to/tasm-mode")

Configuration

;; Use 16-bit TASM instead of the default TASM32
(setq tasm-program-type 'tasm)

;; Set the path to the TASM executables
(setq tasm-executable-path "/path/to/tasm/bin")

;; Set include and library paths
(setq tasm-include-path '("/path/to/includes"))
(setq tasm-library-path '("/path/to/libs"))

;; Customize assembler arguments (defaults: /ml /m2 /z)
(setq tasm-compile-args '("/ml" "/m2" "/z"))

;; Customize linker arguments
(setq tasm-link-args '("/v"))

;; Customize build command (defaults to make)
(setq tasm-build-executable "make")
(setq tasm-build-args '("-f" "Makefile"))

Key Bindings

Key Command Description
C-c C-c tasm-build Build the project
C-c C-b tasm-compile Assemble the current file
C-c C-l tasm-link Link the object file
C-c ; comment-region Comment/uncomment the region
; tasm-comment Context-sensitive comment insertion
: tasm-colon Insert colon; dedent if it forms a label
C-j tasm-newline-and-indent Newline with auto-indentation
RET tasm-newline-and-indent Newline with auto-indentation

Customizable Faces

All faces can be customized via M-x customize-group RET tasm-mode-faces:

  • tasm-registers - CPU registers
  • tasm-instructions - x86 instructions
  • tasm-directives - assembler directives
  • tasm-types - data types
  • tasm-labels - code labels
  • tasm-subprogram - procedures
  • tasm-macro - macro definitions
  • tasm-section-name - segment/section names
  • tasm-constant - numeric constants
  • tasm-struct - struct definitions
  • tasm-union - union definitions
  • tasm-prefix - instruction prefixes

License

MIT

About

Emacs major mode for TASM

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors