mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-27 12:04:27 +01:00
userland: add assembly support
Move arm assembly cheat here, and start some work on x86 cheat as well.
This commit is contained in:
31
userland/arch/arm/push.S
Normal file
31
userland/arch/arm/push.S
Normal file
@@ -0,0 +1,31 @@
|
||||
/* https://github.com/cirosantilli/arm-assembly-cheat#ldmia */
|
||||
|
||||
#include "common.h"
|
||||
|
||||
ENTRY
|
||||
|
||||
/* Save sp before push. */
|
||||
mov r0, sp
|
||||
|
||||
/* Push. */
|
||||
mov r1, 1
|
||||
mov r2, 2
|
||||
push {r1, r2}
|
||||
|
||||
/* Save sp after push. */
|
||||
mov r1, sp
|
||||
|
||||
/* Restore. */
|
||||
mov r3, 0
|
||||
mov r4, 0
|
||||
pop {r3, r4}
|
||||
ASSERT_EQ(r3, 1)
|
||||
ASSERT_EQ(r4, 2)
|
||||
|
||||
/* Check that stack pointer moved down by 8 bytes
|
||||
* (2 registers x 4 bytes each).
|
||||
*/
|
||||
sub r0, r1
|
||||
ASSERT_EQ(r0, 8)
|
||||
|
||||
EXIT
|
||||
Reference in New Issue
Block a user