lr35902ish racket
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
564B

  1. #lang br/quicklang
  2. (provide (rename-out [z-module-begin #%module-begin])
  3. val
  4. z-ld)
  5. (define-macro (z-module-begin (z-program LINE ...))
  6. #'(#%module-begin
  7. (define-values (A B C D E F H L)
  8. (values 0 0 0 0 0 0 0 0))
  9. (set! A 8)
  10. LINE ...
  11. (displayln
  12. (format "A: ~a ; F: ~a\nB: ~a ; C: ~a\nD: ~a ; E: ~a\nH: ~a ; L: ~a"
  13. A F B C D E H L))))
  14. (define (val h x)
  15. (if (symbol? x)
  16. (hash-ref h x)
  17. x))
  18. (define-macro-cases z-ld
  19. [(_ (z-r8 S) (_ D)) #'(set! S (val D))])