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

Explain complex instruction set computer, CISC (Complex Instruction Set Com...

CISC (Complex Instruction Set Computer) CISC stands for Complex Instruction Set Computer. If the control unit having a number of micro-electronic circuitry to make a set of con

8086, the block diagram of an 8086 processor

the block diagram of an 8086 processor

Explain the importance of search engines, Explain the importance of Search ...

Explain the importance of Search Engines The most effective way of finding information on the internet is to use a search engine. Though, it's just as easy to use these ineffic

Digital Design, Design a serial 2’s complementer with a shift register and ...

Design a serial 2’s complementer with a shift register and a flip-flop

The extra key inserted at the end of the array, The extra key inserted at t...

The extra key inserted at the end of the array is called a Sentinel is the extra key inserted at the end of the array

Algorithm and pseudocodes, develop an algorithm using pseudocode for comput...

develop an algorithm using pseudocode for computing cos(x) and sin(x). use a sentinel controlled while loop. use the series definition of e^+-jx

Python implementation of a solver for the desert cro, Python implementation...

Python implementation of a solver for the desert crossing, Python Programming #Minimum 100 words accepted#

Explain the role of a bus arbiter in a multiprocessor, Explain the role of ...

Explain the role of a bus arbiter in a multiprocessor configuration. Bus arbiter: Which functions to resolve priority between bus masters and allows only one device at a time t

Memory management unit, A computer system with 16K of memory, a Memory Mana...

A computer system with 16K of memory, a Memory Management Unit with a page size of 2000, and the following page translation table :      Logical Address    Physical Start 0000

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