Assembly Code - not getting correct answer -
I'm going through "programming from the ground up" Now I have the following code, which should be given 2 as the minimum answer, but I'm getting 0 as the answer when I do Aloe $
.section. Data data_items: .long 3,67,34,222,56,87,9,2,88,22,11,66,900,0 .section .text .globl _start_start: movl $ 0,% edi movl data_imes (,% edi, 4 ),% Eax movl% eax,% Ebx start_loop: CMPL $ 0,% EX which loop_exacted% ADI MML data_its (,% EDI, 4),% EX square% EBX,% EXG GRArt_Loop MLL% AX,% EBX JMAP Start_Lop Loop_Exit : MGL $ 1,% Exx $ 0x80
OK, less than 0
Because if you value in EX current from ebay If you are going back to the loop, it also seems that zero is used as the exit code in these lines
cmpl $ 0,% Eax je loop_exit < / Code>
In this case when you press Zero in the list, this is effectively the lowest number and exit status
Comments
Post a Comment