From the course: Learning Assembly Language

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Using NASM

Using NASM - Python Tutorial

From the course: Learning Assembly Language

Start my 1-month free trial

Using NASM

- [Instructor] NASM is a multi-platform assembler for the x86 chip. We'll take a quick look at what a NASM program looks like in Linux. I'll be using the windows subsystem for Linux to run this. The syntax for NASM is a bit different to what we've seen with MASM and GoAsm. For more details, a comprehensive manual is available online at the nasm.us site shown here. Firstly, let's install the NASM assembler. We do this with sudo apt install nasm. Okay, with the assembler's installed so let's write a simple counter program using NASM. We'll enter it using the nano editor, nano nastest.asm. We start by declaring the data section as the location of our initialized variables, section.data. And we'll initialize a heading, which will be a byte array counting in NASM. And we'll follow it with 0D 0A, for a character turn line feed. And we'll declare the length of the heading by using an equ minus the address of heading. In…

Contents