Skip to content

Instantly share code, notes, and snippets.

@ibuclaw
Created July 17, 2017 23:19
Show Gist options
  • Save ibuclaw/93c707f4729ffc4376539283defdc709 to your computer and use it in GitHub Desktop.
Save ibuclaw/93c707f4729ffc4376539283defdc709 to your computer and use it in GitHub Desktop.
.cpu cortex-m4
.eabi_attribute 20, 1
.eabi_attribute 21, 1
.eabi_attribute 23, 3
.eabi_attribute 24, 1
.eabi_attribute 25, 1
.eabi_attribute 26, 2
.eabi_attribute 30, 4
.eabi_attribute 34, 1
.file "attribute.d"
.section .text._D5board6random3getFZk,"ax",%progbits
.align 1
.syntax unified
.thumb
.thumb_func
.fpu softvfp
.type _D5board6random3getFZk, %function
_D5board6random3getFZk:
.fnstart
.LFB44:
@ args = 0, pretend = 0, frame = 16
@ frame_needed = 0, uses_anonymous_args = 0
push {r0, r1, r2, r3, r4, lr}
ldr r3, .L9
ldr r2, [r3]
lsls r0, r2, #30
bpl .L2
.L4:
ldr r2, .L9+4
str r2, [sp, #8]
movs r3, #2
movs r2, #9
str r2, [sp, #12]
str r3, [sp, #4]
movs r2, #5
add r4, sp, #4
.syntax unified
@ 40 "source/stm32f42/trace.d" 1
mov r0, r2;
mov r1, r4;
bkpt #0xAB
@ 0 "" 2
.thumb
.syntax unified
ldr r1, .L9+8
str r3, [sp, #4]
strd r1, r3, [sp, #8]
.syntax unified
@ 40 "source/stm32f42/trace.d" 1
mov r0, r2;
mov r1, r4;
bkpt #0xAB
@ 0 "" 2
.thumb
.syntax unified
.L3:
b .L3
.L2:
ldr r2, [r3]
lsls r1, r2, #29
bmi .L4
.L5:
ldr r2, [r3]
lsls r2, r2, #31
bpl .L5
ldr r3, .L9+12
ldr r0, [r3]
add sp, sp, #16
@ sp needed
pop {r4, pc}
.L10:
.align 2
.L9:
.word 1342572548
.word .LC18
.word .LC2
.word 1342572552
.cantunwind
.fnend
.size _D5board6random3getFZk, .-_D5board6random3getFZk
.section .text.startup.main,"ax",%progbits
.align 1
.global main
.syntax unified
.thumb
.thumb_func
.fpu softvfp
.type main, %function
main:
.fnstart
.LFB39851:
@ args = 0, pretend = 0, frame = 0
@ frame_needed = 0, uses_anonymous_args = 0
push {r3, r4, r5, r6, r7, r8, r9, r10, fp, lr}
ldr r7, .L23
movs r3, #0
mov r2, r7
mov r4, #2016
.L14:
mov r0, r2
movs r1, #0
.L12:
adds r1, r1, #1
cmp r1, #240
strh r4, [r0], #2 @ movhi
bne .L12
adds r3, r3, #1
cmp r3, #320
add r2, r2, #480
bne .L14
ldr r6, .L23+4
mov r8, #480
.L15:
bl _D5board6random3getFZk
uxth r9, r0
bl _D5board6random3getFZk
mov r10, #240
lsrs r3, r0, #16
mov fp, #320
udiv r5, r3, r10
udiv r4, r0, fp
mls r5, r10, r5, r3
mls r4, fp, r4, r0
bl _D5board6random3getFZk
udiv r3, r0, fp
mls r3, fp, r3, r0
movw r2, #319
add r3, r3, r4
cmp r3, r2
lsr r0, r0, #16
it ge
movge r3, r2
udiv r2, r0, r10
mls r0, r10, r2, r0
add r0, r0, r5
rsb r2, r5, #1
cmp r0, #239
ite le
addle r0, r2, r0
addgt r0, r2, #239
add r5, r7, r5, lsl #1
.L19:
cmp r4, r3
bgt .L16
mla r1, r8, r4, r5
movs r2, #0
.L18:
cmp r0, r2
beq .L17
strh r9, [r1], #2 @ movhi
adds r2, r2, #1
b .L18
.L17:
adds r4, r4, #1
b .L19
.L16:
ldrb r3, [r6] @ zero_extendqisi2
eor r3, r3, #1
strb r3, [r6]
b .L15
.L24:
.align 2
.L23:
.word _D5board4ltdc11frameBufferG76800t
.word 1111687860
.cantunwind
.fnend
.size main, .-main
.section .bss._D5board4ltdc11frameBufferG76800t,"aw",%nobits
.align 1
.type _D5board4ltdc11frameBufferG76800t, %object
.size _D5board4ltdc11frameBufferG76800t, 153600
_D5board4ltdc11frameBufferG76800t:
.space 153600
.section .rodata.str1.1,"aMS",%progbits,1
.LC18:
.ascii "RNG Error\000"
.LC2:
.ascii "\015\012\000"
.ident "GCC: (GNU) 8.0.0 20170625 (experimental)"
.section .note.GNU-stack,"",%progbits
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment