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 are the principles of transport layer, Q. What are the principles of t...

Q. What are the principles of transport layer? Transport layer: This layer is the first end-to-end layer. Header of transport layer includes information which helps send the

What is arrays pointers, Q. What is Arrays Pointers? An array is a coll...

Q. What is Arrays Pointers? An array is a collection of similar type of data. Arrays are extremely popular data structures in parallel programming because of their easiness of

Performance of computer system, Performance of computer system: Comput...

Performance of computer system: Computer performance is frequently described in terms of clock speed (usually in MHz or GHz). It refers to the cycles per second of the main cl

Use of delay loops, A very useful application of assembly is to generate de...

A very useful application of assembly is to generate delay loops. These loops are used for waiting for some time before execution of subsequent instruction. However how to find

Communication process, 1)    Describe challenges involved for both the send...

1)    Describe challenges involved for both the sender and the receiver in the communication process. 2)    Describe the purpose of a subject line in an email message and give gui

Pc cross assembler, 1.0 By working throughthe first time guide this will ga...

1.0 By working throughthe first time guide this will gain familiarity with the on board monitor and the PC cross assembler  After connecting the system to the terminal program,

Explain neural networks, A neural network can be definite as a model of rea...

A neural network can be definite as a model of reasoning based on the human brain. The human brain incorporates nearly 10 billion neurons and 60 trillion connections, Synapses amon

Explain firewall, A firewall is Software or hardware used to separate a...

A firewall is Software or hardware used to separate a private network from a public network.

Explain about the view selection problem, Often calculating all the data is...

Often calculating all the data is not possible by aggregations for this reason some of the difficult data problems are solved. In order to verify which data should be solved and me

Explain about synchronous dram, Q. Explain about Synchronous DRAM? One ...

Q. Explain about Synchronous DRAM? One of the most broadly used forms of DRAM is synchronous DRAM (SDRAM). Unlike the conventional DRAM that is asynchronous SDRAM exchanges dat

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