Write a single statement that computes the product Product^8_ii = 2 ii, i is an
ID: 3883785 • Letter: W
Question
Write a single statement that computes the product Product^8_ii = 2 ii, i is an integer. Specifications: Place the results in EAX/AX/AL. You must choose the correct size, remember to consider efficient use of available resources. To compute the product, you must use one or more constant expressions that computes the value. No loops or use of anything beyond Chapter 3 in the book may be used. The register must be zeroed out before the result is stored. Write a short block of computational statements that causes the EBX register to overflow. Write a short block of computational statements that causes the ECX register to set the carry flag. Specifications: a) Use variables as opposed to immediate values, b) Make sure no other computations affect the outcome of this register. C) The register must be zeroed out before it Using directives for creating symbolics, write a single statement that computes the number of seconds in a day. Specifications: a) Place the result in the EDX register, b) The statement that is placed in the program and expanded should be SECONDS_IN_DAY. C) The EDX register should be zeroed out before it is used. D) Make sure the statement uses the symbolics to the fullest extent: that is, SECONDS_IN_DAY will be the only expression on the instruction line. No other mnemonics, or operands just SECOONDS_IN_DAY. Additional information: A program template is provided below. TITLE pa2.asm: Header comment block as shown in lecture notes INCLUDE Irvine32.inc data;{your variables are be defined here} data?;{used as necessary} code main PROC;{executable code here} call DumpRegs exit main ENDP: end of main procedure END main: end of source code Assembly programmingExplanation / Answer
BASE DB ? POW DB ? NL1 DB 0AH,0DH,'ENTER BASE:','$' NL2 DB 0AH,0DH,'ENTER POWER:','$' .CODE MAIN PROC MOV AX,@DATA MOV DS,AX ENTER_BASE: LEA DX,NL1 MOV AH,09H INT 21H MOV AH,01H INT 21H SUB AL,30H MOV BL,AL MOV BASE,AL ENTER_POWER: LEA DX,NL2 MOV AH,09H INT 21H MOV AH,01H INT 21H SUB AL,30H MOV CL,AL DEC CL MOV AX,00 MOV AL,BASE LBL1: MUL BL LOOP LBL1 MOV CL,10 DIV CL ADD AX,3030H MOV DX,AX MOV AH,02H INT 21H MOV DL,DH INT 21H MOV AH,4CH INT 21H MAIN ENDP END MAIN
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.