#| -*-Scheme-*-
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/machines/vax/insmac.scm,v 1.9 1987/08/23 07:56:16 jinx Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/machines/vax/insmac.scm,v 1.10 1987/08/24 14:39:29 jinx Exp $
Copyright (c) 1987 Massachusetts Institute of Technology
`(EA-VALUE ,(caddar fields)))
,tail)
tail-size))
+ ;; Displacements are like signed bytes. They are a different
+ ;; keyword to allow the disassembler to do its thing correctly.
((DISPLACEMENT)
- (let ((desc (cadar fields)))
- (let ((expression (cadr desc))
- (size (car desc)))
- (receiver
- `(CONS-SYNTAX
- ,(displacement-syntaxer expression size)
- ,tail)
- (+ size tail-size)))))
+ (let* ((desc (cadar fields))
+ (size (car desc)))
+ (receiver
+ `(CONS-SYNTAX ,(integer-syntaxer (cadr desc) 'SIGNED size)
+ ,tail)
+ (+ size tail-size))))
((IMMEDIATE)
(receiver
`(CONS-SYNTAX
(else
(error "expand-fields: Unknown field kind" (caar fields))))))))
\f
-(define (displacement-syntaxer expression size)
- (cond ((not (pair? expression))
- `(SYNTAX-DISPLACEMENT ,expression
- ,(make-coercion-name 'SIGNED size)))
- ((eq? '@PCO (car expression))
- (integer-syntaxer (cadr expression) 'SIGNED size))
- ((eq? '@PCR (car expression))
- (nteger-syntaxer `(- ,(cadr expression)
- (+ *PC* ,(/ size 8))) 'SIGNED size))
- (else
- `(SYNTAX-DISPLACEMENT ,expression
- ,(make-coercion-name 'SIGNED size)))))
-
-(define (syntax-displacement expression coercion)
- (cond ((not (pair? expression))
- (error "syntax-displacement: bad displacement specifier"
- expression))
- ((eq? (car expression) '@PCO)
- (syntax-evaluation (cadr expression) coercion))
- ((eq? (car expression) '@PCR)
- (syntax-evaluation `(- ,(cadr expression)
- (+ *PC* ,(/ (coercion-size coercion) 8)))
- coercion))
- (else
- (error "syntax-displacement: bad displacement specifier"
- expression))))
-
(define (collect-byte components tail receiver)
(define (inner components receiver)
(if (null? components)
#| -*-Scheme-*-
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/machines/vax/instr1.scm,v 1.4 1987/08/19 04:40:53 jinx Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/machines/vax/instr1.scm,v 1.5 1987/08/24 14:43:17 jinx Exp $
Copyright (c) 1987 Massachusetts Institute of Technology
#|
-A) There are three types of operand specifiers:
+A) There are two types of operand specifiers:
- General addressing mode operand specifier, with matching pattern syntax
Handbook", on Appendix E.
They are implemented in insutl.scm
- - Displacement for branch instructions. The matching pattern syntax is
-
- (? value displacement)
-
- This matches either (@PCO offset) or (@PCR label).
-
- - Immediate operand. Only the BUG instruction uses this. The
- matching syntax is (? value).
+ - Immediate operands. The matching syntax is (? value). The operand
+ is processed appropriately by the body of the instruction definition.
+ It is used for instruction displacements (ie. the SOB instruction), or
+ immediate operands (ie. the BUG instruction).
B) The instruction set is currently incomplete. In particular, none
of the instructions in chapters 14 or 16 are below. The missing