anchor.diff:      (load-in-r8 new-value t)
       (emit `(sys.lap-x86:mov64 :rdx :r8)
   	  `(sys.lap-x86:test64 :rdx #b111)
  -	  `(sys.lap-x86:jnz ,type-error-label)
  +	  `(sys.lap-x86:jnz ,bignum-path)
   	  ;; Convert to raw integers, leaving offset correctly scaled (* 8).
  +	  `(sys.lap-x86:sar64 :rdx 3)
  +          value-extracted
   	  `(sys.lap-x86:sar64 :rax 3)
  -	  `(sys.lap-x86:sar64 :rdx 3)
   	  ;; Write.
   	  `(sys.lap-x86:mov64 (:rax :rcx) :rdx))
       *r8-value*))
  
positive.code:           `(sys.lap-x86:mov64 :rax (:rax :rcx))
            ;; Check for overflow. Top 3 bits must be all 0 or all 1.
            `(sys.lap-x86:mov64 :rdx :rax)
            `(sys.lap-x86:sar64 :rdx 61)
            `(sys.lap-x86:jz ,ok-label)
            `(sys.lap-x86:cmp8 :dl -1)
            `(sys.lap-x86:jne ,overflow-error-label)
  
negative.code: 	  `(sys.lap-x86:mov64 (:rax :rcx) :rdx))
      *r8-value*))
  
  (defmacro define-s-b-memref (name shift read-op write-op register size)
    `(progn
       (defbuiltin ,name (base offset) ()
         (load-in-reg :r9 base t)
         (fixnum-check :r9)
         (emit `(sys.lap-x86:mov64 :rdx :r9))
         (load-in-reg :r9 offset t)
         (fixnum-check :r9)
         (emit `(sys.lap-x86:mov64 :rcx :r9))
         (smash-r8)
         ;; BASE to raw integer.
         (emit '(sys.lap-x86:sar64 :rdx 3))
         ;; Convert OFFSET to a scaled raw integer & read it.
         (emit '(sys.lap-x86:sar64 :rcx ,shift)
               '(,read-op :rax (:rdx :rcx)))
         ;; Convert to fixnum.
         (emit '(sys.lap-x86:lea64 :r8 ((:rax 8))))
         (setf *r8-value* (list (gensym))))
       (defbuiltin (setf ,name) (new-value base offset) ()
         (let ((type-error-label (gensym)))
           (emit-trailer (type-error-label)
             (raise-type-error :r8 '(signed-byte ,size)))
           (load-in-reg :r9 base t)
           (fixnum-check :r9)
           (emit `(sys.lap-x86:mov64 :rdx :r9))
           (load-in-reg :r9 offset t)
           (fixnum-check :r9)
           (emit `(sys.lap-x86:mov64 :rcx :r9))
           (load-in-r8 new-value t)
           (emit '(sys.lap-x86:mov64 :rax :r8)
                 '(sys.lap-x86:test64 :rax #b111)
                 `(sys.lap-x86:jnz ,type-error-label)
                 '(sys.lap-x86:sar64 :rax 3)
                 '(sys.lap-x86:mov64 :rsi :rax)
                 '(sys.lap-x86:mov64 :rdi ,(ash 1 (1- size)))
                 '(sys.lap-x86:cmp64 :rsi :rdi)
                 `(sys.lap-x86:jge ,type-error-label)
                 '(sys.lap-x86:mov64 :rdi ,(- (ash 1 (1- size))))
                 '(sys.lap-x86:cmp64 :rsi :rdi)
                 `(sys.lap-x86:jl ,type-error-label)
                 ;; Convert to raw integers, leaving offset correctly scaled.
                 '(sys.lap-x86:sar64 :rdx 3)
                 '(sys.lap-x86:sar64 :rcx ,shift)
                 ;; Write.
                 '(,write-op (:rdx :rcx) ,register))
           *r8-value*))))
  
  (define-s-b-memref sys.int::memref-signed-byte-8 3 sys.lap-x86:movsx8 sys.lap-x86:mov8 :al 8)
  (define-s-b-memref sys.int::memref-signed-byte-16 2 sys.lap-x86:movsx16 sys.lap-x86:mov16 :ax 16)
  (define-s-b-memref sys.int::memref-signed-byte-32 1 sys.lap-x86:movsx32 sys.lap-x86:mov32 :eax 32)
  
  (defbuiltin sys.int::memref-signed-byte-64 (base offset) ()
    (let ((overflow-error-label (gensym))
          (ok-label (gensym))
  