Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
swap bytes
out_curr[3] = ((new_nal_len >> 0) & 0xFF); // move byte 3 to byte 0
b384: e59d302c ldr r3, [sp, #44] ; 0x2c
b388: e2832003 add r2, r3, #3
b38c: e59d3034 ldr r3, [sp, #52] ; 0x34
b390: e20330ff and r3, r3, #255 ; 0xff
b394: e5c23000 strb r3, [r2]
out_curr[2] = ((new_nal_len >> 8) & 0xFF); // move byte 2 to byte 1
b398: e59d302c ldr r3, [sp, #44] ; 0x2c
b39c: e2832002 add r2, r3, #2
b3a0: e59d3034 ldr r3, [sp, #52] ; 0x34
b3a4: e1a03443 asr r3, r3, #8
b3a8: e20330ff and r3, r3, #255 ; 0xff
b3ac: e5c23000 strb r3, [r2]
out_curr[1] = ((new_nal_len << 16) & 0xFF); // move byte 1 to byte 2
b3b0: e59d302c ldr r3, [sp, #44] ; 0x2c
b3b4: e2832001 add r2, r3, #1
b3b8: e3a03000 mov r3, #0
b3bc: e5c23000 strb r3, [r2]
out_curr[0] = ((new_nal_len << 24) & 0xFF);
b3c0: e59d202c ldr r2, [sp, #44] ; 0x2c
b3c4: e3a03000 mov r3, #0
b3c8: e5c23000 strb r3, [r2]
*((int *)out_curr) = __builtin_bswap32(new_nal_len);
b384: e59d402c ldr r4, [sp, #44] ; 0x2c
b388: e59d3034 ldr r3, [sp, #52] ; 0x34
b38c: e1a00003 mov r0, r3
b390: eb0035a6 bl 18a30 <__bswapsi2>
b394: e1a03000 mov r3, r0
b398: e5843000 str r3, [r4]
00017e28 <__bswapsi2>:
17e28: e1a03000 mov r3, r0
17e2c: e1a00c20 lsr r0, r0, #24
17e30: e20328ff and r2, r3, #16711680 ; 0xff0000
17e34: e1800c03 orr r0, r0, r3, lsl #24
17e38: e1800422 orr r0, r0, r2, lsr #8
17e3c: e2033cff and r3, r3, #65280 ; 0xff00
17e40: e1800403 orr r0, r0, r3, lsl #8
17e44: e12fff1e bx lr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.