From b8e92ce3bd50eec26b485f632038c9c86429ebfe Mon Sep 17 00:00:00 2001 From: standenboy Date: Thu, 18 Jan 2024 10:43:18 +0000 Subject: did the classwork --- comp/work/18/1.s | 1 + comp/work/18/2.s | 6 ++++++ comp/work/18/3.s | 9 +++++++++ comp/work/18/4.s | 3 +++ comp/work/18/5.s | 2 ++ comp/work/18/6.s | 6 ++++++ 6 files changed, 27 insertions(+) create mode 100644 comp/work/18/1.s create mode 100644 comp/work/18/2.s create mode 100644 comp/work/18/3.s create mode 100644 comp/work/18/4.s create mode 100644 comp/work/18/5.s create mode 100644 comp/work/18/6.s (limited to 'comp/work/18') diff --git a/comp/work/18/1.s b/comp/work/18/1.s new file mode 100644 index 0000000..85c2acd --- /dev/null +++ b/comp/work/18/1.s @@ -0,0 +1 @@ +ADD R2, R0, R1 diff --git a/comp/work/18/2.s b/comp/work/18/2.s new file mode 100644 index 0000000..7a0e8a5 --- /dev/null +++ b/comp/work/18/2.s @@ -0,0 +1,6 @@ +MOV R1, R0 + +ADD R5, R0, R1 +ADD R5, R5, R1 +ADD R5, R5, R1 + diff --git a/comp/work/18/3.s b/comp/work/18/3.s new file mode 100644 index 0000000..cbd9075 --- /dev/null +++ b/comp/work/18/3.s @@ -0,0 +1,9 @@ +loop: + SUB R0, R0, 5 + CMP R0, #5 + BLT end + ADD R1, R1, 1 + B loop + +end: + STR R1, 101 diff --git a/comp/work/18/4.s b/comp/work/18/4.s new file mode 100644 index 0000000..8a5ad8a --- /dev/null +++ b/comp/work/18/4.s @@ -0,0 +1,3 @@ +LDR R0, 100 +LSR R0, R0, #1 +STR R0, 101 diff --git a/comp/work/18/5.s b/comp/work/18/5.s new file mode 100644 index 0000000..a3f5ee3 --- /dev/null +++ b/comp/work/18/5.s @@ -0,0 +1,2 @@ +LSL R0, R0, #2 +STR R0, 101 diff --git a/comp/work/18/6.s b/comp/work/18/6.s new file mode 100644 index 0000000..5e41863 --- /dev/null +++ b/comp/work/18/6.s @@ -0,0 +1,6 @@ +LDR 105, R0 +LSL R0, R0, 7 +LSR R0, R0, 7 + +STR R0, 102 + -- cgit v1.2.3