mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-26 19:51:35 +01:00
aarch64 basically done, but missing: - other archs - maybe convert main.c into C++ to use templates? - full review of ASSERT_EQ calling convention issues not seen by tests by chance - documentation
18 lines
356 B
ArmAsm
18 lines
356 B
ArmAsm
/* https://github.com/cirosantilli/arm-assembly-cheat#ubfm */
|
|
|
|
#include "common.h"
|
|
|
|
ENTRY
|
|
ldr x19, =0x1122334455667788
|
|
|
|
// lsr alias: imms == 63
|
|
|
|
ldr x20, =0xFFFFFFFFFFFFFFFF
|
|
ubfm x20, x19, 16, 63
|
|
ASSERT_EQ(x20, 0x0000112233445566)
|
|
|
|
ldr x20, =0xFFFFFFFFFFFFFFFF
|
|
ubfm x20, x19, 32, 63
|
|
ASSERT_EQ(x20, 0x0000000011223344)
|
|
EXIT
|