From b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b Mon Sep 17 00:00:00 2001 From: priyanka Date: Wed, 24 Jun 2015 15:03:17 +0530 Subject: initial commit / add all books --- 2522/CH6/EX6.5/exm6_5.sce | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100755 2522/CH6/EX6.5/exm6_5.sce (limited to '2522/CH6/EX6.5/exm6_5.sce') 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 + + -- cgit