Question: #1387

EEC70 HOMEWORK 5 SCored

EEC70 — COMPUTER STRUCTURE AND ASSEMBLY LANGUAGE

HOMEWORK 5

Consider the following program:
TITLE INVESTIGATE
INCLUDE Irvine32.inc
.code
main PROC
cld
call DumpRegs
std
call DumpRegs
call crlf
exit
main ENDP
END main
Executing the above program produces the following output:
EAX=7762494F EBX=7FFDE000 ECX=00000000 EDX=00401000
ESI=00000000 EDI=00000000 EBP=0018FF98 ESP=0018FF90
EIP=00401006 EFL=00000246 CF=0 SF=0 ZF=1 OF=0 AF=0 PF=1
EAX=7762494F EBX=7FFDE000 ECX=00000000 EDX=00401000
ESI=00000000 EDI=00000000 EBP=0018FF98 ESP=0018FF90
EIP=0040100C EFL=00000646 CF=0 SF=0 ZF=1 OF=0 AF=0 PF=1
Assume that string primitive instructions are not available, write few instructions that produce
the exact same behavior as the instruction:
rep movsw
Hint: You need to find the value of the direction flag and then proceed with the copying
accordingly.

Solution: #1367

EEC70 HOMEWORK 5 SCored


MOV EAX, [DS+SI];    // copy from source location t...

Tutormaster
Rating: A+ Purchased: 11 x Posted By: Studyacer
Related Solutions
Comments
Posted by: Studyacer

Online Users