Assembly Language

if you have experience with Assembly Language  please contact me 

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper

Assembly Language

CS 245

20 Points

Name ____________________________________

Due: April 02, 2020

1. Each of these problems gives “before” conditions and an instruction. Give the indicated “after” state.

Before

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper

Instruction executed

(a)

ECX: 00 00 BF 7A

mov ecx, -89

(b)

ECX: 00 00 BF 7A

mov ecx, 984

(c)

EAX: 12 34 56 78
EDX: 9A BC DE F0

xchg ax, dx

(d)

EAX: FF FF FF C8

add eax, 56

ZF__

CF__

OF__

(e)

EDX: 00 00 02 E9

inc edx

ZF__

(f)

EBX: FF FF FF 3B

neg ebx

ZF__

(g)

EAX: 01 23 45 67
ECX: 89 AB CD EF

sub eax, ecx

ZF__

CF__

OF__

(h)

EAX: 00 CC 00 10
ECX: FF FF AF FD
EDX: FF 03 FF 01

mul ecx

EAX

EDX

CF,OF __

(i)

EAX: 00 CC 00 0A
EBX: 00 AA 00 0C
EDX: FF 03 FF 01

imul eax,ebx

EAX

EDX

(i)

EAX: 00 CC 00 0A
EBX: 00 AA 00 0C
EDX: FF 03 FF 01

div ebx

EAX

EDX

2. One way to calculate the harmonic mean of two numbers x and y is using the expression

Complete the following windows32 program to input two numbers and calculate and display their harmonic mean in dddd.dd format. Supply appropriate code in the boxed areas.

.586

.MODEL FLAT

INCLUDE io.h ; header file for input/output

.STACK 4096

.DATA

x DWORD ?

y DWORD ?

prompt1 BYTE “First number”, 0

prompt2 BYTE “Second number”, 0

inArea BYTE 20 DUP (?)

mean BYTE 11 DUP (?), 0

meanLbl BYTE “Harmonic mean”, 0

meanOut BYTE 4 DUP(?), ‘.’, 2 DUP (?), 0

.CODE

_MainProc PROC

input prompt1, inArea, 20 ; read ASCII characters

atod inArea ; convert to integer

mov x, eax ; store in memory

; repeat for second number

3 (continued)

; calculate 100*(harmonic mean)in EAX

dtoa mean, eax ; convert to ASCII characters

; copy digits, one at a time to meanOut (Complete the missing lines)

mov al, mean+5
mov meanout, al
mov al, mean+6
mov meanout+1, al
mov al, mean+7
mov meanout+2, al

; 1st digit
; 2nd digit
; 3rd digit

; output label and mean

mov eax, 0 ; exit with return code 0

ret

_MainProc ENDP

END ; end of source code

Calculate your order
Pages (275 words)
Standard price: $0.00
Client Reviews
4.9
Sitejabber
4.6
Trustpilot
4.8
Our Guarantees
100% Confidentiality
Information about customers is confidential and never disclosed to third parties.
Original Writing
We complete all papers from scratch. You can get a plagiarism report.
Timely Delivery
No missed deadlines – 97% of assignments are completed in time.
Money Back
If you're confident that a writer didn't follow your order details, ask for a refund.

Calculate the price of your order

You will get a personal manager and a discount.
We'll send you the first draft for approval by at
Total price:
$0.00
Power up Your Academic Success with the
Team of Professionals. We’ve Got Your Back.
Power up Your Study Success with Experts We’ve Got Your Back.

Order your essay today and save 30% with the discount code ESSAYHELP