Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

MASM Assembly-Languag Create a PROCEDURE out of LAB #4 which will be called from your MAIN PROCEDURE. lab #4 TITLE ]given array using push and

MASM Assembly-Languag

Create a PROCEDURE out of LAB #4 which will be called from your MAIN PROCEDURE.

lab #4

TITLE ]given array using push and pop (reverseprint.asm)

;This program wiil reverse a given array.

INCLUDE Irvine32.inc

.data

arrayB word 9,8,7,6,5,4,3,2,1,0 ; Array of integers with 10 elements

.code

main PROC

mov eax,0

mov esi,OFFSET arrayB ;Point esi to arrayB

mov ecx,LENGTHOF arrayB ;elements in array

mov ebx,TYPE arrayB ;point ebx to next element in array

call dumpmem

mov eax, 0

mov esi,OFFSET arrayB + SIZEOF arrayB - TYPE arrayB ;Last element in array

mov ecx,LENGTHOF arrayB ;elements in array

;start of loop

Reverse:

mov ax,[esi] ;move vaue of esi to ax

call writeint ;print value in ax

sub esi,TYPE arrayB ;point esi to previous element

loop Reverse ;LOOP

;end of loop

exit

main ENDP

End main

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Refactoring Databases Evolutionary Database Design

Authors: Scott Ambler, Pramod Sadalage

1st Edition

0321774515, 978-0321774514

More Books

Students also viewed these Databases questions

Question

Explain the chemical properties of acids with examples.

Answered: 1 week ago

Question

Write the properties of Group theory.

Answered: 1 week ago