Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @name : Angela Castaneda
- .data
- tempRet: .word 1
- count: .word 1
- nombre: .word 1
- hex: .word 0x12345678, 0xFEDCBA98, 0x01010101, 0x6db6db6d,0xFFFFFFFF,0x00000000
- str1: .asciz "Hex: \t%#010X\t \n"
- str2: .asciz "Binary: "
- str3: .asciz "CIST\t039\tAngela Castaneda"
- .text
- .global main
- .func main
- main:
- ldr r1, =tempRet @Place to save return address
- str lr, [r1]
- ldr r1, =count
- str lr, [r1]
- ldr r2, =nombre
- str lr, [r2]
- ldr r0, =str3 @prints out my name
- bl puts
- mov r4, #0
- DisplayHex:
- ldr r12, = hex
- ldr r6, [r12, r4]
- ldr r0, = str1
- mov r1, r6
- bl printf
- add r4, r4, #1
- cmp r4, #5
- bne DisplayHex
- BinaryStuff:
- ldr r5, = hex
- ldr r6, [r5,r4]
- ldr r0, = str2
- mov r1, r6
- bl printf
- mov r4,#0
- logShift:
- lsls r6, #1
- bcs addOne
- mov r0, #0x30
- bal display
- addOne:
- mov r0, #0x31
- display:
- bl putchar
- add r4,r4, #1
- cmp r4, #32
- blt logShift
- add r4, r4, #1
- cmp r4, #5
- blt BinaryStuff
- loop:
- ldr r0, = str2 @takes str2 and puts it in r0 after str1 prints out
- ldr r1, =count @Get the return address back
- ldr r4, [r1]
- ldr r1, =tempRet @Get the return address back
- ldr lr, [r1]
- //bne loop @goes through again if not equal
- mov r0 , #0 @0 decimal is the exit code
- bx lr
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement