Хорошо, спасибо всем за ваш вклад, мне наконец удалось это сделать. Вот мой код для тех, кому интересно:
Архитектура AVR:
;Declare variables
.dseg
.def num = R16
.def XL = R26
.def XH = R27
.def highest = R17
.def zero = R0
.def count = R18
ldi count, 11
;Initialize array with 10 values
.cseg
;Set register X to point to memory address space 0x0100
ldi XL, 0x09 ;Initialize lower byte of register X to 0x00
ldi XH, 0x01 ;Initialize higher byte of register X to 0x01
ldi num, 1 ;Set value to store in array
st X+, num ;Store value in array and increment address to point to the next index
ldi num, 2
st X+, num
ldi num, 3
st X+, num
ldi num, 4
st X+, num
ldi num, 5
st X+, num
ldi num, 6
st X+, num
ldi num, 7
st X+, num
ldi num, 8
st X+, num
ldi num, 9
st X+, num
ldi num, 10
st X+, num
;Search for the highest number in the array
;Set register to point at first index in array again
ldi XL, 0x00
ldi XH, 0x01
HIGHEST:
ld num, X+ ;Set result to first value in array and increment index
dec count ;Decrement counter
cp num, highest ;Compare value with result
brsh ISBIGGER ;If value is bigger than result set value as the new result
cp zero, count ;Check if counter is zero
brne HIGHEST ;If not repeat routine
END:
rjmp END
ISBIGGER:
mov highest, num ;Set value as new result
jmp HIGHEST ;Return to routine