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-20 22:58 ID:bvDibvxK

        .section        .rodata.str1.4,"aMS",%progbits,1
        .align  2
    .LC0:
        .ascii  "%d%d\000"
        .align  2
    .LC1:
        .ascii  "%d\012\000"
        .text
        .align  2
        .global main
        .type   main, %function
    main:
        @ args = 0, pretend = 0, frame = 8
        @ frame_needed = 0, uses_anonymous_args = 0
        str     lr, [sp, #-4]!
        sub     sp, sp, #8
        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
        mov     r0, #0
        add     sp, sp, #8
        ldmfd   sp!, {pc}
    .L4:
        .align  2
    .L3:
        .word   .LC0
        .word   .LC1
        .size   main, .-main

screens:
$ ./test
34
8
8
$ ./test
68758
456347
68758
$

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