From 1fd2b698d4dc9fe0cd433dc81141a464a2903311 Mon Sep 17 00:00:00 2001 From: Simon Saye Babu Date: Fri, 26 May 2023 13:48:24 +0200 Subject: [PATCH] arm --- ARM/a.out | Bin 0 -> 1656 bytes ARM/add-int.o | Bin 0 -> 1592 bytes ARM/add-int.s | 17 +++++++++++++++++ ARM/add-int32.o | Bin 0 -> 1632 bytes ARM/add-int32.s | 17 +++++++++++++++++ ARM/maybe.o | Bin 0 -> 1992 bytes ARM/maybe.s | 31 +++++++++++++++++++++++++++++++ ARM/printHW.o | Bin 0 -> 1576 bytes ARM/printHW.s | 23 +++++++++++++++++++++++ ARM/shift-experiment.s | 19 +++++++++++++++++++ ARM/tp19.s | 29 +++++++++++++++++++++++++++++ 11 files changed, 136 insertions(+) create mode 100755 ARM/a.out create mode 100644 ARM/add-int.o create mode 100644 ARM/add-int.s create mode 100644 ARM/add-int32.o create mode 100644 ARM/add-int32.s create mode 100644 ARM/maybe.o create mode 100644 ARM/maybe.s create mode 100644 ARM/printHW.o create mode 100755 ARM/printHW.s create mode 100644 ARM/shift-experiment.s create mode 100644 ARM/tp19.s diff --git a/ARM/a.out b/ARM/a.out new file mode 100755 index 0000000000000000000000000000000000000000..5f9c1dc94a60d1d42250415bb85ae09a3bed1a2d GIT binary patch literal 1656 zcmbtUziSjh6#i~E(bJ213I2#0l|UdUcwh>#P`HFd6tpoZ5>S>sZy|x?PO?*6s-(|9 zAy$?t0xDRDC|Fnoli~`CC>9nL5iAZA&Nnmf&29FwSU9lreeZj3=FOX#oz;2)_~!Tpe0TgJerUcFu2iB@Oy&Hu`LqjCb28Y6N9SVCW54bvO~-vCE(fc6 ze|zw=?Sh!-{RZie*cKQtq&qJi9yJfYQtKHqdiVM-u`YXUOzK8hm%S7HGV8MMqTeD? zq`a+E-cp8sGef^`^zL=u$%voH&>v>#k27?>2X#!(O$Sr6cW1CrQ`dAihLHvq>-8sy z8Vd@wsG$%9l{gM!6)vkFU@NLs9XB4*S&OQn3ZX5a6t66)utKPoEzS#5dg_viC9jPM zE99j$|8F}_6X-jp-w@s89&cEa{|Yt;(l>ONG(BE!wA^=jk2>#;okPba+b9`nP5WCM z)MS*rf_$n};<-iuB-k)RiNj-xcspmf^f0M;|juS}d R@6Q-t=0fQa-q+IO{{lbim2&_9 literal 0 HcmV?d00001 diff --git a/ARM/add-int.o b/ARM/add-int.o new file mode 100644 index 0000000000000000000000000000000000000000..f9b5e45ea351e3e3443c928935589a3be2b93d86 GIT binary patch literal 1592 zcmbu9y-EW?5P;`${^UnAilU%M3K0uE5(}}gxZ)xR7Gf+SD9MHkL{O336=!97U&J@? zJ;cICu(h<(ncJOYot#*>a5ppG?##{1?%qTF_%P=-sih#J> z2LF?!LYV{S5n%B0R2rOOoYy7emNQbvE&%ZoKB3_x0>}@o01B2~v~=>)BY+uJ(RbF; z=PbRfbrps?SGTbj!AKjf%2wRWP5{x@%Sg&ubv4c#t$Oq546sQxdhNnS0<9=k{n(1KfGO}^66PIa&bH1M z*W!9R>xzjb`L^KP$$h~&ejqrXgcHHd?!$%PoL^7y6=QSFoadV1;6?X0vFf0V`&#x` z>vyk}7k85wyimmoyiOE>mr`tF>Y_Thm_z+XR?wOHIwgYm#;yp?{bam~3NfF7ky~bS ztH!2&(|5S<+@DRu*f^DR=uG@j5OlZ;GS8ApI-k_lakH XKW~Dr4+CmN_GL!UsCox~3577q@z`SNY@O_G`2huZOBGLZmT33!2lCoI5IYJlAcx{!k`Af3Mk z_m!-NHVKJb`e5$^p#S!q>z|_5`y$3C@n>|iu#9*be?IQ9WZy-MA^37~+?Z$;b6ozo<8A=SOFN!z$5V8Hzn<1fkarEtPpJfzDQz zoTBhD0aGu=V!U1TIwxv=Q}LoxQM~L|RlMAe6UFl_fJ?DPqZF@+!6Nk^OZCva$CZf7eo^r< zXQ5XR5a$ZPw!(+L%|4w2?IY(QbK78E-)!H?V;C9xZV*BDfHZY}haSc(oxh7Qnxizy ze`F1LGo*jHKP7w~*MFP)|KxnCk={Dp|2}fMc1n>v`WD(t*Gj(qeo1Ve12b&ti%H)Q ay+84B`xjVrO$6EM{pUvHpR;J~kNh7)zeLyo literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..5cc8d4eb58b622ec1a050e2675092a7ab2ea7b5c GIT binary patch literal 1992 zcmbtVOKTKC5U$zr5nUgf;QPe}f&__!ksuyCjA2#~JOtxGK}lxGLIQcQ(}&F|dld8s z|N2i^h-Yt?jryPcX557shMUwvIw-CbQhyV-bfuMz|V3Fre2 zEU-jF2M0LLVN6vzN=(;YQT*|HNY{XWFed7L{X+D9n&=i$@M3gtb7%VZ-JM^(-dP!Y zTkSsNd3IlOt|~uv&S4s6e1x9`ejo|Y14(jkYbA6HG$nMx!zVpl^YDm=PkH#XhtGKU zoQKbQ_=1NodHAx2uUNd2ZZum_M$mnazk{&!1c*ZZl}Shk3bd`~&)zdNVk=q9V=Gq7 zWUEx{2tGuXfCjs_6InZ;DQouMqd5v_yw40kC|y({AssHTSDC4m)o1p}>|EpV{YSL4 zY9{4%lg2ujslO$qFXBL?^mPlVl_XZc;vaQ z_#tN}ipM%;6pwCxs(7q#QSsh+JzlVjB^AaB& z|6B%3#J>YF%pduE_W~h^|Kp}Y{{b$iVC(<@ literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..1f79e169bad996a10f02a3197dd2fff35d366051 GIT binary patch literal 1576 zcmbtU%}N773{JcLtk$3U2ZA0}5l^z{MLc-eLn{?LhzeCubW4jBT9w^B)RTP{PriZg zAs&1LuReh$JBd4_D;}KE$(L`EOp=+|$Lhgeu}}aR1$co>6BeNDWH?A+03{d)5BjfY zUw$g|UtPCs1;i!%H`7>Vs=&mLR)I+iPg!`{ z!ZQ}0v+%ryX(t@_(amjAtNXEq%*wB`liLXZ2Y-3PfuRA~)cg5$p;o9D0H0q$DznLC zJ{W&7H8IgLYl9pZ)>NuHFgn05Aydw)>-g;WvU<9I0tD(u`zKZC#@DdcgUdJxql6<# zg|nDS(TXk|FCuSe>9LLGHxw^%cNFikUQxW zHwhaklgP-nps3Xe{iM}Pz;A|02!11u!B1IiS?Urt&{#tKM|$W?eH~Fj0@gjnOFxCC zb0;nkg5@S3qV$3KP5VgSgX&=6h3k3s*SP+7_NN@_HR<|yk<+=8%Lh$3_$y-+oOQ0G+wVmiy6iB93-oQ! b`xBqHzso^ae*zky_opvqp1;Rr^$-7Vsqae$ literal 0 HcmV?d00001 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