What does the following assembly language script do?

Discussion in 'Programming' started by scripthelp, Oct 11, 2009.

  1. #1
    !BITPATTERN = 0xAB01CDFF
    .global main
    main:
    save %sp, -96, %sp


    set BITPATTERN, %l0

    clr %l1 ! checkpoint 1


    sll %l0, 24, %l2
    add %l2, %l1, %l1 ! checkpoint 2

    srl %l0, 8, %l2
    sll %l2, 24, %l2
    srl %l2, 8, %l2

    add %l2, %l1, %l1 ! checkpoint 3


    srl %l0, 16, %l2
    sll %l2, 24, %l2
    srl %l2, 16, %l2
    add %l2, %l1, %l1 ! checkpoint 4


    srl %l0, 24, %l2
    add %l2, %l1, %l1 ! checkpoint 5

    ret
    restore

    I am a beginner and dont understand this code? What does this script do..this is in asssembly language in unix..sparc
    any help is appreciated
     
    scripthelp, Oct 11, 2009 IP