How to write good assembly programs, Computer Engineering

Assignment Help:

Preparation of writing the program

1.  Write an algorithm for your program closer to assembly language. For instance the algorithm for preceding program will be:

get NUM1

add NUM2

put sum into memory at RESULT

position carry bit in LSB of byte

                        mask off upper seven bits

                        store the result in the CARRY location.

2.  Specify the necessary input and output.

input required -                       two 8-bit numbers

output required -                     an 8-bit result and a 8-bit carry in memory.

 

3.  Study instruction set carefully. This step assists in specifying available instructions and their constraints andformat. For illustration the segment registers can't be directly initialized by a memory variable. In its place we have to first move offset for segment in a register and then move contents of register to segment register.

You can exit to DOS by employing interrupt routine 21h with function 4Ch placed in AH register.

It is a nice practice to first write your program on paper and employ comments generously. This makes programming easier and also helps you understand your program in future. Please consider that number of comments don't affect size of program. 

After program development you can assemble it by an assembler and correct it for errors, finally creating exe file for execution.


Related Discussions:- How to write good assembly programs

What is line option explicit, What is line option explicit Line explici...

What is line option explicit Line explicit function makes the compiler to recognize all the variables which are not particular by the dim statement. This command significantly

What is the difference among thread and process, Thread is a least unit of ...

Thread is a least unit of process. In process have one or more thread.

Show organisation of clos network, Q. Show Organisation of Clos network? ...

Q. Show Organisation of Clos network? Clos network: This network was designed by Clos (1953).  It's a non-blocking network and offers full connectivity similar to crossbar netw

Explain working of telnet, Q. Explain Working of TELNET? The working o...

Q. Explain Working of TELNET? The working of TELNET 1.  Commands and characters are sent to operating system on common server computer. 2.  Local operating system send

Microcomputer - controlled breadmaking machine, Q. Microcomputer - Controll...

Q. Microcomputer - Controlled Breadmaking Machine? Figure shows a simplified schematic diagram of a microcomputer-controlled breadmaking machine. A microcomputer along with its

Senior project, any ideas about senior project topic

any ideas about senior project topic

Explain about subsystem and object of object oriented, Explain about subsys...

Explain about subsystem and object of object oriented modeling A subsystem is a grouping of elements of that constitutes a specification of behaviour offered by other contained

Explain in detail companding, Explain in detail companding. Companding...

Explain in detail companding. Companding: It is the process of compressing and expanding. This includes compressing the signal at the transmitter and expanding this at the re

Distinction between lossy and lossless data compression, Question: a De...

Question: a Describe the following terms with reference to video editing: 1. Video frame rate 2. Pixel aspect ratio 3. Frame size 4. Temporal compression 5. Spatial comp

What are the two types of branch prediction techniques, What are the two ty...

What are the two types of branch prediction techniques available?  The two types of branch prediction methods are  1) Static branch prediction  2) Dynamic branch predicti

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd