From 844a8fd108621b3313bb20a00c1057c0cf607a2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C5=A1per=20Dobrovoljc?= Date: Sun, 3 Dec 2023 11:51:49 +0100 Subject: [PATCH] naloga_05 --- .../naloga_05/vaja_01/vaja_01_add_16bit.s | 22 ++++++++++++++++ .../naloga_05/vaja_01/vaja_01_add_32bit.s | 20 +++++++++++++++ .../naloga_05/vaja_01/vaja_01_add_8bit.s | 22 ++++++++++++++++ .../naloga_05/vaja_01/vaja_01_sub_16bit.s | 22 ++++++++++++++++ .../naloga_05/vaja_01/vaja_01_sub_32bit.s | 20 +++++++++++++++ .../naloga_05/vaja_01/vaja_01_sub_8bit.s | 22 ++++++++++++++++ sprotne_naloge/naloga_05/vaja_02.s | 25 +++++++++++++++++++ sprotne_naloge/naloga_05/vaja_03.s | 24 ++++++++++++++++++ sprotne_naloge/naloga_05/vaja_04/vaja_04_a.s | 20 +++++++++++++++ sprotne_naloge/naloga_05/vaja_04/vaja_04_b.s | 20 +++++++++++++++ sprotne_naloge/naloga_05/vaja_04/vaja_04_c.s | 20 +++++++++++++++ 11 files changed, 237 insertions(+) create mode 100644 sprotne_naloge/naloga_05/vaja_01/vaja_01_add_16bit.s create mode 100644 sprotne_naloge/naloga_05/vaja_01/vaja_01_add_32bit.s create mode 100644 sprotne_naloge/naloga_05/vaja_01/vaja_01_add_8bit.s create mode 100644 sprotne_naloge/naloga_05/vaja_01/vaja_01_sub_16bit.s create mode 100644 sprotne_naloge/naloga_05/vaja_01/vaja_01_sub_32bit.s create mode 100644 sprotne_naloge/naloga_05/vaja_01/vaja_01_sub_8bit.s create mode 100644 sprotne_naloge/naloga_05/vaja_02.s create mode 100644 sprotne_naloge/naloga_05/vaja_03.s create mode 100644 sprotne_naloge/naloga_05/vaja_04/vaja_04_a.s create mode 100644 sprotne_naloge/naloga_05/vaja_04/vaja_04_b.s create mode 100644 sprotne_naloge/naloga_05/vaja_04/vaja_04_c.s diff --git a/sprotne_naloge/naloga_05/vaja_01/vaja_01_add_16bit.s b/sprotne_naloge/naloga_05/vaja_01/vaja_01_add_16bit.s new file mode 100644 index 0000000..6659168 --- /dev/null +++ b/sprotne_naloge/naloga_05/vaja_01/vaja_01_add_16bit.s @@ -0,0 +1,22 @@ +.text +.org 0x20 + +stev1: .hword 10 +stev2: .hword 5 +rez: .space 2 + +.align + +.global _start +_start: + + adr r0, stev1 + ldrh r1, [r0] + + adr r0, stev2 + ldrh r2, [r0] + + add r1, r2 + + adr r0, rez + str r1, [r0] diff --git a/sprotne_naloge/naloga_05/vaja_01/vaja_01_add_32bit.s b/sprotne_naloge/naloga_05/vaja_01/vaja_01_add_32bit.s new file mode 100644 index 0000000..dd92095 --- /dev/null +++ b/sprotne_naloge/naloga_05/vaja_01/vaja_01_add_32bit.s @@ -0,0 +1,20 @@ +.text +.org 0x20 + +stev1: .word 10 +stev2: .word 5 +rez: .space 4 + +.global _start +_start: + + adr r0, stev1 + ldr r1, [r0] + + adr r0, stev2 + ldr r2, [r0] + + add r1, r2 + + adr r0, rez + str r1, [r0] diff --git a/sprotne_naloge/naloga_05/vaja_01/vaja_01_add_8bit.s b/sprotne_naloge/naloga_05/vaja_01/vaja_01_add_8bit.s new file mode 100644 index 0000000..2feb0fe --- /dev/null +++ b/sprotne_naloge/naloga_05/vaja_01/vaja_01_add_8bit.s @@ -0,0 +1,22 @@ +.text +.org 0x20 + +stev1: .byte 10 +stev2: .byte 5 +rez: .space 1 + +.align + +.global _start +_start: + + adr r0, stev1 + ldrb r1, [r0] + + adr r0, stev2 + ldrb r2, [r0] + + add r1, r2 + + adr r0, rez + str r1, [r0] diff --git a/sprotne_naloge/naloga_05/vaja_01/vaja_01_sub_16bit.s b/sprotne_naloge/naloga_05/vaja_01/vaja_01_sub_16bit.s new file mode 100644 index 0000000..6b62f52 --- /dev/null +++ b/sprotne_naloge/naloga_05/vaja_01/vaja_01_sub_16bit.s @@ -0,0 +1,22 @@ +.text +.org 0x20 + +stev1: .hword 10 +stev2: .hword 5 +rez: .space 2 + +.align + +.global _start +_start: + + adr r0, stev1 + ldrh r1, [r0] + + adr r0, stev2 + ldrh r2, [r0] + + sub r1, r2 + + adr r0, rez + str r1, [r0] diff --git a/sprotne_naloge/naloga_05/vaja_01/vaja_01_sub_32bit.s b/sprotne_naloge/naloga_05/vaja_01/vaja_01_sub_32bit.s new file mode 100644 index 0000000..e32a77c --- /dev/null +++ b/sprotne_naloge/naloga_05/vaja_01/vaja_01_sub_32bit.s @@ -0,0 +1,20 @@ +.text +.org 0x20 + +stev1: .word 10 +stev2: .word 5 +rez: .space 4 + +.global _start +_start: + + adr r0, stev1 + ldr r1, [r0] + + adr r0, stev2 + ldr r2, [r0] + + sub r1, r2 + + adr r0, rez + str r1, [r0] diff --git a/sprotne_naloge/naloga_05/vaja_01/vaja_01_sub_8bit.s b/sprotne_naloge/naloga_05/vaja_01/vaja_01_sub_8bit.s new file mode 100644 index 0000000..7ad5ef5 --- /dev/null +++ b/sprotne_naloge/naloga_05/vaja_01/vaja_01_sub_8bit.s @@ -0,0 +1,22 @@ +.text +.org 0x20 + +stev1: .byte 10 +stev2: .byte 5 +rez: .space 1 + +.align + +.global _start +_start: + + adr r0, stev1 + ldrb r1, [r0] + + adr r0, stev2 + ldrb r2, [r0] + + sub r1, r2 + + adr r0, rez + str r1, [r0] diff --git a/sprotne_naloge/naloga_05/vaja_02.s b/sprotne_naloge/naloga_05/vaja_02.s new file mode 100644 index 0000000..050f032 --- /dev/null +++ b/sprotne_naloge/naloga_05/vaja_02.s @@ -0,0 +1,25 @@ +.text +.org 0x20 + +stev1: .word 0x50 +stev2: .word 100 +stev3: .word 0x2f + +.align + +.global _start +_start: + + adr r0, stev3 + ldr r3, [r0] + + adr r0, stev2 + ldr r2, [r0] + + adr r0, stev1 + ldr r1, [r0] + + add r2, r3 + sub r1, r2, r1 + + str r1, [r0] diff --git a/sprotne_naloge/naloga_05/vaja_03.s b/sprotne_naloge/naloga_05/vaja_03.s new file mode 100644 index 0000000..54a8880 --- /dev/null +++ b/sprotne_naloge/naloga_05/vaja_03.s @@ -0,0 +1,24 @@ +.text +.org 0x20 + +stev1: .word 0x12345678 +stev2: .byte 128 +.align +stev3: .hword 0xf123 +.align + +.global _start +_start: + + adr r0, stev1 + ldr r1, [r0] + + adr r0, stev2 + ldrb r2, [r0] + + ldrsb r3, [r0] + + adr r0, stev3 + ldrh r4, [r0] + + ldrsh r5, [r0] diff --git a/sprotne_naloge/naloga_05/vaja_04/vaja_04_a.s b/sprotne_naloge/naloga_05/vaja_04/vaja_04_a.s new file mode 100644 index 0000000..d301f0f --- /dev/null +++ b/sprotne_naloge/naloga_05/vaja_04/vaja_04_a.s @@ -0,0 +1,20 @@ +.text +.org 0x20 + +stev1: .byte 15 +stev2: .byte 130 + +.align + +.global _start +_start: + + adr r0, stev2 + ldrb r2, [r0] + + adr r0, stev1 + ldrb r1, [r0] + + add r1, r2 + + str r1, [r0] diff --git a/sprotne_naloge/naloga_05/vaja_04/vaja_04_b.s b/sprotne_naloge/naloga_05/vaja_04/vaja_04_b.s new file mode 100644 index 0000000..523fe7e --- /dev/null +++ b/sprotne_naloge/naloga_05/vaja_04/vaja_04_b.s @@ -0,0 +1,20 @@ +.text +.org 0x20 + +stev1: .byte 15 +stev2: .byte 130 + +.align + +.global _start +_start: + + adr r0, stev2 + ldrsb r2, [r0] + + adr r0, stev1 + ldrsb r1, [r0] + + add r1, r2 + + str r1, [r0] diff --git a/sprotne_naloge/naloga_05/vaja_04/vaja_04_c.s b/sprotne_naloge/naloga_05/vaja_04/vaja_04_c.s new file mode 100644 index 0000000..06c5143 --- /dev/null +++ b/sprotne_naloge/naloga_05/vaja_04/vaja_04_c.s @@ -0,0 +1,20 @@ +.text +.org 0x20 + +stev1: .word 128 +stev2: .byte 128 + +.align + +.global _start +_start: + + adr r0, stev2 + ldrb r2, [r0] + + adr r0, stev1 + ldrb r1, [r0] + + add r1, r2 + + str r1, [r0]