Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1 . Implement in x 8 6 ( 3 2 - bit ) assembly code for the following calculations, according to the specified requirements. a
Implement in xbit assembly code for the following calculations, according to the specified requirements.
a Y cAB aA bB if A and B
ABDE if B and D and E
otherwise.
b Create and use as function modules, PROCedures: ProductXYZ SquareX DivXY
c ProductXYZXYZ:
Input arguments: Passed via the system Stack
Ouput result: passed through a Register
Function: compute:V XY; W VZ; return W as result
V and W are treated as local variables
d SquareXX:
Input arguments: passed via the system Stack
Output result: passed through a Register
Function: compute W XX; return W as result
W is treated as a local variable.
e DivXYX Y:
Input arguments: passed via Registers
Output results: passed via registers
Function: compute Q quotient of XY R remainder of XY
Return Q R as results.
Q and R are treated as local variables.
Extra Credit Implement the code in Problem in xbit assembly
programming.
Do the following problems:
a Write xbit programming ASL code to generate Pascals Triangle for a
given N
b Write xbit programming ASL nonrecursive code to generate Fibonacci
sequence for a given N
Create Your Problems:
Create at least to to questions using concepts involved in x ASL Programming
Procedures or subroutines available bit versions are also presumed to be available:
CombNK:
Inputs: EBX: N EDX: K
Output: EAX
Implement: CN K
TwoExponentN:
Input: EBX: N
Output: EAX: R
Implement: R N
MUL operation
IMUL operation
DIV operation
IDIV operation
MultProc
Inputs: EAX: P EBX: Q
Outputs: EDX:EAX
Implements: P x Q
see MUL instruction operation
DivProc:
Inputs: EDX:EAX: P Dividend
EBX: D Divisor
Outputs: EAX: Q Quotient
EDX: R Remainder
Implements: P DQ x D R
ApproxEDiv:
Inputs:
Outputs: EAX: E
Implements appropriate integer approximation for e
ApproxSqRT:
Inputs: EDX: V
Outputs: EAX: S
Implements appropriate integer approximation for S V
Prof. Amenyo. York College, CUNY, Final Exam, Spring
ReadInput:
Inputs: EDI: pointer to input storage area
ECX: size of input storage area
Outputs: EDI: pointer to content read
ECX: size of actual content read
EAX: status of ReadInput: means Success
Implements: get Input data from Interactive source
WriteOutput:
Inputs: ESI: pointer to storage area of data to be displayed
ECX: size of output data
Outputs: EAX: status of WriteOutput: means Success
Can also use Input and Output functions from C C Java, Python, K Irvines ASL Library, as long
as clearly indicated.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started