(define-module (generator assembly) #:use-module (ast ir) #:use-module (utils assign-stack) #:use-module (utils merge-instructions) #:export (instrs mov)) (define (instrs lst) (cons 'list (cons (list 'alloc (abs (get-frame-size))) (merge-instr lst)))) (define (mov src dst) (if (and (eq? 'stack (car dst)) (eq? 'stack (car src))) (append (list (list 'mov src (reg "r10d"))) (list (list 'mov (reg "r10d") dst))) (list 'mov src dst)))