summaryrefslogtreecommitdiff
path: root/2522/CH12/EX12.3/exm12_3.sce
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /2522/CH12/EX12.3/exm12_3.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/CH12/EX12.3/exm12_3.sce')
-rwxr-xr-x2522/CH12/EX12.3/exm12_3.sce23
1 files changed, 23 insertions, 0 deletions
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