added csa4 and csb4
authoreck <none@none>
Thu, 12 Apr 1990 11:29:49 +0000 (11:29 +0000)
committereck <none@none>
Thu, 12 Apr 1990 11:29:49 +0000 (11:29 +0000)
mach/m68k2/libem/LIST
mach/m68k2/libem/csa4.s [new file with mode: 0644]
mach/m68k2/libem/csb4.s [new file with mode: 0644]

index 7aea94c..62ca99c 100644 (file)
@@ -5,7 +5,9 @@ cmi.s
 cmp.s
 cmu.s
 csa.s
+csa4.s
 csb.s
+csb4.s
 cuu.s
 exg.s
 inn.s
diff --git a/mach/m68k2/libem/csa4.s b/mach/m68k2/libem/csa4.s
new file mode 100644 (file)
index 0000000..5105f32
--- /dev/null
@@ -0,0 +1,30 @@
+.define .csa4
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+
+       .sect .text
+.csa4:
+       move.l  (sp)+,a0        ! case descriptor
+       move.l  (sp)+,d0        ! index
+       move.l  (a0)+,a1        ! default address
+       sub.l   (a0)+,d0        ! index - lower bound
+       blt     1f
+       cmp.l   (a0)+,d0        ! rel. index <-> upper - lower bound
+       bgt     1f
+       asl.l   #2,d0
+       add.l   d0,a0
+       move.l  (a0),d1         ! test jump address
+       move.l  d1,d0
+       beq     1f
+       move.l  d1,a1
+       bra     3f
+1:
+       move.l  a1,d0           ! test default jump address
+       beq     2f
+3:
+       jmp     (a1)
+2:
+       move.w  #ECASE,-(sp)
+       jmp     .fat
diff --git a/mach/m68k2/libem/csb4.s b/mach/m68k2/libem/csb4.s
new file mode 100644 (file)
index 0000000..7b4e3a2
--- /dev/null
@@ -0,0 +1,28 @@
+.define .csb4
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+
+       .sect .text
+.csb4:
+       move.l  (sp)+,a0        ! case descriptor
+       move.l  (sp)+,d0        ! index
+       move.l  (a0)+,a1        ! default jump address
+       move.w  (a0)+,d1        ! # entries
+       beq     2f
+1:
+       cmp.l   (a0)+,d0
+       beq     3f
+       tst.l   (a0)+           ! skip jump address
+       sub.l   #1,d1
+       bgt     1b
+2:
+       move.l  a1,d1           ! default jump address
+       bne     4f
+       move.w  #ECASE,-(sp)
+       jmp     .fat
+3:
+       move.l  (a0)+,a1        ! get jump address
+4:
+       jmp     (a1)