Languages

System

Application

Script

Database

HTML 4

DHTML

Technology

Client

Server

SB Tools

Protocols

SBuilder

 

Learning Assembly Language

The Syntax begins here:

;Microsoft Macro Assembler version 6.11
;This is a statice dat segment
DSEG    SEGMENT WORD PUBLIC 'DATA'
MSG       DS               'Hello world!$'
DSEG     ENDS

;This is the stack
SSEG     SEGMENT PARA STACK  'STACK
                 DW             120         DUP(?)
SSEG      ENDS

;This is the executable code
CSEG      SEGMENT  PUBLIC   'CODE'
MAIN        PROC           FAR
                  ASSUME   CS:CSEG
                  MOV           AX,DSEG
                  MOV           DS,AX
                  ASSUME   DS:DSEG

;Here's the body of the program
                  MOV          DX,OFFSE MSG
                  MOV          AH,09H
                  INT             21H

;Exit back to DOS Prompt
                  MOV         AX,4C00H
                  INT            21H
MAIN        ENDP
CSEG      ENDS
                   END            MAIN    

    Semicolon indicates that the line with semicolon is the comment and the comment does not execute.  It is ignored by the compiler.

    Assembler works around the machine level registers such as General Registers: AL, BL, CL, DL; Index Registers: DI, SI; Pointer Registers: BP, SP; Segment Register: CS, DS, ES, FS, GS, SS; Instruction Pointer: IP; and Flags Registers: FLAGS.

    Topic Machine level means Assembler operates with binary and hexadecimal numbers.  Variables are assigned as WORD, DWORD and constants are placed as DB with the single code.

Assembler has many fields such as operation field and abbereviated (mnemonics) as MOV, CMP, ADD.  MOV means to move from one register location to another, CMP means compare, and ADD means addition.   Operands refer to data to be processed by the OP CODES.  Operands may be the names of registers, names of data fields, character strings enclosed (constants) in quotation marks or numbers. 

The code segment contains machine instructions that specify the actions to be taken to process data. The code segment is divided into one or more procedures, classified as NEAR OR FAR.  NEAR procedures must all be contained in the same segment, while far procedures may be in different segments.

Any one who is interested in learning Assembler better search more information on the Internet.  You should only be interested if you prefer to program on a machine level.  There is always a job demand for assembler programmers from the chip manifactures.

Designed by
Prakash Bom