pic18/sig.ss
#lang scheme/base
(require "../sig.ss")
(provide (all-defined-out))

;; PIC18 specific wordsets

(define-macro-set pic18-assembler^ 
  (movf xorwf andwf iorwf subwf subfwb addwf addwfc comf rrcf rlcf rrncf rlncf
   cpfseq cpfsgt cpfslt clrf setf movwf mulwf
   addlw iorlw xorlw andlw
   push pop sleep reset clrwdt daw tblrd* tblrd*- tblrd*+ tblwt* tblwt*- tblwt*+
   movlw retlw sublw movff retfie lfsr))

(define-macro-set pic18-extra^
  (rot<<c rot>>c rot<< rot>> swap-nibble
   z? nz? c? nc? n? nn?
   @f+ @f @a+ @a 
   !f+ !a+ !a @i !i
   a!! f!! ah al fh fl

   -- ++ ++! --! ;; use of carry flag is considered low-level
   stc clc
   rot<<c! rot>>c! rot<<! rot>>!
   d=reg
   ",,"

   1st 2nd 2nd-

   ;; hardware return stack
   xl xh xu xdrop _>x _x> x>f xskip

   word-address
   
   ))

(define-macro-set pic18-postproc^ (pseudo opti-save))