;MACROS -------------------------------------------------------------------------- ; Port r[a | b | c | d | e] [in | out | pull | float | cmos | ttl] bits ; sets the port mode and configuration for standard pins in EQU $F00 out EQU $FFF pull EQU $E00 float EQU $EFF cmos EQU $D00 ttl EQU $DFF sch EQU $CFF inten EQU $B00 intedge EQU $A00 intpend EQU $900 porthelp MACRO ERROR 'USAGE: port r[a,b,c,d,e] [in,out,pull,float,cmos,ttl] bits' ENDM _PortMode = $1F PortMode MACRO 1 noexpand ; IF _PortMode <> \1 ;can't do this if you don't know how you got to this code. IF CpuPins > 28 _PortMode = \1 | $10 expand mov w,#_PortMode mov m,w noexpand ELSE _PortMode = \1 expand mov m,#_PortMode noexpand ENDIF ; ENDIF ENDM port MACRO port, mode, mask noexpand IF (port==ra) || (port==rb) ELSE IF (CpuPins > 18) && (port==rc) ) ELSE IF (CpuPins > 28) && ((port==rd) || (port==re)) ) ELSE porthelp ENDIF ENDIF ENDIF IF port==RB && ((?mode=='sch') || (?mode=='inten') || (?mode=='intedge') || (?mode=='intpend')) ELSE IF (?mode=='in') || (?mode=='out') || (?mode=='pull') || (?mode=='float') || (?mode=='cmos') || (?mode=='ttl') ELSE porthelp ENDIF ENDIF PortMode (mode / $100) expand mov !port, #(mode//$100)^mask noexpand ENDM
| file: /techref/scenix/sasmport.src, 1KB, , updated: 2002/8/13 14:09, local time: 2008/12/5 01:39,
38.103.63.58:LOG IN
|
| ©2008 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions? Please DO link to this page! Digg it! <A HREF="http://www.piclist.com/techref/scenix/sasmport.src"> scenix sasmport</A> |
| Did you find what you needed? |
|
o List host: MIT, Site host massmind.org, Top posters @20081205 Apptech, Jinx, Xiaofan Chen, olin piclist, Vitaliy, William \Chops\ Westfield, Tamas Rudnai, JonnyMac, Alan B. Pearce, Gerhard Fiedler, * Page Editors: James Newton, David Cary, and YOU! * Roman Black of Black Robotics donates from sales of Linistep stepper controller kits. * Ashley Roll of Digital Nemesis donates from sales of RCL-1 RS232 to TTL converters. * Monthly Subscribers: Shultz Electronics, Timothy Weber, on-going support is MOST appreciated! * Contributors: Richard Seriani, Sr. |
|
.