answersLogoWhite

0


Best Answer

[org 0x0100]

mov ax,6 ; load first number in ax

add ax,6 ; accumulate sum

add ax,6

add ax,6

add ax,6

add ax,6

mov ax, 0x4c00 ; terminate program

int 0x21

------

Another way:

[org 0x0100] ; This is a .com file, not an .exe. DOS .com files start at 100h (256 decimal), have no stack segment, are no larger than 64k, and the code and data segments must be the same.

xor ax, ax ;zero register

mov cx, 6 ;put 6 in counter register for loop instruction

start:

add ax,6 ; accumulate sum

loop start ; decrements cx and serves as conditional jump to start label.

mov ax, 0x4c00 ; terminate program

int 0x21

(I rarely terminated DOS programs this way using the DOS termination service (int 21h, ah=4ch). Usually, terminating with RetN was enough.)

User Avatar

Wiki User

6y ago
This answer is:
User Avatar
User Avatar

Ahsan Ahsan

Lvl 1
2y ago
Is this answer exact
More answers
User Avatar

Marriam khalid

Lvl 2
2y ago

thanks

This answer is:
User Avatar
User Avatar

Camila Kling

Lvl 1
2y ago
love it tyy
User Avatar

Brandyn McClure

Lvl 1
2y ago
can you explain that answer?
User Avatar

Ora Nader

Lvl 1
2y ago
Where did you get your answer

Add your answer:

Earn +20 pts
Q: 21 Write a program in assembly language that calculates the square of six by adding six to the accumulator six times?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Math & Arithmetic

Using a computer how do you create a program that calculates the circumference and area of a circle?

a circle has an area of 36pie square centimeters what is the circumference ?


How do you draw a circle in assembly program?

You can draw a circle in assembly program by using a compass-like tool. Secure the tip of the compass and then rotate the compass tool so that it completes the circle.


Write an assembly language program to find 2's complement of a number FFH?

Code for An Assembly Language Program to find 2's Complement of given binary number in Assembly LanguageData Segment num db 00000010B Data Ends Code Segment Assume cs:code, ds:data Begin: mov ax, data mov ds, ax mov es, ax mov ah, 0000h mov al, num NOT al mov bl, al adc al, 00000001B mov bl, al Exit: mov ax, 4c00h int 21h Code Ends End Begin


What are the advantages and disadvantages of machine language?

AdvantageThe only advantage is that program of machine language run very fast because no translation program is required for the CPU.DisadvantagesIt is very difficult to program in machine language. The programmer has to know details of hardware to write program.The programmer has to remember a lot of codes to write a program which results in program errors.It is difficult to debug the program.


What is the assembly program to generate a geometric series and compute its sum The inputs are the base root and the length of the series The outputs are the series elements and their sum?

What is the assembly program to generate a geometric series and compute its sum The inputs are the base root and the length of the series The outputs are the series elements and their sum?

Related questions

Which program translate assembly language into machine language?

Assembly langue is translated into machine language by an assembler.


A program for assembly language for traffic light control?

an assembly language program of traffic light


What is assembly program?

An assembly program is a machine-dependent program written in a low-level symbolic code known as assembly language.


Reserved word in assembly language program?

use of reserved word in assembly language


What is the Structure of Program in Assembly language?

Assembly language programs are the Low level programs. We write Assembly Language program in basically 8085 and 8086 microprocessors.We can have several registers to do opreations with. Accumulator is one most important Register in a assembly program.We use several instructions like..Arithmetic:INR - Increment AccumulatorADD B - Add Content of Reg. B with AccumulatorSUB, etc.Logical:AND - Bitwise ANDJump Instriction:JZ label - Jump to label if ZERO flaggedJC Label - Jump on CarryEtc..


Example of Password program code in assembly language?

How to write the program un Assembly language to set a password for personal computers?


How does the assembly language can be executed by CPU?

Assembly language programs are the Low level programs. We write Assembly Language program in basically 8085 and 8086 microprocessors.We can have several registers to do opreations with. Accumulator is one most important Register in a assembly program.We use several instructions like..Arithmetic:INR - Increment AccumulatorADD B - Add Content of Reg. B with AccumulatorSUB, etc.Logical:AND - Bitwise ANDJump Instriction:JZ label - Jump to label if ZERO flaggedJC Label - Jump on CarryEtc..Example:MVI B, 06 //Load Register B with the Hex value 06MOV A, B //Move the value in B to the Accumulator or register AMVI C, 07 //Load the Register C with the second number 07ADD C //Add the content of the Accumulator to the Register CSTA 8200 //Store the output at a memory location e.g. 8200HLT //Stop the program execution


Assembly language program for string concatenation using 8086 microprocessor?

write program to concatenating two sting in 8086 assembly language


Write a program in 8086 assembly language to draw a circle?

You need an 8086 assembly language pencil.


What translation programs converts assembly language programs to object program?

The only translation program that converts assembly language to machine code is an assembler.


How do you write an assembly language program to find the sum of n numbers using array?

write an assembly language program to find sum of N numbers


What application will be used to convert an assembly language source program into machine language?

An Assembler converts assembly language instructions into machine language.