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

All QuestionsCategory: ARMWrite an ASM language to find largest number in given array?
Chetu Staff asked 2 months ago

I need code.

1 Answers
Chetu Staff answered 2 months 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

Your Answer