Question: Update: I figured it out! No need to answer Help with ARM Assembly language I take a user input, and then start from 1 and

Update: I figured it out! No need to answer

Help with ARM Assembly language

I take a user input, and then start from 1 and print numbers until i reach their number. I have checked, and there is no problem with getting the number, its only in the loop where there are issues. I think the problem might have to do with how I copy several registers with other registers, but I am new to this and don't really know what the problem would be. I have tried using a debugger but it wont let me single step through the loop, it just executes like a normal run of the file would act. ALSO, correct me if I am wrong, but from what i have gathered so far is that each time I output a number, it resets r1, which is why I copy r1 into r2, to save the original number, is that correct?

Update: I figured it out! No need to answer Help with ARM

cpy r2,r1 mov r4,# @copy r1 into r2 so that when output happens, I dont lose r1 gloop counter oop: cmp r4, r2 bgt myexit cpy ri,r4 ldr re, -printline @print number bl printf add r4, r4,#1 b loop @if value in ri is 100, exit @copy loop number into r1 for output @increment counter myexit: mov r7, #0x01 @ returns control to OS .data balign 4 test :.asciz balign 4 balign 4 balign 4 "%d " numsumstring: .asciz "Number \t SumInln" numinputPattern: .asciz "%d" printline : .asciz "value is %d ". cpy r2,r1 mov r4,# @copy r1 into r2 so that when output happens, I dont lose r1 gloop counter oop: cmp r4, r2 bgt myexit cpy ri,r4 ldr re, -printline @print number bl printf add r4, r4,#1 b loop @if value in ri is 100, exit @copy loop number into r1 for output @increment counter myexit: mov r7, #0x01 @ returns control to OS .data balign 4 test :.asciz balign 4 balign 4 balign 4 "%d " numsumstring: .asciz "Number \t SumInln" numinputPattern: .asciz "%d" printline : .asciz "value is %d

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!