Tuesday, November 12, 2024
HomeComputer programmingAssembly: Code Template

Assembly: Code Template

The following Tech-Recipes tutorial contains a general template for designing an Assembly code program.



TITLE
COMMENT |

|
.MODEL SMALL
.STACK 100H
.DATA

.CODE
.486
INCLUDE io.mac
main PROC
.STARTUP

done:
.EXIT

main ENDP
END main

-After title, commonly listed is the name of the current file (possibly including the path).

-Placed between the | | are comments describing the program.

-Model type SMALL describes code which only points within its own scope or uses extern with path names.

-Under .DATA, goes your pre-defined terms, such as global variables and strings to be output.

-Under .CODE, goes the actual code of your program.

.486 describes the type of program. If you wish to include ONLY 8086 type, you may also choose .386.

-The include here allows for read and write of IO properties from the keyboard (standard IO).

main is only a standard name. It can be any name. .STARTUP is a label to denote the beginning of the program code.

done: is a label showing a method beginning. Assembly works top down, ignoring labels, but it is a relative term to be used in jmp statements.

.EXIT exits the program.

end PROC denotes the end of a process or program.

Questions/Comments: [email protected]
-William. § (marvin_gohan)

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

LATEST REVIEWS

Recent Comments

error: Content is protected !!