Assembly-Language-Lesson-1
Assembly-Language-Lesson-1
Overview
Assembly language is a low-level programming language that provides direct control over a
computer's hardware. It is specific to a processor architecture and is commonly used for system
programming, performance-critical applications, and reverse engineering.
Windows 11 supports assembly programming primarily through x86 and x86-64 architectures
using assemblers like MASM (Microsoft Macro Assembler), NASM (Netwide Assembler), and
FASM (Flat Assembler).
Prerequisites
1. Install MASM: MASM comes with Microsoft Visual Studio. To use it:
2. Install NASM:
3. Use a Text Editor: Write assembly programs in a simple text editor and save them with a
.asm extension.
Basic Assembly Syntax
Supports MASM-
Uses Intel-style syntax with Uses Intel syntax,
Syntax compatible syntax and
strict segmentation supports macros
ideal mode
Preferred for modern Mostly used for legacy Used for Windows
Usage
assembly development DOS applications system programming
Object File Supports multiple formats Primarily OMF and DOS Supports COFF, OMF,
Formats (COFF, ELF, Mach-O, etc.) EXE and 64-bit formats
Works well with GCC for Was commonly used with Works with Visual
Integration
linking Borland C++ Studio
• Use MASM for Windows-specific system programming and integration with Microsoft
tools.
Here is a simple "Hello, World!" program using MASM on Windows 11.
3. Run: hello.exe
Assignment:
Write an assembly program that takes two numbers as input, adds them, and displays the
result.
Create a program that prints numbers from 1 to 10 using a loop in assembly language.
Write a program that takes a user-input string and prints it in reverse order.
Conclusion
This lesson introduced basic assembly programming for Windows 11, focusing on setting up
MASM/NASM and writing a simple "Hello, World!" program. Further lessons can cover system
calls, arithmetic operations, and interaction with Windows APIs.