CodeGuru Forums -
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic Newsletters VB Forums Developer.com


Newest CodeGuru.com Articles:

  • Installing SQL Server 2008
  • Writing UDFs for Firebird Embedded SQL Server
  • [Updated] Shutdown Manager
  • Building Windows Azure Cloud Service Applications with Azure Storage and the Azure SDK

  • Search CodeGuru:
     



    Go Back   CodeGuru Forums > Other Programming > Assembly
    FAQ Members List Calendar Search Today's Posts Mark Forums Read

    Assembly Questions and Answers for Assembly here!

    Closed Thread
     
    Thread Tools Search this Thread Rate Thread Display Modes
      #1    
    Old August 19th, 2004, 10:09 AM
    Brad Jones's Avatar
    Brad Jones Brad Jones is offline
    Admin & Site Manager
    Power Poster
     
    Join Date: Sep 2000
    Location: Indianapolis
    Posts: 5,344
    Brad Jones is a name known to all (1000+)Brad Jones is a name known to all (1000+)Brad Jones is a name known to all (1000+)Brad Jones is a name known to all (1000+)Brad Jones is a name known to all (1000+)Brad Jones is a name known to all (1000+)Brad Jones is a name known to all (1000+)Brad Jones is a name known to all (1000+)Brad Jones is a name known to all (1000+)Brad Jones is a name known to all (1000+)
    Announce: Assembly FAQs

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

    Frequently asked questions

    ----------------------------------------------------

    Contents
    • 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>

    ----------------------------------------------------

    .Introduction

    ..About

    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.

    ...Assemblers

    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
    NASM
    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...

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

    Code:
    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...

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

    ..Links

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

    ----------------------------------------------------

    .Windows

    ..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
    http://members.nbci.com/winasm/tutorials.html
    . They start very easy, and get pretty hard.

    ----------------------------------------------------

    Contributors
    • Jake Bush

    ----------------------------------------------------

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

    Bookmarks
    Go Back   CodeGuru Forums > Other Programming > Assembly


    Thread Tools Search this Thread
    Search this Thread:

    Advanced Search
    Display Modes Rate This Thread
    Rate This Thread:

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off
    Forum Jump


    All times are GMT -5. The time now is 09:27 AM.



    Acceptable Use Policy

    internet.comMediabistrojusttechjobs.comGraphics.com

    WebMediaBrands Corporate Info


    Advertise | Newsletters | Feedback | Submit News

    Legal Notices | Licensing | Permissions | Privacy Policy


    Powered by vBulletin® Version 3.7.3
    Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
    Copyright WebMediaBrands Inc. 2002-2009