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

Discuss about fourth generation electronic computers, Fourth Generation (19...

Fourth Generation (1972-1984) The next generation of computer systems used the large scale integration (LSI -1000 devices per chip) and very large scale integration (VLSI - 100

Mechanisms for pick and place industrial robots - robotics, Each group is r...

Each group is required to complete a group assignment on the analysis, modelling and classification of one of the following classes of mechanisms encountered in robotics and indust

Describe the structure and function of a computer system, Question: a) ...

Question: a) Describe the structure and function of a computer system. b) The raw speed of a microprocessor will not achieve its potential unless a constant stream of wor

State about agp, State about AGP The latest addition to many computer s...

State about AGP The latest addition to many computer systems is the inclusion of accelerated graphics port (AGP). AGP operates at the bus clock frequency of the microprocessor.

Doubly linked list than by singly linked list, Which operations is performe...

Which operations is performed more efficiently by doubly linked list than by singly linked list Deleting a node whose location is given.

Steps in building the structure chart, Steps in Building the Structure Char...

Steps in Building the Structure Chart 1. Recognize top level modules and decompose them into lower levels 2. Add control connections 3. Add couples 4. Review and revis

Determine the fastest logic, Which of the fastest logic: TTL, ECL, CMOS and...

Which of the fastest logic: TTL, ECL, CMOS and LSI ? Ans. The fastest logic family of all logic families ECL. High  speeds  are  possible  in  ECL  since the  transistors  a

Indias parallel computers, Parallel Computers In India, the design and ...

Parallel Computers In India, the design and development of parallel computers in progress in the early 80?s. The Indian Government recognized the Centre for Development of Adva

What is artificial intelligence robotics, Artificial Intelligence Robotics ...

Artificial Intelligence Robotics covers all the material required to understand the principles behind the AI approach to robotics and to program an artificially intelligent robot f

How much frequency is centered in typical human voice, Typical human voice ...

Typical human voice is centered around                   Hz. (A)  200-400                                     (B)  280-3000  (C)  400-600

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