Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Use Assembly Language (ASIDE and CUSP) Create a version of find biggest (see picture below) that supports processing of arrays of any base index (positive

Use Assembly Language (ASIDE and CUSP)

Create a version of "find biggest" (see picture below) that supports processing of arrays of any base index (positive or negative). Assume that the definition of the array is given by three values:

BASE - the base index;

NUM - the number of elements in the array;

ARR - the starting address of the array.

The program should load into memory at address $000.

image text in transcribed

Pascal Version of Find Biggest { Finds the biggest element of an array A of positive integers. This illustrates the ease of of array operations vith indexed addressing. ] AType ARRAY [O..N-1] OF INTEGER; A : AType; TYPE VAR BIG,I : INTEGER; BIG := -1; WHILE I BIG THEN BEGIN BIG: A[I]; END IF) END[WHILE) END CUSP Version of Find Biggest EQU e, $000 .EQU N,5 ; aize of array LDA STA LDX# 0 NEG 1 BIG ; BIG :=-1 ; 1 := 0 (XR is 1) JGE LDA+ CMA JLE STA ADX# JMP HLT DONE A BIG ENDIF BIG ; go to END WHILE : ACC := A[1] ; A[I]? BIG i go to END(IF BIGALI] ENDIF : LOOP go to WHILE DONE: NEG 1: WORD-1 BIG: STOP ; required to initialize BIG WORD 0 BIG WORD 17 WORD 5 WORD 1465 WORD 689 WORD 7 END ; 5 array elements Figure 5.5 Index Addressing Example: Find Biggest Pascal Version of Find Biggest { Finds the biggest element of an array A of positive integers. This illustrates the ease of of array operations vith indexed addressing. ] AType ARRAY [O..N-1] OF INTEGER; A : AType; TYPE VAR BIG,I : INTEGER; BIG := -1; WHILE I BIG THEN BEGIN BIG: A[I]; END IF) END[WHILE) END CUSP Version of Find Biggest EQU e, $000 .EQU N,5 ; aize of array LDA STA LDX# 0 NEG 1 BIG ; BIG :=-1 ; 1 := 0 (XR is 1) JGE LDA+ CMA JLE STA ADX# JMP HLT DONE A BIG ENDIF BIG ; go to END WHILE : ACC := A[1] ; A[I]? BIG i go to END(IF BIGALI] ENDIF : LOOP go to WHILE DONE: NEG 1: WORD-1 BIG: STOP ; required to initialize BIG WORD 0 BIG WORD 17 WORD 5 WORD 1465 WORD 689 WORD 7 END ; 5 array elements Figure 5.5 Index Addressing Example: Find Biggest

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

Online Market Research Cost Effective Searching Of The Internet And Online Databases

Authors: John F. Lescher

1st Edition

0201489295, 978-0201489293

More Books

Students also viewed these Databases questions

Question

Define the term Working Capital Gap.

Answered: 1 week ago

Question

Know how productivity improvements impact quality and value.

Answered: 1 week ago

Question

Recommend the key methods to improve service productivity.

Answered: 1 week ago