CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums
Results 1 to 1 of 1
  1. #1
    Join Date
    Sep 2000

    Announce: Assembly FAQs

    v0.1 (From VBForums' Assembly Language forum.) - 4/30/2001</font></p>

    Frequently asked questions



    • Introduction
    • About
    • General Questions
      • How do I write an assembler program?
        • Assemblers
        • Hello World!
        • What Now?
      • How Do I Get The Command Line?
      • Links
    • Windows
      • How do I start programming for Windows?</a></li>
    • Contributors</a></li>




    This FAQ was originally created by Jake Bush for VBForums. It has since been updated by people here at CodeGuru


    .General Questions

    ..How do I write an assembler program?

    First you'll need an assembler, see below.


    There are alot of assemblers, but for beginners I would suggest using the A86 assembler. It's free and very easy to use. It doesn't require all the different stuff an average assembler requires. It's for MS-DOS and will only assemble .com files, but it's perfect to learn with. Download it, unzip it and add the directory to the path. Here are some other assemblers...

    Turbo Assembler
    flat assembler

    ...Hello World!

    Now that you have an assembler, you'll want to write your first program. The first program people write is usually the "Hello World!" program, so we'll do the same. Create a file and name it "Hello.asm". Then type in the following code...

    	jmp	start
    Message1	db "Hello World!$"
    	mov	ah, 09h
    	mov	dx, offset Message1
    	int	21h
    	mov	ax, 4c00h
    	int	21h
    Then at the command line type...

    a86 hello.asm
    You should get "HELLO.COM". Run it and see what happens.

    ...What Now?

    Now that you've written your first assembler program, you want to know what all
    that means. We'll for that you'll need to read an assembler tutorial, like these...

    Gavin's Guide to 80x86 Assembly
    Assembly Programming Journal

    ..How Do I Get The Command Line?

    The command line is loaded in the memory at offset 81h. The length of the command line is at 80h. So assemble this program with A86...

    	mov	si, 81h
    	mov	ah, 02h
    	cmp	al, 0dh
    	je	endload
    	mov	dl, al
    	int	21h
    	jmp	nextbyte
    This will print out the command line that you type when you run it.


    Easy Assembly
    Bob Rich's Tutorials
    Gavin's Guide to 80x86 Assembly
    Ralf Brown's Interrupt List
    The Art of Assembly Language Programming



    ..How do I start programming for Windows?

    First you need to download the MASM32 package at
    hutch's home page. Then to start programming for Windows go through the tutorials located at Iczelion's Win32 Assembly Homepage . The tutorials are at
    . They start very easy, and get pretty hard.



    • Jake Bush

    Last edited by Andreas Masur; December 16th, 2004 at 04:24 AM. Reason: Fixed small typo...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Click Here to Expand Forum to Full Width