Hello all,

I'm very beginner in x86 assembly language, I saw that there are many assemblers avaliable, but which one to start with, regarding that I want to program in 32-bit pmode but without using any external APIs (e.g: Win32 as in MASM)...

Thanks...

Dani AI

Generated

Short practical guide for , building on 's points.

If the end goal is a small OS, pick tools used by hobby OS authors so you spend time on CPU/memory concepts, not tool quirks. The common choices are NASM or FASM because they emit flat binaries/ELF easily and appear in most OS tutorials. MASM is fine for learning Intel syntax (and matches many textbooks), but its Windows-centric object formats and IDE integration make low-level kernel work more awkward. GAS is an option when you want tight GCC integration, but it uses AT&T syntax and is less beginner-friendly.

Practical learning sequence

  • Learn CPU modes and the minimal platform pieces you will need: protected mode, GDT/IDT, interrupts, PIC/APIC and basic paging — these are what make kernel code different from user programs.
  • Avoid getting stuck on writing a full bootloader at first: use GRUB to load a multiboot kernel so you can concentrate on protected-mode code. Once comfortable, implement a small real-mode boot sector to understand the handoff.
  • Use a cross-toolchain (i386-elf-gcc + binutils) so C and assembly link cleanly into an ELF kernel. Assemble with NASM/FASM, link with ld.
  • Test and iterate in QEMU (or Bochs) and use GDB for remote debugging; this speeds development and avoids hardware risk.

Good references and starting points

Quick tips: print to VGA text memory or use serial for early debugging, keep assembly modules tiny and call C for higher-level parts, and iterate inside an emulator.

Recommended Answers

All 4 Replies

If your program has to do file i/o or displaying something on the screen then it has no choice but to call win32 api functions to do that. 32-bit programs can not access hardware unless its a kernel level program.

Hello AD,

I'll start programming in 16-bit assembly using emu8086, Then i'll shift into 32-bit (x86) assembly programming using MASM or NASM...
I'm preparing to develop a small OS with my friend so I want to know some assembly alongside with my C++ knowledge.
so do you advice me to learn 32-bit asm without learning 16-bit asm? and with which assembler to start with?

Thanks for replying!

I wouldn't bother learn 16-bit asm, go directly to 32-bit so that the program can use whatever memory is available on the computer. It's also somewhat easier -- with the flat memory model it is not necessary to change the value of ds segment because all data is in the same segment.

As for assemblers: either masm, nasm or tasm.

Thanks AD for Advices!
I'm going to learn 32-bit asm using MASM from Assembly Language For Intel-Based Computers
...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.