summaryrefslogtreecommitdiff
path: root/2522/CH7/EX7.10/exm7_10.sce
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /2522/CH7/EX7.10/exm7_10.sce
downloadScilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.gz
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.bz2
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.zip
initial commit / add all books
Diffstat (limited to '2522/CH7/EX7.10/exm7_10.sce')
-rwxr-xr-x2522/CH7/EX7.10/exm7_10.sce29
1 files changed, 29 insertions, 0 deletions
diff --git a/2522/CH7/EX7.10/exm7_10.sce b/2522/CH7/EX7.10/exm7_10.sce
new file mode 100755
index 000000000..0820ba668
--- /dev/null
+++ b/2522/CH7/EX7.10/exm7_10.sce
@@ -0,0 +1,29 @@
+//page no 235
+// example no 7.10
+// RIGHT ROTATION (RRC & RAR) OF BITS.
+clc;
+// initially
+printf('Accumulator= 81H \n');
+printf('D7 D6 D5 D4 D3 D2 D1 D0 \n');
+printf(' 1 0 0 0 0 0 0 1 =81H \n \n');
+printf('CY= 0 \n \n');
+printf('RRC \n \n');
+printf('CY= 1 \n \n');
+// carry flag is set because D0 bit was 1.
+printf('D7 D6 D5 D4 D3 D2 D1 D0 \n');
+printf(' 1 1 0 0 0 0 0 0 =C0H \n \n'); // after the executuion of RRC.
+// RRC instruction places D0 bit in CY flag as well as in D7 bit.
+
+
+
+// initially
+printf('Accumulator= 81H \n');
+printf('D7 D6 D5 D4 D3 D2 D1 D0 \n');
+printf(' 1 0 0 0 0 0 0 1 =81H \n \n');
+printf('CY= 0 \n \n');
+printf('RAR \n \n');
+printf('CY= 1 \n \n');
+// carry flag is set because D0 bit was 1.
+printf('D7 D6 D5 D4 D3 D2 D1 D0 \n');
+printf(' 0 1 0 0 0 0 0 0 =40H \n \n'); // after the executuion of RAR.
+// RAR instruction places D0 bit in CY flag & CY flags bit is send to D7 bit.