answersLogoWhite

0


Best Answer

; This may not be what you wnat in that it displays in Decimal but, it should

; get you started. It was writtne in x86 Assembly using emu8086. Bruce

name Powers

; author: Bruce Hesher

;

; View the flags register, Variables, and the Stack while running

; this program.

; AX - used to store sum

; BX - used to count the number of time the subroutine loops

; CX - used by scan_num to store value

; DX - used to return value

;

org 100h ; Create COM file

include 'emu8086.inc' ; emu8086.inc has some useful subroutines.

; prompt user for the number of Fibonacci numbers to display.

mov ah, 9

mov dx, offset msg_prompt

int 21h

call scan_num ; Type digits then ENTER, result goes in CX

lea si, msg_CRLFLF ; 1 CR and 2 LF

call print_string

lea si, space ; Used PRINT_STRING inside the program loop.

mov ax, 0 ; Clear AX.

mov al, cl ; Seed AL with number to show powers of.

mov [value], cx ; mov number to value since CX used by loop

mov cx, 20

NEXT: mul [value] ; (DX AX) = AX * operand.

call print_num_uns ; print value in AX

call print_string

loop NEXT ; jump if no overflow to next

ret ; to OS

; Define variables

msg_prompt db 'Enter the number to calc the powers of: $'

msg_CRLFLF db 0Dh, 0Ah, 0Ah

space dw 20h

value dd 0h ; dd directive to define double length word (4bytes).

; Define selected subroutines from emu8086.inc

DEFINE_SCAN_NUM

DEFINE_PRINT_STRING

DEFINE_PRINT_NUM_UNS ; Print unsigned number in AX

END ; directive to stop the assembler.

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: WAP that displays the binary powers of 2 in assembly level language?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Which number system is based on powers of 2?

- Binary


How can I calculate 8 into a Binary number?

Find the powers of 2. 8 in binary would be 1000


Each place value in a binary number represents what?

A power of 2. In the decimal system, we use powers of 10, in the binary system, powers of 2. Other number system use some other number as their base; for example, hexadecimal (base-16) uses powers of 16.


What are the powers of the assembly?

The Maryland General Assembly is the state's legislature, made up of two chambers. The function of the Assembly is to write state laws.


What powers did legislative assemblies have?

The Legislative Assembly could impose taxes, and propose bills, they had limited powers


What numbering system is based on power of 2?

The Binary numbering system is based on powers of 2


What are the powers of the Maryland general Assembly?

The Maryland General Assembly is the state's legislature, made up of two chambers. The function of the Assembly is to write state laws.


What is the Northern Ireland Assembly and the executive committee?

The Assembly is like Northern Ireland's parliament and the Executive is like its government. Northern Ireland has a devolved government, so it only has some powers and the other powers come from Westminster in London.The Assembly is like Northern Ireland's parliament and the Executive is like its government. Northern Ireland has a devolved government, so it only has some powers and the other powers come from Westminster in London.The Assembly is like Northern Ireland's parliament and the Executive is like its government. Northern Ireland has a devolved government, so it only has some powers and the other powers come from Westminster in London.The Assembly is like Northern Ireland's parliament and the Executive is like its government. Northern Ireland has a devolved government, so it only has some powers and the other powers come from Westminster in London.The Assembly is like Northern Ireland's parliament and the Executive is like its government. Northern Ireland has a devolved government, so it only has some powers and the other powers come from Westminster in London.The Assembly is like Northern Ireland's parliament and the Executive is like its government. Northern Ireland has a devolved government, so it only has some powers and the other powers come from Westminster in London.The Assembly is like Northern Ireland's parliament and the Executive is like its government. Northern Ireland has a devolved government, so it only has some powers and the other powers come from Westminster in London.The Assembly is like Northern Ireland's parliament and the Executive is like its government. Northern Ireland has a devolved government, so it only has some powers and the other powers come from Westminster in London.The Assembly is like Northern Ireland's parliament and the Executive is like its government. Northern Ireland has a devolved government, so it only has some powers and the other powers come from Westminster in London.The Assembly is like Northern Ireland's parliament and the Executive is like its government. Northern Ireland has a devolved government, so it only has some powers and the other powers come from Westminster in London.The Assembly is like Northern Ireland's parliament and the Executive is like its government. Northern Ireland has a devolved government, so it only has some powers and the other powers come from Westminster in London.


How do you convert 15 to a binary number?

Express it as a sum of powers of 2, thus: 15 = 8 + 4 + 2 + 1. The binary representation has a one for every power of two that is present and 0 when not. So 15, in binary, is 1111.


What is cubs legislature?

Cuba's legislature branch is the national assembly of people powers


What is the name of the government run wales?

The Welsh Assembly which has limited budgetary and some legislative powers. Westminster still retains most powers.


What is the legislative branch of Serbia?

The legislative branch of Serbia is The National Assembly. There are 250 elected officials in this assembly. They are able to apply supreme legislative powers.