about summary refs log tree commit diff stats
path: root/example/samples/armt.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/armt.S
parent9206458e0f4b815e4af68f8978d96d14632a087f (diff)
downloadmiasm-7ce340c2e62d985e92c42add8ffc385d54360a91.tar.gz
miasm-7ce340c2e62d985e92c42add8ffc385d54360a91.zip
Example/ASM: Extract asm sources to sample dir
Diffstat (limited to 'example/samples/armt.S')
-rw-r--r--example/samples/armt.S27
1 files changed, 27 insertions, 0 deletions
diff --git a/example/samples/armt.S b/example/samples/armt.S
new file mode 100644
index 00000000..c50075a6
--- /dev/null
+++ b/example/samples/armt.S
@@ -0,0 +1,27 @@
+memcpy:
+     PUSH    {R0-R3, LR}
+     B       test_end
+loop:
+     LDRB    R3, [R1]
+     STRB    R3, [R0]
+     ADDS    R0, R0, 1
+     ADDS    R1, R1, 1
+     SUBS    R2, R2, 1
+test_end:
+     CMP     R2, 0
+     BNE     loop
+     POP     {R0-R3, PC}
+main:
+     PUSH    {LR}
+     SUB     SP, 0x100
+     MOV     R0, SP
+     ADD     R1, PC, mystr-$+6
+     MOV     R0, R0
+     EORS    R2, R2
+     ADDS    R2, R2, 0x4
+     BL      memcpy
+     ADD     SP, 0x100
+     POP     {PC}
+
+mystr:
+.string "toto"