answersLogoWhite

0

; 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

14y ago

What else can I help you with?

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 is 166 as a binary number?

The decimal number 166 can be represented as a binary number by converting it through repeated division by 2. The binary equivalent of 166 is 10100110. This means that in binary, 166 is composed of 1s and 0s that represent powers of 2.


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 is 2014 in binary code?

The number 2014 in binary code is represented as 11111011110. In binary, each digit (bit) corresponds to a power of 2, starting from the rightmost bit, which represents (2^0). Thus, when you convert 2014 to binary, you sum the appropriate powers of 2 to arrive at the binary representation.


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.


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 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.


What is cubs legislature?

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