; ******************************** ; Microchip-style macros for SX Key ; by Al Williams (http://www.al-williams.com/awce.htm) ; V1.1 3 March 1999 ; Notes: Use _W instead of W ; Use _OPTION instead of OPTION ; I've only tested this a bit -- let me know if you find mistakes. ; NOP, CALL, SLEEP work without change ; For the SX-only commands, use the SX mnemonics, or port over the stuff in ; SXDEFS.INC ; When you debug, the "hot spot" for the line is a blank line under the ; actual line of code (because of NOEXPAND). You get used to this pretty quick. ; The upper window shows the SX mnemonics which is good for double checking my macros. ; Don't like Microchip syntax? Don't use this file. Don't complain to me! ; Get the most current copy at http://www.al-williams.com/awce.htm ; While you are there check out our line of coprocessors (including floating point) ; Work great with the PIC or SX chips ; Internal use macros uchipdf macro 3 dw 1円 + (3円 * 20ドル & 20ドル) + (2円 & 1ドルF) endm uchipbf macro 3 dw 1円 + (3円 * 20ドル & $E0) + (2円 & 1ドルF) endm ; HERE WE GO..... addwf macro 2 uchipdf 1ドルC0, 1,円 2円 endm andwf macro 2 uchipdf 140,ドル 1,円 2円 endm clrf macro 1 uchipdf 060,ドル 1,円 0 endm clrw macro 0 dw 40ドル endm comf macro 2 uchipdf 240,ドル1,円2円 endm decf macro 2 uchipdf 0ドルc0,1,円2円 endm decfsz macro 2 uchipdf 2ドルC0,1,円2円 endm incf macro 2 uchipdf 280,ドル1,円2円 endm incfsz macro 2 uchipdf 3ドルc0,1,円2円 endm iorwf macro 2 uchipdf 100,ドル1,円2円 endm movf macro 2 uchipdf 200,ドル1,円2円 endm movwf macro 1 uchipdf 020,ドル1,0円 endm ; nop already works as-is rlf macro 2 uchipdf 340,ドル1,円2円 endm rrf macro 2 uchipdf 300,ドル1,円2円 endm subwf macro 2 uchipdf 080,ドル1,円2円 endm swapf macro 2 uchipdf 380,ドル1,円2円 endm xorwf macro 2 uchipdf 180,ドル1,円2円 endm bcf macro 2 uchipbf 400,ドル1,円2円 endm bsf macro 2 uchipbf 500,ドル1,円2円 endm btfsc macro 2 uchipbf 600,ドル1,円2円 endm btfss macro 2 uchipbf 700,ドル1,円2円 endm andlw macro 1 dw $E00+ (1円 & $FF) endm ; Call already works clrwdt macro 0 dw 4 endm goto macro 1 jmp 1円 endm iorlw macro 1 dw $D00+(1円 & $FF) endm movlw macro 1 dw $C00+ (1円 & $FF) endm ; can't use option, so use _option if you want _option macro 0 dw 2 endm retlw macro 1 dw 800ドル+(1円 & $FF) endm tris macro 1 dw 1円 &7ドル endm ; Sleep already works xorlw macro 1 dw $F00 + (1円 & $FF) endm F = 1 ; a hack because Parallax uses W and won't let us use it _W = 0 PORTA = RA PORTB = RB PORTC = RC NOEXPAND ; ******** End of UCHIP.MAC
.