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 4:34 ID:XeZl9pfr

>>10

x86-64 is slightly better.

        .file   "comp.c"
        .section        .rodata.str1.1,"aMS",@progbits,1
.LC0:
        .string "%d"
.LC1:
        .string "%i"
        .text
        .p2align 4,,15
.globl main
        .type   main, @function
main:
        leal    4(%esp), %ecx
        andl    $-16, %esp
        pushl   -4(%ecx)
        pushl   %ebp
        movl    %esp, %ebp
        subl    $40, %esp
        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
        movl    -8(%ebp), %ecx
        movl    -4(%ebp), %ebx
        xorl    %eax, %eax
        leave
        leal    -4(%ecx), %esp
        ret
        .size   main, .-main
        .ident  "GCC: (GNU) 4.1.3 20070514 (prerelease) (Ubuntu 4.1.2-7ubuntu2)"
        .section        .note.GNU-stack,"",@progbits

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