Part 1 Implement the following C++ code fragment in assembly language. Use the block-structured .IF and .WHILE directives. Assume that all variables are 32-bit integers. int array[] = {3,1,4,1,5,9,2,6, 5,3,5,8,9,7,9,3,2,3,8,4}; int lower = 3; int upper = 8; int ArraySize = sizeof array / sizeof lower; int index = 0; int sum = 0; while( index = lower && array[index] 5000 mov edx, OFFSET message3 call WriteString jmp quit .ENDIF cmp eax, 0 je quit .IF eax >= 4000 mov al, "P" .ELSEIF eax >= 3000 mov al, "G" .ELSEIF eax >= 2000 mov al, "S" .ELSEIF eax >= 1000 mov al, "B" .ELSE mov al, "C" .ENDIF mov edx, OFFSET message2 call WriteString call WriteChar call Crlf Quit : popad ret exit main ENDP END main
hmm · Mar 23, 2015 9:38 PM · 16,067 views
for the first part, here's a disassembly from vs2013 compiler https://gist.githubusercontent... your code begins with line 009B545E mov dword ptr [array],3
kkus · Mar 24, 2015 9:01 PM
This conversation is preserved exactly as it was on the original Sajha.com and can't accept new replies.
Start a New Discussion