237 |
|
|
238 |
;; If REG is a CCL register symbol (e.g. r0, r1...), the register |
;; If REG is a CCL register symbol (e.g. r0, r1...), the register |
239 |
;; number is embedded. If OP is one of unconditional jumps, DATA is |
;; number is embedded. If OP is one of unconditional jumps, DATA is |
240 |
;; changed to an relative jump address. |
;; changed to a relative jump address. |
241 |
|
|
242 |
(defun ccl-embed-code (op reg data &optional reg2) |
(defun ccl-embed-code (op reg data &optional reg2) |
243 |
(if (and (> data 0) (get op 'jump-flag)) |
(if (and (> data 0) (get op 'jump-flag)) |
509 |
(ccl-embed-data op) |
(ccl-embed-data op) |
510 |
(ccl-embed-data arg)) |
(ccl-embed-data arg)) |
511 |
(ccl-check-register arg cmd) |
(ccl-check-register arg cmd) |
512 |
(ccl-embed-code (if read-flag 'read-jump-cond-expr-register |
(ccl-embed-code (if read-flag 'read-jump-cond-expr-register |
513 |
'jump-cond-expr-register) |
'jump-cond-expr-register) |
514 |
rrr 0) |
rrr 0) |
515 |
(ccl-embed-data op) |
(ccl-embed-data op) |
707 |
(error "CCL: Invalid argument %s: %s" arg cmd))) |
(error "CCL: Invalid argument %s: %s" arg cmd))) |
708 |
(ccl-embed-code 'read-jump rrr ccl-loop-head)) |
(ccl-embed-code 'read-jump rrr ccl-loop-head)) |
709 |
t) |
t) |
710 |
|
|
711 |
;; Compile READ statement. |
;; Compile READ statement. |
712 |
(defun ccl-compile-read (cmd) |
(defun ccl-compile-read (cmd) |
713 |
(if (< (length cmd) 2) |
(if (< (length cmd) 2) |
899 |
add 1)) |
add 1)) |
900 |
(setq arg (cdr arg) |
(setq arg (cdr arg) |
901 |
len (+ len add))) |
len (+ len add))) |
902 |
(if mp |
(if mp |
903 |
(cons (- len) result) |
(cons (- len) result) |
904 |
result)))) |
result)))) |
905 |
(setq arg (append (list (nth 0 cmd) (nth 1 cmd) (nth 2 cmd)) |
(setq arg (append (list (nth 0 cmd) (nth 1 cmd) (nth 2 cmd)) |
990 |
(rrr (ash (logand code 255) -5)) |
(rrr (ash (logand code 255) -5)) |
991 |
(cc (ash code -8))) |
(cc (ash code -8))) |
992 |
(insert (format "%5d:[%s] " (1- ccl-current-ic) cmd)) |
(insert (format "%5d:[%s] " (1- ccl-current-ic) cmd)) |
993 |
(funcall (get cmd 'ccl-dump-function) rrr cc))) |
(funcall (get cmd 'ccl-dump-function) rrr cc))) |
994 |
|
|
995 |
(defun ccl-dump-set-register (rrr cc) |
(defun ccl-dump-set-register (rrr cc) |
996 |
(insert (format "r%d = r%d\n" rrr cc))) |
(insert (format "r%d = r%d\n" rrr cc))) |
1273 |
(insert (format "map-single r%d r%d map(%S)\n" RRR rrr id)))) |
(insert (format "map-single r%d r%d map(%S)\n" RRR rrr id)))) |
1274 |
|
|
1275 |
|
|
1276 |
;; CCL emulation staffs |
;; CCL emulation staffs |
1277 |
|
|
1278 |
;; Not yet implemented. |
;; Not yet implemented. |
1279 |
|
|
1472 |
;; (REG <8= ARG) is the same as: |
;; (REG <8= ARG) is the same as: |
1473 |
;; ((REG <<= 8) |
;; ((REG <<= 8) |
1474 |
;; (REG |= ARG)) |
;; (REG |= ARG)) |
1475 |
| <8= |
| <8= |
1476 |
|
|
1477 |
;; (REG >8= ARG) is the same as: |
;; (REG >8= ARG) is the same as: |
1478 |
;; ((r7 = (REG & 255)) |
;; ((r7 = (REG & 255)) |