1 (define (predefine-var id type adr)
3 (new-value (list (make-byte-cell adr '() '()))))
5 (new-def-variable '() id '() type value '())))
8 (define (predefine-fun id type param-defs adr)
10 (cond ((eq? type 'int)
11 (new-value (list (make-byte-cell WREG '() '()))))
15 (error "unknown return type"))))
18 (predefine-var 'foo (car x) (cdr x)))
21 (new-def-procedure '() id '() type value params))
23 (asm-make-label id adr)))
24 (multi-link-parent! params ast)
25 (def-procedure-entry-set! ast entry)
28 (define (initial-cte) ;; TODO see what really has to be predefined
29 (list (predefine-var 'X 'int 5)
30 (predefine-var 'Y 'int 6)
31 (predefine-var 'Z 'int 7)
32 (predefine-fun 'FLASH_execute_erase
36 (predefine-fun 'FLASH_execute_write
40 (predefine-fun 'led_set
42 (list (cons 'int WREG))
44 (predefine-fun 'irda_tx_wake_up
48 (predefine-fun 'irda_tx_raw
50 (list (cons 'int WREG))
52 (predefine-fun 'irda_rx_raw
56 (predefine-fun 'sleep_mode
60 (predefine-fun 'exec_client
65 (define (cte-extend cte bindings)
66 (append bindings cte))
68 (define (cte-lookup cte id)
70 (error "undefined identifier" id))
71 ((eq? (def-id (car cte)) id)
74 (cte-lookup (cdr cte) id))))