Permalink
Browse files

バイト値を直接記述できるように修正

  • Loading branch information...
1 parent 55696a3 commit 9a2fe4df0ffe4eadcd6a81786366b25362576ce0 @sile committed Feb 7, 2012
Showing with 8 additions and 2 deletions.
  1. +7 −1 cl-asm.lisp
  2. +1 −1 sample.lisp
View
@@ -471,13 +471,17 @@
list2
(subseq list pos)))
+(defun byte-p (n)
+ (typep n '(unsigned-byte 8)))
+
;; XXX: name
(defun expand-progn (mnemonics)
(loop FOR m IN mnemonics
APPEND
(progn
(loop WHILE (not (or (and (consp m) (keywordp (car m)))
(keywordp m)
+ (byte-p m)
(operand-label-p m)))
DO (setf m (eval m)))
@@ -498,7 +502,9 @@
WITH unresolves = '()
FOR mnemonic IN (mapcar #'to-list (expand-progn mnemonics))
APPEND
- (cond ((mnemonic-label-p mnemonic)
+ (cond ((byte-p (car mnemonic))
+ mnemonic)
+ ((mnemonic-label-p mnemonic)
(setf (label-addr (first mnemonic)) (pc))
'())
((mnemonic-unresolve-p mnemonic)
View
@@ -40,4 +40,4 @@
&finish)
(function int int)
- 35))
+ 40))

0 comments on commit 9a2fe4d

Please sign in to comment.