summaryrefslogtreecommitdiff
path: root/2522
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /2522
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')
-rwxr-xr-x2522/CH10/EX10.1/exm10_1.sce15
-rwxr-xr-x2522/CH10/EX10.1/exm10_1_output.jpgbin0 -> 19356 bytes
-rwxr-xr-x2522/CH10/EX10.2/exm10_2.sce36
-rwxr-xr-x2522/CH10/EX10.2/exm10_2_output.jpgbin0 -> 28224 bytes
-rwxr-xr-x2522/CH10/EX10.3/exm10_3.sce16
-rwxr-xr-x2522/CH10/EX10.3/exm10_3_output.jpgbin0 -> 29272 bytes
-rwxr-xr-x2522/CH10/EX10.4/exm10_4.sce48
-rwxr-xr-x2522/CH10/EX10.4/exm10_4_output.jpgbin0 -> 31874 bytes
-rwxr-xr-x2522/CH10/EX10.5/exm10_5.sce43
-rwxr-xr-x2522/CH10/EX10.5/exm10_5_output.jpgbin0 -> 27668 bytes
-rwxr-xr-x2522/CH10/EX10.6/exm10_6.sce15
-rwxr-xr-x2522/CH10/EX10.6/exm10_6_output.jpgbin0 -> 27067 bytes
-rwxr-xr-x2522/CH10/EX10.7/exm10_7.sce17
-rwxr-xr-x2522/CH10/EX10.7/exm10_7_output.jpgbin0 -> 22915 bytes
-rwxr-xr-x2522/CH10/EX10.8/exm10_8.sce6
-rwxr-xr-x2522/CH10/EX10.8/exm10_8_output.jpgbin0 -> 21403 bytes
-rwxr-xr-x2522/CH12/EX12.1/exm12_1.sce15
-rwxr-xr-x2522/CH12/EX12.1/exm12_1_output.jpgbin0 -> 21459 bytes
-rwxr-xr-x2522/CH12/EX12.2/exm12_2.sce10
-rwxr-xr-x2522/CH12/EX12.2/exm12_2_output.jpgbin0 -> 9828 bytes
-rwxr-xr-x2522/CH12/EX12.3/exm12_3.sce23
-rwxr-xr-x2522/CH12/EX12.3/exm12_3_output.jpgbin0 -> 46081 bytes
-rwxr-xr-x2522/CH14/EX14.1/exm14_1.sce12
-rwxr-xr-x2522/CH14/EX14.1/exm14_1_output.jpgbin0 -> 14769 bytes
-rwxr-xr-x2522/CH14/EX14.2/exm14_2.sce18
-rwxr-xr-x2522/CH14/EX14.2/exm14_2_output.jpgbin0 -> 53209 bytes
-rwxr-xr-x2522/CH15/EX15.1/exm15_1.sce36
-rwxr-xr-x2522/CH15/EX15.1/exm15_1_output.jpgbin0 -> 61833 bytes
-rwxr-xr-x2522/CH15/EX15.2/exm15_2.sce27
-rwxr-xr-x2522/CH15/EX15.2/exm15_2_output.jpgbin0 -> 45639 bytes
-rwxr-xr-x2522/CH15/EX15.3/exm15_3.sce28
-rwxr-xr-x2522/CH15/EX15.3/exm15_3_output.jpgbin0 -> 40191 bytes
-rwxr-xr-x2522/CH15/EX15.4/exm15_4.sce31
-rwxr-xr-x2522/CH15/EX15.4/exm15_4_output.jpgbin0 -> 41677 bytes
-rwxr-xr-x2522/CH15/EX15.5/exm15_5.sce31
-rwxr-xr-x2522/CH15/EX15.5/exm15_5_output.jpgbin0 -> 52096 bytes
-rwxr-xr-x2522/CH15/EX15.6/exm15_6.sce20
-rwxr-xr-x2522/CH15/EX15.6/exm15_6_output.jpgbin0 -> 73527 bytes
-rwxr-xr-x2522/CH15/EX15.8/exm15_8.sce36
-rwxr-xr-x2522/CH15/EX15.8/exm15_8_output1.jpgbin0 -> 43932 bytes
-rwxr-xr-x2522/CH15/EX15.8/exm15_8_output2.jpgbin0 -> 21836 bytes
-rwxr-xr-x2522/CH19/EX19.1/exm19_1.sce13
-rwxr-xr-x2522/CH19/EX19.1/exm19_1_output.jpgbin0 -> 14908 bytes
-rwxr-xr-x2522/CH19/EX19.2/exm19_2.sce31
-rwxr-xr-x2522/CH19/EX19.2/exm19_2_output.jpgbin0 -> 21832 bytes
-rwxr-xr-x2522/CH19/EX19.3/exm19_3.sce34
-rwxr-xr-x2522/CH19/EX19.3/exm19_3_output.jpgbin0 -> 35575 bytes
-rwxr-xr-x2522/CH19/EX19.4/exm19_4.sce12
-rwxr-xr-x2522/CH19/EX19.4/exm19_4_output.jpgbin0 -> 13569 bytes
-rwxr-xr-x2522/CH19/EX19.5/exm19_5.sce16
-rwxr-xr-x2522/CH19/EX19.5/exm19_5_output.jpgbin0 -> 12652 bytes
-rwxr-xr-x2522/CH19/EX19.6/exm19_6.sce16
-rwxr-xr-x2522/CH19/EX19.6/exm19_6_output.jpgbin0 -> 19207 bytes
-rwxr-xr-x2522/CH19/EX19.7/exm19_7.sce33
-rwxr-xr-x2522/CH19/EX19.7/exm19_7_output.jpgbin0 -> 30015 bytes
-rwxr-xr-x2522/CH19/EX19.8/exm19_8.sce31
-rwxr-xr-x2522/CH19/EX19.8/exm19_8_output.jpgbin0 -> 43203 bytes
-rwxr-xr-x2522/CH19/EX19.9/exm19_9.sce28
-rwxr-xr-x2522/CH19/EX19.9/exm19_9_output.jpgbin0 -> 9498 bytes
-rwxr-xr-x2522/CH2/EX2.1/exm2_1.sce25
-rwxr-xr-x2522/CH2/EX2.1/exm2_1_output.pngbin0 -> 12941 bytes
-rwxr-xr-x2522/CH2/EX2.2/exm2_2.sce18
-rwxr-xr-x2522/CH2/EX2.2/exm2_2_output.pngbin0 -> 9073 bytes
-rwxr-xr-x2522/CH2/EX2.3/exm2_3.sce8
-rwxr-xr-x2522/CH2/EX2.3/exm2_3_output.pngbin0 -> 2056 bytes
-rwxr-xr-x2522/CH2/EX2.4/exm2_4.sce8
-rwxr-xr-x2522/CH2/EX2.4/exm2_4_output.jpgbin0 -> 8379 bytes
-rwxr-xr-x2522/CH2/EX2.5/exm2_5.sce8
-rwxr-xr-x2522/CH2/EX2.5/exm2_5_output.jpgbin0 -> 16767 bytes
-rwxr-xr-x2522/CH3/EX3.2/exm3_2.sce13
-rwxr-xr-x2522/CH3/EX3.2/exm3_2_output.jpgbin0 -> 13860 bytes
-rwxr-xr-x2522/CH3/EX3.3/exm3_3.sce18
-rwxr-xr-x2522/CH3/EX3.3/exm3_3_output.jpgbin0 -> 31198 bytes
-rwxr-xr-x2522/CH3/EX3.5/exm3_5.sce17
-rwxr-xr-x2522/CH3/EX3.5/exm3_5_output.jpgbin0 -> 51636 bytes
-rwxr-xr-x2522/CH3/EX3.6/exm3_6.sce22
-rwxr-xr-x2522/CH3/EX3.6/exm3_6_output.jpgbin0 -> 56073 bytes
-rwxr-xr-x2522/CH6/EX6.1/exm6_1.sce7
-rwxr-xr-x2522/CH6/EX6.1/exm6_1_output.jpgbin0 -> 6961 bytes
-rwxr-xr-x2522/CH6/EX6.2/exm6_2.sce11
-rwxr-xr-x2522/CH6/EX6.2/exm6_2_output.jpgbin0 -> 17482 bytes
-rwxr-xr-x2522/CH6/EX6.3/exm6_3.sce21
-rwxr-xr-x2522/CH6/EX6.3/exm6_3_output.jpgbin0 -> 8952 bytes
-rwxr-xr-x2522/CH6/EX6.4/exm6_4.sce17
-rwxr-xr-x2522/CH6/EX6.4/exm6_4_output.jpgbin0 -> 7477 bytes
-rwxr-xr-x2522/CH6/EX6.5/exm6_5.sce29
-rwxr-xr-x2522/CH6/EX6.5/exm6_5_output.jpgbin0 -> 8371 bytes
-rwxr-xr-x2522/CH6/EX6.6/exm6_6.sce31
-rwxr-xr-x2522/CH6/EX6.6/exm6_6_output.jpgbin0 -> 11593 bytes
-rwxr-xr-x2522/CH6/EX6.7/exm6_7.sce39
-rwxr-xr-x2522/CH6/EX6.7/exm6_7_output.jpgbin0 -> 22315 bytes
-rwxr-xr-x2522/CH6/EX6.8/exm6_8.sce11
-rwxr-xr-x2522/CH6/EX6.8/exm6_8_output.jpgbin0 -> 13716 bytes
-rwxr-xr-x2522/CH6/EX6.9/exm6_9.sce11
-rwxr-xr-x2522/CH6/EX6.9/exm6_9_output.jpgbin0 -> 14178 bytes
-rwxr-xr-x2522/CH7/EX7.1/exm7_1.sce12
-rwxr-xr-x2522/CH7/EX7.1/exm7_1_output.jpgbin0 -> 46533 bytes
-rwxr-xr-x2522/CH7/EX7.10/exm7_10.sce29
-rwxr-xr-x2522/CH7/EX7.10/exm7_10_output.jpgbin0 -> 37111 bytes
-rwxr-xr-x2522/CH7/EX7.11/exm7_11.sce23
-rwxr-xr-x2522/CH7/EX7.11/exm7_11_output.jpgbin0 -> 19147 bytes
-rwxr-xr-x2522/CH7/EX7.2/exm7_2.sce15
-rwxr-xr-x2522/CH7/EX7.2/exm7_2_output.jpgbin0 -> 33005 bytes
-rwxr-xr-x2522/CH7/EX7.3/exm7_3.sce32
-rwxr-xr-x2522/CH7/EX7.3/exm7_3_output.jpgbin0 -> 21181 bytes
-rwxr-xr-x2522/CH7/EX7.4/exm7_4.sce33
-rwxr-xr-x2522/CH7/EX7.4/exm7_4_output1.jpgbin0 -> 27847 bytes
-rwxr-xr-x2522/CH7/EX7.4/exm7_4_output2.jpgbin0 -> 13512 bytes
-rwxr-xr-x2522/CH7/EX7.5/exm7_5.sce20
-rwxr-xr-x2522/CH7/EX7.5/exm7_5_output.jpgbin0 -> 29601 bytes
-rwxr-xr-x2522/CH7/EX7.6/exm7_6.sce24
-rwxr-xr-x2522/CH7/EX7.6/exm7_6_output.jpgbin0 -> 33942 bytes
-rwxr-xr-x2522/CH7/EX7.7/exm7_7.sce26
-rwxr-xr-x2522/CH7/EX7.7/exm7_7_output.jpgbin0 -> 32857 bytes
-rwxr-xr-x2522/CH7/EX7.8/exm7_8.sce22
-rwxr-xr-x2522/CH7/EX7.8/exm7_8_output.jpgbin0 -> 30351 bytes
-rwxr-xr-x2522/CH7/EX7.9/exm7_9.sce21
-rwxr-xr-x2522/CH7/EX7.9/exm7_9_output.jpgbin0 -> 24844 bytes
-rwxr-xr-x2522/CH9/EX9.1/exm9_1.sce26
-rwxr-xr-x2522/CH9/EX9.1/exm9_1_output.jpgbin0 -> 20612 bytes
-rwxr-xr-x2522/CH9/EX9.2/exm9_2.sce41
-rwxr-xr-x2522/CH9/EX9.2/exm9_2_output.jpgbin0 -> 49534 bytes
-rwxr-xr-x2522/CH9/EX9.3/exm9_3.sce13
-rwxr-xr-x2522/CH9/EX9.3/exm9_3_output.jpgbin0 -> 28804 bytes
124 files changed, 1348 insertions, 0 deletions
diff --git a/2522/CH10/EX10.1/exm10_1.sce b/2522/CH10/EX10.1/exm10_1.sce
new file mode 100755
index 000000000..03436e088
--- /dev/null
+++ b/2522/CH10/EX10.1/exm10_1.sce
@@ -0,0 +1,15 @@
+// page no 310
+// example 10.1
+// BCD TO BINARY
+// BCD into its binary equivalent.
+// given BCD no is 72
+clc;
+a=72;
+ x=modulo(a,10); // seperating the units digit
+ printf('Unpacked BCD1 ')
+ disp(dec2bin(x,8));
+a=a/10; // seperating the tens place digit
+a=floor(a);
+printf('\n \n Unpacked BCD2');
+disp(dec2bin(a,8));
+printf('\n \n Multiply BCD2 by 10 and add BCD1');
diff --git a/2522/CH10/EX10.1/exm10_1_output.jpg b/2522/CH10/EX10.1/exm10_1_output.jpg
new file mode 100755
index 000000000..fe1455a12
--- /dev/null
+++ b/2522/CH10/EX10.1/exm10_1_output.jpg
Binary files differ
diff --git a/2522/CH10/EX10.2/exm10_2.sce b/2522/CH10/EX10.2/exm10_2.sce
new file mode 100755
index 000000000..8936f99e5
--- /dev/null
+++ b/2522/CH10/EX10.2/exm10_2.sce
@@ -0,0 +1,36 @@
+// page no 321
+// example no 10.2
+// ADDITION OF PACKED BCD NUMBERS
+clc;
+a=77;
+b=48;
+x=modulo(a,10);
+y=modulo(b,10);
+z=x+y;
+if z>9 then
+ f=z+6;
+
+ printf('After addition BCD1 is: ')
+ disp(dec2bin(f));
+ printf('MSB of this sequence is the carry generated after addition. \n \n')
+else
+ printf('After addition BCD1 is: ')
+ disp(z);
+end
+x=a/10;
+x=floor(x);
+y=b/10;
+y=floor(y);
+z=x+y;
+if z>9 then
+ f=z+6;
+ f=f+1; // this 1 is the carry of BCD1.
+ printf('After addition BCD2 is: ')
+ disp(dec2bin(f));
+ printf('MSB of this sequence is the carry generated after addition.')
+else
+ printf('After addition BCD1 is: ')
+ disp(z);
+end
+printf('\n \n BCD1 : 0101 \n \n');
+printf('BCD2: 0010')
diff --git a/2522/CH10/EX10.2/exm10_2_output.jpg b/2522/CH10/EX10.2/exm10_2_output.jpg
new file mode 100755
index 000000000..5302b5a43
--- /dev/null
+++ b/2522/CH10/EX10.2/exm10_2_output.jpg
Binary files differ
diff --git a/2522/CH10/EX10.3/exm10_3.sce b/2522/CH10/EX10.3/exm10_3.sce
new file mode 100755
index 000000000..62b21380b
--- /dev/null
+++ b/2522/CH10/EX10.3/exm10_3.sce
@@ -0,0 +1,16 @@
+// page no 325
+// example no 10.3
+// EXCHANGE OF DATA
+clc;
+printf('2050H--> 3FH \n \n');
+printf('2051H--> 42H \n \n');
+printf('DE--> 856FH \n');
+printf('D--> 85H E--> 6FH \n \n');
+printf('LHLD 2050H \n'); // loads the HL register pair with data on 2050H & 2051H.
+printf('H--> 42H L--> 3FH \n \n');
+printf('XCHG \n'); // exchange the data of HL register pair with DE register pair.
+printf('D<-->H E<-->L \n');
+printf('D--> 42H E--> 3FH \n H--> 85H L--> 6FH \n \n');
+printf('SHLD 2050H \n'); // stores the 16bit dat in HL register pair on memory location 2051H & 2050H.
+printf('2050H--> 6FH \n');
+printf('2051H--> 85H');
diff --git a/2522/CH10/EX10.3/exm10_3_output.jpg b/2522/CH10/EX10.3/exm10_3_output.jpg
new file mode 100755
index 000000000..84e63695a
--- /dev/null
+++ b/2522/CH10/EX10.3/exm10_3_output.jpg
Binary files differ
diff --git a/2522/CH10/EX10.4/exm10_4.sce b/2522/CH10/EX10.4/exm10_4.sce
new file mode 100755
index 000000000..1e69494c9
--- /dev/null
+++ b/2522/CH10/EX10.4/exm10_4.sce
@@ -0,0 +1,48 @@
+// page no 326
+// examle no 10.4
+// ADDITION OF TWO 16 BIT NUMBERS
+clc;
+printf('B--> 27H C--> 93H \n');
+printf('D--> 31H E--> 82H \n \n');
+b=hex2dec(['27']);
+c=hex2dec(['93']);
+d=hex2dec(['31']);
+e=hex2dec(['82']);
+printf('MOV A,C \n \n');
+a=c;
+printf('ADD E \n');
+a=a+e;
+Z=a-256;
+X=dec2hex(Z);
+printf('Sum =')
+disp(X);
+if a>255 then
+ printf('CY=1 \n \n');
+ CY=1;
+else
+ printf('CY=0 \n');
+ CY=0;
+end
+printf('MOV L,A \n');
+printf('L-->');
+disp(X);
+printf('\n \n MOV A,B \n \n');
+a=b;
+printf('ADC D \n');
+a=a+d+CY; // CY is added because of the previous carry as per the instructions ADC (add with carry)
+T=dec2hex(a);
+printf('Sum =')
+disp(T);
+if a>255 then
+ printf('CY=1 \n \n')
+else
+ printf('CY=0 \n \n')
+end
+printf('MOV H,A \n');
+printf('H-->');
+disp(T);
+printf('\n \n SHLD 2050H \n'); // stores the contents of HL register pair on memory locations 2051H & 2050H.
+printf('2050H--> ');
+disp(X);
+printf('2051H--> ');
+disp(T);
diff --git a/2522/CH10/EX10.4/exm10_4_output.jpg b/2522/CH10/EX10.4/exm10_4_output.jpg
new file mode 100755
index 000000000..c2201e8e9
--- /dev/null
+++ b/2522/CH10/EX10.4/exm10_4_output.jpg
Binary files differ
diff --git a/2522/CH10/EX10.5/exm10_5.sce b/2522/CH10/EX10.5/exm10_5.sce
new file mode 100755
index 000000000..6270eaf3a
--- /dev/null
+++ b/2522/CH10/EX10.5/exm10_5.sce
@@ -0,0 +1,43 @@
+// page no 326
+// examle no 10.5
+// SUBTRACTION OF TWO 16 BIT NUMBERS
+clc;
+printf('B--> 85H C--> 38H \n');
+printf('D--> 62H E--> A5H \n \n');
+b=hex2dec(['85']);
+c=hex2dec(['38']);
+d=hex2dec(['62']);
+e=hex2dec(['A5']);
+printf('MOV A,C \n \n');
+a=c;
+printf('SUB E \n');
+a=a-e;
+Z=a+256;
+X=dec2hex(Z);
+printf('Difference =')
+disp(X);
+if a<0 then
+ printf('Borrow=1 \n \n');
+ B=1;
+else
+ printf('Borrow=0 \n')
+ B=0;
+end
+printf('MOV C,A \n');
+printf('C-->');
+disp(X);
+printf('\n \n MOV A,B \n \n');
+a=b;
+printf('SBB D \n');
+a=a-d-B; // 1 is subtracted because of the previous borrow as per the instructions SBB (subtract with borrow)
+T=dec2hex(a);
+printf('Difference =')
+disp(T);
+if a<0 then
+ printf('Borrow=1 \n \n')
+else
+ printf('Borrow=0 \n \n')
+end
+printf('MOV B,A \n');
+printf('B-->');
+disp(T);
diff --git a/2522/CH10/EX10.5/exm10_5_output.jpg b/2522/CH10/EX10.5/exm10_5_output.jpg
new file mode 100755
index 000000000..577c8a207
--- /dev/null
+++ b/2522/CH10/EX10.5/exm10_5_output.jpg
Binary files differ
diff --git a/2522/CH10/EX10.6/exm10_6.sce b/2522/CH10/EX10.6/exm10_6.sce
new file mode 100755
index 000000000..f6a6f1539
--- /dev/null
+++ b/2522/CH10/EX10.6/exm10_6.sce
@@ -0,0 +1,15 @@
+// page no 327
+// example no 10.6
+// DISPLAY CONTENTS OF STACK
+clc;
+printf('LXI H,0000H \n'); // clears the HL register pair
+printf('H--> 00H L--> 00H \n \n');
+printf('DAD SP \n'); // place the stack pointer content in HL
+printf('H--> higher bytes of stack pointer register \n');
+printf('L--> lower bytes of stack pointer register \n \n');
+printf('MOV A,H \n'); // copies the contents of H in A.
+printf('H--> A \n \n');
+printf('OUT PORT1 \n \n');
+printf('MOV A,L \n'); // copies the contents of L in A.
+printf('L--> A \n \n');
+printf('OUT PORT2');
diff --git a/2522/CH10/EX10.6/exm10_6_output.jpg b/2522/CH10/EX10.6/exm10_6_output.jpg
new file mode 100755
index 000000000..646aa755e
--- /dev/null
+++ b/2522/CH10/EX10.6/exm10_6_output.jpg
Binary files differ
diff --git a/2522/CH10/EX10.7/exm10_7.sce b/2522/CH10/EX10.7/exm10_7.sce
new file mode 100755
index 000000000..9555335fb
--- /dev/null
+++ b/2522/CH10/EX10.7/exm10_7.sce
@@ -0,0 +1,17 @@
+// page no 327
+// example no 10.7
+// SUBROUTINE TO SET THE ZERO FLAG
+clc;
+printf('CHECK: PUSH H \n \n'); // sends the contents of H to the location pointed by the stack pointer.
+printf(' MVI L,FFH \n');
+l=hex2dec(['FF']);
+l=dec2bin(l,8);
+printf(' L--> '); // set all bits in L to logic 1.
+disp(l);
+printf('\n \n PUSH PSW \n \n'); // save flags on top of the stack
+printf(' XTHL \n \n'); // set all bits in the top stack location.
+printf(' POP PSW \n \n'); // now the zero flag is set.
+printf(' JZ NOEROR \n \n');
+printf(' JMP ERROR \n \n');
+printf('NOEROR: POP H \n \n'); // retrives the data from the stack into H if zero flag is set
+printf(' RET');
diff --git a/2522/CH10/EX10.7/exm10_7_output.jpg b/2522/CH10/EX10.7/exm10_7_output.jpg
new file mode 100755
index 000000000..4a9067de0
--- /dev/null
+++ b/2522/CH10/EX10.7/exm10_7_output.jpg
Binary files differ
diff --git a/2522/CH10/EX10.8/exm10_8.sce b/2522/CH10/EX10.8/exm10_8.sce
new file mode 100755
index 000000000..87d5be571
--- /dev/null
+++ b/2522/CH10/EX10.8/exm10_8.sce
@@ -0,0 +1,6 @@
+// page no 328
+// example no 10.8
+// TRANSFER A PROGRAM TO AN ADDRESS IN HL REGISTER
+clc;
+printf('\n \nThe program can be transfered using Jump instruction. \n \n');
+printf('PCHL a 1 byte instruction can also be used in place of Jump instruction \n \n');
diff --git a/2522/CH10/EX10.8/exm10_8_output.jpg b/2522/CH10/EX10.8/exm10_8_output.jpg
new file mode 100755
index 000000000..3b237cbf5
--- /dev/null
+++ b/2522/CH10/EX10.8/exm10_8_output.jpg
Binary files differ
diff --git a/2522/CH12/EX12.1/exm12_1.sce b/2522/CH12/EX12.1/exm12_1.sce
new file mode 100755
index 000000000..93d9a56cc
--- /dev/null
+++ b/2522/CH12/EX12.1/exm12_1.sce
@@ -0,0 +1,15 @@
+// page no 374
+// example no 12.1
+// ENABLE INTERRUPTS
+clc;
+printf('EI \n \n'); // enable interrupts
+printf('MVI A,08H \n');
+a=hex2dec(['8']);
+b=dec2bin(a,8);
+printf('A--> ')
+disp(b);
+printf('\n SIM \n \n'); // enable RST 7.5,6.5, and 5.5
+printf('D3=1 SIM functional \n');
+printf('D2=0 Enable RST 7.5 \n');
+printf('D1=0 Enable RST 6.5 \n');
+printf('D0=0 Enable RST 5.5 \n');
diff --git a/2522/CH12/EX12.1/exm12_1_output.jpg b/2522/CH12/EX12.1/exm12_1_output.jpg
new file mode 100755
index 000000000..78baae858
--- /dev/null
+++ b/2522/CH12/EX12.1/exm12_1_output.jpg
Binary files differ
diff --git a/2522/CH12/EX12.2/exm12_2.sce b/2522/CH12/EX12.2/exm12_2.sce
new file mode 100755
index 000000000..0e77bb164
--- /dev/null
+++ b/2522/CH12/EX12.2/exm12_2.sce
@@ -0,0 +1,10 @@
+// page no 374
+// example no 12.2
+// RESET 7.5 INTERRUPT
+clc;
+printf('MVI A,18H \n'); // set D4=1
+a=hex2dec(['18']);
+b=dec2bin(a,8);
+printf('A--> ')
+disp(b);
+printf('\n \n SIM'); // Reset 7.5 interrupt flip flop
diff --git a/2522/CH12/EX12.2/exm12_2_output.jpg b/2522/CH12/EX12.2/exm12_2_output.jpg
new file mode 100755
index 000000000..0682bb627
--- /dev/null
+++ b/2522/CH12/EX12.2/exm12_2_output.jpg
Binary files differ
diff --git a/2522/CH12/EX12.3/exm12_3.sce b/2522/CH12/EX12.3/exm12_3.sce
new file mode 100755
index 000000000..c3db03c72
--- /dev/null
+++ b/2522/CH12/EX12.3/exm12_3.sce
@@ -0,0 +1,23 @@
+// page no 375
+// example no 12.3
+// CHECK PENDING INTERRUPT
+clc;
+printf('RIM instruction interpretation \n \n');
+printf('D7=SID Serial input data if any \n');
+printf('D6,D5,D4= I7.5,I6.5,I5.5 Pending interrupts: 1= pending \n');
+printf('D3=IE Interrupt enable flag: 1= enabled \n');
+printf('D2,D1,D0= M7.5,M6.5,M5.5 Interrupt masks: 1= masked \n \n \n');
+
+
+printf('Instructions \n \n');
+printf(' RIM \n'); // Read interrupt mask
+printf(' MOV B,A \n'); // save mask information
+printf(' ANI 20H \n'); // check whether RST 6.5 is pending
+printf(' JNZ NEXT \n');
+printf(' EI \n');
+printf(' RET \n'); // RST 6.5 is not pending, return to main program
+printf('NEXT: MOV A,B \n'); // get bit pattern; RST 6.5 is pending
+printf(' ANI 0DH \n'); // enables RST 6.5 by setting D1=0
+printf(' ORI 08H\n'); // enable SIM by setting D3=1
+printf(' SIM \n');
+printf(' JMP SERV \n'); // jump to service routine for RST 6.5
diff --git a/2522/CH12/EX12.3/exm12_3_output.jpg b/2522/CH12/EX12.3/exm12_3_output.jpg
new file mode 100755
index 000000000..16bd6d315
--- /dev/null
+++ b/2522/CH12/EX12.3/exm12_3_output.jpg
Binary files differ
diff --git a/2522/CH14/EX14.1/exm14_1.sce b/2522/CH14/EX14.1/exm14_1.sce
new file mode 100755
index 000000000..fecdf39bd
--- /dev/null
+++ b/2522/CH14/EX14.1/exm14_1.sce
@@ -0,0 +1,12 @@
+// page no 414
+// example no 14.1
+// INITIALIZE HYPOTHETICAL CHIP AS OUTPUT BUFFER
+clc;
+printf('MVI A,01H \n'); // Set D0=1, D1 through D7 are don't care lines.
+a=hex2dec(['1']);
+b=dec2bin(a,8);
+printf('A--> ')
+disp(b);
+printf('\n \n OUT FFH \n \n'); // write in the control register.
+printf('MVI A,BYTE1 \n \n'); // load data byte.
+printf('OUT FEH'); // send data out.
diff --git a/2522/CH14/EX14.1/exm14_1_output.jpg b/2522/CH14/EX14.1/exm14_1_output.jpg
new file mode 100755
index 000000000..561ed8286
--- /dev/null
+++ b/2522/CH14/EX14.1/exm14_1_output.jpg
Binary files differ
diff --git a/2522/CH14/EX14.2/exm14_2.sce b/2522/CH14/EX14.2/exm14_2.sce
new file mode 100755
index 000000000..13cdf0992
--- /dev/null
+++ b/2522/CH14/EX14.2/exm14_2.sce
@@ -0,0 +1,18 @@
+// page no 420
+// example no 14.2
+// ADDRESS DETERMINATION OF GIVEN FIGURE
+clc;
+printf('To select the chip: \n \n');
+printf('A15 A14 A13 A12 A11 \n');
+printf(' 0 0 0 1 0 \n \n');
+printf('A15,A14 Enable lines of 8205 \n');
+printf('A13,A12,A11 Input logic to activate the putput line O4 of the 8205 \n \n');
+printf('A15,A14,A13,A12,A11 = A7,A6,A5,A4,A3, = 2H \n \n');
+printf('AD2 AD1 AD0 = Address Ports \n');
+printf(' 0 0 0 = 20H Control or status register \n');
+printf(' 0 0 1 = 21H Port A \n');
+printf(' 0 1 0 = 22H Port B \n');
+printf(' 0 1 1 = 23H Port C \n');
+printf(' 1 0 0 = 24H Timer LSB \n');
+printf(' 1 0 1 = 25H Timer MSB \n \n');
+printf('Port numbers in given figure thus range from 20H-25H');
diff --git a/2522/CH14/EX14.2/exm14_2_output.jpg b/2522/CH14/EX14.2/exm14_2_output.jpg
new file mode 100755
index 000000000..c0cb357fc
--- /dev/null
+++ b/2522/CH14/EX14.2/exm14_2_output.jpg
Binary files differ
diff --git a/2522/CH15/EX15.1/exm15_1.sce b/2522/CH15/EX15.1/exm15_1.sce
new file mode 100755
index 000000000..85125a882
--- /dev/null
+++ b/2522/CH15/EX15.1/exm15_1.sce
@@ -0,0 +1,36 @@
+// page no 449
+// example no 15.1
+// PORT ADDRESS CONTROL WORD ADDRESS AND READ THE DIP SWITCHES
+clc;
+printf('1 Port Address \n \n');
+printf('Port A = 8000H (A1=0,A0=0) \n');
+printf('Port B = 8001H (A1=0,A0=1) \n');
+printf('Port C = 8002H (A1=1,A0=0) \n');
+printf('Control Register = 8003H (A1=1,A0=1) \n \n');
+
+
+printf('2 Control Word \n \n');
+printf('D7 D6 D5 D4 D3 D2 D1 D0 \n');
+printf('1 0 0 0 0 0 1 1 = 83H \n \n');
+printf('D7=1 I/O Function \n');
+printf('D6,D5=0 Port A in Mode 0 \n');
+printf('D4=0 Port A= output \n');
+printf('D3=0 Port C upper= output \n');
+printf('D2=0 Port B in Mode 0 \n');
+printf('D1=1 Port B= input \n');
+printf('D0=1 Port C1= input \n \n');
+
+
+printf('3 Program \n \n');
+printf('MVI A,83H \n'); // load accumulator with the control word.
+printf('STA 8003H \n'); // write word in the control register to initialize the ports.
+printf('LDA 8001H \n'); // reads switches at port B.
+printf('STA 8000H \n'); // display the reading at port A.
+printf('LDA 8002H \n'); // read switches at port C.
+printf('ANI 0FH \n'); // mask the upper four bits of port C, these bits are not input data.
+printf('RLC \n'); // rotate and place the data in the upper half of the accumulator.
+printf('RLC \n');
+printf('RLC \n');
+printf('RLC \n');
+printf('STA 8002H \n'); // display data at port C upper.
+printf('HLT \n');
diff --git a/2522/CH15/EX15.1/exm15_1_output.jpg b/2522/CH15/EX15.1/exm15_1_output.jpg
new file mode 100755
index 000000000..bae364be9
--- /dev/null
+++ b/2522/CH15/EX15.1/exm15_1_output.jpg
Binary files differ
diff --git a/2522/CH15/EX15.2/exm15_2.sce b/2522/CH15/EX15.2/exm15_2.sce
new file mode 100755
index 000000000..c92562964
--- /dev/null
+++ b/2522/CH15/EX15.2/exm15_2.sce
@@ -0,0 +1,27 @@
+// page no 453
+// example no 15.2
+// BSR CONTROL WORD SUBROUTINE
+clc;
+printf('BSR Control Words \n \n');
+printf('D7 D6 D5 D4 D3 D2 D1 D0 \n');
+printf('0 0 0 0 1 1 1 1 = 0FH To set bit PC7 \n');
+printf('0 0 0 0 1 1 1 0 = 0EH To reset bit PC7 \n');
+printf('0 0 0 0 0 1 1 1 = 07H To set bit PC3 \n');
+printf('0 0 0 0 0 1 1 0 = 06H To reset bit PC3 \n \n');
+
+
+printf('Port Address \n \n');
+printf('Control Register Address = 83H \n \n');
+
+
+printf('Subroutine \n \n');
+printf('MVI A,0FH \n'); // load byte in accumulator to set PC7
+printf('OUT 83H \n'); // set PC7=1
+printf('MVI A,07H \n'); // load byte in accumulator to set PC3.
+printf('OUT 83H \n'); // set PC3=1.
+printf('CALL DELAY \n'); // this is a 10 microsec delay.
+printf('MVI A,06H \n'); // load byte in accumulator to reset PC3
+printf('OUT 83H \n'); // reset PC3
+printf('MVI A,0EH \n'); // load byte in accumulator to reset PC7.
+printf('OUT 83H \n'); // reset PC7
+printf('RET');
diff --git a/2522/CH15/EX15.2/exm15_2_output.jpg b/2522/CH15/EX15.2/exm15_2_output.jpg
new file mode 100755
index 000000000..4ddbb16e3
--- /dev/null
+++ b/2522/CH15/EX15.2/exm15_2_output.jpg
Binary files differ
diff --git a/2522/CH15/EX15.3/exm15_3.sce b/2522/CH15/EX15.3/exm15_3.sce
new file mode 100755
index 000000000..2eb0d1b62
--- /dev/null
+++ b/2522/CH15/EX15.3/exm15_3.sce
@@ -0,0 +1,28 @@
+// page no 483
+// example no 15.3
+// INSTRUCTIONS TO GENERATE A PULSE FROM COUNTER 0
+clc;
+printf('Control Word \n \n');
+printf('D7 D6 D5 D4 D3 D2 D1 D0 \n');
+printf('0 0 0 1 0 1 0 0 = 14H \n \n');
+printf('D7,D6=0 Select counter 0 \n');
+printf('D5,D4=01 Load 8 bit count \n');
+printf('D3,D2,D1=010 Mode 2 \n');
+printf('D0=0 Binary Count \n \n');
+
+
+printf('Count \n \n');
+count=(50*10^-6)/(0.5*10^-6);
+printf('Count= ');
+disp(count);
+disp(dec2hex(count));
+printf('in hexadecimal \n \n');
+
+
+printf('Instructions \n \n');
+printf('PULSE: \n')
+printf('MVI A,00010100B \n'); // control word mode 2 & counter 0.
+printf('OUT 83H \n'); // write in 8254 control register.
+printf('MVI A,64H \n'); // low order byte of the count.
+printf('OUT 80H \n'); // load counter 0 with low order byte
+printf('HLT');
diff --git a/2522/CH15/EX15.3/exm15_3_output.jpg b/2522/CH15/EX15.3/exm15_3_output.jpg
new file mode 100755
index 000000000..129f74dcf
--- /dev/null
+++ b/2522/CH15/EX15.3/exm15_3_output.jpg
Binary files differ
diff --git a/2522/CH15/EX15.4/exm15_4.sce b/2522/CH15/EX15.4/exm15_4.sce
new file mode 100755
index 000000000..05cc50e49
--- /dev/null
+++ b/2522/CH15/EX15.4/exm15_4.sce
@@ -0,0 +1,31 @@
+// page no 484
+// example no 15.4
+// INSTRUCTIONS TO GENERATE SQUARE WAVE PULSE FROM COUNTER 1
+clc;
+printf('Control Word \n \n');
+printf('D7 D6 D5 D4 D3 D2 D1 D0 \n');
+printf('0 1 1 1 0 1 1 0 = 76H \n \n');
+printf('D7,D6=01 Select counter 1 \n');
+printf('D5,D4=11 Load 16 bit count \n');
+printf('D3,D2,D1=011 Mode 3 \n');
+printf('D0=0 Binary Count \n \n');
+
+
+printf('Count \n \n');
+count=(1*10^-3)/(0.5*10^-6);
+printf('Count= ');
+disp(count);
+b=dec2hex(2000);
+disp(b);
+printf('in hexadecimal \n \n');
+
+
+printf('Instructions \n \n');
+printf('SQWAVE: \n');
+printf('MVI A,01110110B \n'); // control word mode 3 & counter 1.
+printf('OUT 83H \n'); // write in 8254 control register.
+printf('MVI A,D0H \n'); // low order byte of the count.
+printf('OUT 81H \n'); // load counter 1 with low order byte.
+printf('MVI A,07H \n'); // high order byte of the count.
+printf('OUT 81H \n'); // load counter 1 with high order byte
+printf('HLT');
diff --git a/2522/CH15/EX15.4/exm15_4_output.jpg b/2522/CH15/EX15.4/exm15_4_output.jpg
new file mode 100755
index 000000000..ae6aa8c1c
--- /dev/null
+++ b/2522/CH15/EX15.4/exm15_4_output.jpg
Binary files differ
diff --git a/2522/CH15/EX15.5/exm15_5.sce b/2522/CH15/EX15.5/exm15_5.sce
new file mode 100755
index 000000000..bed4c68dc
--- /dev/null
+++ b/2522/CH15/EX15.5/exm15_5.sce
@@ -0,0 +1,31 @@
+// page no 486
+// example no 15.5
+// SUBROUTINE TO GENERATE AN INTERRUPT
+clc;
+printf('Control Word \n \n');
+printf('D7 D6 D5 D4 D3 D2 D1 D0 \n');
+printf('0 1 1 1 0 1 0 0 = 74H Counter 1 \n');
+printf('1 0 0 1 0 1 0 0 = 94H Counter 2 \n \n');
+printf('D7,D6 Select counter 1 \n');
+printf('D5,D4 Load count \n');
+printf('D3,D2,D1=010 Mode 2 \n');
+printf('D0=0 Binary Count \n \n');
+
+
+
+printf('Instructions \n \n');
+printf('CNT1LO EQU 50H \n');
+printf('CNT1HI EQU C3H \n');
+printf('COUNT2 EQU 40H \n');
+printf('SECOND MVI A,01110100B \n'); // control word mode 2 & counter 1.
+printf(' OUT 83H \n'); // write in 8254 control register.
+printf(' MVI A,10010100B \n'); // control word mode 2 & counter 2.
+printf(' OUT 83H \n'); // write in 8254 control register.
+printf(' MVI A,CNT1LO \n'); // Low order byte of count 50000
+printf(' OUT 81H \n'); // Load counter 1 with low order byte
+printf(' MVI A,CNT1HI \n'); // high order byte of count 50000.
+printf(' OUT 81H \n'); // load counter 1 with high order byte
+printf(' MVI A,COUNT2 \n'); // Count for Counter 2.
+printf(' OUT 82H \n'); // load counter 2.
+printf(' RET');
+
diff --git a/2522/CH15/EX15.5/exm15_5_output.jpg b/2522/CH15/EX15.5/exm15_5_output.jpg
new file mode 100755
index 000000000..0b2c47251
--- /dev/null
+++ b/2522/CH15/EX15.5/exm15_5_output.jpg
Binary files differ
diff --git a/2522/CH15/EX15.6/exm15_6.sce b/2522/CH15/EX15.6/exm15_6.sce
new file mode 100755
index 000000000..a42e964c5
--- /dev/null
+++ b/2522/CH15/EX15.6/exm15_6.sce
@@ -0,0 +1,20 @@
+// page no 493
+// example no 15.6
+// EXPLANATION OF INSTRUCTIONS
+clc;
+printf('1) DI instruction disables the interrupts. \n \n');
+printf('2) Command word 76H specifies the following parameters \n');
+printf('A7 A6 A5 A4 A3 A2 A1 A0 \n');
+printf('0 1 1 1 0 1 1 0 =76H \n');
+printf('A7,A6,A5 Low order address bits \n');
+printf('A3 Edge triggered \n');
+printf('A2 Call address interval is four locations \n');
+printf('A1 Single 8259A \n \n');
+printf('Low order byte of the IR0 call address \n');
+printf('A7 A6 A5 A4 A3 A2 A1 A0 \n');
+printf('0 1 1 0 0 0 0 0 =60H \n');
+printf('The address bits A4-A0 are supplied by 8259A. \n');
+printf('Subsequent addresses are four locations apart eg. IR1=64H')
+printf('3) Port address of the 8259SA for ICW1 is 80H, A0 should be at \n logic 0 & the other bits are determined by the decoder. \n \n');
+printf('4) Command word ICW2 is 20H. \n \n');
+printf('5) Port address of ICW2 is 81H, A0 should be at logic 1.');
diff --git a/2522/CH15/EX15.6/exm15_6_output.jpg b/2522/CH15/EX15.6/exm15_6_output.jpg
new file mode 100755
index 000000000..0d1866500
--- /dev/null
+++ b/2522/CH15/EX15.6/exm15_6_output.jpg
Binary files differ
diff --git a/2522/CH15/EX15.8/exm15_8.sce b/2522/CH15/EX15.8/exm15_8.sce
new file mode 100755
index 000000000..3e1cc0ea8
--- /dev/null
+++ b/2522/CH15/EX15.8/exm15_8.sce
@@ -0,0 +1,36 @@
+// page no 502
+// example no 15.8
+// INITIALIZATION INSTRUCTIONS FOR DMA
+clc;
+printf('MVI A,00000100B \n \n');
+printf('A7 A6 A5 A4 A3 A2 A1 A0 \n');
+printf('0 0 0 0 0 1 0 0 \n');
+printf('A2=1 Disable DMA \n \n');
+printf('OUT 08H \n');
+printf('MVI A,00000111B \n \n');
+printf('A7 A6 A5 A4 A3 A2 A1 A0 \n');
+printf('0 0 0 0 0 1 1 1 \n');
+printf('A7,A6=00 Demand mode \n');
+printf('A5=0 Increment address \n');
+printf('A4=0 Disable auto load \n');
+printf('A3,A2=01 Write \n');
+printf('A1,A0=11 Ch 3 \n \n');
+printf('OUT 0BH \n'); // Send to mode reg.
+printf('MVI A,75H \n'); // Low order byte of starting address
+printf('OUT 06H \n'); // Output to CH3 memory address reg.
+printf('MVI A,40H \n'); // High order byte of starting address
+printf('OUT 06H \n'); // Output to CH3 memory address reg.
+printf('MVI A,FFH \n'); // Low order byte of the count 03FFH
+printf('OUT 07H \n'); // Output to CH3 count reg.
+printf('MVI A,03H \n'); // High order byte of the count 03FFH
+printf('OUT 07H \n'); // Output to CH3 count reg.
+printf('MVI A,10000000B \n \n');
+printf('A7 A6 A5 A4 A3 A2 A1 A0 \n');
+printf('1 0 0 0 0 0 0 0 \n');
+printf('A7,A6=10 DACK DREQ High \n');
+printf('A5=0 Late write \n');
+printf('A4=0 Fixed priority \n');
+printf('A3=0 Normal time \n');
+printf('A2=0 DMA enable \n')
+printf('A0=0 Disable mem to mem \n \n');
+printf('OUT 08H \n');
diff --git a/2522/CH15/EX15.8/exm15_8_output1.jpg b/2522/CH15/EX15.8/exm15_8_output1.jpg
new file mode 100755
index 000000000..bb2a3746b
--- /dev/null
+++ b/2522/CH15/EX15.8/exm15_8_output1.jpg
Binary files differ
diff --git a/2522/CH15/EX15.8/exm15_8_output2.jpg b/2522/CH15/EX15.8/exm15_8_output2.jpg
new file mode 100755
index 000000000..9bfbba886
--- /dev/null
+++ b/2522/CH15/EX15.8/exm15_8_output2.jpg
Binary files differ
diff --git a/2522/CH19/EX19.1/exm19_1.sce b/2522/CH19/EX19.1/exm19_1.sce
new file mode 100755
index 000000000..2140e80b4
--- /dev/null
+++ b/2522/CH19/EX19.1/exm19_1.sce
@@ -0,0 +1,13 @@
+// page no 622
+// example no A.1
+// BINARY INTO HEX AND OCTAL
+clc;
+printf('Binary no= 10011010 \n \n');
+str='10011010';
+h=bin2dec(str);
+H=dec2hex(h);
+printf('Hex Equivalent= ');
+disp(H);
+O=dec2oct(h);
+printf('\n Octal Equivalent= ')
+disp(O);
diff --git a/2522/CH19/EX19.1/exm19_1_output.jpg b/2522/CH19/EX19.1/exm19_1_output.jpg
new file mode 100755
index 000000000..b9f97eacd
--- /dev/null
+++ b/2522/CH19/EX19.1/exm19_1_output.jpg
Binary files differ
diff --git a/2522/CH19/EX19.2/exm19_2.sce b/2522/CH19/EX19.2/exm19_2.sce
new file mode 100755
index 000000000..1d512d329
--- /dev/null
+++ b/2522/CH19/EX19.2/exm19_2.sce
@@ -0,0 +1,31 @@
+// page no 623
+// example no A.2
+// SUBTRACTION OF TWO NUMBERS
+clc;
+printf('Minuend: 52 \n');
+printf('Subtrahend: 23 \n \n')
+printf('BORROW METHOD \n \n');
+
+m=5*10+2; // minuend
+s=2*10+3; // subtrahend
+// to subtract 3 from 2, 10 must be borrowed from the second place of the minuend.
+
+m=4*10+12;
+
+sub=m-s;
+printf('Subtraction= ')
+disp(sub);
+
+printf('\n \n 10s COMPLEMENT METHOD \n \n');
+
+// 9's complement of 23 is
+
+n=99-23;
+// add 1 to the 9's complement to find the 10's complement
+t=n+1;
+// add the 10's complement of the subtrahend(23) to minuend(52) to subtract 23 from 52
+a=m+t;
+// subtract 100 from a to compensate for the 100 that was added to find the 10's complement of 23
+sub=a-100;
+printf('Subtraction= ');
+disp(sub);
diff --git a/2522/CH19/EX19.2/exm19_2_output.jpg b/2522/CH19/EX19.2/exm19_2_output.jpg
new file mode 100755
index 000000000..33d1ea10d
--- /dev/null
+++ b/2522/CH19/EX19.2/exm19_2_output.jpg
Binary files differ
diff --git a/2522/CH19/EX19.3/exm19_3.sce b/2522/CH19/EX19.3/exm19_3.sce
new file mode 100755
index 000000000..91c2c0951
--- /dev/null
+++ b/2522/CH19/EX19.3/exm19_3.sce
@@ -0,0 +1,34 @@
+// page no 624
+// example no A.3
+// SUBTRACTION OF TWO NUMBERS
+clc;
+printf('Minuend: 23 \n');
+printf('Subtrahend: 52 \n \n')
+printf('BORROW METHOD \n \n');
+
+m=2*10+3; // minuend
+s=5*10+2; // subtrahend
+// subtraction of the digits in the first place results in
+a=3-2;
+// to subtract the digits in the second place a borrow is required from the third place. assuming 1 at third place.
+
+x=12-5; // with a borrowed 1 from the third place
+
+sub=10*x+a;
+printf('Subtraction= ')
+disp(sub);
+printf('this is negative 29, expressed in 10s complement. \n negative sign is verified by the borrowed 1 from the third place.');
+
+printf('\n \n 10s COMPLEMENT METHOD \n \n');
+
+// 9's complement of 52 is
+
+n=99-52;
+// add 1 to the 9's complement to find the 10's complement
+t=n+1;
+// add the 10's complement of the subtrahend(23) to minuend(52) to subtract 23 from 52
+a=m+t;
+
+printf('Subtraction= ');
+disp(a);
+printf('this is negative 29, expressed in 10s complement');
diff --git a/2522/CH19/EX19.3/exm19_3_output.jpg b/2522/CH19/EX19.3/exm19_3_output.jpg
new file mode 100755
index 000000000..fda9528ea
--- /dev/null
+++ b/2522/CH19/EX19.3/exm19_3_output.jpg
Binary files differ
diff --git a/2522/CH19/EX19.4/exm19_4.sce b/2522/CH19/EX19.4/exm19_4.sce
new file mode 100755
index 000000000..7091f2cd4
--- /dev/null
+++ b/2522/CH19/EX19.4/exm19_4.sce
@@ -0,0 +1,12 @@
+// page no 625
+// example no A.4
+// 2's COMPLIMENT OF BINARY NUMBER
+clc;
+printf('Given binary no= 00011100 \n \n');
+str='00011100'
+d=bin2dec(str);
+x=bitcmp(d,8);
+s=x+1;
+y=dec2bin(s);
+printf('2s complement=');
+disp(y);
diff --git a/2522/CH19/EX19.4/exm19_4_output.jpg b/2522/CH19/EX19.4/exm19_4_output.jpg
new file mode 100755
index 000000000..60e90f7c5
--- /dev/null
+++ b/2522/CH19/EX19.4/exm19_4_output.jpg
Binary files differ
diff --git a/2522/CH19/EX19.5/exm19_5.sce b/2522/CH19/EX19.5/exm19_5.sce
new file mode 100755
index 000000000..f8b4e4fb9
--- /dev/null
+++ b/2522/CH19/EX19.5/exm19_5.sce
@@ -0,0 +1,16 @@
+// page no 626
+// example no A.5
+// SUBTRACTION OF TWO NUMBERS
+clc;
+printf('Subtrahend= 32H \n');
+printf('Minuend= 45H \n \n');
+// finding 2's complement of subtrahend (32H);
+m=hex2dec(['45']);
+x=hex2dec(['32']);
+y=bitcmp(x,8); // 1's compliment of 32H
+z=y+1; // 2's compliment of 32H
+s=m+z;
+f=s-256; // to compensate the effect of 2's compliment
+e=dec2hex(f);
+printf('Subtraction= ');
+disp(e);
diff --git a/2522/CH19/EX19.5/exm19_5_output.jpg b/2522/CH19/EX19.5/exm19_5_output.jpg
new file mode 100755
index 000000000..f9c6d7cdc
--- /dev/null
+++ b/2522/CH19/EX19.5/exm19_5_output.jpg
Binary files differ
diff --git a/2522/CH19/EX19.6/exm19_6.sce b/2522/CH19/EX19.6/exm19_6.sce
new file mode 100755
index 000000000..b1c363aeb
--- /dev/null
+++ b/2522/CH19/EX19.6/exm19_6.sce
@@ -0,0 +1,16 @@
+// page no 626
+// example no A.6
+// SUBTRACTION OF TWO NUMBERS
+clc;
+printf('Subtrahend= 45H \n');
+printf('Minuend= 32H \n \n');
+// finding 2's complement of subtrahend (32H);
+m=hex2dec(['32']);
+x=hex2dec(['45']);
+y=bitcmp(x,8); // 1's compliment of 32H
+z=y+1; // 2's compliment of 32H
+s=m+z;
+r=dec2hex(s);
+printf('Subtraction= ');
+disp(r);
+printf('The result is negative & it is expressed in 2s complement.')
diff --git a/2522/CH19/EX19.6/exm19_6_output.jpg b/2522/CH19/EX19.6/exm19_6_output.jpg
new file mode 100755
index 000000000..a380d512a
--- /dev/null
+++ b/2522/CH19/EX19.6/exm19_6_output.jpg
Binary files differ
diff --git a/2522/CH19/EX19.7/exm19_7.sce b/2522/CH19/EX19.7/exm19_7.sce
new file mode 100755
index 000000000..4aa2ce3ec
--- /dev/null
+++ b/2522/CH19/EX19.7/exm19_7.sce
@@ -0,0 +1,33 @@
+// page no 628
+// example no A.7
+// SUBTRACTION OF UNSIGNED NUMBERS
+clc;
+printf('Part a \n \n')
+printf('Subtrahend= 62H \n');
+printf('Minuend= FAH \n \n');
+// finding 2's complement of subtrahend (62H);
+m=hex2dec(['FA']);
+x=hex2dec(['62']);
+y=bitcmp(x,8); // 1's compliment of 62H
+z=y+1; // 2's compliment of 62H
+s=m+z;
+f=s-256; // to compensate the effect of 2's compliment
+e=dec2hex(f);
+printf('Subtraction= ');
+disp(e);
+printf('This result is positive \n \n');
+
+
+printf('Part b \n \n')
+printf('Subtrahend= FAH \n');
+printf('Minuend= 62H \n \n');
+// finding 2's complement of subtrahend (FAH);
+m=hex2dec(['62']);
+x=hex2dec(['FA']);
+y=bitcmp(x,8); // 1's compliment of FAH
+z=y+1; // 2's compliment of FAH
+s=m+z;
+r=dec2hex(s);
+printf('Subtraction= ');
+disp(r);
+printf('The result is negative & it is expressed in 2s complement.')
diff --git a/2522/CH19/EX19.7/exm19_7_output.jpg b/2522/CH19/EX19.7/exm19_7_output.jpg
new file mode 100755
index 000000000..6960ad96c
--- /dev/null
+++ b/2522/CH19/EX19.7/exm19_7_output.jpg
Binary files differ
diff --git a/2522/CH19/EX19.8/exm19_8.sce b/2522/CH19/EX19.8/exm19_8.sce
new file mode 100755
index 000000000..11f59b728
--- /dev/null
+++ b/2522/CH19/EX19.8/exm19_8.sce
@@ -0,0 +1,31 @@
+// page no 629
+// example no A.8
+// SUBTRACTION OF SIGNED NUMBERS
+clc;
+printf('Part a \n \n')
+printf('Minuend= FAH \n \n');
+printf('It is a negative no since D7= 1 for FAH, this must be represented in \n2s compliment form. \n');
+// finding 2's complement of subtrahend (FAH);
+m=hex2dec(['FA']);
+x=hex2dec(['62']);
+y=bitcmp(m,8); // 1's compliment of FAH
+z=y+1; // 2's compliment of FAH
+printf('2s compliment of minuend is= ');
+disp(z);
+
+printf('\n \n Subtrahend= 62H \n');
+printf('It is a positive no since D7= 0 for 62H. \n');
+// subtraction can be represented as
+// FAH-62H= (-06H)-(+62H)
+s=-x-z;
+a=-s;
+d=dec2hex(a);
+printf('Subtraction= ');
+disp(s);
+disp(d);
+printf('in hexadecimal with a negative sign \n \n');
+g=bitcmp(a,8); // 1's compliment of result
+q=g+1; // 2's compliment of result
+e=dec2hex(q);
+printf('2s compliment of result would be= ');
+disp(e);
diff --git a/2522/CH19/EX19.8/exm19_8_output.jpg b/2522/CH19/EX19.8/exm19_8_output.jpg
new file mode 100755
index 000000000..daa5f70b4
--- /dev/null
+++ b/2522/CH19/EX19.8/exm19_8_output.jpg
Binary files differ
diff --git a/2522/CH19/EX19.9/exm19_9.sce b/2522/CH19/EX19.9/exm19_9.sce
new file mode 100755
index 000000000..29cbad276
--- /dev/null
+++ b/2522/CH19/EX19.9/exm19_9.sce
@@ -0,0 +1,28 @@
+//page no 629
+//example no A.9
+// ADDITION OF TWO POSITIVE NUMBERS
+clc;
+//the given numbers are 41H & 54H.
+A=hex2dec(['41']);
+B=hex2dec(['54'])
+Y=A+B;
+X=dec2hex(Y);
+printf('Sum =')
+disp(X);
+if Y>255 then // checking the carry flag.
+ printf('CY=1 \n \n')
+else
+ printf('CY=0 \n \n')
+end
+if Y>127 then // checking the sign flag.
+ printf('S=1 \n \n')
+else
+ printf('S=0 \n \n')
+end
+if Y>0 then // checking the zero flag.
+ printf('Z=0 \n \n')
+else
+ printf('Z=1 \n \n')
+end
+
+
diff --git a/2522/CH19/EX19.9/exm19_9_output.jpg b/2522/CH19/EX19.9/exm19_9_output.jpg
new file mode 100755
index 000000000..1ab2a5e4b
--- /dev/null
+++ b/2522/CH19/EX19.9/exm19_9_output.jpg
Binary files differ
diff --git a/2522/CH2/EX2.1/exm2_1.sce b/2522/CH2/EX2.1/exm2_1.sce
new file mode 100755
index 000000000..ddf019e6a
--- /dev/null
+++ b/2522/CH2/EX2.1/exm2_1.sce
@@ -0,0 +1,25 @@
+//page no 39
+//example no 2.1
+//MEMORY ADDRESS RANGE.
+clc;
+printf('A7-A0 are address lines for register select. \n');
+printf('A15-A8 are address lines for chip select. \n \n');
+printf('A15 A14 A13 A12 A11 A10 A9 A8 \n');
+printf(' 0 0 0 0 0 0 0 0 =00H \n \n'); //chip select bits have to be active low always to select that chip.
+printf('A7 A6 A5 A4 A3 A2 A1 A0 \n');
+printf(' 0 0 0 0 0 0 0 0 =00H \n'); //this selects the register 00.
+printf('The above combination selects the memory address 0000H. \n \n');
+printf('A15 A14 A13 A12 A11 A10 A9 A8 \n');
+printf(' 0 0 0 0 0 0 0 0 =00H \n \n'); //chip select bits have to be active low always to select that chip.
+printf('A7 A6 A5 A4 A3 A2 A1 A0 \n');
+printf(' 1 1 1 1 1 1 1 1 =FFH \n'); //this selects the register FF.
+printf('The above combination selects the memory address 00FFH. \n \n');
+//thus this chip can select any memory location from 0000H to 00FFH.
+//the memory addressed of the chip can be changed by modifying the hardware.For example if we remove the inverter on line A15.
+printf('A15 A14 A13 A12 A11 A10 A9 A8 \n');
+printf(' 1 0 0 0 0 0 0 0 =80H \n \n'); //chip select bits have to be active low always to select that chip.
+printf('A7 A6 A5 A4 A3 A2 A1 A0 \n');
+printf(' 0 0 0 0 0 0 0 0 =00H \n'); //this selects the register 00.
+printf('The above combination selects the memory address 8000H. \n \n');
+//The memory address range from above change will be 8000H to 80FFH.
+//Thus a memory can be assigned address in various locations over the entire map of 0000H to FFFFH.
diff --git a/2522/CH2/EX2.1/exm2_1_output.png b/2522/CH2/EX2.1/exm2_1_output.png
new file mode 100755
index 000000000..dce04265d
--- /dev/null
+++ b/2522/CH2/EX2.1/exm2_1_output.png
Binary files differ
diff --git a/2522/CH2/EX2.2/exm2_2.sce b/2522/CH2/EX2.2/exm2_2.sce
new file mode 100755
index 000000000..bb33e959b
--- /dev/null
+++ b/2522/CH2/EX2.2/exm2_2.sce
@@ -0,0 +1,18 @@
+//page no 41
+//example no 2.2
+//MEMORY ADDRESS RANGE.
+clc;
+printf('A9-A0 are address lines for register select. \n');
+printf('A15-A10 are address lines for chip select. \n \n');
+printf('A15 A14 A13 A12 A11 A10 \n');
+printf(' 0 0 0 0 0 0 \n \n'); //chip select bits have to be active low always to select that chip.
+printf('A9 A8 A7 A6 A5 A4 A3 A2 A1 A0 \n');
+printf(' 0 0 0 0 0 0 0 0 0 0 \n'); //this selects the register
+printf('The above combination selects the memory address 0000H. \n \n');
+printf('A15 A14 A13 A12 A11 A10 \n');
+printf(' 0 0 0 0 0 0 \n \n'); //chip select bits have to be active low always to select that chip.
+printf('A9 A8 A7 A6 A5 A4 A3 A2 A1 A0 \n');
+printf(' 1 1 1 1 1 1 1 1 1 1 \n'); //this selects the register
+printf('The above combination selects the memory address 03FFH. \n \n');
+//thus this chip can select any memory location from 0000H to 03FFH.
+//the memory addressed of the chip can be changed by modifying the hardware.Like we did in the previous example.
diff --git a/2522/CH2/EX2.2/exm2_2_output.png b/2522/CH2/EX2.2/exm2_2_output.png
new file mode 100755
index 000000000..5d0f3c654
--- /dev/null
+++ b/2522/CH2/EX2.2/exm2_2_output.png
Binary files differ
diff --git a/2522/CH2/EX2.3/exm2_3.sce b/2522/CH2/EX2.3/exm2_3.sce
new file mode 100755
index 000000000..2351d4262
--- /dev/null
+++ b/2522/CH2/EX2.3/exm2_3.sce
@@ -0,0 +1,8 @@
+//page no 43
+//example no 2.3
+//CALCULATING ADDRESS LINES
+clc;
+//number of address lines are given by x
+x={log(8192)}/{log(2)};
+printf('Number of address lines= ')
+disp(x);
diff --git a/2522/CH2/EX2.3/exm2_3_output.png b/2522/CH2/EX2.3/exm2_3_output.png
new file mode 100755
index 000000000..f7151ce3c
--- /dev/null
+++ b/2522/CH2/EX2.3/exm2_3_output.png
Binary files differ
diff --git a/2522/CH2/EX2.4/exm2_4.sce b/2522/CH2/EX2.4/exm2_4.sce
new file mode 100755
index 000000000..d3c76ac99
--- /dev/null
+++ b/2522/CH2/EX2.4/exm2_4.sce
@@ -0,0 +1,8 @@
+//page no 43
+//example no 2.4
+//CALCULATING NO OF CHIPS.
+clc;
+//chip 1024*1 has 1024(1k) registers & each register can store one bit with one data line. We need 8 data lines for byte size memory. Therefore 8 chips are necessary for 1k byte memory.For 1k byte memory we will need 64 chips. We can arrive at the same ans by dividing 8k byte by 1k*1 as follows:
+no=(8192*8)/(1024*1);
+printf('No of chips= ');
+disp(no);
diff --git a/2522/CH2/EX2.4/exm2_4_output.jpg b/2522/CH2/EX2.4/exm2_4_output.jpg
new file mode 100755
index 000000000..09fb54c30
--- /dev/null
+++ b/2522/CH2/EX2.4/exm2_4_output.jpg
Binary files differ
diff --git a/2522/CH2/EX2.5/exm2_5.sce b/2522/CH2/EX2.5/exm2_5.sce
new file mode 100755
index 000000000..fd642d680
--- /dev/null
+++ b/2522/CH2/EX2.5/exm2_5.sce
@@ -0,0 +1,8 @@
+//page no 44
+//example no 2.5
+//FETCHING AN INSTRUCTION.
+clc;
+printf('Memory Location 2005H= 4FH \n');
+printf('Address bus= 2005H \n') //program counter places the 16-bit address on the address bus.
+printf('Control bus--> (MEMR) \n'); //control bus sends memory read control signal.
+printf('Data bus= 4FH \n'); //instruction 4FH is fetched and transferred to instruction decoder.
diff --git a/2522/CH2/EX2.5/exm2_5_output.jpg b/2522/CH2/EX2.5/exm2_5_output.jpg
new file mode 100755
index 000000000..18e6f2586
--- /dev/null
+++ b/2522/CH2/EX2.5/exm2_5_output.jpg
Binary files differ
diff --git a/2522/CH3/EX3.2/exm3_2.sce b/2522/CH3/EX3.2/exm3_2.sce
new file mode 100755
index 000000000..8a39ad619
--- /dev/null
+++ b/2522/CH3/EX3.2/exm3_2.sce
@@ -0,0 +1,13 @@
+//page no 78
+//example no 3.2
+//EXECUTING THE INSTRUCTION.
+clc;
+A=82; //contents of the accumulator.
+printf('Accumulator= ');
+disp(A);
+TR=A; //contents of the accumulator tranferred to the temporary register.
+printf('Temporary Register= ');
+disp(TR);
+C=TR; //contents of the temporary register are transferred to register C.
+printf('Register C= ');
+disp(C);
diff --git a/2522/CH3/EX3.2/exm3_2_output.jpg b/2522/CH3/EX3.2/exm3_2_output.jpg
new file mode 100755
index 000000000..de6a2b364
--- /dev/null
+++ b/2522/CH3/EX3.2/exm3_2_output.jpg
Binary files differ
diff --git a/2522/CH3/EX3.3/exm3_3.sce b/2522/CH3/EX3.3/exm3_3.sce
new file mode 100755
index 000000000..a39b94357
--- /dev/null
+++ b/2522/CH3/EX3.3/exm3_3.sce
@@ -0,0 +1,18 @@
+//page no 82
+//example no 3.3
+//TIME REQUIRED FOR EXECUTION.
+clc;
+A=32; // MVI A,32H loads the value 32 in accumulator.
+printf('Accumulator= ');
+disp(A);
+//calculating the execution time for instruction.
+f=2; // clock frequncy.
+printf('clock frequency= %f MHz \n',f);
+t=1/f; // T-state=clock period
+printf('T-state=clock period= %f microsec \n',t);
+t1=4*t; // execution time for opcode fetch.
+printf('Execution time for opcode fetch= %f microsec \n',t1);
+t2=3*t; // execution time for memory read.
+printf('Execution time for memory read= %f microsec \n',t2);
+t3=7*t; // execution time for instruction.
+printf('Execution time for instruction= %f microsec \n',t3);
diff --git a/2522/CH3/EX3.3/exm3_3_output.jpg b/2522/CH3/EX3.3/exm3_3_output.jpg
new file mode 100755
index 000000000..997253ef8
--- /dev/null
+++ b/2522/CH3/EX3.3/exm3_3_output.jpg
Binary files differ
diff --git a/2522/CH3/EX3.5/exm3_5.sce b/2522/CH3/EX3.5/exm3_5.sce
new file mode 100755
index 000000000..1dc756e20
--- /dev/null
+++ b/2522/CH3/EX3.5/exm3_5.sce
@@ -0,0 +1,17 @@
+////page no 91
+//example no 3.5
+//MEMORY ADDRESS RANGE OF 6116.
+clc;
+printf('A10-A0 are address lines for register select. \n');
+printf('A15-A11 are address lines for chip select. \n \n');
+printf('A15 A14 A13 A12 A11 \n');
+printf(' 1 0 0 0 1 \n \n'); //chip select bits have to be active low always to select that chip.
+printf('A10 A9 A8 A7 A6 A5 A4 A3 A2 A1 A0 \n');
+printf('0 0 0 0 0 0 0 0 0 0 0 \n'); //this selects the register
+printf('The above combination selects the memory address 8800H. \n \n');
+printf('A15 A14 A13 A12 A11 \n');
+printf(' 1 0 0 0 1 \n \n'); //chip select bits have to be active low always to select that chip.
+printf('A10 A9 A8 A7 A6 A5 A4 A3 A2 A1 A0 \n');
+printf('1 1 1 1 1 1 1 1 1 1 1 \n'); //this selects the register
+printf('The above combination selects the memory address 88FFH. \n \n');
+//thus this chip can select any memory location from 8800H to 88FFH.
diff --git a/2522/CH3/EX3.5/exm3_5_output.jpg b/2522/CH3/EX3.5/exm3_5_output.jpg
new file mode 100755
index 000000000..db6f257b4
--- /dev/null
+++ b/2522/CH3/EX3.5/exm3_5_output.jpg
Binary files differ
diff --git a/2522/CH3/EX3.6/exm3_6.sce b/2522/CH3/EX3.6/exm3_6.sce
new file mode 100755
index 000000000..f0e29baf1
--- /dev/null
+++ b/2522/CH3/EX3.6/exm3_6.sce
@@ -0,0 +1,22 @@
+////page no 95
+//example no 3.6
+//MEMORY ADDRESS RANGE OF 8155.
+clc;
+printf('A7-A0 are address lines for register select. \n');
+printf('A10-A8 address lines are dont care conditions. \n');
+printf('A15-A11 are address lines for chip select. \n \n');
+printf('A15 A14 A13 A12 A11 \n');
+printf(' 0 0 1 0 0 \n \n'); //chip select bits have to be active low always to select that chip.
+printf('A10 A9 A8 \n');
+printf('0 0 1 \n \n'); //this is the don't care condition.
+printf('A7 A6 A5 A4 A3 A2 A1 A0 \n');
+printf('0 0 0 0 0 0 0 0 \n'); //this selects the register
+printf('The above combination selects the memory address 2100H. \n \n');
+printf('A15 A14 A13 A12 A11 \n');
+printf(' 0 0 1 0 0 \n \n'); //chip select bits have to be active low always to select that chip.
+printf('A10 A9 A8 \n');
+printf('0 0 1 \n \n'); //this is the don't care condition.
+printf('A7 A6 A5 A4 A3 A2 A1 A0 \n');
+printf('1 1 1 1 1 1 1 1 \n'); //this selects the register
+printf('The above combination selects the memory address 21FFH. \n \n');
+//thus this chip can select any memory location from 2100H to 21FFH.
diff --git a/2522/CH3/EX3.6/exm3_6_output.jpg b/2522/CH3/EX3.6/exm3_6_output.jpg
new file mode 100755
index 000000000..f58ac1264
--- /dev/null
+++ b/2522/CH3/EX3.6/exm3_6_output.jpg
Binary files differ
diff --git a/2522/CH6/EX6.1/exm6_1.sce b/2522/CH6/EX6.1/exm6_1.sce
new file mode 100755
index 000000000..e0ba67ec4
--- /dev/null
+++ b/2522/CH6/EX6.1/exm6_1.sce
@@ -0,0 +1,7 @@
+//page no 164
+//example no 6.1
+//LOAD A DATA TO ONE REGISTER AND MOVE IT TO ANOTHER.
+clc;
+A=hex2dec(['82']); //storing the decimal value of hexadecimal no 82 in accumulator A
+B=dec2hex([A]); //storing the hexadecimal value of A in B
+print(%io(2),B); //displaying the hexadecimal number in register B
diff --git a/2522/CH6/EX6.1/exm6_1_output.jpg b/2522/CH6/EX6.1/exm6_1_output.jpg
new file mode 100755
index 000000000..9171e0314
--- /dev/null
+++ b/2522/CH6/EX6.1/exm6_1_output.jpg
Binary files differ
diff --git a/2522/CH6/EX6.2/exm6_2.sce b/2522/CH6/EX6.2/exm6_2.sce
new file mode 100755
index 000000000..951ba780f
--- /dev/null
+++ b/2522/CH6/EX6.2/exm6_2.sce
@@ -0,0 +1,11 @@
+//page no 164
+//example 6.2
+//TO SWITCH ON SOME DEVICES
+//let the switches which are ON are at bit no D0,D1,D2,D3,D6;
+clc;
+x=hex2dec(['4F']); //hexadecimal to decimal conversion
+y=dec2bin(x); //decimal to binary conversion
+printf('At output port 01H: '); //same input appears at the putput
+disp(y);
+printf('Value 1s are showing the devices are ON. \n')
+printf('Value 0s are showing the devices are switched OFF.');
diff --git a/2522/CH6/EX6.2/exm6_2_output.jpg b/2522/CH6/EX6.2/exm6_2_output.jpg
new file mode 100755
index 000000000..bce1db726
--- /dev/null
+++ b/2522/CH6/EX6.2/exm6_2_output.jpg
Binary files differ
diff --git a/2522/CH6/EX6.3/exm6_3.sce b/2522/CH6/EX6.3/exm6_3.sce
new file mode 100755
index 000000000..b9ac5befb
--- /dev/null
+++ b/2522/CH6/EX6.3/exm6_3.sce
@@ -0,0 +1,21 @@
+//page no 174
+//example 6.3
+//ADDITION OF TWO NUMBERS.
+//93H is stored in accumulator. Converting it into decimal.
+clc;
+A=hex2dec(['93']);
+//B7H is stored in register C. Converting it into decimal.
+C=hex2dec(['B7']);
+X=A+C; // the result comes out to be 330
+Z=X-256;
+//X=330; // this is a decimal value. Converting it into hexadecimal
+Y=dec2hex(Z);
+printf('Sum= ')
+disp(Y);
+if X>255 then
+ printf('CY=1')
+else
+ printf('CY=0')
+end
+
+
diff --git a/2522/CH6/EX6.3/exm6_3_output.jpg b/2522/CH6/EX6.3/exm6_3_output.jpg
new file mode 100755
index 000000000..8d3dddd3a
--- /dev/null
+++ b/2522/CH6/EX6.3/exm6_3_output.jpg
Binary files differ
diff --git a/2522/CH6/EX6.4/exm6_4.sce b/2522/CH6/EX6.4/exm6_4.sce
new file mode 100755
index 000000000..4dbf06ddb
--- /dev/null
+++ b/2522/CH6/EX6.4/exm6_4.sce
@@ -0,0 +1,17 @@
+//page no 175
+//example 6.4
+//CONTINUATION OF PREVIOUS EXAMPLE.
+//the sum of previous example is added to 35H
+clc;
+S=hex2dec(['4A']); //4AH is converted into decimal value.
+A=hex2dec(['35']); //35H is converted into decimal value
+s=A+S; //the result comes out to be 127. it is a decimal value
+Y=dec2hex(s);
+printf('Sum= ')
+disp(Y);
+if s>255 then
+ printf('CY=1')
+else
+ printf('CY=0')
+end
+
diff --git a/2522/CH6/EX6.4/exm6_4_output.jpg b/2522/CH6/EX6.4/exm6_4_output.jpg
new file mode 100755
index 000000000..7730e7c01
--- /dev/null
+++ b/2522/CH6/EX6.4/exm6_4_output.jpg
Binary files differ
diff --git a/2522/CH6/EX6.5/exm6_5.sce b/2522/CH6/EX6.5/exm6_5.sce
new file mode 100755
index 000000000..65e682f77
--- /dev/null
+++ b/2522/CH6/EX6.5/exm6_5.sce
@@ -0,0 +1,29 @@
+//page no 175
+//example no 6.5
+//INCRIMENTING ACCUMULATOR CONTENT.
+//accumulator holds the data FFH
+clc;
+A=hex2dec(['FF']); //converting FFH into decimal value
+//decimal value of 01H is 01. Adding 01 to A
+Y=A+1; //the result comes out to be 256
+Z=Y-256;
+X=dec2hex(Z);
+printf('Sum =')
+disp(X);
+if Y>255 then
+ printf('CY=1 \n')
+else
+ printf('CY=0 \n')
+end
+if Z>127 then
+ printf('S=1 \n')
+else
+ printf('S=0 \n')
+end
+if Z>0 then
+ printf('Z=0 \n')
+else
+ printf('Z=1 \n')
+end
+
+
diff --git a/2522/CH6/EX6.5/exm6_5_output.jpg b/2522/CH6/EX6.5/exm6_5_output.jpg
new file mode 100755
index 000000000..a920b1e5d
--- /dev/null
+++ b/2522/CH6/EX6.5/exm6_5_output.jpg
Binary files differ
diff --git a/2522/CH6/EX6.6/exm6_6.sce b/2522/CH6/EX6.6/exm6_6.sce
new file mode 100755
index 000000000..f206ea94d
--- /dev/null
+++ b/2522/CH6/EX6.6/exm6_6.sce
@@ -0,0 +1,31 @@
+//page no 179
+//example 6.6
+//SUBTRACTION OF TWO NUMBERS.
+//accumulator has 97H. Converting it into decimal value
+clc;
+A=hex2dec(['97']);
+//register B has 65H. Finding 2's compliment of 65H.
+B=hex2dec(['65']);
+X=256-B;
+Y=A+X;
+S=Y-256;
+Z=dec2hex(S);
+printf('Subtraction= ')
+disp(Z);
+if Y>255 then
+ CY=1;
+ printf('The result is positive. \n');
+else
+ CY=0;
+ printf('The result is negative. \n')
+end
+if S>127 then
+ printf('S=1 \n')
+else
+ printf('S=0 \n')
+end
+if S>0 then
+ printf('Z=0 \n')
+else
+ printf('Z=1 \n')
+end
diff --git a/2522/CH6/EX6.6/exm6_6_output.jpg b/2522/CH6/EX6.6/exm6_6_output.jpg
new file mode 100755
index 000000000..7f69f33fa
--- /dev/null
+++ b/2522/CH6/EX6.6/exm6_6_output.jpg
Binary files differ
diff --git a/2522/CH6/EX6.7/exm6_7.sce b/2522/CH6/EX6.7/exm6_7.sce
new file mode 100755
index 000000000..036a7d318
--- /dev/null
+++ b/2522/CH6/EX6.7/exm6_7.sce
@@ -0,0 +1,39 @@
+//page no 185
+//example no 6.7
+//PERFORMING LOGICAL OPERATIONS.
+//register B holds 93H.Binary of 93H is 10010011
+//register A holds 15H. Binary of 15H is 00010101.
+clc;
+B=[1 0 0 1 0 0 1 1]; //taking the value of A in matrix form.
+A=[0 0 0 1 0 1 0 1]; //taking the value of B in matrix form.
+Y= bitor(A,B); // getting OR of A & B
+printf('OR of A & B is')
+disp(Y);
+if Y(1,1)==1 then
+ printf('S=1 \n');
+else
+ printf('S=0 \n');
+end
+if Y==0 then
+ printf('Z=1 \n');
+else
+ printf('Z=0 \n');
+end
+printf('CY=0 \n');
+R=bitxor(A,B); //getting XOR of A & B
+printf('XOR of A & B is')
+disp(R);
+if R(1,1)==1 then
+ printf('S=1 \n');
+else
+ printf('S=0 \n');
+end
+if R==0 then
+ printf('Z=1 \n');
+else
+ printf('Z=0 \n');
+end
+printf('CY=0 \n');
+K=bitcmp(A,1); //getting the compliment of A
+printf('Compliment of A is: \n');
+disp(K);
diff --git a/2522/CH6/EX6.7/exm6_7_output.jpg b/2522/CH6/EX6.7/exm6_7_output.jpg
new file mode 100755
index 000000000..8c2eb3767
--- /dev/null
+++ b/2522/CH6/EX6.7/exm6_7_output.jpg
Binary files differ
diff --git a/2522/CH6/EX6.8/exm6_8.sce b/2522/CH6/EX6.8/exm6_8.sce
new file mode 100755
index 000000000..00e371f86
--- /dev/null
+++ b/2522/CH6/EX6.8/exm6_8.sce
@@ -0,0 +1,11 @@
+//page no 186
+//example no 6.8
+//KEEPING THE RADIO ON.
+//to keep the radio on without affecting the other appliances, the D4 bit should always be 1
+//assuming an input input binary 10101010
+clc;
+A=[1 0 1 0 1 0 1 0];
+B=[0 0 0 1 0 0 0 0];
+Y=bitor(A,B); //ORing input (A) with B to keep the D4 bit always set
+disp(Y);
+printf('D4 bit will always be one without affecting the other bits');
diff --git a/2522/CH6/EX6.8/exm6_8_output.jpg b/2522/CH6/EX6.8/exm6_8_output.jpg
new file mode 100755
index 000000000..f5bb856b8
--- /dev/null
+++ b/2522/CH6/EX6.8/exm6_8_output.jpg
Binary files differ
diff --git a/2522/CH6/EX6.9/exm6_9.sce b/2522/CH6/EX6.9/exm6_9.sce
new file mode 100755
index 000000000..061af9c51
--- /dev/null
+++ b/2522/CH6/EX6.9/exm6_9.sce
@@ -0,0 +1,11 @@
+//page no 187
+//example no 6.9
+//TURN OFF THE AIR CONDITIONER.
+//to turn OFF the air conditioner, reset bit D7
+//Assuming the same input as earlier as it is a continuation of previous example.
+clc;
+A=[1 0 1 0 1 0 1 0];
+B=[0 1 1 1 1 1 1 1];
+Y=bitand(A,B); //ANDing input (A) with B to keep the D4 bit always set
+disp(Y);
+printf('D7 bit will always be zero without affecting the other bits');
diff --git a/2522/CH6/EX6.9/exm6_9_output.jpg b/2522/CH6/EX6.9/exm6_9_output.jpg
new file mode 100755
index 000000000..2a9869bfb
--- /dev/null
+++ b/2522/CH6/EX6.9/exm6_9_output.jpg
Binary files differ
diff --git a/2522/CH7/EX7.1/exm7_1.sce b/2522/CH7/EX7.1/exm7_1.sce
new file mode 100755
index 000000000..85f1c9c16
--- /dev/null
+++ b/2522/CH7/EX7.1/exm7_1.sce
@@ -0,0 +1,12 @@
+//page no 216
+//example no 7.1
+//STEPS TO ADD 10 BYTES OF DATA.
+clc;
+disp('The micriprocessor needs :');
+disp('a counter to count 10 data bytes');
+disp('an index or a memory pointer to locate where data bytes are stored');
+disp('to transfer data from a memory location to the microprocessor');
+disp('to perform addition');
+disp('registers for temporary storage of partial answers');
+disp('a flag to indicate the completion of the task');
+disp('to store or output the result');
diff --git a/2522/CH7/EX7.1/exm7_1_output.jpg b/2522/CH7/EX7.1/exm7_1_output.jpg
new file mode 100755
index 000000000..974ab1003
--- /dev/null
+++ b/2522/CH7/EX7.1/exm7_1_output.jpg
Binary files differ
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.
diff --git a/2522/CH7/EX7.10/exm7_10_output.jpg b/2522/CH7/EX7.10/exm7_10_output.jpg
new file mode 100755
index 000000000..144d3d6bd
--- /dev/null
+++ b/2522/CH7/EX7.10/exm7_10_output.jpg
Binary files differ
diff --git a/2522/CH7/EX7.11/exm7_11.sce b/2522/CH7/EX7.11/exm7_11.sce
new file mode 100755
index 000000000..6e00e460f
--- /dev/null
+++ b/2522/CH7/EX7.11/exm7_11.sce
@@ -0,0 +1,23 @@
+//page no 241
+//example no 7.11
+// COMPARISION OF DATA.
+clc;
+disp('MVI A,64H'); //loads accumulator with 64H.
+disp('A-->64H');
+disp('LXI H,2050H'); // loads HL register pair.
+disp('H=20H L=50H');
+disp('M-->9AH'); //assumed in the solution.
+disp('CMP M');
+//this command compares the contents of A with M by subtracting M from A.
+A=hex2dec(['64']);
+//register M has 9AH. Finding 2's compliment of 9AH.
+M=hex2dec(['9A']);
+a=dec2bin(A);
+m=dec2bin(M);
+t=isequalbitwise(a,m); //compares the two datas bitwise.
+if(A==M) // Jump condition
+ printf('\n Result after comparision is= ');
+ printf('OUT1');
+else
+ printf('\n Result after comparision is= ');
+ disp(t); //this shows the false condition of the bitwise comparision.
diff --git a/2522/CH7/EX7.11/exm7_11_output.jpg b/2522/CH7/EX7.11/exm7_11_output.jpg
new file mode 100755
index 000000000..178c3c509
--- /dev/null
+++ b/2522/CH7/EX7.11/exm7_11_output.jpg
Binary files differ
diff --git a/2522/CH7/EX7.2/exm7_2.sce b/2522/CH7/EX7.2/exm7_2.sce
new file mode 100755
index 000000000..7bf636aa0
--- /dev/null
+++ b/2522/CH7/EX7.2/exm7_2.sce
@@ -0,0 +1,15 @@
+//page no 219
+//example no 7.2
+//LOADING 16-BIT NUMBER.
+//working of LXI instruction.
+clc;
+disp('LXI H,2050H'); // loads HL register pair.
+disp('L=50H'); // 50H in L register.
+disp('H=20H'); //20H in H register pair.
+disp('LXI instruction takes 3 bytes of memory and 10 clock periods.')
+//working of MVI instruction.
+disp('MVI H,20H');
+disp('H=20H'); // load 20H in register H.
+disp('MVI L,50H'); // load 50H in register L.
+disp('L=50H');
+disp('2 MVI instructions take 4 bytes of memory and 14 clock periods.')
diff --git a/2522/CH7/EX7.2/exm7_2_output.jpg b/2522/CH7/EX7.2/exm7_2_output.jpg
new file mode 100755
index 000000000..2e37cc0c8
--- /dev/null
+++ b/2522/CH7/EX7.2/exm7_2_output.jpg
Binary files differ
diff --git a/2522/CH7/EX7.3/exm7_3.sce b/2522/CH7/EX7.3/exm7_3.sce
new file mode 100755
index 000000000..0c622fdcd
--- /dev/null
+++ b/2522/CH7/EX7.3/exm7_3.sce
@@ -0,0 +1,32 @@
+//page no 220
+//example no 7.3
+// TRANSFER OF DATA BYTES TO ACCUMULATOR.
+// Memory location 2050H has the data F7H.
+clc;
+
+// using MOV instruction.
+//indirect addressing mode.
+disp('LXI H,2050H');
+printf('H=20H L=50H \n \n'); // the 16-bit address of the data is loaded in HL register pair.
+M=hex2dec(['F7']); // M is the memory location pointer of address 2050H.
+printf('MOV A,M \n');
+A=dec2hex(M);
+printf('A= ');
+disp(A); // the contents of the HL register pair are used as memory pointer to the location 2050H.
+
+// using LDAX instruction.
+// indirect addressing mode.
+disp('LXI B,2050H');
+printf('B=20H C=50H \n \n'); // the 16-bit address of the data is loaded in BC register pair.
+M=hex2dec(['F7']); // M is the memory location pointer of address 2050H.
+printf('LDAX B \n');
+A=dec2hex(M);
+printf('A= ');
+disp(A); // the contents of the BC register pair are used as memory pointer to the location 2050H.
+
+// using LDA instruction.
+// direct addressing mode.
+printf('\n LDA 2050H \n'); //directly sends the data of memory location 2050H to accumulator.
+printf('A= ');
+disp(A);
+
diff --git a/2522/CH7/EX7.3/exm7_3_output.jpg b/2522/CH7/EX7.3/exm7_3_output.jpg
new file mode 100755
index 000000000..8676a2c49
--- /dev/null
+++ b/2522/CH7/EX7.3/exm7_3_output.jpg
Binary files differ
diff --git a/2522/CH7/EX7.4/exm7_4.sce b/2522/CH7/EX7.4/exm7_4.sce
new file mode 100755
index 000000000..8de6ed61f
--- /dev/null
+++ b/2522/CH7/EX7.4/exm7_4.sce
@@ -0,0 +1,33 @@
+//page no 222
+//example no 7.4
+// USE OF ADDRESSING MODES.
+clc;
+//register B contains 32H
+B=32;
+
+//using indirect addressing modes
+printf('B= %d \n',B);
+disp(' 1) LXI H,8000H'); // loads HL register pair.
+disp('H=80H L=00H');
+disp('MOV M,B'); // contents of register B are moved in memory location pointed by HL register pair.
+M=B;
+printf('\n 8000H --> %d \n \n',M);
+
+disp('LXI D,8000H'); //loads the memory location 8000H in DE register pair.
+disp('D=80H E=00H');
+disp('MOV A,B');
+A=B;
+printf('A= %d \n',A);
+disp('STAX D'); //stores the value of accumulator in the memory location pointer by DE register pair.
+printf('\n 8000H --> %d \n \n',A);
+
+//using direct addressing mode.
+disp('2) A= F2H');
+disp('STA 8000H'); //this instruction stores the value of accumulator in the memory location 8000H.
+disp('8000H --> F2H');
+
+//using indirect addressing mode.
+disp('3) LXI H,8000H'); // loads HL register pair.
+disp('H=80H L=00H');
+disp('MVI M,F2H'); //moving the data in the memory.
+disp('8000H --> F2H');
diff --git a/2522/CH7/EX7.4/exm7_4_output1.jpg b/2522/CH7/EX7.4/exm7_4_output1.jpg
new file mode 100755
index 000000000..8aea52faa
--- /dev/null
+++ b/2522/CH7/EX7.4/exm7_4_output1.jpg
Binary files differ
diff --git a/2522/CH7/EX7.4/exm7_4_output2.jpg b/2522/CH7/EX7.4/exm7_4_output2.jpg
new file mode 100755
index 000000000..a74a894f8
--- /dev/null
+++ b/2522/CH7/EX7.4/exm7_4_output2.jpg
Binary files differ
diff --git a/2522/CH7/EX7.5/exm7_5.sce b/2522/CH7/EX7.5/exm7_5.sce
new file mode 100755
index 000000000..d5b8b41b3
--- /dev/null
+++ b/2522/CH7/EX7.5/exm7_5.sce
@@ -0,0 +1,20 @@
+//page no 224
+//example no 7.5
+// INCREMENT A NUMBER.
+clc;
+disp('LXI B,2050H'); //loads the data 2050H in BC register pair.
+disp('B=20H C=50H');
+B=20;
+C=50;
+disp('INX B');
+C=C+1;
+printf('B= %d C= %d \n',B,C);
+disp('The contents of BC register pair will be 2051H');
+disp('INR B');
+B=B+1;
+printf('B= %d \n',B);
+disp('INR C');
+C=50;
+C=C+1;
+printf('C= %d \n',C);
+disp('The contents of BC register pair will be 2151H');
diff --git a/2522/CH7/EX7.5/exm7_5_output.jpg b/2522/CH7/EX7.5/exm7_5_output.jpg
new file mode 100755
index 000000000..ed3d60c1e
--- /dev/null
+++ b/2522/CH7/EX7.5/exm7_5_output.jpg
Binary files differ
diff --git a/2522/CH7/EX7.6/exm7_6.sce b/2522/CH7/EX7.6/exm7_6.sce
new file mode 100755
index 000000000..636d57ab3
--- /dev/null
+++ b/2522/CH7/EX7.6/exm7_6.sce
@@ -0,0 +1,24 @@
+//page no 228
+//example no 7.6
+// ARITHEMETIC OPERATIONS.
+clc;
+disp('A-->30H');
+disp('2040H-->68H');
+disp('2041H-->7FH');
+disp('LXI H,2040H'); // loads HL register pair.
+disp('H=20H L=40H M=68H');
+disp('ADD M');
+A=hex2dec(['30']);
+M=hex2dec(['68']);
+S=A+M; // adds the contents of A and data at memory location 2040H.
+s=dec2hex(S);
+printf('\n Content of A after addition with 2040H= ');
+disp(s);
+disp('INX H'); // takes the program to the next memory location.
+disp('H=20H L=41H M=7FH');
+disp('SUB M');
+M=hex2dec(['7F']);
+D=S-M; // subtracts the contents of A from the data at memory location 2041H.
+d=dec2hex(D);
+printf('\n Content of A after subtraction with 2041H= ');
+disp(d);
diff --git a/2522/CH7/EX7.6/exm7_6_output.jpg b/2522/CH7/EX7.6/exm7_6_output.jpg
new file mode 100755
index 000000000..390fe6e11
--- /dev/null
+++ b/2522/CH7/EX7.6/exm7_6_output.jpg
Binary files differ
diff --git a/2522/CH7/EX7.7/exm7_7.sce b/2522/CH7/EX7.7/exm7_7.sce
new file mode 100755
index 000000000..ed4ec0ba4
--- /dev/null
+++ b/2522/CH7/EX7.7/exm7_7.sce
@@ -0,0 +1,26 @@
+//page no 229
+//example no 7.7
+// INCREMENT & DECREMENT.
+clc;
+disp('LXI H,2040H'); // loads HL register pair.
+disp('H=20H L=40H');
+disp('MVI M,59H');
+M=59;
+M=hex2dec(['59']);
+disp('2040H-->59H')
+disp('INR M');
+M=M+1; // increments the value at the memory location by 1.
+m=dec2hex(M);
+printf('\n Content of 2040H after increment= ');
+disp(m);
+disp('INX H'); //takes the program to the next memory location.
+disp('H=20H L=41H');
+disp('MVI M,90H');
+M=90;
+M=hex2dec(['90']);
+disp('2041H-->90H');
+disp('DCR M');
+M=M-1; //decrements the value at the memory location by 1.
+m=dec2hex(M);
+printf('\n Content of 2041H after decrement= ');
+disp(m);
diff --git a/2522/CH7/EX7.7/exm7_7_output.jpg b/2522/CH7/EX7.7/exm7_7_output.jpg
new file mode 100755
index 000000000..c3b3ae561
--- /dev/null
+++ b/2522/CH7/EX7.7/exm7_7_output.jpg
Binary files differ
diff --git a/2522/CH7/EX7.8/exm7_8.sce b/2522/CH7/EX7.8/exm7_8.sce
new file mode 100755
index 000000000..c541e68ab
--- /dev/null
+++ b/2522/CH7/EX7.8/exm7_8.sce
@@ -0,0 +1,22 @@
+//page no 233
+// example no 7.8
+// LEFT ROTATION (RLC) OF BITS.
+clc;
+// initially
+printf('Accumulator= AAH \n');
+printf('D7 D6 D5 D4 D3 D2 D1 D0 \n');
+printf(' 1 0 1 0 1 0 1 0 =AAH \n \n');
+printf('CY= 0 \n \n');
+printf('RLC \n \n');
+printf('CY= 1 \n \n');
+// carry flag is set because D7 bit was 1.
+printf('D7 D6 D5 D4 D3 D2 D1 D0 \n');
+printf(' 0 1 0 1 0 1 0 1 =55H \n \n'); // after the executuion of first RLC.
+// RLC instruction places D7 bit in CY flag as well as in D0 bit.
+printf('RLC \n \n');
+printf('CY= 0 \n \n');
+// carry flag is reset because D7 bit was 0.
+printf('D7 D6 D5 D4 D3 D2 D1 D0 \n');
+printf(' 1 0 1 0 1 0 1 0 =AAH \n \n'); // after the executuion of second RLC.
+// RLC instruction places D7 bit in CY flag as well as in D0 bit.
+
diff --git a/2522/CH7/EX7.8/exm7_8_output.jpg b/2522/CH7/EX7.8/exm7_8_output.jpg
new file mode 100755
index 000000000..69e9eb5e5
--- /dev/null
+++ b/2522/CH7/EX7.8/exm7_8_output.jpg
Binary files differ
diff --git a/2522/CH7/EX7.9/exm7_9.sce b/2522/CH7/EX7.9/exm7_9.sce
new file mode 100755
index 000000000..a67e89f30
--- /dev/null
+++ b/2522/CH7/EX7.9/exm7_9.sce
@@ -0,0 +1,21 @@
+//page no 234
+// example no 7.9
+// LEFT ROTATION (RAL) OF BITS.
+clc;
+// initially
+printf('Accumulator= AAH \n');
+printf('D7 D6 D5 D4 D3 D2 D1 D0 \n');
+printf(' 1 0 1 0 1 0 1 0 =AAH \n \n');
+printf('CY= 0 \n \n');
+printf('RAL \n \n');
+printf('CY= 1 \n \n');
+// carry flag is set because D7 bit was 1.
+printf('D7 D6 D5 D4 D3 D2 D1 D0 \n');
+printf(' 0 1 0 1 0 1 0 0 =54H \n \n'); // after the executuion of first RAL.
+// RAL instruction places D7 bit in CY flag & CY flags bit is send to D0 bit.
+printf('RAL \n \n');
+printf('CY= 0 \n \n');
+// carry flag is reset because D7 bit was 0.
+printf('D7 D6 D5 D4 D3 D2 D1 D0 \n');
+printf(' 1 0 1 0 1 0 0 1 =A9H \n \n'); // after the executuion of second RAL.
+// RAL instruction places D7 bit in CY flag & CY flags bit is send to D0 bit.
diff --git a/2522/CH7/EX7.9/exm7_9_output.jpg b/2522/CH7/EX7.9/exm7_9_output.jpg
new file mode 100755
index 000000000..0f26bb266
--- /dev/null
+++ b/2522/CH7/EX7.9/exm7_9_output.jpg
Binary files differ
diff --git a/2522/CH9/EX9.1/exm9_1.sce b/2522/CH9/EX9.1/exm9_1.sce
new file mode 100755
index 000000000..48860f84f
--- /dev/null
+++ b/2522/CH9/EX9.1/exm9_1.sce
@@ -0,0 +1,26 @@
+// page no 283
+// example no 9.1
+// PUSH POP AND DELAY INSTRUCTIONS
+clc;
+printf('LXI SP,2099H \n \n'); // the stack pointer is located at 2099H.
+printf('LXI H,42F2H \n ');
+printf('H--> 42 L-->F2 \n \n');
+printf('PUSH H \n'); // sends the data of HL register pair in the stack.
+// stack pointer is decremented by one to 2098H and the contents of the H register are copied to memory location 2098H
+printf('2098H--> 42 \n');
+// stack pointer is again decremented by one to 2097H and the contents of the L register are copied to memory location 2097H
+printf('2097H--> F2 \n \n');
+printf('Delay Counter \n \n');
+
+
+n=hex2dec(['42F2']);
+for i=1:n // DELAY LOOP
+ {
+ }
+end
+
+printf(' POP H \n'); // sends the data in the stack back to the HL register pair.
+// the contents of the top of the stack are copied to L register and the stack pointer is incremented by one to 2098H
+printf('L--> F2H \n');
+// the contents of the current location of stack are copied to H register and the stack pointer is again incremented by one to 2099H.
+printf('H--> 42H \n');
diff --git a/2522/CH9/EX9.1/exm9_1_output.jpg b/2522/CH9/EX9.1/exm9_1_output.jpg
new file mode 100755
index 000000000..34e53adc1
--- /dev/null
+++ b/2522/CH9/EX9.1/exm9_1_output.jpg
Binary files differ
diff --git a/2522/CH9/EX9.2/exm9_2.sce b/2522/CH9/EX9.2/exm9_2.sce
new file mode 100755
index 000000000..079109dfd
--- /dev/null
+++ b/2522/CH9/EX9.2/exm9_2.sce
@@ -0,0 +1,41 @@
+// page no 285
+// example no 9.2
+// EXCHANGE OF DATA USING STACK.
+clc;
+printf('LXI SP,2400H \n \n'); // the stack pointer is located at 2400H.
+printf('LXI H,2150H \n ');
+printf('H--> 21 L-->50 \n \n');
+printf('LXI B,2280H \n ');
+printf('B--> 22 C-->80 \n \n');
+printf('PUSH H \n'); // sends the data of HL register pair in the stack.
+// stack pointer is decremented by one to 23FFH and the contents of the H register are copied to memory location 23FFH
+printf('23FFH--> 21 \n');
+// stack pointer is again decremented by one to 23FEH and the contents of the L register are copied to memory location 23FEH
+printf('23FEH--> 50 \n \n');
+printf('PUSH B \n'); // sends the data of BC register pair in the stack.
+// stack pointer is decremented by one to 23FDH and the contents of the H register are copied to memory location 23FDH
+printf('23FDH--> 22 \n');
+// stack pointer is again decremented by one to 23FCH and the contents of the L register are copied to memory location 23FCH
+printf('23FCH--> 80 \n \n');
+printf('PUSH PSW \n'); // sends the data of accumulator & flag register in the stack.
+// stack pointer is decremented by one to 23FBH and the contents of the H register are copied to memory location 23FBH
+printf('23FBH--> contents of accumulator \n');
+// stack pointer is again decremented by one to 23FAH and the contents of the L register are copied to memory location 23FAH
+printf('23FAH--> contents of flag register \n \n');
+
+printf('To exchange the data. \n \n')
+printf(' POP PSW \n'); // sends the data in the stack back to the accumulator & flag register.
+// the contents of the top of the stack are copied to A register and the stack pointer is incremented by one to 23FBH
+printf('A--> contents of accumulator \n');
+// the contents of the current location of stack are copied to flag register and the stack pointer is again incremented by one to 23FCH.
+printf('F--> contents of flag register \n \n');
+printf(' POP H \n'); // sends the data in the stack back to the HL register pair.
+// the contents of the current location of the stack are copied to L register and the stack pointer is incremented by one to 23FDH
+printf('L--> 80H \n');
+// the contents of the current location of stack are copied to H register and the stack pointer is again incremented by one to 23FEH.
+printf('H--> 22H \n \n');
+printf(' POP B \n'); // sends the data in the stack back to the BC register pair.
+// the contents of the current location of the stack are copied to C register and the stack pointer is incremented by one to 23FFH
+printf('C--> 50H \n');
+// the contents of the current location of stack are copied to B register and the stack pointer is again incremented by one to 2400H.
+printf('B--> 21H \n');
diff --git a/2522/CH9/EX9.2/exm9_2_output.jpg b/2522/CH9/EX9.2/exm9_2_output.jpg
new file mode 100755
index 000000000..6e40637b0
--- /dev/null
+++ b/2522/CH9/EX9.2/exm9_2_output.jpg
Binary files differ
diff --git a/2522/CH9/EX9.3/exm9_3.sce b/2522/CH9/EX9.3/exm9_3.sce
new file mode 100755
index 000000000..fbf214b3f
--- /dev/null
+++ b/2522/CH9/EX9.3/exm9_3.sce
@@ -0,0 +1,13 @@
+// page no 292
+// example no 9.3
+// EXCHANGE INFORMATION BETWEEN STACK AND PROGRAM COUNTER
+clc;
+printf('After the CALL instruction \n \n');
+printf('STACK MEMORY: \n \n');
+printf('23FFH--> 20 \n');
+printf('23FEH-->43 \n');
+printf('Stack pointer--> 23FEH \n');
+printf('Program counter--> 2070H \n \n');
+printf('After RET instruction \n \n');
+printf('Program counter--> 2043H \n');
+printf('Stack pointer--> 2400H');
diff --git a/2522/CH9/EX9.3/exm9_3_output.jpg b/2522/CH9/EX9.3/exm9_3_output.jpg
new file mode 100755
index 000000000..aac7ca4d0
--- /dev/null
+++ b/2522/CH9/EX9.3/exm9_3_output.jpg
Binary files differ