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 selective complement - logic micro operations, SELECTIVE COMPLEMEN...

SELECTIVE COMPLEMENT The selective-complement process complements bits in register A where there are corresponding 1's inside register B. It does not affect bit positions which

Explain the difference between a subroutine and macro, Explain the differen...

Explain the difference between a subroutine & macro. It is inefficient to have to write code for standard routines.  For instance reading a character form the keyboard or savin

Explain the uses of arithmetic processor, Explain the uses of arithmetic pr...

Explain the uses of arithmetic processor A processor has arithmetic processor (as a sub part of it) which executes arithmetic operations.  The data  type,  assumed  to  reside

What does a lock object involve, What does a lock object involve? The t...

What does a lock object involve? The tables. The lock argument.

What is an html tag, An HTML tag is a syntactical construct in the HTML lan...

An HTML tag is a syntactical construct in the HTML language that abbreviates particular instructions to be implemented when the HTML script is loaded into a Web browser. It is like

Define functions with that virtual memory can be implemented, Virtual memor...

Virtual memory can be implemented with ? With Segmentation and Paging Virtual memory can be implemented.

C Programming, Program about railway reservation system using structure . G...

Program about railway reservation system using structure . Get 10 names,their gender ,address , seats availability according to trains and some extra datas

Approaches for development of information systems, Q. Approaches for develo...

Q. Approaches for development of information systems? Numerous approaches are available for development of Information Systems. They are as below: • Model Driven: It put e

Codevita test, provide answers for Luminous Jewels - The Polishing Game?

provide answers for Luminous Jewels - The Polishing Game?

Define how ptrace is used by debuggers, State how Shared Memory is used for...

State how Shared Memory is used for inter process communication. Define how ptrace is used by debuggers.  What are modules? Explain how data mapping takes place among modules

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