Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Can someone help me with this problem. We\'re using microsoft visual studios and

ID: 3701472 • Letter: C

Question

Can someone help me with this problem. We're using microsoft visual studios and its from my assembly code language class.

we're following this template in class.

Write a program and verify it using visual studio that does the following: Use type, lengthof, and size to make your program more independent of the data type. 1) Write a program that prints the str1, stored in data, on the screen. Then waits for 1 sec and prints str2 on the screen. .data str1 byte "Today I have an assignment. str2 byte "I just finished my assignment."

Explanation / Answer

.data

str1      byte     "Today I have an assignment."

str2      byte     "I just finished my assignment."

timeval:

            tv_sec dd        0

            tv_usec            dd        0

.code

main PROC

            ; print first string str1

            mov     dx, str1

            mov                 cx, LENGTHOF str1

            mov                 ah, 9

            int                    0x21

           

            ; sleep for 1 second

            mov                 dw [tv_sec],1

            mov                 dw [tv_usec],0

            mov                 eax, 162

            mov                 ebx, timeval

            mov                 ecx, 0x21

            int        0x21

           

            ; print second string str1

            mov     dx, str2

            mov                 cx, LENGTHOF str2

            mov                 ah, 9

            int                    0x21

           

            INVOKE ExitProcess, 0

main ENDP

END main