home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / mitsch75.zip / scheme-7_5_17-src.zip / scheme-7.5.17 / src / compiler / machines / i386 / assmd.scm next >
Text File  |  1999-01-02  |  2KB  |  73 lines

  1. #| -*-Scheme-*-
  2.  
  3. $Id: assmd.scm,v 1.3 1999/01/02 06:06:43 cph Exp $
  4. $MC68020-Header: assmd.scm,v 1.36 89/08/28 18:33:33 GMT cph Exp $
  5.  
  6. Copyright (c) 1992, 1999 Massachusetts Institute of Technology
  7.  
  8. This program is free software; you can redistribute it and/or modify
  9. it under the terms of the GNU General Public License as published by
  10. the Free Software Foundation; either version 2 of the License, or (at
  11. your option) any later version.
  12.  
  13. This program is distributed in the hope that it will be useful, but
  14. WITHOUT ANY WARRANTY; without even the implied warranty of
  15. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  16. General Public License for more details.
  17.  
  18. You should have received a copy of the GNU General Public License
  19. along with this program; if not, write to the Free Software
  20. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  21. |#
  22.  
  23. ;;;; Assembler Machine Dependencies.  Intel 386 version
  24.  
  25. (declare (usual-integrations))
  26.  
  27. (let-syntax ((ucode-type (macro (name) `',(microcode-type name))))
  28.  
  29. (define-integrable maximum-padding-length
  30.   ;; Instructions can be any number of bytes long.
  31.   ;; Thus the maximum padding is 3 bytes.
  32.   24)
  33.  
  34. (define-integrable padding-string
  35.   ;; Pad with HLT instructions
  36.   (unsigned-integer->bit-string 8 #xf4))
  37.  
  38. (define-integrable block-offset-width
  39.   ;; Block offsets are encoded words
  40.   16)
  41.  
  42. (define maximum-block-offset
  43.   (- (expt 2 (-1+ block-offset-width)) 1))
  44.  
  45. (define-integrable (block-offset->bit-string offset start?)
  46.   (unsigned-integer->bit-string block-offset-width
  47.                 (+ (* 2 offset)
  48.                    (if start? 0 1))))
  49.  
  50.  
  51. (define-integrable nmv-type-string
  52.   (unsigned-integer->bit-string scheme-type-width
  53.                 (ucode-type manifest-nm-vector)))
  54.  
  55. (define (make-nmv-header n)
  56.   (bit-string-append (unsigned-integer->bit-string scheme-datum-width n)
  57.              nmv-type-string))
  58.  
  59. ;;; Machine dependent instruction order
  60.  
  61. (define (instruction-insert! bits block position receiver)
  62.   (let ((l (bit-string-length bits)))
  63.     (bit-substring-move-right! bits 0 l block position)
  64.     (receiver (+ position l))))
  65.  
  66. (define-integrable (instruction-initial-position block)
  67.   block                    ; ignored
  68.   0)
  69.  
  70. (define-integrable instruction-append bit-string-append)
  71.  
  72. ;;; end let-syntax
  73. )