tom@zzz:~/brood/tex$ tom@zzz:~/brood/tex$ ls -al *.hex ls: *.hex: No such file or directory tom@zzz:~/brood/tex$ cd .. tom@zzz:~/brood$ cd prj/ tom@zzz:~/brood/prj$ cd hub tom@zzz:~/brood/prj/hub$ ls -al *.hex -rw-r--r-- 1 tom users 1412 2007-10-30 15:26 check-monitor.hex -rw-r--r-- 1 tom users 1412 2007-10-30 15:25 monitor.hex tom@zzz:~/brood/prj/hub$ darcs wh { hunk ./doc/ramblings.txt 15496 +so the point where i need to make some changes is the way 'here' is +used: chicken and egg: + + * can't determine 'here' untill all previous instructions were + assembled. + + * can't assemble instruction intil it is know how far a forwared + reference is. + +what about trying to solve this with backtracking? is that overkill? +maybe backtracking with memoization? maybe assembly itself is cheaper +than memoization :) + +maybe every instruction should be compiled to a thunk that takes just +the absolute address? + +hmm.. need some time to sort it through.. it should be possible to +write this in a lazy way.. + +roadmap: + + - get it to work like it did before + - change the implementation of 'here' to a parameter + - create a graph data structure from 'label' + - figure out the control flow for some backtracking like thing + - write some graph opti (i.e. jump chaining) + +another remark: having 'labels' as pseudo instructions is bad. they +shoul really be true graph elements: pointers to instructions. + +hmm.. i need a break. hunk ./host/assembler.ss 185 - (define (comma0 code) - (assemble-result (dict) code)) + (define (comma0 code/false) + (assemble-result (dict) code/false)) hunk ./host/assembler.ss 188 + ;; FIXME: the point where code is #f and we have to GUESS how many + ;; instructions it takes is where it goes wrong. assume 1 for now. + [_$_] hunk ./host/assembler.ss 192 - (define (comma code) - (assemble-result (here! (+ (here@) (length code))) - code)) + (define (comma code/false) + (assemble-result (here! + (+ (here@) + (if code/false + (length code/false) + 1))) + code/false)) hunk ./host/assembler.ss 217 - (comma `(,instruction))))))) - + (comma `(,instruction))))))) ;; FIXME: should be false later + [_$_] hunk ./host/assembler.ss 378 - (define dict (fix-org input-dict)) +;; (define dict (fix-org input-dict)) hunk ./host/assembler.ss 380 - ;; Convert the input asm into a structured representation as a - ;; vector of ins types. +;; ;; Convert the input asm into a structured representation as a +;; ;; vector of ins types. hunk ./host/assembler.ss 383 - (define instructions - (list->vector - (map (lambda (i) - (make-ins (car i) (cdr i) #f #f)) - input-instructions))) +;; (define instructions +;; (list->vector +;; (map (lambda (i) +;; (make-ins (car i) (cdr i) #f #f)) +;; input-instructions))) hunk ./host/assembler.ss 389 - ;; Update the instructions using an ins -> ins processor +;; ;; Update the instructions using an ins -> ins processor hunk ./host/assembler.ss 391 - (define (update fn) - (let ((len (vector-length instructions))) - (do ((i 0 (add1 i))) - ((= i len) instructions) - (vector-set! instructions i - (fn (vector-ref instructions i)))))) +;; (define (update fn) +;; (let ((len (vector-length instructions))) +;; (do ((i 0 (add1 i))) +;; ((= i len) instructions) +;; (vector-set! instructions i +;; (fn (vector-ref instructions i)))))) hunk ./host/assembler.ss 399 - (define (here) (dict-find dict 'here)) - [_$_] + ;; Run a single assembly pass. If assemble-instruction returns #f + ;; it means the instruction might work in a next pass. Otherwise + ;; it will throw an exception. hunk ./host/assembler.ss 403 - 123) + (define (classic-pass _dict _in) + (let next ((dict _dict) + (in _in) + (out '())) + (if (null? in) + (values dict (apply append (reverse! out))) ;; stitch together + (let-values + (((dict+ result) + (assemble-instruction dict (car in)))) + (next dict+ (cdr in) (cons result out)))))) + + + (let-values + (((d1 i1) + (classic-pass + input-dict + (fix-org input-dict + input-instructions)))) + (let-values + (((d2 i2) + (classic-pass d1 i1))) + (values + (cleanup-dict d2) i2)))) } tom@zzz:~/brood/prj/hub$ darcs record -m 'assembler stuff BROKEN' hunk ./doc/ramblings.txt 15496 +so the point where i need to make some changes is the way 'here' is +used: chicken and egg: + + * can't determine 'here' untill all previous instructions were + assembled. + + * can't assemble instruction intil it is know how far a forwared + reference is. + +what about trying to solve this with backtracking? is that overkill? +maybe backtracking with memoization? maybe assembly itself is cheaper +than memoization :) + +maybe every instruction should be compiled to a thunk that takes just +the absolute address? + +hmm.. need some time to sort it through.. it should be possible to +write this in a lazy way.. + +roadmap: + + - get it to work like it did before + - change the implementation of 'here' to a parameter + - create a graph data structure from 'label' + - figure out the control flow for some backtracking like thing + - write some graph opti (i.e. jump chaining) + +another remark: having 'labels' as pseudo instructions is bad. they +shoul really be true graph elements: pointers to instructions. + +hmm.. i need a break. Shall I record this change? (1/?) [ynWsfqadjkc], or ? for help: a Finished recording patch 'assembler stuff BROKEN' tom@zzz:~/brood/prj/hub$ push del --- brood Tue Oct 30 22:29:33 CET 2007 tom@goto10.org * assembler stuff BROKEN Tue Oct 30 21:30:26 CET 2007 tom@goto10.org * purrr.tex Finished applying... --- snot --- pool { hunk ./bin/keepmaking 2 -while sleep 1; do make -s; done +while sleep 1; do make -s "$@"; done hunk ./emacs/emacs.el 116 +(setq-default indent-tabs-mode nil) + hunk ./emacs/emacs.el 128 + } --- papers --- sweb --- packetforth tom@zzz:~/brood/prj/hub$ cdc bash: cdc: command not found tom@zzz:~/brood/prj/hub$ cd tom@zzz:~$ cd brood tom@zzz:~/brood$ cd host tom@zzz:~/brood/host$ darcs wh assembler.ss What's new in "host/assembler.ss": { hunk ./host/assembler.ss 286 + (define (assemble-directives + [_$_] + [_$_] } tom@zzz:~/brood/host$ darcs revert assembler.ss Reverting changes in "host/assembler.ss".. hunk ./host/assembler.ss 286 + (define (assemble-directives + [_$_] + [_$_] Shall I revert this change? (1/?) [ynWsfqadjkc], or ? for help: y Do you really want to revert these changes? yes Finished reverting. tom@zzz:~/brood/host$ pull del --- brood { hunk ./doc/ramblings.txt 15668 +Entry: shopping for opamps +Date: Wed Oct 31 19:59:42 CET 2007 + +@ maxim for low voltage rail-to-rail. + +i can get as low as 2.7V for [_$_] +MAX4167 5MHz, 1.3mA (DUAL) +MAX494 0.5MHz, 0.15mA (QUAD) + + + + + hunk ./host/relaxation.ss 1 +;; OBSOLETE + +;; was a nice experiment, but i have a much simpler text book solution +;; now: multipass with phase error detection. + } Wed Oct 31 20:40:11 CET 2007 tom@goto10.org * fixed undefined error bug [fixed undefined error bug tom@goto10.org**20071031194011] diffing dir... Applying patches to the local directories... diffing dir... --- snot --- pool { hunk ./bin/keepmaking 2 -while sleep 1; do make -s; done +while sleep 1; do make -s "$@"; done hunk ./emacs/emacs.el 116 +(setq-default indent-tabs-mode nil) + hunk ./emacs/emacs.el 128 + } --- papers --- sweb --- packetforth tom@zzz:~/brood/host$