Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Lets see if you can do it!

Name: Mc. Pants 2007-05-20 22:37 ID:NB2e5KHf

Hey guys, write an assembly language program that will allow the user to input 2 values, store them in declared variables, and display the smaller of the 2 values. Winner will get whatever they want on request, but to win it, provide the evidence by a screencap. Answers are fine too... (but screencap is the way to win!)

Name: Anonymous 2007-05-21 6:23 ID:WvZpq1Ym

>>11
        add     r1, sp, #4
        mov     r2, sp
        ldr     r0, .L3
        bl      scanf
        ldr     r3, [sp, #0]
        ldr     r1, [sp, #4]
        ldr     r0, .L3+4
        cmp     r3, r1
        movlt   r1, r3
        bl      printf

        leal    -16(%ebp), %eax
        movl    %ecx, -8(%ebp)
        movl    %ebx, -4(%ebp)
        movl    $.LC0, (%esp)
        movl    %eax, 4(%esp)
        call    scanf
        leal    -12(%ebp), %eax
        movl    -16(%ebp), %ebx
        movl    $.LC0, (%esp)
        movl    %eax, 4(%esp)
        call    scanf
        movl    -12(%ebp), %eax
        movl    $.LC1, (%esp)
        cmpl    %eax, %ebx
        cmovge  %ebx, %eax
        movl    %eax, 4(%esp)
        call    printf

way easier to read

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List