diff --git a/ARM/a.out b/ARM/a.out new file mode 100755 index 0000000..5f9c1dc Binary files /dev/null and b/ARM/a.out differ diff --git a/ARM/add-int.o b/ARM/add-int.o new file mode 100644 index 0000000..f9b5e45 Binary files /dev/null and b/ARM/add-int.o differ diff --git a/ARM/add-int.s b/ARM/add-int.s new file mode 100644 index 0000000..401d4af --- /dev/null +++ b/ARM/add-int.s @@ -0,0 +1,17 @@ + .equ SYS_EXIT, 93 + .data +int1: .quad 0x15 +int2: .quad 0x2 + .text + + .globl _start +_start: adr x3,int1 + ldr x0,[x3] + adr x3,int2 + ldr x1,[x3] + add x2,x0,x1 + + mov x0,#0 + mov w8,#SYS_EXIT + svc #0 +.end diff --git a/ARM/add-int32.o b/ARM/add-int32.o new file mode 100644 index 0000000..4db1d62 Binary files /dev/null and b/ARM/add-int32.o differ diff --git a/ARM/add-int32.s b/ARM/add-int32.s new file mode 100644 index 0000000..54b1cbb --- /dev/null +++ b/ARM/add-int32.s @@ -0,0 +1,17 @@ + .equ SYS_EXIT, 93 + .data +int1: .word 0x15 +int2: .word 0x2 + .text + + .globl _start +_start: adr x3,int1 + ldr w0,[x3] + adr x3,int2 + ldr w1,[x3] + add w2,w0,w1 + mrs x4,nzcv + mov x0,#0 + mov w8,#SYS_EXIT + svc #0 +.end diff --git a/ARM/maybe.o b/ARM/maybe.o new file mode 100644 index 0000000..5cc8d4e Binary files /dev/null and b/ARM/maybe.o differ diff --git a/ARM/maybe.s b/ARM/maybe.s new file mode 100644 index 0000000..7079aad --- /dev/null +++ b/ARM/maybe.s @@ -0,0 +1,31 @@ + .equ SYS_EXIT,93 + + .data +int1: .word 0xa2 +int2: .word 0xb + + .text + .globl _start +_start: + adr x5,int1 + ldr w0,[x5] + uxtw x1,w0 + + adr x5,int2 + ldr w0,[x5] + uxtw x2,w0 + + mov x0,#0 + +loop: cbz x2, exit + tbz x2, 0, next + add x0, x0, x1 + +next: lsl x1, x1, #1 + lsr x2, x2, #1 + b loop + +exit: mov x0,#0 + mov w8,#SYS_EXIT + svc #0x0 +.end diff --git a/ARM/printHW.o b/ARM/printHW.o new file mode 100644 index 0000000..1f79e16 Binary files /dev/null and b/ARM/printHW.o differ diff --git a/ARM/printHW.s b/ARM/printHW.s new file mode 100755 index 0000000..f9e5933 --- /dev/null +++ b/ARM/printHW.s @@ -0,0 +1,23 @@ +.equ SYS_EXIT, 93 +.equ SYS_WRITE, 64 + +.data +msg: .asciz "Hello World!\n" +.text + +.global _start + + +_start: +mov x0,#1 +adr x1,msg +mov x2,#13 +mov w8, #SYS_WRITE + +svc #0 + +mov x0, #0 +mov w8, #SYS_EXIT +svc #0 + +.end diff --git a/ARM/shift-experiment.s b/ARM/shift-experiment.s new file mode 100644 index 0000000..0facd15 --- /dev/null +++ b/ARM/shift-experiment.s @@ -0,0 +1,19 @@ + .equ SYS_EXIT, 93 + .data +int1: .quad 0x15 +int2: .quad 0x2 + .text + + .globl _start +_start: + mov x0,#1 + lsl x1,x0,#3 + lsr x2,x0,#1 + adr x6,int + ldr x3,[x6] + lsr x4,x3,#3 + asr x5,x3,#3 + + mov w8,#SYS_EXIT + svc #0 +.end diff --git a/ARM/tp19.s b/ARM/tp19.s new file mode 100644 index 0000000..1e361fb --- /dev/null +++ b/ARM/tp19.s @@ -0,0 +1,29 @@ + .equ SYS_EXIT,93 + .data +int1: .word 0xa2 +int2: .word 0xb + .text + .globl _start +_start: + adr x5,int1 + ldr x0,[x5] + uxtw x1,x0 + + adr x5,int2 + ldr x0,[x0] + uxtw x2,x0 + + mov x0,#0 + +loop: cbz x2, exit + tbz x2, next + add w8, w8, x1 + +next: lsl x1, #1 + lsr x2, #1 + b loop + +exit: mov x0,#0 + mov w8,#SYS_EXIT + svc #0x0 +.end \ No newline at end of file