A Simple MinusView as PDF
Your computer engineering instructor decided to ramp things up a bit (in terms of difficulty, of course) with this next task:
Write a program to find the maximum difference between the of adjacent elements of a given array.
Given an array , find the maximum value of for some and , where .
Unimpressed by the supposed "challenge", you open up your favourite text editor and begin typing away... in assembly.
The first line of input will contain a single integer .
The second line of input will contain space-separated integers in the range , denoting the contents of array .
The desired integer value as defined by your teacher on a line by itself.
3 3 2 1
We can find the maximum value when and :
libc in NASM, the first line of your program should be
; libc. For all others, it should be
; features: libc.
Assembly (ARM) runs under
qemu, it is allocated 0.5s and 4096kb of RAM.
Report an issue