changeset 1552:13f5293e67d0

Fixed a bug in the mpi utility
author boisy
date Mon, 10 May 2004 14:35:28 +0000
parents 8cb72bbe71f4
children 9f5c9a328fb8
files level1/cmds/mpi.asm
diffstat 1 files changed, 19 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/level1/cmds/mpi.asm	Sat May 08 23:41:54 2004 +0000
+++ b/level1/cmds/mpi.asm	Mon May 10 14:35:28 2004 +0000
@@ -8,6 +8,10 @@
 * ------------------------------------------------------------------
 *   1      2004/03/16  Rodney Hamilton
 * Created.
+*
+*   1r1    2004/05/08  Boisy G. Pitre
+* Fixed a problem where wrong message was being reported due to buggy
+* code, placed there by me :(
 
          nam   mpi
          ttl   Determines if a Multi-Pak is present
@@ -18,7 +22,7 @@
 
 tylg     set   Prgrm+Objct   
 atrv     set   ReEnt+rev
-rev      set   $00
+rev      set   $01
 edition  set   1
 
          mod   eom,name,tylg,atrv,start,size
@@ -35,27 +39,24 @@
 	fcb   C$CR
 
 start	equ   *
-        tfr   cc,a
-        pshs  a
-	ldx   #$FF7F
-	lda   #$CC
-        orcc  #IntMasks
-	eora  ,x
-	sta   ,x
-	cmpa  ,x
-        puls  a
-        tfr   a,cc
-	beq   is_mpi
-	leax  <no,pc
-	bra   doit
-is_mpi	leax  <mpi,pc
-doit	equ   *
+        tfr   cc,b			save CC into B
+	ldx   #$FF7F			get MPI slot sel reg contents
+	lda   #$CC			load A with %11001100
+        orcc  #IntMasks			mask interrupts from this point on
+	eora  ,x			XOR with MPI slot sel reg contents
+	sta   ,x			and save...
+	cmpa  ,x			same?
+	beq   is_mpi			branch if so
+	leax  <no,pc			else point to "no"...
+	bra   doit			and DO IT!
+is_mpi	leax  <mpi,pc			or point to "yes"...
+doit	tfr   b,cc			restore original CC
 	ldy   #100
 	lda   #$01
-	os9   I$WritLn 
+	os9   I$WritLn 			write the message at ,X
 	bcs   L001C
 	clrb 
-L001C	os9   F$Exit 
+L001C	os9   F$Exit 			exit...
 
 	emod
 eom	equ   *