about summary refs log tree commit diff stats
path: root/example/samples/arm_simple.S
diff options
context:
space:
mode:
authorCamille Mougey <camille.mougey@cea.fr>2015-01-21 17:46:26 +0100
committerCamille Mougey <camille.mougey@cea.fr>2015-01-23 17:24:43 +0100
commit7ce340c2e62d985e92c42add8ffc385d54360a91 (patch)
tree920c6d567ba941b92a4aba3cfeec72c0e80bf92c /example/samples/arm_simple.S
parent9206458e0f4b815e4af68f8978d96d14632a087f (diff)
downloadmiasm-7ce340c2e62d985e92c42add8ffc385d54360a91.tar.gz
miasm-7ce340c2e62d985e92c42add8ffc385d54360a91.zip
Example/ASM: Extract asm sources to sample dir
Diffstat (limited to 'example/samples/arm_simple.S')
-rw-r--r--example/samples/arm_simple.S24
1 files changed, 24 insertions, 0 deletions
diff --git a/example/samples/arm_simple.S b/example/samples/arm_simple.S
new file mode 100644
index 00000000..f6dcf81e
--- /dev/null
+++ b/example/samples/arm_simple.S
@@ -0,0 +1,24 @@
+main:
+  STMFD  SP!, {R4, R5, LR}
+  MOV    R0, mystr & 0xffff
+  ORR    R0, R0, mystr & 0xffff0000
+  MOV    R4, R0
+  MOV    R1, mystrend & 0xffff
+  ORR    R1, R1, mystrend & 0xffff0000
+xxx:
+  LDRB    R2, [PC, key-$]
+loop:
+  LDRB   R3, [R0]
+  EOR    R3, R3, R2
+  STRB   R3, [R0], 1
+  CMP    R0, R1
+  BNE    loop
+end:
+  MOV    R0, R4
+  LDMFD  SP!, {R4, R5, PC}
+key:
+.byte 0x11
+mystr:
+.string "test string"
+mystrend:
+.long 0