From d42a7a3b54614e47b12e3daa2388de4ff36089a2 Mon Sep 17 00:00:00 2001 From: DarkShadowFT <41124884+DarkShadowFT@users.noreply.github.com> Date: Tue, 3 Jan 2023 09:27:09 +0500 Subject: [PATCH] Create chp1_21.asm Added solution to a missing question from Chapter 1 --- assembly_code/chp1_21.asm | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 assembly_code/chp1_21.asm diff --git a/assembly_code/chp1_21.asm b/assembly_code/chp1_21.asm new file mode 100644 index 0000000..03af016 --- /dev/null +++ b/assembly_code/chp1_21.asm @@ -0,0 +1,18 @@ +; solution developed by https://github.com/DarkShadowFT/ + + +; Write a program in assembly language that calculates the square of +; six by adding six to the accumulator six times. +[org 0x0100] + +mov ax, 6 ; moves six to the acculumator + +add ax, 6 ; adding six to the acculumator until ax=36 + ; (or 24 in hex) +add ax, 6 +add ax, 6 +add ax, 6 +add ax, 6 + +mov ax, 0x4c00 ; exit. +int 0x21