Write an ASM language to find largest number in given array?

All QuestionsCategory: Embedded SystemWrite an ASM language to find largest number in given array?
Chetan Shidling Staff asked 5 years ago

I need code.

1 Answers
Chetan Shidling Staff answered 5 years ago

Code 01:

AREA LARGE, CODE
ENTRY
LDR R0,= 0X40000000
MOV R5, #5
LDR R2, [R0], #4
LRG LDR R4, [R0], #4
CMP R2, R4
MOVCC R2, R4
SUBS R5, R5, #1
BNE LRG
STOP B STOP
END

Code 02:

AREA LARGE2, CODE
ENTRY
LDR R5,= 0X40000000
MOV R0, #5
LDRB R6, [R5], #1
LRG LDRB R7, [R5], #1
SUBS R8, R6, R7
MOVCC R6, R7
SUBS R0, R0, #1
BNE LRG
STOP B STOP
END