subject

Create a procedure named FindThrees that returns 1 if an array has three consecutive values of 3 somewhere in the array. Otherwise, return 0. The
procedure's input parameter list contains a pointer to the array and the
array's size. Use the PROC directive with a parameter list when declaring
the procedure. Preserve all registers (except EAX) that are modified by
the procedure. Write a test program that calls FindThrees several times
with different arrays.
!
.386
.model flat, stdcall
.stack 4096
ExitProcess proto, dwExitCode:dword
FindThrees proto aPtr:PTR SDWORD, arraySize:DWORD
.data
strSuccess BYTE "Success.", 0
strFailure BYTE "Failure.", 0
Array1 sdword 4, 6, 3, 3, 2, 5 ; false
Array2 sdword 3,3,3,9,5 ; true
Array3 sdword 1,2,3,3,4,3,3,3,9 ; true
Array4 sdword 1,2,4,-4,-5,9 ; false
.code
main proc
invoke FindThrees, ADDR Array1, LENGTHOF Array1 ;invoke FindThrees procedure for Array 1
;invoke FindThrees procedure for Array 2
;invoke FindThrees procedure for Array 3
;invoke FindThrees procedure for Array 4
invoke ExitProcess,0
main endp
FindThrees proc,
aPtr:PTR SDWORD, arraySize:DWORD

ansver
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 19:40, Dogtes9667
Consider the following generator matrix: g= (1 0 0 0 1 0 0 0 1 1 1 1 1 0 1 1 1 0) find all the codewords generated by this generator matrix. determine the number of errors that this code will detect. determine the number of errors that this code will correct. prove that a linear code's minimum weight is equivalent to its minimum distance. that is, where c is a linear code, dist(c) = wh(c)
Answers: 1
image
Computers and Technology, 24.06.2019 01:30, shonnybenskin8
Hazel has just finished adding pictures to her holiday newsletter. she decides to crop an image. what is cropping an image?
Answers: 1
image
Computers and Technology, 24.06.2019 07:20, djs1002
Ingrid started speaking about her slide presentation. when she clicked to th"third slide, which had just a picture of an elephant, she forgot what she wassupposed to talk about. what could ingrid do to avoid this situation in thefuture? oa. print handouts for her audience. ob. add presenter's notes to each slide. oc. add a video to each slide. od. save her slide presentation to a flash drive
Answers: 2
image
Computers and Technology, 24.06.2019 10:20, silviamgarcia
Write a program that keeps asking the user for new values to be added to a list until the user enters 'exit' ('exit' should not be added to the list). these values entered by the user are added to a list we call 'initial_list'. then write a function that takes this initial_list as input and returns another list with 3 copies of every value in the initial_list. finally, inside print out all of the values in the new list. for example: input: enter value to be added to list: a enter value to be added to list: b enter value to be added to list: c enter value to be added to list: exit output: a b c a b c a b c note how 'exit' is not added to the list. also, your program needs to be able to handle any variation of 'exit' such as 'exit', 'exit' etc. and treat them all as 'exit'.
Answers: 2
You know the right answer?
Create a procedure named FindThrees that returns 1 if an array has three consecutive values of 3 so...

Questions in other subjects:

Konu
Mathematics, 27.09.2019 04:00
Konu
History, 27.09.2019 04:00