*** CFYCMP1.LSP	2008/03/04 17:32:14	1.1
--- CFYCMP1.LSP	2008/03/04 17:46:04
***************
*** 154,164 ****
      (cond ((= w l) win)
            ((and (= l 0) (8bitp w)) (gen w) (gen c))
            ((and (= w 0) (8bitp l)) (gen l) (gen (inv c)))
!           ((and (8bitp l) (8bitp (- w 2)))
!            (gen l) (gen (inv c)) (gen (- w 2)) (gen c))
!           ((and (8bitp w) (8bitp (- l 2)))
!            (gen w) (gen c) (gen (- l 2)) (gen (inv c)))
!           ((8bitp (- l 3)) (genbrc c (genbr win) lose))
            (t (genbrc c win (genbr lose))))))
  
  (defun ogen (op a)
--- 154,164 ----
      (cond ((= w l) win)
            ((and (= l 0) (8bitp w)) (gen w) (gen c))
            ((and (= w 0) (8bitp l)) (gen l) (gen (inv c)))
!           ((and (8bitp l) (8bitp (+ w 2)))
!            (gen l) (gen (inv c)) (gen (+ w 2)) (gen c))
!           ((and (8bitp w) (8bitp (+ l 2)))
!            (gen w) (gen c) (gen (+ l 2)) (gen (inv c)))
!           ((8bitp (+ l 3)) (genbrc c (genbr win) lose))
            (t (genbrc c win (genbr lose))))))
  
  (defun ogen (op a)
***************
*** 506,540 ****
        (compile '(seq 13 25 19 61 35 49 47 59 55 11) 0 0))
  
  (setq
!  code 11
!  digit 12
!  mq 13
   upcwand
!  '(alt
!    (seq (fori (\# 6) (\# 12)            ; complement patterns of right 6 upc digits.
!               (l i code)
!               (lxor \# 127)
!               (st i code))
!         (fori (\# 0) (\# 12)
!               (l i code)
!               (not
!                (forj (\# 0) (\# 10)
!                      (c j upctable)
!                      ~=\?))             ; fail if equal.
!               (stj i digit))            ; store index of upctable.
!         decimal                         ; set decimal arithmetic mode.
!         (l \# 0)                        ; clear ac.
!         (fori (\# 0) (\# 12)            ; add up the even digits.
!               (+ i digit)               ; loop control clears carry!
!               i+1)                      ; only every other one.
!         (st mq)                         ; save partial sum.
!         c=0                             ; clear the carry.
!         (2 (+ mq))                      ; multiply by 3.
!         (fori (\# 1) (\# 12)            ; add up the odd digits.
!               (+ i digit)               ; loop cotrol clears carry.
!               i+1)                      ; only every other one.
!         (lxor \# 15)                    ; select low decimal digit.
!         =0\?                            ; fails if non-zero.
!         return)
!    (seq break                           ; signal failure.
!         return)))
--- 506,541 ----
        (compile '(seq 13 25 19 61 35 49 47 59 55 11) 0 0))
  
  (setq
!  code 0
!  digit (+ code 13)
!  mq (+ digit 13)
   upcwand
!  (compile 
!   '(alt
!     (seq (fori (\# 6) (\# 12)            ; complement patterns of right 6 upc digits.
! 	       (l i code)
! 	       (lxor \# 127)
! 	       (st i code))
! 	 (fori (\# 0) (\# 12)
! 	       (l i code)
! 	       (not
! 		(forj (\# 0) (\# 10)
! 		      (c j upctable)
! 		      ~=\?))             ; fail if equal.
! 	       (stj i digit))            ; store index of upctable.
! 	 decimal                         ; set decimal arithmetic mode.
! 	 (l \# 0)                        ; clear ac.
! 	 (fori (\# 0) (\# 12)            ; add up the even digits.
! 	       (+ i digit)               ; loop control clears carry!
! 	       i+1)                      ; only every other one.
! 	 (st mq)                         ; save partial sum.
! 	 c=0                             ; clear the carry.
! 	 (2 (+ mq))                      ; multiply by 3.
! 	 (fori (\# 1) (\# 12)            ; add up the odd digits.
! 	       (+ i digit)               ; loop cotrol clears carry.
! 	       i+1)                      ; only every other one.
! 	 (lxor \# 15)                    ; select low decimal digit.
! 	 =0\?                            ; fails if non-zero.
! 	 return)
!     (seq trap                            ; signal failure.
! 	 return)) 0 0))
