Home » Hardware

Assembly Language Programming

Submitted by admin on September 30, 2010 – 2:37 pmNo Comment

This article discusses assembly language programming syntax.

An assembly statement consists of up to four fields. They are:

[label[:]] [operation-code-specification {operand(s) separated by commas}] [;comment]

where [] surround optional fields (and the optional colon in the label field). The only field not

optional is the operand(s) field and its existence and number of elements depends on the operation code (opcode) field. It does not (must not) exist for many instructions. The label field provides a symbolic handle for the information specified on that and possibly succeeding lines. It is used to assign names to program variables, constants, and the beginning of sections of code that need a name. Code sections that need names include subroutines, beginnings of loops, or parts of if-then-else style program constructs. The opcode field can specify either a machine instruction or it can be a command to the assembler. In the later case it is usually referred to as a pseudo opcode or pseudo-op for short.

These assemblers have only a handful of pseudo-ops, but 120 machine instruction mnemonics. The opcode field dictates the number of operands that can be present (if any). Any of these fields may appear on a line by itself except the operands field which must exist on the same line as the opcode with which it is connected. If a label is not followed by the optional colon it must start in column 1. Other than that the fields are in a free format. Any amount of white space may appear between fields. No field can contain white space except the comment field and the operand field when it is a quoted string. No statement, in and of itself, requires a label, but we will see programming situations that will necessitate labels.

You should try to identify those situations in the following assembly language programs which are rewrites of the previously presented machine language examples.

If you would like to learn more, please visit my personal website at http://engineersphere.com about Assembly Language Examples

Leave a comment!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.


Architecture »

Want Imperia 3 BHK apartments Dosti Group THANE MUMBAI

Affinity Solution Pvt. Ltd.
Presents
Dosti Imperia Thane Mumbai:
Dosti Group Imperia Thane ||91-9999684166|| Dosti Group Imperia Project Thane | Dosti Group Imperia Property Thane | Dosti Group Imperia Propeties Thane | Dosti Group Imperia Apartment Thane | …

Hi-Tech »

IT »

Benefits of Online Video on Demand Services for Individuals

Are you tired of waiting for your favorite programs or movies? On the other hand, do you have to wait restlessly in front of the idiot box and have to watch commercials in between your …

Medicine »

Bring your natural smile back by consulting Burbank cosmetic dentist

A beautiful and charming smile is all you need when you speak to somebody. Your smile can attract anyone and make an impressive impact to the listener. And a simple problem in your teeth and …

Press Releases »

Vashi Navi Mumbai New Booking Properties-09999684166 Sparsh Projects By Arihant Vashi Mumbai

Affinity Solution Pvt. Ltd.
Presents
Arihant Sparsh Vashi Navi Mumbai:
Arihant Sparsh | Arihant Sparsh Vashi | Arihant Sparsh Vashi Rates | Arihant Sparsh Vashi Navi Mumbai | Arihant Sparsh Vashi Location | Arihant Sparsh Project Vashi | …

Science »

Culinary Management Programs

There are many different culinary management programs throughout the country at various schools, but the most common type is the Bachelor of Culinary Management degree, which can be found at colleges, universities, technical institutions and …