gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 1 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00001 00002 ;ELMOT.PIC for 18F242 on Board elmot 00003 ;Co. Elmar Benninghaus 00004 ;78628 Rottweil 00005 ;------------------------------------ 00006 00007 ;27.06.2005 - V 1.0 00008 ;------------------------------------ 00009 00010 00011 00012 include "p18f242.inc" 00001 LIST 00002 ; P18F242.INC Standard Header File, Version 1.4 Microchip Technology, Inc. 00923 LIST 00013 ;------------------------------------ 00014 00015 00016 ;configurations 00017 ;------------------------------------ 00018 ;20Mhz, power-on timer, no watchdog, hs-oscillator 00019 300000 FAFF 00020 __CONFIG _CONFIG1H, _HS_OSC_1H 00021 __CONFIG _CONFIG2L, _PWRT_ON_2L 300002 FEFE 00022 __CONFIG _CONFIG2H, _WDT_OFF_2H 00023 00024 ;------------------------------------ 00025 00026 00027 ;global Definitions 00028 ;------------------------------------ 00029 #define CPUFREQ D'20000000' ;CPU-Frequency 00030 00031 #define SETBANK0 movlb 0x00 00032 #define SETBANK1 movlb 0x01 00033 #define SETBANK2 movlb 0x02 00034 ;------------------------------------ 00035 00036 ;AC = ACCESS, BK = BANKED 00000000 00037 AC EQU 0 00000001 00038 BK EQU 1 00039 00040 00041 include "mem.asm" 00001 00002 00003 ;----------------------------------------------------------- 00004 ;datamem: 0x000 to 0x2ff real address used address 00005 ;----------------------------------------------------------- 00006 ;access ram low ( a = 0 ) 0x000 to 0x07f 0x00 to 0x7f 00007 ;bank 0 (0000) ( a = 1 ) 0x000 to 0x0ff 0x00 to 0xff 00008 00009 ;bank 1 (0001) ( a = 1 ) 0x100 to 0x1ff 0x00 to 0xff 00010 ;bank 2 (0010) ( a = 1 ) 0x200 to 0x2ff 0x00 to 0xff gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 2 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00011 00012 ;access bank high ( a = 0 ) 0xf80 to 0xfff 0x80 to 0xff 00013 00014 00015 ;this drivers address 00000000 00016 spi_addr equ 0x00 00000001 00017 spi_ctr equ 0x01 00000002 00018 spi_cmd equ 0x02 00019 00020 ;the driver flags 00000003 00021 drv_flags equ 0x03 00022 00000007 00023 INT_AS_FRQ equ H'0007' 00000006 00024 TIMER_AS_FRQ equ H'0006' 00000005 00025 INT_HANDLES_CMD equ H'0005' 00026 00027 00000002 00028 NO_CIRCLE equ H'0002' 00029 00030 ;the running flags, escpecially for "set TARGET" 00000004 00031 run_flags equ 0x04 00000007 00032 STEP_ON equ H'0007' 00000006 00033 RESTART_FRQ equ H'0006' 00000005 00034 DONT_IGNORES5 equ H'0005' 00000004 00035 CONTENTS5 equ H'0004' 00000003 00036 EEPROM_CFG equ H'0003' 00037 00038 ;the working flags 00000005 00039 work_flags equ 0x05 00000007 00040 ENC_LEFTDOWN equ H'0007' 00000006 00041 RUN_LEFTDOWN equ H'0006' 00000005 00042 POS_EQUAL equ H'0005' 00000004 00043 POS_SMALLER equ H'0004' 00000003 00044 POS_GREATER equ H'0003' 00000002 00045 POS_FARAWAY equ H'0002' 00046 00047 ;some special flags for config, offset ... 00000006 00048 spec_flags equ 0x06 00000007 00049 OFFSET_ROLLEFT equ H'0007' 00050 00000007 00051 stepctr equ 0x07 00052 ;0x08 free 00053 ;0x09 free 00054 00055 ;the buffers 0000000A 00056 spiibuf equ 0x0a 0000000A 00057 spiibuf0 equ 0x0a 0000000B 00058 spiibuf1 equ 0x0b 0000000C 00059 spiibuf2 equ 0x0c 0000000D 00060 spiibuf3 equ 0x0d 0000000E 00061 spiibuf4 equ 0x0e 0000000F 00062 spiibuf5 equ 0x0f 00000010 00063 spiibufend equ 0x10 00064 ;spiibuf5 + 1 gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 3 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00065 00000010 00066 spiobuf equ 0x10 00000010 00067 spiobuf0 equ 0x10 00000011 00068 spiobuf1 equ 0x11 00000012 00069 spiobuf2 equ 0x12 00000013 00070 spiobuf3 equ 0x13 00000014 00071 spiobuf4 equ 0x14 00000015 00072 spiobuf5 equ 0x15 00000016 00073 spiobufend equ 0x16 00074 ;spiobuf5 + 1 00075 00076 00000017 00077 encHigh equ 0x17 00000018 00078 encLow equ 0x18 00079 00000019 00080 encMaxHigh equ 0x19 0000001A 00081 encMaxLow equ 0x1a 00082 0000001B 00083 curpos3 equ 0x1b 0000001C 00084 curpos2 equ 0x1c 0000001D 00085 curpos1 equ 0x1d 0000001E 00086 curpos0 equ 0x1e 00087 0000001F 00088 maxpos3 equ 0x1f 00000020 00089 maxpos2 equ 0x20 00000021 00090 maxpos1 equ 0x21 00000022 00091 maxpos0 equ 0x22 00092 00000023 00093 target3 equ 0x23 00000024 00094 target2 equ 0x24 00000025 00095 target1 equ 0x25 00000026 00096 target0 equ 0x26 00097 00098 ;free 0x27 00099 ;free 0x28 00000029 00100 steplp equ 0x29 0000002A 00101 steplpctr equ 0x2a 00102 0000002B 00103 msmax equ 0x2b 0000002C 00104 msmin equ 0x2c 0000002D 00105 mscur equ 0x2d 00106 0000002E 00107 timerhigh equ 0x2e 0000002F 00108 timerlow equ 0x2f 00109 00000030 00110 rega3 equ 0x30 00000031 00111 rega2 equ 0x31 00000032 00112 rega1 equ 0x32 00000033 00113 rega0 equ 0x33 00114 00000034 00115 regb3 equ 0x34 00000035 00116 regb2 equ 0x35 00000036 00117 regb1 equ 0x36 00000037 00118 regb0 equ 0x37 gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 4 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00119 00000038 00120 regc3 equ 0x38 00000039 00121 regc2 equ 0x39 0000003A 00122 regc1 equ 0x3a 0000003B 00123 regc0 equ 0x3b 00124 0000003C 00125 regd3 equ 0x3c 0000003D 00126 regd2 equ 0x3d 0000003E 00127 regd1 equ 0x3e 0000003F 00128 regd0 equ 0x3f 00129 00000040 00130 offsetbyte equ 0x40 00000041 00131 offsetbit equ 0x41 00132 00133 00134 ;next valid stuff is 0x42 till 0x77 00135 00136 ;--------------------------- 00137 ;temporary values 00138 00000078 00139 enc_tmpold equ 0x78 00000079 00140 enc_tmp equ 0x79 00141 ;flags for encoderhandlings 00000000 00142 MENCA equ H'0000' 00000001 00143 MENCB equ H'0001' 00144 0000007A 00145 spi_tmp equ 0x7a 0000007B 00146 spi_tmpcmd equ 0x7b 0000007C 00147 spi_tmpaddr equ 0x7c 00148 00149 ;these are currently not used 0000007D 00150 litmp_w equ 0x7d 0000007E 00151 litmp_status equ 0x7e 0000007F 00152 litmp_bsr equ 0x7f 00153 00154 ;using values using not ACCESS, but BANKED 00155 ;we can also use values 0x80 to 0xff 00156 ;then 00157 ;switching to BANK 1 using additionally 256 byte 0x00-0xff 00158 ;switching to BANK 2 using additionally 256 byte 0x00-0xff 00159 ;------------------------------------ 00160 00042 00043 00044 ;programstart 0000 00045 org 0x00 0000 EF0E F000 00046 goto GENINIT 00047 ;high prio interrupt 0008 00048 org 0x08 0008 EFB3 F006 00049 goto INT_SPI 00050 ;low prio interrupt 0018 00051 org 0x18 0018 EF77 F000 00052 goto INT_TIMER 00053 gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 5 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00054 00055 ;############# THE INITIALIZATION ####################### 00056 001C 00057 GENINIT 00058 00059 ;PortA0 MP1SENSE Input Analog (default digital input) 00060 ;PortA1 MP2SENSE Input Analog (default digital input) 00061 ;PortA2 MP1DIR Output ( low at startup ) 00062 ;PortA3 MP2DIR Output ( low at startup ) 00063 ;PortA4 ADDR1 Input 00064 ;PortA5 SPICS(SS) Input SPI - Slave CS input 00065 00066 ;PortB0 MENCA Input Encoder input A 00067 ;PortB1 MENCB Input Encoder input B 00068 ;PortB2 MP1EN Output L298 Enable (H-active, at startup L) 00069 ;PortB3 MP2EN Output L298 Enable (H-active, at startup L) 00070 ;PortB4 ADDR0 Input 00071 ;PortB5 PGM INPUT h = PROGRAM ICSP l = normal program 00072 ;PortB6 PGMCLK INPUT CLOCK ICSP 00073 ;PortB7 PGMDATA INPUT DATAIN ICSP 00074 00075 ;PortC0 ADDR2 Input 00076 ;PortC1 MP2PWM Output ( default low at startup ) 00077 ;PortC2 MP1PWM Output ( default low at startup ) 00078 ;PortC3 SPICLK Input SPI - Slave clock input 00079 ;PortC4 SPIDATAIN Input SPI - Slave datain 00080 ;PortC5 SPIDATAOUT Output SPI - Slave dataout 00081 ;PortC6 TXT Output Test with LED ( default high at startup ) 00082 ;PortC7 RXD Input 00083 00084 ;SPI - Mode Slave SS used 00085 ;High active clock-level ( idle = low, because this is also when not connect) 00086 ;set data when clock rises ( leading edge ) 00087 ;sample data when clock fall( falling edge ) 00088 00089 ;init porta 001C 6A80 00090 CLRF PORTA,AC 001E 6A89 00091 CLRF LATA,AC 0020 0E07 00092 MOVLW 0x07 0022 6EC1 00093 MOVWF ADCON1,AC ;default all as digital 0024 0EF3 00094 MOVLW 0xF3 0026 6E92 00095 MOVWF TRISA,AC ;11110011 0028 6A80 00096 CLRF PORTA,AC 00097 ;init portb 002A 6A81 00098 CLRF PORTB,AC 002C 6A8A 00099 CLRF LATB,AC 002E 0EF3 00100 MOVLW 0xF3 0030 6E93 00101 MOVWF TRISB,AC ;11110011 0032 6A81 00102 CLRF PORTB,AC 00103 ;init portc 0034 6A82 00104 CLRF PORTC,AC 0036 6A8B 00105 CLRF LATC,AC 0038 0E99 00106 MOVLW 0x99 003A 6E94 00107 MOVWF TRISC,AC ;10011001 gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 6 LOC OBJECT CODE LINE SOURCE TEXT VALUE 003C 0E60 00108 MOVLW 0x60 003E 6E82 00109 MOVWF PORTC,AC ;01100000 00110 00111 ;setting all to default,saver values 0040 6A03 00112 CLRF drv_flags,AC 0042 6A04 00113 CLRF run_flags,AC 0044 6A05 00114 CLRF work_flags,AC 0046 6A06 00115 CLRF spec_flags,AC 0048 6A07 00116 CLRF stepctr,AC 004A 6A02 00117 CLRF spi_cmd,AC 004C 6A01 00118 CLRF spi_ctr,AC 004E 6829 00119 SETF steplp,AC 0050 682A 00120 SETF steplpctr,AC 0052 0E20 00121 MOVLW D'0032' 0054 6E2B 00122 MOVWF msmax,AC ;set msmax to Fullstep 0056 0E01 00123 MOVLW D'0001' 0058 6E2C 00124 MOVWF msmin,AC ;set msmin to 1/32 microstepsize 005A 6E2D 00125 MOVWF mscur,AC ;dito for mscur 00126 ;getting ADDR0,1,2 and setting spi_addr from it 005C 6A00 00127 CLRF spi_addr,AC 005E B082 00128 BTFSC PORTC,0,AC ;skip if ADDR2=0 0060 8400 00129 BSF spi_addr,2,AC 0062 B880 00130 BTFSC PORTA,4,AC ;skip if ADDR1=0 0064 8200 00131 BSF spi_addr,1,AC 0066 B881 00132 BTFSC PORTB,4,AC ;skip if ADDR0=0 0068 8000 00133 BSF spi_addr,0,AC 00134 ;ok, now dvr_addr contains the meaned address 00135 ;------------------------------------------------- 00136 00137 ;init PWM Frq. with PR2, 20 kHz ( if 20 Mhz clock ) 00138 ;(period = 0,00005 )(10 bit max duty (100%) 1000 = 0,00005 ), 00139 ; 00140 ; or 40 kHz ( if 40 Mhz clock ) 00141 ;(period = 0,000025)(10 bit max duty (100%) 1000 = 0,000025) 00142 ;(max. poss. frq for l298 is 40Mhz, also for pic18f242) 00143 ;------------------------------------------------------------------------ 00144 006A 0E00 00145 MOVLW 0x00 006C 6ECC 00146 MOVWF TMR2,AC ;clear Timer2 006E 0EF9 00147 MOVLW 0xF9 ;PR2=PWM Period;0xFF corresponds to Frq 0070 6ECB 00148 MOVWF PR2,AC ;PWM period = [(PR2)+1]*4* 1/sysclock *Tmr2 prescale 00149 ; = [255+1] * 4 * 0,00000005 * 1 = 0,000051 0072 0E04 00150 MOVLW 0x04 ;Timer2 is ON,prescale = 1:1 0074 6ECA 00151 MOVWF T2CON,AC ;Load to Timer2 control register 0076 0E0C 00152 MOVLW 0x0c ;Set CCP1 to PWM mode 0078 6EBD 00153 MOVWF CCP1CON,AC 007A 0E0C 00154 MOVLW 0x0c ;Set CCP2 to PWM mode 007C 6EBA 00155 MOVWF CCP2CON,AC 00156 00157 ;set motor to a fullstep-value, default direction is right 00158 ;means work_flags.RUN_LEFTDOWN is cleared when startup. 007E 0EE8 00159 MOVLW 0xE8 ;Set CCPR1L 100% duty cycle (CCPR1L:CCP1CON<5.4> = 1000 ) 0080 6EBE 00160 MOVWF CCPR1L,AC ;8MSBs of duty cycle 0082 0E30 00161 MOVLW 0x30 ;2 LSBs at CCPxCON<5:4> gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 7 LOC OBJECT CODE LINE SOURCE TEXT VALUE 0084 12BD 00162 IORWF CCP1CON,1,AC 0086 0E00 00163 MOVLW 0x00 ;set CCPR2L 0088 6EBB 00164 MOVWF CCPR2L,AC ;8MSBs of duty cycle 008A 0E04 00165 MOVLW B'00000100' ;MP2DIR=0,MP1DIR=1 set Forward current in Winding1 008C 6E80 00166 MOVWF PORTA 008E 0E0C 00167 MOVLW B'00001100' ;MP2EN =1,MP1EN =1 on 0090 6E81 00168 MOVWF PORTB 00169 00170 ;------------------------------------------------- 00171 ;We have to read encodersignals here to set 00172 ;enc_tmp, and enc_tmpold to a proper value 0092 6A79 00173 CLRF enc_tmp 0094 B081 00174 BTFSC PORTB,0,AC 0096 8079 00175 BSF enc_tmp,MENCA,AC 0098 B281 00176 BTFSC PORTB,1,AC 009A 8279 00177 BSF enc_tmp,MENCB,AC 009C C079 F078 00178 MOVFF enc_tmp,enc_tmpold 00179 ;------------------------------------------------- 00180 ;init spi 00A0 9AC6 00181 BCF SSPCON1,SSPEN,AC 00A2 0E40 00182 MOVLW 0x40 00A4 6EC7 00183 MOVWF SSPSTAT,AC ;01000000 transmit when rise 00A6 0E24 00184 MOVLW 0x24 00A8 6EC6 00185 MOVWF SSPCON1,AC ;00100100 no collision, no overflow, 00186 ;clock highactive, spi enabled 00187 ;clearing, reading SSBUF 00AA 50C9 00188 MOVF SSPBUF,W,AC 00189 ;then setting it to 0xff 00AC 68C9 00190 SETF SSPBUF,AC 00191 ;init spi - interrupt stuff 00192 00AE 969E 00193 BCF PIR1,SSPIF ;clear int-req flag 00B0 8ED0 00194 BSF RCON,IPEN ;enabling prio-levels 00B2 869F 00195 BSF IPR1,SSPIP ;setting high prio for spi-int 00196 ;( after start, the IPR-regs are all 1 default ) 00B4 869D 00197 BSF PIE1,SSPIE,AC ;enabling spi-int 00198 00199 ;init timer - interrupt stuff 00B6 9AF2 00200 BCF INTCON,TMR0IE,AC ;disable TMR0 Overflow int 00B8 9ED5 00201 BCF T0CON,TMR0ON,AC ;stops timer 0 00BA 94F1 00202 BCF INTCON2,TMR0IP,AC ;timer 0 overflow int low priority 00203 00204 ;last stuff, enabling general all init interrupts 00205 00BC 8CF2 00206 BSF INTCON,PEIE,AC ;enable low-level int 00BE 8EF2 00207 BSF INTCON,GIE,AC ;enable high-level int 00208 00209 00210 00211 00212 ;-------- TEST - little show loop 3 times, only for showing 00213 ;-------- if board is living after programming. 00214 ; MOVLW 0x03 00215 ; MOVWF spi_ctr,AC gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 8 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00216 ;testloop: 00217 ; BSF PORTC,TX,AC 00218 ;testcounta: 00219 ; MOVLW 0xff 00220 ; MOVWF spi_cmd,AC 00221 ;testcountb: 00222 ; NOP 00223 ; DECFSZ WREG,1,AC 00224 ; BRA testcountb 00225 ; MOVLW 0xff 00226 ; DECFSZ spi_cmd,1,AC 00227 ; BRA testcountb 00228 ; MOVWF spi_cmd,AC 00229 ; BCF PORTC,TX,AC 00230 00231 ;testcountc: 00232 ; NOP 00233 ; DECFSZ WREG,1,AC 00234 ; BRA testcountc 00235 ; MOVLW 0xff 00236 ; DECFSZ spi_cmd,1,AC 00237 ; BRA testcountc 00238 ; MOVWF spi_cmd,AC 00239 00240 ; DECFSZ spi_ctr,1,AC 00241 ; BRA testloop 00242 00243 00244 ; CLRF spi_cmd,AC 00245 ; CLRF spi_ctr,AC 00246 ;-------- TESTEND 00247 00248 00249 ;TX high, can be used as flag externally for looking 00250 ;if board is ready. 00251 00C0 8C82 00252 BSF PORTC,TX,AC 00253 00254 00255 ;############# THE PROGRAMLOOP ####################### 00256 00257 ;now, - all should be in a proper conditions 00258 ;and we can do our programloop, if we use it 00259 ;------------------------------------------- 00C2 00260 GENLOOP 00261 ;------- 00C2 AA03 00262 BTFSS drv_flags,INT_HANDLES_CMD,AC 00C4 EC4C F006 00263 CALL CMD_WORK ;if not handled by interrupt, we do it here 00C8 AE82 00264 BTFSS PORTC,RX,AC;skip if high 00CA D7FB 00265 BRA GENLOOP;if bit 7 of portc low, normally loop 00266 00267 ;we have a high signal on RXD, so we will wait till it goes 00268 ;high again. 00CC 00269 waitforrxdhigh gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 9 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00CC 0000 00270 NOP 00CE BE82 00271 BTFSC PORTC,RX,AC;skip if low again 00D0 D7FD 00272 BRA waitforrxdhigh 00273 00D2 EC78 F005 00274 CALL STEP_WORK 00275 00D6 EF61 F000 00276 GOTO GENLOOP 00277 00278 00279 00280 ;starts timer with timerval, called by CMD_WORK 00DA 00281 start_timer 00DA 9AF2 00282 BCF INTCON,TMR0IE,AC ;disable TMR0 Overflow int 00DC 0E81 00283 MOVLW B'10000001' ;Bit 7 = 0 Timer off 00284 ;Bit 6 = 0 Timer is 16bit-timer 00285 ;Bit 5 = 0 Internal instruction cycle clock 00286 ;Bit 4 = 0 We use timermode (cycle clock) 00287 ;Bit 3 = 0 prescaler on 00288 ;Bit 2,1,0 = 111 = 1:256 00289 ; 110 = 1:128 00290 ; 101 = 1:64 00291 ; 100 = 1:32 00292 ; 011 = 1:16 00293 ; 010 = 1:8 00294 ; 001 = 1:4 we use this 00295 ; 000 = 1:2 00296 00DE 502E 00297 MOVF timerhigh,W,AC 00E0 6ED7 00298 MOVWF TMR0H,AC 00E2 502F 00299 MOVF timerlow,W,AC 00E4 6ED6 00300 MOVWF TMR0L,AC ;this clears also prescaler 00301 00E6 94F2 00302 BCF INTCON,TMR0IF,AC ;clear TMR0 overflow flag 00E8 8AF2 00303 BSF INTCON,TMR0IE,AC ;enable TMR0 Overflow int 00EA 8ED5 00304 BSF T0CON,TMR0ON,AC ;starts timer 0 00EC 0012 00305 RETURN 00306 ;13 cycles 00307 00308 00309 00EE 00310 INT_TIMER 00EE B4F2 00311 BTFSC INTCON,TMR0IF,AC ;Timer0 overflow Interrupt? 00F0 D001 00312 BRA timer0int 00F2 0010 00313 RETFIE 0 00F4 00314 timer0int 00F4 8ED5 00315 BSF T0CON,TMR0ON,AC ;stops timer 0 00316 ;For reason the high-prio INT_SPI will occure, 00317 ;we have to save, and restore our values by our own. 00F6 6E7D 00318 MOVWF litmp_w,AC 00F8 CFD8 F07E 00319 MOVFF STATUS, litmp_status 00FC CFE0 F07F 00320 MOVFF BSR, litmp_bsr 00321 00322 0100 EC78 F005 00323 CALL STEP_WORK gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 10 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00324 0104 502E 00325 MOVF timerhigh,W,AC 0106 6ED7 00326 MOVWF TMR0H,AC 0108 502F 00327 MOVF timerlow,W,AC 010A 6ED6 00328 MOVWF TMR0L,AC ;this clears also prescaler 010C 94F2 00329 BCF INTCON,TMR0IF,AC ;clear TMR0 overflow flag 010E 8ED5 00330 BSF T0CON,TMR0ON,AC ;starts timer 0 00331 ;restore regs 0110 C07F FFE0 00332 MOVFF litmp_bsr, BSR 0114 507D 00333 MOVF litmp_w, W, AC 0116 C07E FFD8 00334 MOVFF litmp_status, STATUS 011A 0010 00335 RETFIE 0 00336 ;24 + max step_work(440) = 464 00337 ;5.000.000 / 464 = 10.775,86 max Frq. 00338 00339 00340 00341 00342 00343 include "pos.asm" 00001 00002 00003 ;proofed 1 00004 ;this increments encoderval, compares also 00005 ;incremented stuff with encmaxval, and 00006 ;sets to 0 if overflow. 00007 ;(used by ENC_WORK in STEP_WORK) 011C 00008 inc_encval_ov 011C 3E18 00009 INCFSZ encLow,1,AC ;inc lowbyte 011E D001 00010 BRA inc_encval_cmp ;skip this if res 0 0120 2A17 00011 INCF encHigh,1,AC ;inc highbyte 00012 ;compare encval with encmaxval 0122 00013 inc_encval_cmp 0122 5018 00014 MOVF encLow,W,AC 0124 621A 00015 CPFSEQ encMaxLow,AC 0126 0012 00016 RETURN 0128 5017 00017 MOVF encHigh,W,AC 012A 6219 00018 CPFSEQ encMaxHigh,AC 012C 0012 00019 RETURN 012E 6A18 00020 CLRF encLow ;set all to 0 if max 0130 6A17 00021 CLRF encHigh 0132 0012 00022 RETURN 00023 00024 00025 ;proofed 1 00026 ;this decrements encoderval, compares also 00027 ;to underflow 0, and sets to maxval is this 00028 ;happens. 00029 ;(used by ENC_WORK in STEP_WORK ) 0134 00030 dec_encval_ov 0134 5018 00031 MOVF encLow,W,AC ;if 0 Z is set 0136 E106 00032 BNZ dec_encval 0138 5017 00033 MOVF encHigh,W,AC ;if 0 Z is set 013A E104 00034 BNZ dec_encval gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 11 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00035 ;ok all is 0, before decrement, 00036 ;so we will store maxencval -1 to current val 013C C01A F018 00037 MOVFF encMaxLow,encLow 0140 C019 F017 00038 MOVFF encMaxHigh,encHigh 00039 ;and do a -1 0144 00040 dec_encval 0144 0618 00041 DECF encLow,1,AC 0146 0EFF 00042 MOVLW 0xff 0148 6218 00043 CPFSEQ encLow,AC 014A 0012 00044 RETURN ;skip if encLow == 0xff 014C 0617 00045 DECF encHigh,1,AC 014E 6217 00046 CPFSEQ encHigh,AC 0150 0012 00047 RETURN 00048 ;do overflow work, but should never reached 0152 0012 00049 RETURN 00050 ;max 25 cycles 00051 00052 00053 00054 ;proofed 1 00055 ;this is called by STEP_WORK, when starting 00056 ;if positions are equal, only encoderwork will be 00057 ;done, no stepping 00058 ;This clears work_flags.POS_EQUAL, compares positions, 00059 ;and sets POS_EQUAL, if positions equal. 00060 ;the flags POS_SMALLER, and POS_EQUAL, are only cleared 00061 ;if positions are really equal. 00062 ;Use this, if only testing for equal, because this 00063 ;uses less cycles then test_pos 0154 00064 test_ifposequaltrg 0154 9A05 00065 BCF work_flags,POS_EQUAL,AC 0156 5023 00066 MOVF target3,W,AC 0158 621B 00067 CPFSEQ curpos3,AC 015A 0012 00068 RETURN 015C 5024 00069 MOVF target2,W,AC 015E 621C 00070 CPFSEQ curpos2,AC 0160 0012 00071 RETURN 0162 5025 00072 MOVF target1,W,AC 0164 621D 00073 CPFSEQ curpos1,AC 0166 0012 00074 RETURN 0168 5026 00075 MOVF target0,W,AC 016A 621E 00076 CPFSEQ curpos0,AC 016C 0012 00077 RETURN 00078 016E 9805 00079 BCF work_flags,POS_SMALLER,AC 0170 9605 00080 BCF work_flags,POS_GREATER,AC 0172 8A05 00081 BSF work_flags,POS_EQUAL,AC 0174 0012 00082 RETURN 00083 ;20 cycles max with call, and return 00084 00085 00086 00087 ;proofed 1 00088 ;this is called by scan_direction, if current, and target gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 12 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00089 ;are in the same section, or if NO_CIRCLE used directly by STEP_WORK 00090 ;it sets work_flags POS_SMALLER,POS_GREATER,POS_EQUAL, 00091 ;for the status of currentpos ( compared with target ) 0176 00092 test_pos 0176 9805 00093 BCF work_flags,POS_SMALLER,AC 0178 9605 00094 BCF work_flags,POS_GREATER,AC 017A 9A05 00095 BCF work_flags,POS_EQUAL,AC 00096 017C 5023 00097 MOVF target3,W,AC 017E 641B 00098 CPFSGT curpos3,AC 0180 D001 00099 BRA tstcursm1 ;smaller, or equal 0182 D01A 00100 BRA testcurisgreater ;if sure greater 0184 00101 tstcursm1 0184 601B 00102 CPFSLT curpos3,AC 0186 D001 00103 BRA tstcursm2 ;greater, or equal 0188 D019 00104 BRA testcurissmaller ;if sure smaller 018A 00105 tstcursm2 00106 018A 5024 00107 MOVF target2,W,AC 018C 641C 00108 CPFSGT curpos2,AC 018E D001 00109 BRA tstcursm3 ;smaller, or equal 0190 D013 00110 BRA testcurisgreater ;if sure greater 0192 00111 tstcursm3 0192 601C 00112 CPFSLT curpos2,AC 0194 D001 00113 BRA tstcursm4 ;greater, or equal 0196 D012 00114 BRA testcurissmaller ;if sure smaller 0198 00115 tstcursm4 00116 0198 5025 00117 MOVF target1,W,AC 019A 641D 00118 CPFSGT curpos1,AC 019C D001 00119 BRA tstcursm5 ;smaller, or equal 019E D00C 00120 BRA testcurisgreater ;if sure greater 01A0 00121 tstcursm5 01A0 601D 00122 CPFSLT curpos1,AC 01A2 D001 00123 BRA tstcursm6 ;greater, or equal 01A4 D00B 00124 BRA testcurissmaller ;if sure smaller 01A6 00125 tstcursm6 01A6 5026 00126 MOVF target0,W,AC 01A8 641E 00127 CPFSGT curpos0,AC 01AA D001 00128 BRA tstcursm7 ;smaller, or equal 01AC D005 00129 BRA testcurisgreater ;if sure greater 01AE 00130 tstcursm7 01AE 601E 00131 CPFSLT curpos0,AC 01B0 D001 00132 BRA testcurisequal ;this can only be equal 01B2 D004 00133 BRA testcurissmaller ;if sure smaller 00134 01B4 00135 testcurisequal 01B4 8A05 00136 BSF work_flags,POS_EQUAL,AC 01B6 0012 00137 RETURN 01B8 00138 testcurisgreater 01B8 8605 00139 BSF work_flags,POS_GREATER,AC 01BA 0012 00140 RETURN 01BC 00141 testcurissmaller 01BC 8805 00142 BSF work_flags,POS_SMALLER,AC gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 13 LOC OBJECT CODE LINE SOURCE TEXT VALUE 01BE 0012 00143 RETURN 00144 ;38 cycles with call, and return 00145 00146 00147 00148 00149 00344 include "matrix.asm" 00001 00002 00003 00004 ;this section-matrixes are called from 00005 ;scan_direction 00006 ;All of them requires that 00007 ;sets run_flags.RUN_LEFTDOWN, (which is default 00008 ;cleared by scan_direction previous), 00009 ;is a move to left is required. 00010 ;regb0 has to contain the section of the targetposition 00011 00012 00013 00014 ;current-pos is in section 0 01C0 00015 cursecmatrix0 01C0 00016 trgc0_0_f 01C0 B637 00017 BTFSC regb0,0x03,AC 01C2 D016 00018 BRA trgc0_8_f 01C4 00019 trgc0_0_7 01C4 B437 00020 BTFSC regb0,0x02,AC 01C6 D00A 00021 BRA trgc0_4_7 01C8 00022 trgc0_0_3 01C8 B237 00023 BTFSC regb0,0x01,AC 01CA D004 00024 BRA trgc0_2_3 01CC 00025 trgc0_0_1 01CC B037 00026 BTFSC regb0,0x00,AC 01CE D001 00027 BRA trgc0___1 01D0 00028 trgc0___0 00029 ;sector target 0 never reached, set by test_pos 00030 ;BSF work_flags,RUN_LEFTDOWN,AC 01D0 0012 00031 RETURN 01D2 00032 trgc0___1 00033 ;sector target 1 00034 ;BSF work_flags,RUN_LEFTDOWN,AC 01D2 0012 00035 RETURN 01D4 00036 trgc0_2_3 01D4 B037 00037 BTFSC regb0,0x00,AC 01D6 D001 00038 BRA trgc0___3 01D8 00039 trgc0___2 00040 ;sector target 2 00041 ;BSF work_flags,RUN_LEFTDOWN,AC 01D8 0012 00042 RETURN 01DA 00043 trgc0___3 00044 ;sector target 3 00045 ;BSF work_flags,RUN_LEFTDOWN,AC 01DA 0012 00046 RETURN gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 14 LOC OBJECT CODE LINE SOURCE TEXT VALUE 01DC 00047 trgc0_4_7 01DC B237 00048 BTFSC regb0,0x01,AC 01DE D004 00049 BRA trgc0_6_7 01E0 00050 trgc0_4_5 01E0 B037 00051 BTFSC regb0,0x00,AC 01E2 D001 00052 BRA trgc0___5 01E4 00053 trgc0___4 00054 ;sector target 4 00055 ;BSF work_flags,RUN_LEFTDOWN,AC 01E4 0012 00056 RETURN 01E6 00057 trgc0___5 00058 ;sector target 5 00059 ;BSF work_flags,RUN_LEFTDOWN,AC 01E6 0012 00060 RETURN 01E8 00061 trgc0_6_7 01E8 B037 00062 BTFSC regb0,0x00,AC 01EA D001 00063 BRA trgc0___7 01EC 00064 trgc0___6 00065 ;sector target 6 00066 ;BSF work_flags,RUN_LEFTDOWN,AC 01EC 0012 00067 RETURN 01EE 00068 trgc0___7 00069 ;sector target 7 00070 ;BSF work_flags,RUN_LEFTDOWN,AC 01EE 0012 00071 RETURN 01F0 00072 trgc0_8_f 01F0 B437 00073 BTFSC regb0,0x02,AC 01F2 D00D 00074 BRA trgc0_c_f 01F4 00075 trgc0_8_b 01F4 B237 00076 BTFSC regb0,0x01,AC 01F6 D005 00077 BRA trgc0_a_b 01F8 00078 trgc0_8_9 01F8 B037 00079 BTFSC regb0,0x00,AC 01FA D001 00080 BRA trgc0___9 01FC 00081 trgc0___8 00082 ;sector target 8 00083 ;BSF work_flags,RUN_LEFTDOWN,AC 01FC 0012 00084 RETURN 01FE 00085 trgc0___9 00086 ;sector target 9 01FE 8C05 00087 BSF work_flags,RUN_LEFTDOWN,AC 0200 0012 00088 RETURN 0202 00089 trgc0_a_b 0202 B037 00090 BTFSC regb0,0x00,AC 0204 D002 00091 BRA trgc0___b 0206 00092 trgc0___a 00093 ;sector target 10 0206 8C05 00094 BSF work_flags,RUN_LEFTDOWN,AC 0208 0012 00095 RETURN 020A 00096 trgc0___b 00097 ;sector target 11 020A 8C05 00098 BSF work_flags,RUN_LEFTDOWN,AC 020C 0012 00099 RETURN 020E 00100 trgc0_c_f gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 15 LOC OBJECT CODE LINE SOURCE TEXT VALUE 020E B237 00101 BTFSC regb0,0x01,AC 0210 D006 00102 BRA trgc0_e_f 0212 00103 trgc0_c_d 0212 B037 00104 BTFSC regb0,0x00,AC 0214 D002 00105 BRA trgc0___d 0216 00106 trgc0___c 00107 ;sector target 12 0216 8C05 00108 BSF work_flags,RUN_LEFTDOWN,AC 0218 0012 00109 RETURN 021A 00110 trgc0___d 00111 ;sector target 13 021A 8C05 00112 BSF work_flags,RUN_LEFTDOWN,AC 021C 0012 00113 RETURN 021E 00114 trgc0_e_f 021E B037 00115 BTFSC regb0,0x00,AC 0220 D002 00116 BRA trgc0___f 0222 00117 trgc0___e 00118 ;sector target 14 0222 8C05 00119 BSF work_flags,RUN_LEFTDOWN,AC 0224 0012 00120 RETURN 0226 00121 trgc0___f 00122 ;sector target 15 0226 8C05 00123 BSF work_flags,RUN_LEFTDOWN,AC 0228 0012 00124 RETURN 00125 00126 00127 00128 00129 00130 ;current-pos is in section 1 022A 00131 cursecmatrix1 022A 00132 trgc1_0_f 022A B637 00133 BTFSC regb0,0x03,AC 022C D017 00134 BRA trgc1_8_f 022E 00135 trgc1_0_7 022E B437 00136 BTFSC regb0,0x02,AC 0230 D00B 00137 BRA trgc1_4_7 0232 00138 trgc1_0_3 0232 B237 00139 BTFSC regb0,0x01,AC 0234 D005 00140 BRA trgc1_2_3 0236 00141 trgc1_0_1 0236 B037 00142 BTFSC regb0,0x00,AC 0238 D002 00143 BRA trgc1___1 023A 00144 trgc1___0 00145 ;sector target 0 023A 8C05 00146 BSF work_flags,RUN_LEFTDOWN,AC 023C 0012 00147 RETURN 023E 00148 trgc1___1 00149 ;sector target 1, never reached, set by test_pos 00150 ;BSF work_flags,RUN_LEFTDOWN,AC 023E 0012 00151 RETURN 0240 00152 trgc1_2_3 0240 B037 00153 BTFSC regb0,0x00,AC 0242 D001 00154 BRA trgc1___3 gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 16 LOC OBJECT CODE LINE SOURCE TEXT VALUE 0244 00155 trgc1___2 00156 ;sector target 2 00157 ;BSF work_flags,RUN_LEFTDOWN,AC 0244 0012 00158 RETURN 0246 00159 trgc1___3 00160 ;sector target 3 00161 ;BSF work_flags,RUN_LEFTDOWN,AC 0246 0012 00162 RETURN 0248 00163 trgc1_4_7 0248 B237 00164 BTFSC regb0,0x01,AC 024A D004 00165 BRA trgc1_6_7 024C 00166 trgc1_4_5 024C B037 00167 BTFSC regb0,0x00,AC 024E D001 00168 BRA trgc1___5 0250 00169 trgc1___4 00170 ;sector target 4 00171 ;BSF work_flags,RUN_LEFTDOWN,AC 0250 0012 00172 RETURN 0252 00173 trgc1___5 00174 ;sector target 5 00175 ;BSF work_flags,RUN_LEFTDOWN,AC 0252 0012 00176 RETURN 0254 00177 trgc1_6_7 0254 B037 00178 BTFSC regb0,0x00,AC 0256 D001 00179 BRA trgc1___7 0258 00180 trgc1___6 00181 ;sector target 6 00182 ;BSF work_flags,RUN_LEFTDOWN,AC 0258 0012 00183 RETURN 025A 00184 trgc1___7 00185 ;sector target 7 00186 ;BSF work_flags,RUN_LEFTDOWN,AC 025A 0012 00187 RETURN 025C 00188 trgc1_8_f 025C B437 00189 BTFSC regb0,0x02,AC 025E D00C 00190 BRA trgc1_c_f 0260 00191 trgc1_8_b 0260 B237 00192 BTFSC regb0,0x01,AC 0262 D004 00193 BRA trgc1_a_b 0264 00194 trgc1_8_9 0264 B037 00195 BTFSC regb0,0x00,AC 0266 D001 00196 BRA trgc1___9 0268 00197 trgc1___8 00198 ;sector target 8 00199 ;BSF work_flags,RUN_LEFTDOWN,AC 0268 0012 00200 RETURN 026A 00201 trgc1___9 00202 ;sector target 9 00203 ;BSF work_flags,RUN_LEFTDOWN,AC 026A 0012 00204 RETURN 026C 00205 trgc1_a_b 026C B037 00206 BTFSC regb0,0x00,AC 026E D002 00207 BRA trgc1___b 0270 00208 trgc1___a gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 17 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00209 ;sector target 10 0270 8C05 00210 BSF work_flags,RUN_LEFTDOWN,AC 0272 0012 00211 RETURN 0274 00212 trgc1___b 00213 ;sector target 11 0274 8C05 00214 BSF work_flags,RUN_LEFTDOWN,AC 0276 0012 00215 RETURN 0278 00216 trgc1_c_f 0278 B237 00217 BTFSC regb0,0x01,AC 027A D006 00218 BRA trgc1_e_f 027C 00219 trgc1_c_d 027C B037 00220 BTFSC regb0,0x00,AC 027E D002 00221 BRA trgc1___d 0280 00222 trgc1___c 00223 ;sector target 12 0280 8C05 00224 BSF work_flags,RUN_LEFTDOWN,AC 0282 0012 00225 RETURN 0284 00226 trgc1___d 00227 ;sector target 13 0284 8C05 00228 BSF work_flags,RUN_LEFTDOWN,AC 0286 0012 00229 RETURN 0288 00230 trgc1_e_f 0288 B037 00231 BTFSC regb0,0x00,AC 028A D002 00232 BRA trgc1___f 028C 00233 trgc1___e 00234 ;sector target 14 028C 8C05 00235 BSF work_flags,RUN_LEFTDOWN,AC 028E 0012 00236 RETURN 0290 00237 trgc1___f 00238 ;sector target 15 0290 8C05 00239 BSF work_flags,RUN_LEFTDOWN,AC 0292 0012 00240 RETURN 00241 00242 00243 00244 00245 00246 ;current-pos is in section 2 0294 00247 cursecmatrix2 0294 00248 trgc2_0_f 0294 B637 00249 BTFSC regb0,0x03,AC 0296 D018 00250 BRA trgc2_8_f 0298 00251 trgc2_0_7 0298 B437 00252 BTFSC regb0,0x02,AC 029A D00C 00253 BRA trgc2_4_7 029C 00254 trgc2_0_3 029C B237 00255 BTFSC regb0,0x01,AC 029E D006 00256 BRA trgc2_2_3 02A0 00257 trgc2_0_1 02A0 B037 00258 BTFSC regb0,0x00,AC 02A2 D002 00259 BRA trgc2___1 02A4 00260 trgc2___0 00261 ;sector target 0 02A4 8C05 00262 BSF work_flags,RUN_LEFTDOWN,AC gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 18 LOC OBJECT CODE LINE SOURCE TEXT VALUE 02A6 0012 00263 RETURN 02A8 00264 trgc2___1 00265 ;sector target 1 02A8 8C05 00266 BSF work_flags,RUN_LEFTDOWN,AC 02AA 0012 00267 RETURN 02AC 00268 trgc2_2_3 02AC B037 00269 BTFSC regb0,0x00,AC 02AE D001 00270 BRA trgc2___3 02B0 00271 trgc2___2 00272 ;sector target 2, never reached, set by test_pos 00273 ;BSF work_flags,RUN_LEFTDOWN,AC 02B0 0012 00274 RETURN 02B2 00275 trgc2___3 00276 ;sector target 3 00277 ;BSF work_flags,RUN_LEFTDOWN,AC 02B2 0012 00278 RETURN 02B4 00279 trgc2_4_7 02B4 B237 00280 BTFSC regb0,0x01,AC 02B6 D004 00281 BRA trgc2_6_7 02B8 00282 trgc2_4_5 02B8 B037 00283 BTFSC regb0,0x00,AC 02BA D001 00284 BRA trgc2___5 02BC 00285 trgc2___4 00286 ;sector target 4 00287 ;BSF work_flags,RUN_LEFTDOWN,AC 02BC 0012 00288 RETURN 02BE 00289 trgc2___5 00290 ;sector target 5 00291 ;BSF work_flags,RUN_LEFTDOWN,AC 02BE 0012 00292 RETURN 02C0 00293 trgc2_6_7 02C0 B037 00294 BTFSC regb0,0x00,AC 02C2 D001 00295 BRA trgc2___7 02C4 00296 trgc2___6 00297 ;sector target 6 00298 ;BSF work_flags,RUN_LEFTDOWN,AC 02C4 0012 00299 RETURN 02C6 00300 trgc2___7 00301 ;sector target 7 00302 ;BSF work_flags,RUN_LEFTDOWN,AC 02C6 0012 00303 RETURN 02C8 00304 trgc2_8_f 02C8 B437 00305 BTFSC regb0,0x02,AC 02CA D00B 00306 BRA trgc2_c_f 02CC 00307 trgc2_8_b 02CC B237 00308 BTFSC regb0,0x01,AC 02CE D004 00309 BRA trgc2_a_b 02D0 00310 trgc2_8_9 02D0 B037 00311 BTFSC regb0,0x00,AC 02D2 D001 00312 BRA trgc2___9 02D4 00313 trgc2___8 00314 ;sector target 8 00315 ;BSF work_flags,RUN_LEFTDOWN,AC 02D4 0012 00316 RETURN gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 19 LOC OBJECT CODE LINE SOURCE TEXT VALUE 02D6 00317 trgc2___9 00318 ;sector target 9 00319 ;BSF work_flags,RUN_LEFTDOWN,AC 02D6 0012 00320 RETURN 02D8 00321 trgc2_a_b 02D8 B037 00322 BTFSC regb0,0x00,AC 02DA D001 00323 BRA trgc2___b 02DC 00324 trgc2___a 00325 ;sector target 10 00326 ;BSF work_flags,RUN_LEFTDOWN,AC 02DC 0012 00327 RETURN 02DE 00328 trgc2___b 00329 ;sector target 11 02DE 8C05 00330 BSF work_flags,RUN_LEFTDOWN,AC 02E0 0012 00331 RETURN 02E2 00332 trgc2_c_f 02E2 B237 00333 BTFSC regb0,0x01,AC 02E4 D006 00334 BRA trgc2_e_f 02E6 00335 trgc2_c_d 02E6 B037 00336 BTFSC regb0,0x00,AC 02E8 D002 00337 BRA trgc2___d 02EA 00338 trgc2___c 00339 ;sector target 12 02EA 8C05 00340 BSF work_flags,RUN_LEFTDOWN,AC 02EC 0012 00341 RETURN 02EE 00342 trgc2___d 00343 ;sector target 13 02EE 8C05 00344 BSF work_flags,RUN_LEFTDOWN,AC 02F0 0012 00345 RETURN 02F2 00346 trgc2_e_f 02F2 B037 00347 BTFSC regb0,0x00,AC 02F4 D002 00348 BRA trgc2___f 02F6 00349 trgc2___e 00350 ;sector target 14 02F6 8C05 00351 BSF work_flags,RUN_LEFTDOWN,AC 02F8 0012 00352 RETURN 02FA 00353 trgc2___f 00354 ;sector target 15 02FA 8C05 00355 BSF work_flags,RUN_LEFTDOWN,AC 02FC 0012 00356 RETURN 00357 00358 00359 00360 00361 00362 00363 ;current-pos is in section 3 02FE 00364 cursecmatrix3 02FE 00365 trgc3_0_f 02FE B637 00366 BTFSC regb0,0x03,AC 0300 D019 00367 BRA trgc3_8_f 0302 00368 trgc3_0_7 0302 B437 00369 BTFSC regb0,0x02,AC 0304 D00D 00370 BRA trgc3_4_7 gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 20 LOC OBJECT CODE LINE SOURCE TEXT VALUE 0306 00371 trgc3_0_3 0306 B237 00372 BTFSC regb0,0x01,AC 0308 D006 00373 BRA trgc3_2_3 030A 00374 trgc3_0_1 030A B037 00375 BTFSC regb0,0x00,AC 030C D002 00376 BRA trgc3___1 030E 00377 trgc3___0 00378 ;sector target 0 030E 8C05 00379 BSF work_flags,RUN_LEFTDOWN,AC 0310 0012 00380 RETURN 0312 00381 trgc3___1 00382 ;sector target 1 0312 8C05 00383 BSF work_flags,RUN_LEFTDOWN,AC 0314 0012 00384 RETURN 0316 00385 trgc3_2_3 0316 B037 00386 BTFSC regb0,0x00,AC 0318 D002 00387 BRA trgc3___3 031A 00388 trgc3___2 00389 ;sector target 2 031A 8C05 00390 BSF work_flags,RUN_LEFTDOWN,AC 031C 0012 00391 RETURN 031E 00392 trgc3___3 00393 ;sector target 3, never reached, set by test_pos 00394 ;BSF work_flags,RUN_LEFTDOWN,AC 031E 0012 00395 RETURN 0320 00396 trgc3_4_7 0320 B237 00397 BTFSC regb0,0x01,AC 0322 D004 00398 BRA trgc3_6_7 0324 00399 trgc3_4_5 0324 B037 00400 BTFSC regb0,0x00,AC 0326 D001 00401 BRA trgc3___5 0328 00402 trgc3___4 00403 ;sector target 4 00404 ;BSF work_flags,RUN_LEFTDOWN,AC 0328 0012 00405 RETURN 032A 00406 trgc3___5 00407 ;sector target 5 00408 ;BSF work_flags,RUN_LEFTDOWN,AC 032A 0012 00409 RETURN 032C 00410 trgc3_6_7 032C B037 00411 BTFSC regb0,0x00,AC 032E D001 00412 BRA trgc3___7 0330 00413 trgc3___6 00414 ;sector target 6 00415 ;BSF work_flags,RUN_LEFTDOWN,AC 0330 0012 00416 RETURN 0332 00417 trgc3___7 00418 ;sector target 7 00419 ;BSF work_flags,RUN_LEFTDOWN,AC 0332 0012 00420 RETURN 0334 00421 trgc3_8_f 0334 B437 00422 BTFSC regb0,0x02,AC 0336 D00A 00423 BRA trgc3_c_f 0338 00424 trgc3_8_b gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 21 LOC OBJECT CODE LINE SOURCE TEXT VALUE 0338 B237 00425 BTFSC regb0,0x01,AC 033A D004 00426 BRA trgc3_a_b 033C 00427 trgc3_8_9 033C B037 00428 BTFSC regb0,0x00,AC 033E D001 00429 BRA trgc3___9 0340 00430 trgc3___8 00431 ;sector target 8 00432 ;BSF work_flags,RUN_LEFTDOWN,AC 0340 0012 00433 RETURN 0342 00434 trgc3___9 00435 ;sector target 9 00436 ;BSF work_flags,RUN_LEFTDOWN,AC 0342 0012 00437 RETURN 0344 00438 trgc3_a_b 0344 B037 00439 BTFSC regb0,0x00,AC 0346 D001 00440 BRA trgc3___b 0348 00441 trgc3___a 00442 ;sector target 10 00443 ;BSF work_flags,RUN_LEFTDOWN,AC 0348 0012 00444 RETURN 034A 00445 trgc3___b 00446 ;sector target 11 00447 ;BSF work_flags,RUN_LEFTDOWN,AC 034A 0012 00448 RETURN 034C 00449 trgc3_c_f 034C B237 00450 BTFSC regb0,0x01,AC 034E D006 00451 BRA trgc3_e_f 0350 00452 trgc3_c_d 0350 B037 00453 BTFSC regb0,0x00,AC 0352 D002 00454 BRA trgc3___d 0354 00455 trgc3___c 00456 ;sector target 12 0354 8C05 00457 BSF work_flags,RUN_LEFTDOWN,AC 0356 0012 00458 RETURN 0358 00459 trgc3___d 00460 ;sector target 13 0358 8C05 00461 BSF work_flags,RUN_LEFTDOWN,AC 035A 0012 00462 RETURN 035C 00463 trgc3_e_f 035C B037 00464 BTFSC regb0,0x00,AC 035E D002 00465 BRA trgc3___f 0360 00466 trgc3___e 00467 ;sector target 14 0360 8C05 00468 BSF work_flags,RUN_LEFTDOWN,AC 0362 0012 00469 RETURN 0364 00470 trgc3___f 00471 ;sector target 15 0364 8C05 00472 BSF work_flags,RUN_LEFTDOWN,AC 0366 0012 00473 RETURN 00474 00475 00476 00477 00478 gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 22 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00479 ;current-pos is in section 4 0368 00480 cursecmatrix4 0368 00481 trgc4_0_f 0368 B637 00482 BTFSC regb0,0x03,AC 036A D01A 00483 BRA trgc4_8_f 036C 00484 trgc4_0_7 036C B437 00485 BTFSC regb0,0x02,AC 036E D00E 00486 BRA trgc4_4_7 0370 00487 trgc4_0_3 0370 B237 00488 BTFSC regb0,0x01,AC 0372 D006 00489 BRA trgc4_2_3 0374 00490 trgc4_0_1 0374 B037 00491 BTFSC regb0,0x00,AC 0376 D002 00492 BRA trgc4___1 0378 00493 trgc4___0 00494 ;sector target 0 0378 8C05 00495 BSF work_flags,RUN_LEFTDOWN,AC 037A 0012 00496 RETURN 037C 00497 trgc4___1 00498 ;sector target 1 037C 8C05 00499 BSF work_flags,RUN_LEFTDOWN,AC 037E 0012 00500 RETURN 0380 00501 trgc4_2_3 0380 B037 00502 BTFSC regb0,0x00,AC 0382 D002 00503 BRA trgc4___3 0384 00504 trgc4___2 00505 ;sector target 2 0384 8C05 00506 BSF work_flags,RUN_LEFTDOWN,AC 0386 0012 00507 RETURN 0388 00508 trgc4___3 00509 ;sector target 3 0388 8C05 00510 BSF work_flags,RUN_LEFTDOWN,AC 038A 0012 00511 RETURN 038C 00512 trgc4_4_7 038C B237 00513 BTFSC regb0,0x01,AC 038E D004 00514 BRA trgc4_6_7 0390 00515 trgc4_4_5 0390 B037 00516 BTFSC regb0,0x00,AC 0392 D001 00517 BRA trgc4___5 0394 00518 trgc4___4 00519 ;sector target 4, not reached, set by test_pos 00520 ;BSF work_flags,RUN_LEFTDOWN,AC 0394 0012 00521 RETURN 0396 00522 trgc4___5 00523 ;sector target 5 00524 ;BSF work_flags,RUN_LEFTDOWN,AC 0396 0012 00525 RETURN 0398 00526 trgc4_6_7 0398 B037 00527 BTFSC regb0,0x00,AC 039A D001 00528 BRA trgc4___7 039C 00529 trgc4___6 00530 ;sector target 6 00531 ;BSF work_flags,RUN_LEFTDOWN,AC 039C 0012 00532 RETURN gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 23 LOC OBJECT CODE LINE SOURCE TEXT VALUE 039E 00533 trgc4___7 00534 ;sector target 7 00535 ;BSF work_flags,RUN_LEFTDOWN,AC 039E 0012 00536 RETURN 03A0 00537 trgc4_8_f 03A0 B437 00538 BTFSC regb0,0x02,AC 03A2 D00A 00539 BRA trgc4_c_f 03A4 00540 trgc4_8_b 03A4 B237 00541 BTFSC regb0,0x01,AC 03A6 D004 00542 BRA trgc4_a_b 03A8 00543 trgc4_8_9 03A8 B037 00544 BTFSC regb0,0x00,AC 03AA D001 00545 BRA trgc4___9 03AC 00546 trgc4___8 00547 ;sector target 8 00548 ;BSF work_flags,RUN_LEFTDOWN,AC 03AC 0012 00549 RETURN 03AE 00550 trgc4___9 00551 ;sector target 9 00552 ;BSF work_flags,RUN_LEFTDOWN,AC 03AE 0012 00553 RETURN 03B0 00554 trgc4_a_b 03B0 B037 00555 BTFSC regb0,0x00,AC 03B2 D001 00556 BRA trgc4___b 03B4 00557 trgc4___a 00558 ;sector target 10 00559 ;BSF work_flags,RUN_LEFTDOWN,AC 03B4 0012 00560 RETURN 03B6 00561 trgc4___b 00562 ;sector target 11 00563 ;BSF work_flags,RUN_LEFTDOWN,AC 03B6 0012 00564 RETURN 03B8 00565 trgc4_c_f 03B8 B237 00566 BTFSC regb0,0x01,AC 03BA D005 00567 BRA trgc4_e_f 03BC 00568 trgc4_c_d 03BC B037 00569 BTFSC regb0,0x00,AC 03BE D001 00570 BRA trgc4___d 03C0 00571 trgc4___c 00572 ;sector target 12 00573 ;BSF work_flags,RUN_LEFTDOWN,AC 03C0 0012 00574 RETURN 03C2 00575 trgc4___d 00576 ;sector target 13 03C2 8C05 00577 BSF work_flags,RUN_LEFTDOWN,AC 03C4 0012 00578 RETURN 03C6 00579 trgc4_e_f 03C6 B037 00580 BTFSC regb0,0x00,AC 03C8 D002 00581 BRA trgc4___f 03CA 00582 trgc4___e 00583 ;sector target 14 03CA 8C05 00584 BSF work_flags,RUN_LEFTDOWN,AC 03CC 0012 00585 RETURN 03CE 00586 trgc4___f gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 24 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00587 ;sector target 15 03CE 8C05 00588 BSF work_flags,RUN_LEFTDOWN,AC 03D0 0012 00589 RETURN 00590 00591 00592 00593 00594 00595 ;current-pos is in section 5 03D2 00596 cursecmatrix5 03D2 00597 trgc5_0_f 03D2 B637 00598 BTFSC regb0,0x03,AC 03D4 D01B 00599 BRA trgc5_8_f 03D6 00600 trgc5_0_7 03D6 B437 00601 BTFSC regb0,0x02,AC 03D8 D00E 00602 BRA trgc5_4_7 03DA 00603 trgc5_0_3 03DA B237 00604 BTFSC regb0,0x01,AC 03DC D006 00605 BRA trgc5_2_3 03DE 00606 trgc5_0_1 03DE B037 00607 BTFSC regb0,0x00,AC 03E0 D002 00608 BRA trgc5___1 03E2 00609 trgc5___0 00610 ;sector target 0 03E2 8C05 00611 BSF work_flags,RUN_LEFTDOWN,AC 03E4 0012 00612 RETURN 03E6 00613 trgc5___1 00614 ;sector target 1 03E6 8C05 00615 BSF work_flags,RUN_LEFTDOWN,AC 03E8 0012 00616 RETURN 03EA 00617 trgc5_2_3 03EA B037 00618 BTFSC regb0,0x00,AC 03EC D002 00619 BRA trgc5___3 03EE 00620 trgc5___2 00621 ;sector target 2 03EE 8C05 00622 BSF work_flags,RUN_LEFTDOWN,AC 03F0 0012 00623 RETURN 03F2 00624 trgc5___3 00625 ;sector target 3 03F2 8C05 00626 BSF work_flags,RUN_LEFTDOWN,AC 03F4 0012 00627 RETURN 03F6 00628 trgc5_4_7 03F6 B237 00629 BTFSC regb0,0x01,AC 03F8 D005 00630 BRA trgc5_6_7 03FA 00631 trgc5_4_5 03FA B037 00632 BTFSC regb0,0x00,AC 03FC D002 00633 BRA trgc5___5 03FE 00634 trgc5___4 00635 ;sector target 4 03FE 8C05 00636 BSF work_flags,RUN_LEFTDOWN,AC 0400 0012 00637 RETURN 0402 00638 trgc5___5 00639 ;sector target 5, never reached 00640 ;BSF work_flags,RUN_LEFTDOWN,AC gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 25 LOC OBJECT CODE LINE SOURCE TEXT VALUE 0402 0012 00641 RETURN 0404 00642 trgc5_6_7 0404 B037 00643 BTFSC regb0,0x00,AC 0406 D001 00644 BRA trgc5___7 0408 00645 trgc5___6 00646 ;sector target 6 00647 ;BSF work_flags,RUN_LEFTDOWN,AC 0408 0012 00648 RETURN 040A 00649 trgc5___7 00650 ;sector target 7 00651 ;BSF work_flags,RUN_LEFTDOWN,AC 040A 0012 00652 RETURN 040C 00653 trgc5_8_f 040C B437 00654 BTFSC regb0,0x02,AC 040E D00A 00655 BRA trgc5_c_f 0410 00656 trgc5_8_b 0410 B237 00657 BTFSC regb0,0x01,AC 0412 D004 00658 BRA trgc5_a_b 0414 00659 trgc5_8_9 0414 B037 00660 BTFSC regb0,0x00,AC 0416 D001 00661 BRA trgc5___9 0418 00662 trgc5___8 00663 ;sector target 8 00664 ;BSF work_flags,RUN_LEFTDOWN,AC 0418 0012 00665 RETURN 041A 00666 trgc5___9 00667 ;sector target 9 00668 ;BSF work_flags,RUN_LEFTDOWN,AC 041A 0012 00669 RETURN 041C 00670 trgc5_a_b 041C B037 00671 BTFSC regb0,0x00,AC 041E D001 00672 BRA trgc5___b 0420 00673 trgc5___a 00674 ;sector target 10 00675 ;BSF work_flags,RUN_LEFTDOWN,AC 0420 0012 00676 RETURN 0422 00677 trgc5___b 00678 ;sector target 11 00679 ;BSF work_flags,RUN_LEFTDOWN,AC 0422 0012 00680 RETURN 0424 00681 trgc5_c_f 0424 B237 00682 BTFSC regb0,0x01,AC 0426 D004 00683 BRA trgc5_e_f 0428 00684 trgc5_c_d 0428 B037 00685 BTFSC regb0,0x00,AC 042A D001 00686 BRA trgc5___d 042C 00687 trgc5___c 00688 ;sector target 12 00689 ;BSF work_flags,RUN_LEFTDOWN,AC 042C 0012 00690 RETURN 042E 00691 trgc5___d 00692 ;sector target 13 00693 ;BSF work_flags,RUN_LEFTDOWN,AC 042E 0012 00694 RETURN gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 26 LOC OBJECT CODE LINE SOURCE TEXT VALUE 0430 00695 trgc5_e_f 0430 B037 00696 BTFSC regb0,0x00,AC 0432 D002 00697 BRA trgc5___f 0434 00698 trgc5___e 00699 ;sector target 14 0434 8C05 00700 BSF work_flags,RUN_LEFTDOWN,AC 0436 0012 00701 RETURN 0438 00702 trgc5___f 00703 ;sector target 15 0438 8C05 00704 BSF work_flags,RUN_LEFTDOWN,AC 043A 0012 00705 RETURN 00706 00707 00708 00709 00710 00711 ;current-pos is in section 8 043C 00712 cursecmatrix6 043C 00713 trgc6_0_f 043C B637 00714 BTFSC regb0,0x03,AC 043E D01C 00715 BRA trgc6_8_f 0440 00716 trgc6_0_7 0440 B437 00717 BTFSC regb0,0x02,AC 0442 D00E 00718 BRA trgc6_4_7 0444 00719 trgc6_0_3 0444 B237 00720 BTFSC regb0,0x01,AC 0446 D006 00721 BRA trgc6_2_3 0448 00722 trgc6_0_1 0448 B037 00723 BTFSC regb0,0x00,AC 044A D002 00724 BRA trgc6___1 044C 00725 trgc6___0 00726 ;sector target 0 044C 8C05 00727 BSF work_flags,RUN_LEFTDOWN,AC 044E 0012 00728 RETURN 0450 00729 trgc6___1 00730 ;sector target 1 0450 8C05 00731 BSF work_flags,RUN_LEFTDOWN,AC 0452 0012 00732 RETURN 0454 00733 trgc6_2_3 0454 B037 00734 BTFSC regb0,0x00,AC 0456 D002 00735 BRA trgc6___3 0458 00736 trgc6___2 00737 ;sector target 2 0458 8C05 00738 BSF work_flags,RUN_LEFTDOWN,AC 045A 0012 00739 RETURN 045C 00740 trgc6___3 00741 ;sector target 3 045C 8C05 00742 BSF work_flags,RUN_LEFTDOWN,AC 045E 0012 00743 RETURN 0460 00744 trgc6_4_7 0460 B237 00745 BTFSC regb0,0x01,AC 0462 D006 00746 BRA trgc6_6_7 0464 00747 trgc6_4_5 0464 B037 00748 BTFSC regb0,0x00,AC gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 27 LOC OBJECT CODE LINE SOURCE TEXT VALUE 0466 D002 00749 BRA trgc6___5 0468 00750 trgc6___4 00751 ;sector target 4 0468 8C05 00752 BSF work_flags,RUN_LEFTDOWN,AC 046A 0012 00753 RETURN 046C 00754 trgc6___5 00755 ;sector target 5 046C 8C05 00756 BSF work_flags,RUN_LEFTDOWN,AC 046E 0012 00757 RETURN 0470 00758 trgc6_6_7 0470 B037 00759 BTFSC regb0,0x00,AC 0472 D001 00760 BRA trgc6___7 0474 00761 trgc6___6 00762 ;sector target 6, never reached 00763 ;BSF work_flags,RUN_LEFTDOWN,AC 0474 0012 00764 RETURN 0476 00765 trgc6___7 00766 ;sector target 7 00767 ;BSF work_flags,RUN_LEFTDOWN,AC 0476 0012 00768 RETURN 0478 00769 trgc6_8_f 0478 B437 00770 BTFSC regb0,0x02,AC 047A D00A 00771 BRA trgc6_c_f 047C 00772 trgc6_8_b 047C B237 00773 BTFSC regb0,0x01,AC 047E D004 00774 BRA trgc6_a_b 0480 00775 trgc6_8_9 0480 B037 00776 BTFSC regb0,0x00,AC 0482 D001 00777 BRA trgc6___9 0484 00778 trgc6___8 00779 ;sector target 8 00780 ;BSF work_flags,RUN_LEFTDOWN,AC 0484 0012 00781 RETURN 0486 00782 trgc6___9 00783 ;sector target 9 00784 ;BSF work_flags,RUN_LEFTDOWN,AC 0486 0012 00785 RETURN 0488 00786 trgc6_a_b 0488 B037 00787 BTFSC regb0,0x00,AC 048A D001 00788 BRA trgc6___b 048C 00789 trgc6___a 00790 ;sector target 10 00791 ;BSF work_flags,RUN_LEFTDOWN,AC 048C 0012 00792 RETURN 048E 00793 trgc6___b 00794 ;sector target 11 00795 ;BSF work_flags,RUN_LEFTDOWN,AC 048E 0012 00796 RETURN 0490 00797 trgc6_c_f 0490 B237 00798 BTFSC regb0,0x01,AC 0492 D004 00799 BRA trgc6_e_f 0494 00800 trgc6_c_d 0494 B037 00801 BTFSC regb0,0x00,AC 0496 D001 00802 BRA trgc6___d gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 28 LOC OBJECT CODE LINE SOURCE TEXT VALUE 0498 00803 trgc6___c 00804 ;sector target 12 00805 ;BSF work_flags,RUN_LEFTDOWN,AC 0498 0012 00806 RETURN 049A 00807 trgc6___d 00808 ;sector target 13 00809 ;BSF work_flags,RUN_LEFTDOWN,AC 049A 0012 00810 RETURN 049C 00811 trgc6_e_f 049C B037 00812 BTFSC regb0,0x00,AC 049E D001 00813 BRA trgc6___f 04A0 00814 trgc6___e 00815 ;sector target 14 00816 ;BSF work_flags,RUN_LEFTDOWN,AC 04A0 0012 00817 RETURN 04A2 00818 trgc6___f 00819 ;sector target 15 04A2 8C05 00820 BSF work_flags,RUN_LEFTDOWN,AC 04A4 0012 00821 RETURN 00822 00823 00824 00825 00826 00827 ;current-pos is in section 7 04A6 00828 cursecmatrix7 04A6 00829 trgc7_0_f 04A6 B637 00830 BTFSC regb0,0x03,AC 04A8 D01D 00831 BRA trgc7_8_f 04AA 00832 trgc7_0_7 04AA B437 00833 BTFSC regb0,0x02,AC 04AC D00E 00834 BRA trgc7_4_7 04AE 00835 trgc7_0_3 04AE B237 00836 BTFSC regb0,0x01,AC 04B0 D006 00837 BRA trgc7_2_3 04B2 00838 trgc7_0_1 04B2 B037 00839 BTFSC regb0,0x00,AC 04B4 D002 00840 BRA trgc7___1 04B6 00841 trgc7___0 00842 ;sector target 0 04B6 8C05 00843 BSF work_flags,RUN_LEFTDOWN,AC 04B8 0012 00844 RETURN 04BA 00845 trgc7___1 00846 ;sector target 1 04BA 8C05 00847 BSF work_flags,RUN_LEFTDOWN,AC 04BC 0012 00848 RETURN 04BE 00849 trgc7_2_3 04BE B037 00850 BTFSC regb0,0x00,AC 04C0 D002 00851 BRA trgc7___3 04C2 00852 trgc7___2 00853 ;sector target 2 04C2 8C05 00854 BSF work_flags,RUN_LEFTDOWN,AC 04C4 0012 00855 RETURN 04C6 00856 trgc7___3 gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 29 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00857 ;sector target 3 04C6 8C05 00858 BSF work_flags,RUN_LEFTDOWN,AC 04C8 0012 00859 RETURN 04CA 00860 trgc7_4_7 04CA B237 00861 BTFSC regb0,0x01,AC 04CC D006 00862 BRA trgc7_6_7 04CE 00863 trgc7_4_5 04CE B037 00864 BTFSC regb0,0x00,AC 04D0 D002 00865 BRA trgc7___5 04D2 00866 trgc7___4 00867 ;sector target 4 04D2 8C05 00868 BSF work_flags,RUN_LEFTDOWN,AC 04D4 0012 00869 RETURN 04D6 00870 trgc7___5 00871 ;sector target 5 04D6 8C05 00872 BSF work_flags,RUN_LEFTDOWN,AC 04D8 0012 00873 RETURN 04DA 00874 trgc7_6_7 04DA B037 00875 BTFSC regb0,0x00,AC 04DC D002 00876 BRA trgc7___7 04DE 00877 trgc7___6 00878 ;sector target 6 04DE 8C05 00879 BSF work_flags,RUN_LEFTDOWN,AC 04E0 0012 00880 RETURN 04E2 00881 trgc7___7 00882 ;sector target 7, never reached 00883 ;BSF work_flags,RUN_LEFTDOWN,AC 04E2 0012 00884 RETURN 04E4 00885 trgc7_8_f 04E4 B437 00886 BTFSC regb0,0x02,AC 04E6 D00A 00887 BRA trgc7_c_f 04E8 00888 trgc7_8_b 04E8 B237 00889 BTFSC regb0,0x01,AC 04EA D004 00890 BRA trgc7_a_b 04EC 00891 trgc7_8_9 04EC B037 00892 BTFSC regb0,0x00,AC 04EE D001 00893 BRA trgc7___9 04F0 00894 trgc7___8 00895 ;sector target 8 00896 ;BSF work_flags,RUN_LEFTDOWN,AC 04F0 0012 00897 RETURN 04F2 00898 trgc7___9 00899 ;sector target 9 00900 ;BSF work_flags,RUN_LEFTDOWN,AC 04F2 0012 00901 RETURN 04F4 00902 trgc7_a_b 04F4 B037 00903 BTFSC regb0,0x00,AC 04F6 D001 00904 BRA trgc7___b 04F8 00905 trgc7___a 00906 ;sector target 10 00907 ;BSF work_flags,RUN_LEFTDOWN,AC 04F8 0012 00908 RETURN 04FA 00909 trgc7___b 00910 ;sector target 11 gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 30 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00911 ;BSF work_flags,RUN_LEFTDOWN,AC 04FA 0012 00912 RETURN 04FC 00913 trgc7_c_f 04FC B237 00914 BTFSC regb0,0x01,AC 04FE D004 00915 BRA trgc7_e_f 0500 00916 trgc7_c_d 0500 B037 00917 BTFSC regb0,0x00,AC 0502 D001 00918 BRA trgc7___d 0504 00919 trgc7___c 00920 ;sector target 12 00921 ;BSF work_flags,RUN_LEFTDOWN,AC 0504 0012 00922 RETURN 0506 00923 trgc7___d 00924 ;sector target 13 00925 ;BSF work_flags,RUN_LEFTDOWN,AC 0506 0012 00926 RETURN 0508 00927 trgc7_e_f 0508 B037 00928 BTFSC regb0,0x00,AC 050A D001 00929 BRA trgc7___f 050C 00930 trgc7___e 00931 ;sector target 14 00932 ;BSF work_flags,RUN_LEFTDOWN,AC 050C 0012 00933 RETURN 050E 00934 trgc7___f 00935 ;sector target 15 00936 ;BSF work_flags,RUN_LEFTDOWN,AC 050E 0012 00937 RETURN 00938 00939 00940 00941 00942 00943 ;current-pos is in section 8 0510 00944 cursecmatrix8 0510 00945 trgc8_0_f 0510 B637 00946 BTFSC regb0,0x03,AC 0512 D01D 00947 BRA trgc8_8_f 0514 00948 trgc8_0_7 0514 B437 00949 BTFSC regb0,0x02,AC 0516 D00D 00950 BRA trgc8_4_7 0518 00951 trgc8_0_3 0518 B237 00952 BTFSC regb0,0x01,AC 051A D005 00953 BRA trgc8_2_3 051C 00954 trgc8_0_1 051C B037 00955 BTFSC regb0,0x00,AC 051E D001 00956 BRA trgc8___1 0520 00957 trgc8___0 00958 ;sector target 0 00959 ;BSF work_flags,RUN_LEFTDOWN,AC 0520 0012 00960 RETURN 0522 00961 trgc8___1 00962 ;sector target 1 0522 8C05 00963 BSF work_flags,RUN_LEFTDOWN,AC 0524 0012 00964 RETURN gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 31 LOC OBJECT CODE LINE SOURCE TEXT VALUE 0526 00965 trgc8_2_3 0526 B037 00966 BTFSC regb0,0x00,AC 0528 D002 00967 BRA trgc8___3 052A 00968 trgc8___2 00969 ;sector target 2 052A 8C05 00970 BSF work_flags,RUN_LEFTDOWN,AC 052C 0012 00971 RETURN 052E 00972 trgc8___3 00973 ;sector target 3 052E 8C05 00974 BSF work_flags,RUN_LEFTDOWN,AC 0530 0012 00975 RETURN 0532 00976 trgc8_4_7 0532 B237 00977 BTFSC regb0,0x01,AC 0534 D006 00978 BRA trgc8_6_7 0536 00979 trgc8_4_5 0536 B037 00980 BTFSC regb0,0x00,AC 0538 D002 00981 BRA trgc8___5 053A 00982 trgc8___4 00983 ;sector target 4 053A 8C05 00984 BSF work_flags,RUN_LEFTDOWN,AC 053C 0012 00985 RETURN 053E 00986 trgc8___5 00987 ;sector target 5 053E 8C05 00988 BSF work_flags,RUN_LEFTDOWN,AC 0540 0012 00989 RETURN 0542 00990 trgc8_6_7 0542 B037 00991 BTFSC regb0,0x00,AC 0544 D002 00992 BRA trgc8___7 0546 00993 trgc8___6 00994 ;sector target 6 0546 8C05 00995 BSF work_flags,RUN_LEFTDOWN,AC 0548 0012 00996 RETURN 054A 00997 trgc8___7 00998 ;sector target 7 054A 8C05 00999 BSF work_flags,RUN_LEFTDOWN,AC 054C 0012 01000 RETURN 054E 01001 trgc8_8_f 054E B437 01002 BTFSC regb0,0x02,AC 0550 D00A 01003 BRA trgc8_c_f 0552 01004 trgc8_8_b 0552 B237 01005 BTFSC regb0,0x01,AC 0554 D004 01006 BRA trgc8_a_b 0556 01007 trgc8_8_9 0556 B037 01008 BTFSC regb0,0x00,AC 0558 D001 01009 BRA trgc8___9 055A 01010 trgc8___8 01011 ;sector target 8, never reached 01012 ;BSF work_flags,RUN_LEFTDOWN,AC 055A 0012 01013 RETURN 055C 01014 trgc8___9 01015 ;sector target 9 01016 ;BSF work_flags,RUN_LEFTDOWN,AC 055C 0012 01017 RETURN 055E 01018 trgc8_a_b gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 32 LOC OBJECT CODE LINE SOURCE TEXT VALUE 055E B037 01019 BTFSC regb0,0x00,AC 0560 D001 01020 BRA trgc8___b 0562 01021 trgc8___a 01022 ;sector target 10 01023 ;BSF work_flags,RUN_LEFTDOWN,AC 0562 0012 01024 RETURN 0564 01025 trgc8___b 01026 ;sector target 11 01027 ;BSF work_flags,RUN_LEFTDOWN,AC 0564 0012 01028 RETURN 0566 01029 trgc8_c_f 0566 B237 01030 BTFSC regb0,0x01,AC 0568 D004 01031 BRA trgc8_e_f 056A 01032 trgc8_c_d 056A B037 01033 BTFSC regb0,0x00,AC 056C D001 01034 BRA trgc8___d 056E 01035 trgc8___c 01036 ;sector target 12 01037 ;BSF work_flags,RUN_LEFTDOWN,AC 056E 0012 01038 RETURN 0570 01039 trgc8___d 01040 ;sector target 13 01041 ;BSF work_flags,RUN_LEFTDOWN,AC 0570 0012 01042 RETURN 0572 01043 trgc8_e_f 0572 B037 01044 BTFSC regb0,0x00,AC 0574 D001 01045 BRA trgc8___f 0576 01046 trgc8___e 01047 ;sector target 14 01048 ;BSF work_flags,RUN_LEFTDOWN,AC 0576 0012 01049 RETURN 0578 01050 trgc8___f 01051 ;sector target 15 01052 ;BSF work_flags,RUN_LEFTDOWN,AC 0578 0012 01053 RETURN 01054 01055 01056 01057 01058 01059 ;current-pos is in section 9 057A 01060 cursecmatrix9 057A 01061 trgc9_0_f 057A B637 01062 BTFSC regb0,0x03,AC 057C D01C 01063 BRA trgc9_8_f 057E 01064 trgc9_0_7 057E B437 01065 BTFSC regb0,0x02,AC 0580 D00C 01066 BRA trgc9_4_7 0582 01067 trgc9_0_3 0582 B237 01068 BTFSC regb0,0x01,AC 0584 D004 01069 BRA trgc9_2_3 0586 01070 trgc9_0_1 0586 B037 01071 BTFSC regb0,0x00,AC 0588 D001 01072 BRA trgc9___1 gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 33 LOC OBJECT CODE LINE SOURCE TEXT VALUE 058A 01073 trgc9___0 01074 ;sector target 0 01075 ;BSF work_flags,RUN_LEFTDOWN,AC 058A 0012 01076 RETURN 058C 01077 trgc9___1 01078 ;sector target 1 01079 ;BSF work_flags,RUN_LEFTDOWN,AC 058C 0012 01080 RETURN 058E 01081 trgc9_2_3 058E B037 01082 BTFSC regb0,0x00,AC 0590 D002 01083 BRA trgc9___3 0592 01084 trgc9___2 01085 ;sector target 2 0592 8C05 01086 BSF work_flags,RUN_LEFTDOWN,AC 0594 0012 01087 RETURN 0596 01088 trgc9___3 01089 ;sector target 3 0596 8C05 01090 BSF work_flags,RUN_LEFTDOWN,AC 0598 0012 01091 RETURN 059A 01092 trgc9_4_7 059A B237 01093 BTFSC regb0,0x01,AC 059C D006 01094 BRA trgc9_6_7 059E 01095 trgc9_4_5 059E B037 01096 BTFSC regb0,0x00,AC 05A0 D002 01097 BRA trgc9___5 05A2 01098 trgc9___4 01099 ;sector target 4 05A2 8C05 01100 BSF work_flags,RUN_LEFTDOWN,AC 05A4 0012 01101 RETURN 05A6 01102 trgc9___5 01103 ;sector target 5 05A6 8C05 01104 BSF work_flags,RUN_LEFTDOWN,AC 05A8 0012 01105 RETURN 05AA 01106 trgc9_6_7 05AA B037 01107 BTFSC regb0,0x00,AC 05AC D002 01108 BRA trgc9___7 05AE 01109 trgc9___6 01110 ;sector target 6 05AE 8C05 01111 BSF work_flags,RUN_LEFTDOWN,AC 05B0 0012 01112 RETURN 05B2 01113 trgc9___7 01114 ;sector target 7 05B2 8C05 01115 BSF work_flags,RUN_LEFTDOWN,AC 05B4 0012 01116 RETURN 05B6 01117 trgc9_8_f 05B6 B437 01118 BTFSC regb0,0x02,AC 05B8 D00B 01119 BRA trgc9_c_f 05BA 01120 trgc9_8_b 05BA B237 01121 BTFSC regb0,0x01,AC 05BC D005 01122 BRA trgc9_a_b 05BE 01123 trgc9_8_9 05BE B037 01124 BTFSC regb0,0x00,AC 05C0 D002 01125 BRA trgc9___9 05C2 01126 trgc9___8 gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 34 LOC OBJECT CODE LINE SOURCE TEXT VALUE 01127 ;sector target 8 05C2 8C05 01128 BSF work_flags,RUN_LEFTDOWN,AC 05C4 0012 01129 RETURN 05C6 01130 trgc9___9 01131 ;sector target 9, never reached 01132 ;BSF work_flags,RUN_LEFTDOWN,AC 05C6 0012 01133 RETURN 05C8 01134 trgc9_a_b 05C8 B037 01135 BTFSC regb0,0x00,AC 05CA D001 01136 BRA trgc9___b 05CC 01137 trgc9___a 01138 ;sector target 10 01139 ;BSF work_flags,RUN_LEFTDOWN,AC 05CC 0012 01140 RETURN 05CE 01141 trgc9___b 01142 ;sector target 11 01143 ;BSF work_flags,RUN_LEFTDOWN,AC 05CE 0012 01144 RETURN 05D0 01145 trgc9_c_f 05D0 B237 01146 BTFSC regb0,0x01,AC 05D2 D004 01147 BRA trgc9_e_f 05D4 01148 trgc9_c_d 05D4 B037 01149 BTFSC regb0,0x00,AC 05D6 D001 01150 BRA trgc9___d 05D8 01151 trgc9___c 01152 ;sector target 12 01153 ;BSF work_flags,RUN_LEFTDOWN,AC 05D8 0012 01154 RETURN 05DA 01155 trgc9___d 01156 ;sector target 13 01157 ;BSF work_flags,RUN_LEFTDOWN,AC 05DA 0012 01158 RETURN 05DC 01159 trgc9_e_f 05DC B037 01160 BTFSC regb0,0x00,AC 05DE D001 01161 BRA trgc9___f 05E0 01162 trgc9___e 01163 ;sector target 14 01164 ;BSF work_flags,RUN_LEFTDOWN,AC 05E0 0012 01165 RETURN 05E2 01166 trgc9___f 01167 ;sector target 15 01168 ;BSF work_flags,RUN_LEFTDOWN,AC 05E2 0012 01169 RETURN 01170 01171 01172 01173 01174 01175 ;current-pos is in section 10 05E4 01176 cursecmatrixa 05E4 01177 trgca_0_f 05E4 B637 01178 BTFSC regb0,0x03,AC 05E6 D01B 01179 BRA trgca_8_f 05E8 01180 trgca_0_7 gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 35 LOC OBJECT CODE LINE SOURCE TEXT VALUE 05E8 B437 01181 BTFSC regb0,0x02,AC 05EA D00B 01182 BRA trgca_4_7 05EC 01183 trgca_0_3 05EC B237 01184 BTFSC regb0,0x01,AC 05EE D004 01185 BRA trgca_2_3 05F0 01186 trgca_0_1 05F0 B037 01187 BTFSC regb0,0x00,AC 05F2 D001 01188 BRA trgca___1 05F4 01189 trgca___0 01190 ;sector target 0 01191 ;BSF work_flags,RUN_LEFTDOWN,AC 05F4 0012 01192 RETURN 05F6 01193 trgca___1 01194 ;sector target 1 01195 ;BSF work_flags,RUN_LEFTDOWN,AC 05F6 0012 01196 RETURN 05F8 01197 trgca_2_3 05F8 B037 01198 BTFSC regb0,0x00,AC 05FA D001 01199 BRA trgca___3 05FC 01200 trgca___2 01201 ;sector target 2 01202 ;BSF work_flags,RUN_LEFTDOWN,AC 05FC 0012 01203 RETURN 05FE 01204 trgca___3 01205 ;sector target 3 05FE 8C05 01206 BSF work_flags,RUN_LEFTDOWN,AC 0600 0012 01207 RETURN 0602 01208 trgca_4_7 0602 B237 01209 BTFSC regb0,0x01,AC 0604 D006 01210 BRA trgca_6_7 0606 01211 trgca_4_5 0606 B037 01212 BTFSC regb0,0x00,AC 0608 D002 01213 BRA trgca___5 060A 01214 trgca___4 01215 ;sector target 4 060A 8C05 01216 BSF work_flags,RUN_LEFTDOWN,AC 060C 0012 01217 RETURN 060E 01218 trgca___5 01219 ;sector target 5 060E 8C05 01220 BSF work_flags,RUN_LEFTDOWN,AC 0610 0012 01221 RETURN 0612 01222 trgca_6_7 0612 B037 01223 BTFSC regb0,0x00,AC 0614 D002 01224 BRA trgca___7 0616 01225 trgca___6 01226 ;sector target 6 0616 8C05 01227 BSF work_flags,RUN_LEFTDOWN,AC 0618 0012 01228 RETURN 061A 01229 trgca___7 01230 ;sector target 7 061A 8C05 01231 BSF work_flags,RUN_LEFTDOWN,AC 061C 0012 01232 RETURN 061E 01233 trgca_8_f 061E B437 01234 BTFSC regb0,0x02,AC gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 36 LOC OBJECT CODE LINE SOURCE TEXT VALUE 0620 D00C 01235 BRA trgca_c_f 0622 01236 trgca_8_b 0622 B237 01237 BTFSC regb0,0x01,AC 0624 D006 01238 BRA trgca_a_b 0626 01239 trgca_8_9 0626 B037 01240 BTFSC regb0,0x00,AC 0628 D002 01241 BRA trgca___9 062A 01242 trgca___8 01243 ;sector target 8 062A 8C05 01244 BSF work_flags,RUN_LEFTDOWN,AC 062C 0012 01245 RETURN 062E 01246 trgca___9 01247 ;sector target 9 062E 8C05 01248 BSF work_flags,RUN_LEFTDOWN,AC 0630 0012 01249 RETURN 0632 01250 trgca_a_b 0632 B037 01251 BTFSC regb0,0x00,AC 0634 D001 01252 BRA trgca___b 0636 01253 trgca___a 01254 ;sector target 10, never reached 01255 ;BSF work_flags,RUN_LEFTDOWN,AC 0636 0012 01256 RETURN 0638 01257 trgca___b 01258 ;sector target 11 01259 ;BSF work_flags,RUN_LEFTDOWN,AC 0638 0012 01260 RETURN 063A 01261 trgca_c_f 063A B237 01262 BTFSC regb0,0x01,AC 063C D004 01263 BRA trgca_e_f 063E 01264 trgca_c_d 063E B037 01265 BTFSC regb0,0x00,AC 0640 D001 01266 BRA trgca___d 0642 01267 trgca___c 01268 ;sector target 12 01269 ;BSF work_flags,RUN_LEFTDOWN,AC 0642 0012 01270 RETURN 0644 01271 trgca___d 01272 ;sector target 13 01273 ;BSF work_flags,RUN_LEFTDOWN,AC 0644 0012 01274 RETURN 0646 01275 trgca_e_f 0646 B037 01276 BTFSC regb0,0x00,AC 0648 D001 01277 BRA trgca___f 064A 01278 trgca___e 01279 ;sector target 14 01280 ;BSF work_flags,RUN_LEFTDOWN,AC 064A 0012 01281 RETURN 064C 01282 trgca___f 01283 ;sector target 15 01284 ;BSF work_flags,RUN_LEFTDOWN,AC 064C 0012 01285 RETURN 01286 01287 01288 gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 37 LOC OBJECT CODE LINE SOURCE TEXT VALUE 01289 01290 01291 ;current-pos is in section 11 064E 01292 cursecmatrixb 064E 01293 trgcb_0_f 064E B637 01294 BTFSC regb0,0x03,AC 0650 D01A 01295 BRA trgcb_8_f 0652 01296 trgcb_0_7 0652 B437 01297 BTFSC regb0,0x02,AC 0654 D00A 01298 BRA trgcb_4_7 0656 01299 trgcb_0_3 0656 B237 01300 BTFSC regb0,0x01,AC 0658 D004 01301 BRA trgcb_2_3 065A 01302 trgcb_0_1 065A B037 01303 BTFSC regb0,0x00,AC 065C D001 01304 BRA trgcb___1 065E 01305 trgcb___0 01306 ;sector target 0 01307 ;BSF work_flags,RUN_LEFTDOWN,AC 065E 0012 01308 RETURN 0660 01309 trgcb___1 01310 ;sector target 1 01311 ;BSF work_flags,RUN_LEFTDOWN,AC 0660 0012 01312 RETURN 0662 01313 trgcb_2_3 0662 B037 01314 BTFSC regb0,0x00,AC 0664 D001 01315 BRA trgcb___3 0666 01316 trgcb___2 01317 ;sector target 2 01318 ;BSF work_flags,RUN_LEFTDOWN,AC 0666 0012 01319 RETURN 0668 01320 trgcb___3 01321 ;sector target 3 01322 ;BSF work_flags,RUN_LEFTDOWN,AC 0668 0012 01323 RETURN 066A 01324 trgcb_4_7 066A B237 01325 BTFSC regb0,0x01,AC 066C D006 01326 BRA trgcb_6_7 066E 01327 trgcb_4_5 066E B037 01328 BTFSC regb0,0x00,AC 0670 D002 01329 BRA trgcb___5 0672 01330 trgcb___4 01331 ;sector target 4 0672 8C05 01332 BSF work_flags,RUN_LEFTDOWN,AC 0674 0012 01333 RETURN 0676 01334 trgcb___5 01335 ;sector target 5 0676 8C05 01336 BSF work_flags,RUN_LEFTDOWN,AC 0678 0012 01337 RETURN 067A 01338 trgcb_6_7 067A B037 01339 BTFSC regb0,0x00,AC 067C D002 01340 BRA trgcb___7 067E 01341 trgcb___6 01342 ;sector target 6 gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 38 LOC OBJECT CODE LINE SOURCE TEXT VALUE 067E 8C05 01343 BSF work_flags,RUN_LEFTDOWN,AC 0680 0012 01344 RETURN 0682 01345 trgcb___7 01346 ;sector target 7 0682 8C05 01347 BSF work_flags,RUN_LEFTDOWN,AC 0684 0012 01348 RETURN 0686 01349 trgcb_8_f 0686 B437 01350 BTFSC regb0,0x02,AC 0688 D00D 01351 BRA trgcb_c_f 068A 01352 trgcb_8_b 068A B237 01353 BTFSC regb0,0x01,AC 068C D006 01354 BRA trgcb_a_b 068E 01355 trgcb_8_9 068E B037 01356 BTFSC regb0,0x00,AC 0690 D002 01357 BRA trgcb___9 0692 01358 trgcb___8 01359 ;sector target 8 0692 8C05 01360 BSF work_flags,RUN_LEFTDOWN,AC 0694 0012 01361 RETURN 0696 01362 trgcb___9 01363 ;sector target 9 0696 8C05 01364 BSF work_flags,RUN_LEFTDOWN,AC 0698 0012 01365 RETURN 069A 01366 trgcb_a_b 069A B037 01367 BTFSC regb0,0x00,AC 069C D002 01368 BRA trgcb___b 069E 01369 trgcb___a 01370 ;sector target 10 069E 8C05 01371 BSF work_flags,RUN_LEFTDOWN,AC 06A0 0012 01372 RETURN 06A2 01373 trgcb___b 01374 ;sector target 11, never reached 01375 ;BSF work_flags,RUN_LEFTDOWN,AC 06A2 0012 01376 RETURN 06A4 01377 trgcb_c_f 06A4 B237 01378 BTFSC regb0,0x01,AC 06A6 D004 01379 BRA trgcb_e_f 06A8 01380 trgcb_c_d 06A8 B037 01381 BTFSC regb0,0x00,AC 06AA D001 01382 BRA trgcb___d 06AC 01383 trgcb___c 01384 ;sector target 12 01385 ;BSF work_flags,RUN_LEFTDOWN,AC 06AC 0012 01386 RETURN 06AE 01387 trgcb___d 01388 ;sector target 13 01389 ;BSF work_flags,RUN_LEFTDOWN,AC 06AE 0012 01390 RETURN 06B0 01391 trgcb_e_f 06B0 B037 01392 BTFSC regb0,0x00,AC 06B2 D001 01393 BRA trgcb___f 06B4 01394 trgcb___e 01395 ;sector target 14 01396 ;BSF work_flags,RUN_LEFTDOWN,AC gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 39 LOC OBJECT CODE LINE SOURCE TEXT VALUE 06B4 0012 01397 RETURN 06B6 01398 trgcb___f 01399 ;sector target 15 01400 ;BSF work_flags,RUN_LEFTDOWN,AC 06B6 0012 01401 RETURN 01402 01403 01404 01405 01406 01407 ;current-pos is in section 12 06B8 01408 cursecmatrixc 06B8 01409 trgcc_0_f 06B8 B637 01410 BTFSC regb0,0x03,AC 06BA D019 01411 BRA trgcc_8_f 06BC 01412 trgcc_0_7 06BC B437 01413 BTFSC regb0,0x02,AC 06BE D00A 01414 BRA trgcc_4_7 06C0 01415 trgcc_0_3 06C0 B237 01416 BTFSC regb0,0x01,AC 06C2 D004 01417 BRA trgcc_2_3 06C4 01418 trgcc_0_1 06C4 B037 01419 BTFSC regb0,0x00,AC 06C6 D001 01420 BRA trgcc___1 06C8 01421 trgcc___0 01422 ;sector target 0 01423 ;BSF work_flags,RUN_LEFTDOWN,AC 06C8 0012 01424 RETURN 06CA 01425 trgcc___1 01426 ;sector target 1 01427 ;BSF work_flags,RUN_LEFTDOWN,AC 06CA 0012 01428 RETURN 06CC 01429 trgcc_2_3 06CC B037 01430 BTFSC regb0,0x00,AC 06CE D001 01431 BRA trgcc___3 06D0 01432 trgcc___2 01433 ;sector target 2 01434 ;BSF work_flags,RUN_LEFTDOWN,AC 06D0 0012 01435 RETURN 06D2 01436 trgcc___3 01437 ;sector target 3 01438 ;BSF work_flags,RUN_LEFTDOWN,AC 06D2 0012 01439 RETURN 06D4 01440 trgcc_4_7 06D4 B237 01441 BTFSC regb0,0x01,AC 06D6 D005 01442 BRA trgcc_6_7 06D8 01443 trgcc_4_5 06D8 B037 01444 BTFSC regb0,0x00,AC 06DA D001 01445 BRA trgcc___5 06DC 01446 trgcc___4 01447 ;sector target 4 01448 ;BSF work_flags,RUN_LEFTDOWN,AC 06DC 0012 01449 RETURN 06DE 01450 trgcc___5 gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 40 LOC OBJECT CODE LINE SOURCE TEXT VALUE 01451 ;sector target 5 06DE 8C05 01452 BSF work_flags,RUN_LEFTDOWN,AC 06E0 0012 01453 RETURN 06E2 01454 trgcc_6_7 06E2 B037 01455 BTFSC regb0,0x00,AC 06E4 D002 01456 BRA trgcc___7 06E6 01457 trgcc___6 01458 ;sector target 6 06E6 8C05 01459 BSF work_flags,RUN_LEFTDOWN,AC 06E8 0012 01460 RETURN 06EA 01461 trgcc___7 01462 ;sector target 7 06EA 8C05 01463 BSF work_flags,RUN_LEFTDOWN,AC 06EC 0012 01464 RETURN 06EE 01465 trgcc_8_f 06EE B437 01466 BTFSC regb0,0x02,AC 06F0 D00E 01467 BRA trgcc_c_f 06F2 01468 trgcc_8_b 06F2 B237 01469 BTFSC regb0,0x01,AC 06F4 D006 01470 BRA trgcc_a_b 06F6 01471 trgcc_8_9 06F6 B037 01472 BTFSC regb0,0x00,AC 06F8 D002 01473 BRA trgcc___9 06FA 01474 trgcc___8 01475 ;sector target 8 06FA 8C05 01476 BSF work_flags,RUN_LEFTDOWN,AC 06FC 0012 01477 RETURN 06FE 01478 trgcc___9 01479 ;sector target 9 06FE 8C05 01480 BSF work_flags,RUN_LEFTDOWN,AC 0700 0012 01481 RETURN 0702 01482 trgcc_a_b 0702 B037 01483 BTFSC regb0,0x00,AC 0704 D002 01484 BRA trgcc___b 0706 01485 trgcc___a 01486 ;sector target 10 0706 8C05 01487 BSF work_flags,RUN_LEFTDOWN,AC 0708 0012 01488 RETURN 070A 01489 trgcc___b 01490 ;sector target 11 070A 8C05 01491 BSF work_flags,RUN_LEFTDOWN,AC 070C 0012 01492 RETURN 070E 01493 trgcc_c_f 070E B237 01494 BTFSC regb0,0x01,AC 0710 D004 01495 BRA trgcc_e_f 0712 01496 trgcc_c_d 0712 B037 01497 BTFSC regb0,0x00,AC 0714 D001 01498 BRA trgcc___d 0716 01499 trgcc___c 01500 ;sector target 12, never reached 01501 ;BSF work_flags,RUN_LEFTDOWN,AC 0716 0012 01502 RETURN 0718 01503 trgcc___d 01504 ;sector target 13 gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 41 LOC OBJECT CODE LINE SOURCE TEXT VALUE 01505 ;BSF work_flags,RUN_LEFTDOWN,AC 0718 0012 01506 RETURN 071A 01507 trgcc_e_f 071A B037 01508 BTFSC regb0,0x00,AC 071C D001 01509 BRA trgcc___f 071E 01510 trgcc___e 01511 ;sector target 14 01512 ;BSF work_flags,RUN_LEFTDOWN,AC 071E 0012 01513 RETURN 0720 01514 trgcc___f 01515 ;sector target 15 01516 ;BSF work_flags,RUN_LEFTDOWN,AC 0720 0012 01517 RETURN 01518 01519 01520 01521 01522 01523 ;current-pos is in section 13 0722 01524 cursecmatrixd 0722 01525 trgcd_0_f 0722 B637 01526 BTFSC regb0,0x03,AC 0724 D018 01527 BRA trgcd_8_f 0726 01528 trgcd_0_7 0726 B437 01529 BTFSC regb0,0x02,AC 0728 D00A 01530 BRA trgcd_4_7 072A 01531 trgcd_0_3 072A B237 01532 BTFSC regb0,0x01,AC 072C D004 01533 BRA trgcd_2_3 072E 01534 trgcd_0_1 072E B037 01535 BTFSC regb0,0x00,AC 0730 D001 01536 BRA trgcd___1 0732 01537 trgcd___0 01538 ;sector target 0 01539 ;BSF work_flags,RUN_LEFTDOWN,AC 0732 0012 01540 RETURN 0734 01541 trgcd___1 01542 ;sector target 1 01543 ;BSF work_flags,RUN_LEFTDOWN,AC 0734 0012 01544 RETURN 0736 01545 trgcd_2_3 0736 B037 01546 BTFSC regb0,0x00,AC 0738 D001 01547 BRA trgcd___3 073A 01548 trgcd___2 01549 ;sector target 2 01550 ;BSF work_flags,RUN_LEFTDOWN,AC 073A 0012 01551 RETURN 073C 01552 trgcd___3 01553 ;sector target 3 01554 ;BSF work_flags,RUN_LEFTDOWN,AC 073C 0012 01555 RETURN 073E 01556 trgcd_4_7 073E B237 01557 BTFSC regb0,0x01,AC 0740 D004 01558 BRA trgcd_6_7 gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 42 LOC OBJECT CODE LINE SOURCE TEXT VALUE 0742 01559 trgcd_4_5 0742 B037 01560 BTFSC regb0,0x00,AC 0744 D001 01561 BRA trgcd___5 0746 01562 trgcd___4 01563 ;sector target 4 01564 ;BSF work_flags,RUN_LEFTDOWN,AC 0746 0012 01565 RETURN 0748 01566 trgcd___5 01567 ;sector target 5 01568 ;BSF work_flags,RUN_LEFTDOWN,AC 0748 0012 01569 RETURN 074A 01570 trgcd_6_7 074A B037 01571 BTFSC regb0,0x00,AC 074C D002 01572 BRA trgcd___7 074E 01573 trgcd___6 01574 ;sector target 6 074E 8C05 01575 BSF work_flags,RUN_LEFTDOWN,AC 0750 0012 01576 RETURN 0752 01577 trgcd___7 01578 ;sector target 7 0752 8C05 01579 BSF work_flags,RUN_LEFTDOWN,AC 0754 0012 01580 RETURN 0756 01581 trgcd_8_f 0756 B437 01582 BTFSC regb0,0x02,AC 0758 D00E 01583 BRA trgcd_c_f 075A 01584 trgcd_8_b 075A B237 01585 BTFSC regb0,0x01,AC 075C D006 01586 BRA trgcd_a_b 075E 01587 trgcd_8_9 075E B037 01588 BTFSC regb0,0x00,AC 0760 D002 01589 BRA trgcd___9 0762 01590 trgcd___8 01591 ;sector target 8 0762 8C05 01592 BSF work_flags,RUN_LEFTDOWN,AC 0764 0012 01593 RETURN 0766 01594 trgcd___9 01595 ;sector target 9 0766 8C05 01596 BSF work_flags,RUN_LEFTDOWN,AC 0768 0012 01597 RETURN 076A 01598 trgcd_a_b 076A B037 01599 BTFSC regb0,0x00,AC 076C D002 01600 BRA trgcd___b 076E 01601 trgcd___a 01602 ;sector target 10 076E 8C05 01603 BSF work_flags,RUN_LEFTDOWN,AC 0770 0012 01604 RETURN 0772 01605 trgcd___b 01606 ;sector target 11 0772 8C05 01607 BSF work_flags,RUN_LEFTDOWN,AC 0774 0012 01608 RETURN 0776 01609 trgcd_c_f 0776 B237 01610 BTFSC regb0,0x01,AC 0778 D005 01611 BRA trgcd_e_f 077A 01612 trgcd_c_d gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 43 LOC OBJECT CODE LINE SOURCE TEXT VALUE 077A B037 01613 BTFSC regb0,0x00,AC 077C D002 01614 BRA trgcd___d 077E 01615 trgcd___c 01616 ;sector target 12 077E 8C05 01617 BSF work_flags,RUN_LEFTDOWN,AC 0780 0012 01618 RETURN 0782 01619 trgcd___d 01620 ;sector target 13, never reached 01621 ;BSF work_flags,RUN_LEFTDOWN,AC 0782 0012 01622 RETURN 0784 01623 trgcd_e_f 0784 B037 01624 BTFSC regb0,0x00,AC 0786 D001 01625 BRA trgcd___f 0788 01626 trgcd___e 01627 ;sector target 14 01628 ;BSF work_flags,RUN_LEFTDOWN,AC 0788 0012 01629 RETURN 078A 01630 trgcd___f 01631 ;sector target 15 01632 ;BSF work_flags,RUN_LEFTDOWN,AC 078A 0012 01633 RETURN 01634 01635 01636 01637 01638 01639 ;current-pos is in section 14 078C 01640 cursecmatrixe 078C 01641 trgce_0_f 078C B637 01642 BTFSC regb0,0x03,AC 078E D017 01643 BRA trgce_8_f 0790 01644 trgce_0_7 0790 B437 01645 BTFSC regb0,0x02,AC 0792 D00A 01646 BRA trgce_4_7 0794 01647 trgce_0_3 0794 B237 01648 BTFSC regb0,0x01,AC 0796 D004 01649 BRA trgce_2_3 0798 01650 trgce_0_1 0798 B037 01651 BTFSC regb0,0x00,AC 079A D001 01652 BRA trgce___1 079C 01653 trgce___0 01654 ;sector target 0 01655 ;BSF work_flags,RUN_LEFTDOWN,AC 079C 0012 01656 RETURN 079E 01657 trgce___1 01658 ;sector target 1 01659 ;BSF work_flags,RUN_LEFTDOWN,AC 079E 0012 01660 RETURN 07A0 01661 trgce_2_3 07A0 B037 01662 BTFSC regb0,0x00,AC 07A2 D001 01663 BRA trgce___3 07A4 01664 trgce___2 01665 ;sector target 2 01666 ;BSF work_flags,RUN_LEFTDOWN,AC gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 44 LOC OBJECT CODE LINE SOURCE TEXT VALUE 07A4 0012 01667 RETURN 07A6 01668 trgce___3 01669 ;sector target 3 01670 ;BSF work_flags,RUN_LEFTDOWN,AC 07A6 0012 01671 RETURN 07A8 01672 trgce_4_7 07A8 B237 01673 BTFSC regb0,0x01,AC 07AA D004 01674 BRA trgce_6_7 07AC 01675 trgce_4_5 07AC B037 01676 BTFSC regb0,0x00,AC 07AE D001 01677 BRA trgce___5 07B0 01678 trgce___4 01679 ;sector target 4 01680 ;BSF work_flags,RUN_LEFTDOWN,AC 07B0 0012 01681 RETURN 07B2 01682 trgce___5 01683 ;sector target 5 01684 ;BSF work_flags,RUN_LEFTDOWN,AC 07B2 0012 01685 RETURN 07B4 01686 trgce_6_7 07B4 B037 01687 BTFSC regb0,0x00,AC 07B6 D001 01688 BRA trgce___7 07B8 01689 trgce___6 01690 ;sector target 6 01691 ;BSF work_flags,RUN_LEFTDOWN,AC 07B8 0012 01692 RETURN 07BA 01693 trgce___7 01694 ;sector target 7 07BA 8C05 01695 BSF work_flags,RUN_LEFTDOWN,AC 07BC 0012 01696 RETURN 07BE 01697 trgce_8_f 07BE B437 01698 BTFSC regb0,0x02,AC 07C0 D00E 01699 BRA trgce_c_f 07C2 01700 trgce_8_b 07C2 B237 01701 BTFSC regb0,0x01,AC 07C4 D006 01702 BRA trgce_a_b 07C6 01703 trgce_8_9 07C6 B037 01704 BTFSC regb0,0x00,AC 07C8 D002 01705 BRA trgce___9 07CA 01706 trgce___8 01707 ;sector target 8 07CA 8C05 01708 BSF work_flags,RUN_LEFTDOWN,AC 07CC 0012 01709 RETURN 07CE 01710 trgce___9 01711 ;sector target 9 07CE 8C05 01712 BSF work_flags,RUN_LEFTDOWN,AC 07D0 0012 01713 RETURN 07D2 01714 trgce_a_b 07D2 B037 01715 BTFSC regb0,0x00,AC 07D4 D002 01716 BRA trgce___b 07D6 01717 trgce___a 01718 ;sector target 10 07D6 8C05 01719 BSF work_flags,RUN_LEFTDOWN,AC 07D8 0012 01720 RETURN gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 45 LOC OBJECT CODE LINE SOURCE TEXT VALUE 07DA 01721 trgce___b 01722 ;sector target 11 07DA 8C05 01723 BSF work_flags,RUN_LEFTDOWN,AC 07DC 0012 01724 RETURN 07DE 01725 trgce_c_f 07DE B237 01726 BTFSC regb0,0x01,AC 07E0 D006 01727 BRA trgce_e_f 07E2 01728 trgce_c_d 07E2 B037 01729 BTFSC regb0,0x00,AC 07E4 D002 01730 BRA trgce___d 07E6 01731 trgce___c 01732 ;sector target 12 07E6 8C05 01733 BSF work_flags,RUN_LEFTDOWN,AC 07E8 0012 01734 RETURN 07EA 01735 trgce___d 01736 ;sector target 13 07EA 8C05 01737 BSF work_flags,RUN_LEFTDOWN,AC 07EC 0012 01738 RETURN 07EE 01739 trgce_e_f 07EE B037 01740 BTFSC regb0,0x00,AC 07F0 D001 01741 BRA trgce___f 07F2 01742 trgce___e 01743 ;sector target 14, never reached 01744 ;BSF work_flags,RUN_LEFTDOWN,AC 07F2 0012 01745 RETURN 07F4 01746 trgce___f 01747 ;sector target 15 01748 ;BSF work_flags,RUN_LEFTDOWN,AC 07F4 0012 01749 RETURN 01750 01751 01752 01753 01754 01755 ;current-pos is in section 15 07F6 01756 cursecmatrixf 07F6 01757 trgcf_0_f 07F6 B637 01758 BTFSC regb0,0x03,AC 07F8 D016 01759 BRA trgcf_8_f 07FA 01760 trgcf_0_7 07FA B437 01761 BTFSC regb0,0x02,AC 07FC D00A 01762 BRA trgcf_4_7 07FE 01763 trgcf_0_3 07FE B237 01764 BTFSC regb0,0x01,AC 0800 D004 01765 BRA trgcf_2_3 0802 01766 trgcf_0_1 0802 B037 01767 BTFSC regb0,0x00,AC 0804 D001 01768 BRA trgcf___1 0806 01769 trgcf___0 01770 ;sector target 0 01771 ;BSF work_flags,RUN_LEFTDOWN,AC 0806 0012 01772 RETURN 0808 01773 trgcf___1 01774 ;sector target 1 gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 46 LOC OBJECT CODE LINE SOURCE TEXT VALUE 01775 ;BSF work_flags,RUN_LEFTDOWN,AC 0808 0012 01776 RETURN 080A 01777 trgcf_2_3 080A B037 01778 BTFSC regb0,0x00,AC 080C D001 01779 BRA trgcf___3 080E 01780 trgcf___2 01781 ;sector target 2 01782 ;BSF work_flags,RUN_LEFTDOWN,AC 080E 0012 01783 RETURN 0810 01784 trgcf___3 01785 ;sector target 3 01786 ;BSF work_flags,RUN_LEFTDOWN,AC 0810 0012 01787 RETURN 0812 01788 trgcf_4_7 0812 B237 01789 BTFSC regb0,0x01,AC 0814 D004 01790 BRA trgcf_6_7 0816 01791 trgcf_4_5 0816 B037 01792 BTFSC regb0,0x00,AC 0818 D001 01793 BRA trgcf___5 081A 01794 trgcf___4 01795 ;sector target 4 01796 ;BSF work_flags,RUN_LEFTDOWN,AC 081A 0012 01797 RETURN 081C 01798 trgcf___5 01799 ;sector target 5 01800 ;BSF work_flags,RUN_LEFTDOWN,AC 081C 0012 01801 RETURN 081E 01802 trgcf_6_7 081E B037 01803 BTFSC regb0,0x00,AC 0820 D001 01804 BRA trgcf___7 0822 01805 trgcf___6 01806 ;sector target 6 01807 ;BSF work_flags,RUN_LEFTDOWN,AC 0822 0012 01808 RETURN 0824 01809 trgcf___7 01810 ;sector target 7 01811 ;BSF work_flags,RUN_LEFTDOWN,AC 0824 0012 01812 RETURN 0826 01813 trgcf_8_f 0826 B437 01814 BTFSC regb0,0x02,AC 0828 D00E 01815 BRA trgcf_c_f 082A 01816 trgcf_8_b 082A B237 01817 BTFSC regb0,0x01,AC 082C D006 01818 BRA trgcf_a_b 082E 01819 trgcf_8_9 082E B037 01820 BTFSC regb0,0x00,AC 0830 D002 01821 BRA trgcf___9 0832 01822 trgcf___8 01823 ;sector target 8 0832 8C05 01824 BSF work_flags,RUN_LEFTDOWN,AC 0834 0012 01825 RETURN 0836 01826 trgcf___9 01827 ;sector target 9 0836 8C05 01828 BSF work_flags,RUN_LEFTDOWN,AC gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 47 LOC OBJECT CODE LINE SOURCE TEXT VALUE 0838 0012 01829 RETURN 083A 01830 trgcf_a_b 083A B037 01831 BTFSC regb0,0x00,AC 083C D002 01832 BRA trgcf___b 083E 01833 trgcf___a 01834 ;sector target 10 083E 8C05 01835 BSF work_flags,RUN_LEFTDOWN,AC 0840 0012 01836 RETURN 0842 01837 trgcf___b 01838 ;sector target 11 0842 8C05 01839 BSF work_flags,RUN_LEFTDOWN,AC 0844 0012 01840 RETURN 0846 01841 trgcf_c_f 0846 B237 01842 BTFSC regb0,0x01,AC 0848 D006 01843 BRA trgcf_e_f 084A 01844 trgcf_c_d 084A B037 01845 BTFSC regb0,0x00,AC 084C D002 01846 BRA trgcf___d 084E 01847 trgcf___c 01848 ;sector target 12 084E 8C05 01849 BSF work_flags,RUN_LEFTDOWN,AC 0850 0012 01850 RETURN 0852 01851 trgcf___d 01852 ;sector target 13 0852 8C05 01853 BSF work_flags,RUN_LEFTDOWN,AC 0854 0012 01854 RETURN 0856 01855 trgcf_e_f 0856 B037 01856 BTFSC regb0,0x00,AC 0858 D002 01857 BRA trgcf___f 085A 01858 trgcf___e 01859 ;sector target 14 085A 8C05 01860 BSF work_flags,RUN_LEFTDOWN,AC 085C 0012 01861 RETURN 085E 01862 trgcf___f 01863 ;sector target 15, never reached 01864 ;BSF work_flags,RUN_LEFTDOWN,AC 085E 0012 01865 RETURN 01866 01867 01868 01869 00345 include "dir.asm" 00001 00002 00003 00004 00005 ;test_ifposequaltrg has to be called before 00006 ;to make it sure, that curpos, and targepos is not 00007 ;equal ( done by STEP_WORK ) 00008 ;this should never be called, if positions are equal 00009 ;for this init_scanoffset should be runned after 00010 ;config1, to have a valid offsetbyte,offsetbit 00011 ;we use only the highest 4bits (16 segments)of a value, to 00012 ;decide which direction we will use gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 48 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00013 ;offsetbyte contains nr of byte containing the highest bit of maxval 00014 ;offsetbit contains nr to rol 00015 ;spec_flags.OFFSET_ROLLEFT is set, or not to show direction to rol 0860 00016 scan_direction 00017 0860 9C05 00018 BCF work_flags,RUN_LEFTDOWN,AC 00019 0862 00020 scandiroftb0 0862 0E00 00021 MOVLW 0x00 0864 6240 00022 CPFSEQ offsetbyte,AC 0866 D007 00023 BRA scandiroftb1 0868 C01E F033 00024 MOVFF curpos0,rega0 086C C026 F037 00025 MOVFF target0,regb0 0870 6A32 00026 CLRF rega1 ;byte 0 have no following byte 0872 6A36 00027 CLRF regb1 ;so we use dummys 0874 D020 00028 BRA scandirbstart 0876 00029 scandiroftb1 0876 0E01 00030 MOVLW 0x01 0878 6240 00031 CPFSEQ offsetbyte,AC 087A D009 00032 BRA scandiroftb2 087C C01D F033 00033 MOVFF curpos1,rega0 0880 C025 F037 00034 MOVFF target1,regb0 0884 C01E F032 00035 MOVFF curpos0,rega1 0888 C026 F036 00036 MOVFF target0,regb1 088C D014 00037 BRA scandirbstart 088E 00038 scandiroftb2 088E 0E02 00039 MOVLW 0x02 0890 6240 00040 CPFSEQ offsetbyte,AC 0892 D009 00041 BRA scandiroftb3 0894 C01C F033 00042 MOVFF curpos2,rega0 0898 C024 F037 00043 MOVFF target2,regb0 089C C01D F032 00044 MOVFF curpos1,rega1 08A0 C025 F036 00045 MOVFF target1,regb1 08A4 D008 00046 BRA scandirbstart 08A6 00047 scandiroftb3 08A6 C01B F033 00048 MOVFF curpos3,rega0 08AA C023 F037 00049 MOVFF target3,regb0 08AE C01C F032 00050 MOVFF curpos2,rega1 08B2 C024 F036 00051 MOVFF target2,regb1 00052 00053 ;20 till here with call 00054 00055 ;now, rega0,rega1 contains a 16bit value of currentpos 00056 ; regb0,regb1 of targetpos 08B6 00057 scandirbstart 08B6 5041 00058 MOVF offsetbit,W,AC 08B8 E012 00059 BZ scandirsetit ;for case last byte low-nibble, or not necessary 00060 08BA 6E3B 00061 MOVWF regc0,AC 00062 ;regc0 contains offsetbit 08BC BE06 00063 BTFSC spec_flags,OFFSET_ROLLEFT,AC 08BE D005 00064 BRA scandirrleft 08C0 00065 scandirrright 00066 ;rol right gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 49 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00067 08C0 4233 00068 RRNCF rega0,1,AC 08C2 4237 00069 RRNCF regb0,1,AC 00070 ;thats all, the lower byte is for hell 00071 08C4 2E3B 00072 DECFSZ regc0,1,AC 08C6 D7FC 00073 BRA scandirrright 08C8 D00A 00074 BRA scandirsetit 08CA 00075 scandirrleft 00076 ;rol left 00077 ;thats a bit more difficult, showing the overflow from lower byte 00078 08CA 3633 00079 RLCF rega0,1,AC 08CC 3632 00080 RLCF rega1,1,AC 08CE B0D8 00081 BTFSC STATUS,C,AC 08D0 8033 00082 BSF rega0,0x00,AC 00083 00084 ;the same for target 08D2 3637 00085 RLCF regb0,1,AC 08D4 3636 00086 RLCF regb1,1,AC 08D6 B0D8 00087 BTFSC STATUS,C,AC 08D8 8037 00088 BSF regb0,0x00,AC 00089 08DA 2E3B 00090 DECFSZ regc0,1,AC 08DC D7F6 00091 BRA scandirrleft 00092 08DE 00093 scandirsetit 08DE 0E0F 00094 MOVLW 0x0f 08E0 1633 00095 ANDWF rega0,1,AC ;rega0 contains section for current 08E2 1637 00096 ANDWF regb0,1,AC ;regb0 contains section for target 00097 00098 ;------------------------------------------------------------------- 00099 ;abs max. possible cycles used till here is 64 ( with 4 x rol left ) 00100 ;hmm looks good 00101 ;------------------------------------------------------------------- 00102 00103 ;So, now we have valid sections, and have to compare it 08E4 5033 00104 MOVF rega0,W,AC 08E6 6237 00105 CPFSEQ regb0,AC ;compare sections together 08E8 D005 00106 BRA scandirsection ;not equal, so we have scan sections. 00107 00108 ;here both sections are equal, so we have a minimal differenc 00109 ;between current, and target, and both are not differed 00110 ;through under/overflow 0/360 degrees. 00111 ;we using a call to test_pos 00112 ;wich compares fro smaller,equal,greater, and 00113 ;sets flags: run_flags.RUN_LEFTDOWN, 00114 ;and work_flags POS_SMALLER,POS_GREATER,POS_EQUAL 00115 ;POS_EQUAL should normally never happens here, 00116 ;because the test for this is called previous 00117 ;by STEP_WORK, to decide is this work here 00118 ;necessary :-) 00119 08EA ECBB F000 00120 CALL test_pos gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 50 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00121 08EE B605 00122 BTFSC work_flags,POS_GREATER,AC 08F0 8C05 00123 BSF work_flags,RUN_LEFTDOWN,AC ;if current pos greater, then target 00124 ;we have to go to left 00125 00126 ;Now, we have the "shortest way" as possible. 08F2 0012 00127 RETURN 00128 ;SO, here the max. possible value of cycles is 00129 ;71, + the call of test_pos (36 ) = 107 ( thats the worst case ) 00130 ;( better as the previous version of more then 800 :-) 00131 ;--------------------------------------------- 08F4 00132 scandirsection 00133 ;67 max poss. cycles till here with call 00134 00135 ;the using of sections is useful, if target, on the 00136 ;other side of current. So we don't know if one of 00137 ;them affected to the under/overflow of 0/360 degrees 00138 ;So, we have split both circles to 16 sections, 00139 ;and defined in wich section every position is currently. 00140 ;If current section is diagonal to target section, 00141 ;we have not the "shortest" possible way in every case, 00142 ;but its as nearest to them as possible. To make 00143 ;it more sensible, by using more sections ( 32, or 64 ) 00144 ;is to hard for this poor processor-environment, and not necessary, 00145 ;because if we spare 22,5 degrees in the way, seems to be 00146 ;only for interrest when using very large circles. 00147 ;Such large instruments, can also pay a more sensible 00148 ;steering hard,- software :-) 00149 00150 08F4 00151 cur0_f 08F4 B633 00152 BTFSC rega0,0x03,AC 08F6 D026 00153 BRA cur8_f 08F8 00154 cur0_7 08F8 B433 00155 BTFSC rega0,0x02,AC 08FA D012 00156 BRA cur4_7 08FC 00157 cur0_3 08FC B233 00158 BTFSC rega0,0x01,AC 08FE D008 00159 BRA cur2_3 0900 00160 cur0_1 0900 B033 00161 BTFSC rega0,0x00,AC 0902 D003 00162 BRA cur__1 0904 00163 cur__0 00164 ;sector current 0 0904 ECE0 F000 00165 CALL cursecmatrix0 0908 D043 00166 BRA scandirsecend 090A 00167 cur__1 00168 ;sector current 1 090A EC15 F001 00169 CALL cursecmatrix1 090E D040 00170 BRA scandirsecend 0910 00171 cur2_3 0910 B033 00172 BTFSC rega0,0x00,AC 0912 D003 00173 BRA cur__3 0914 00174 cur__2 gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 51 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00175 ;sector current 2 0914 EC4A F001 00176 CALL cursecmatrix2 0918 D03B 00177 BRA scandirsecend 091A 00178 cur__3 00179 ;sector current 3 091A EC7F F001 00180 CALL cursecmatrix3 091E D038 00181 BRA scandirsecend 0920 00182 cur4_7 0920 B233 00183 BTFSC rega0,0x01,AC 0922 D008 00184 BRA cur6_7 0924 00185 cur4_5 0924 B033 00186 BTFSC rega0,0x00,AC 0926 D003 00187 BRA cur__5 0928 00188 cur__4 00189 ;sector current 4 0928 ECB4 F001 00190 CALL cursecmatrix4 092C D031 00191 BRA scandirsecend 092E 00192 cur__5 00193 ;sector current 5 092E ECE9 F001 00194 CALL cursecmatrix5 0932 D02E 00195 BRA scandirsecend 0934 00196 cur6_7 0934 B033 00197 BTFSC rega0,0x00,AC 0936 D003 00198 BRA cur__7 0938 00199 cur__6 00200 ;sector current 6 0938 EC1E F002 00201 CALL cursecmatrix6 093C D029 00202 BRA scandirsecend 093E 00203 cur__7 00204 ;sector current 7 093E EC53 F002 00205 CALL cursecmatrix7 0942 D026 00206 BRA scandirsecend 0944 00207 cur8_f 0944 B433 00208 BTFSC rega0,0x02,AC 0946 D012 00209 BRA curc_f 0948 00210 cur8_b 0948 B233 00211 BTFSC rega0,0x01,AC 094A D008 00212 BRA cura_b 094C 00213 cur8_9 094C B033 00214 BTFSC rega0,0x00,AC 094E D003 00215 BRA cur__9 0950 00216 cur__8 00217 ;sector current 8 0950 EC88 F002 00218 CALL cursecmatrix8 0954 D01D 00219 BRA scandirsecend 0956 00220 cur__9 00221 ;sector current 9 0956 ECBD F002 00222 CALL cursecmatrix9 095A D01A 00223 BRA scandirsecend 095C 00224 cura_b 095C B033 00225 BTFSC rega0,0x00,AC 095E D003 00226 BRA cur__b 0960 00227 cur__a 00228 ;sector current 10 gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 52 LOC OBJECT CODE LINE SOURCE TEXT VALUE 0960 ECF2 F002 00229 CALL cursecmatrixa 0964 D015 00230 BRA scandirsecend 0966 00231 cur__b 00232 ;sector current 11 0966 EC27 F003 00233 CALL cursecmatrixb 096A D012 00234 BRA scandirsecend 096C 00235 curc_f 096C B233 00236 BTFSC rega0,0x01,AC 096E D008 00237 BRA cure_f 0970 00238 curc_d 0970 B033 00239 BTFSC rega0,0x00,AC 0972 D003 00240 BRA cur__d 0974 00241 cur__c 00242 ;sector current 12 0974 EC5C F003 00243 CALL cursecmatrixc 0978 D00B 00244 BRA scandirsecend 097A 00245 cur__d 00246 ;sector current 13 097A EC91 F003 00247 CALL cursecmatrixd 097E D008 00248 BRA scandirsecend 0980 00249 cure_f 0980 B033 00250 BTFSC rega0,0x00,AC 0982 D003 00251 BRA cur__f 0984 00252 cur__e 00253 ;sector current 14 0984 ECC6 F003 00254 CALL cursecmatrixe 0988 D003 00255 BRA scandirsecend 098A 00256 cur__f 00257 ;sector current 15 098A ECFB F003 00258 CALL cursecmatrixf 098E D000 00259 BRA scandirsecend 00260 00261 ;to found the section for current 00262 ;all under 10 cycles max 00263 ;also for the target 00264 ;so we have 67 + 14 + 14 = 95 as worst case for sectionwork 00265 0990 00266 scandirsecend 00267 ;--------------------------------------------- 0990 0012 00268 RETURN 00269 ;the absolutely worst case for this is 107 cycles 00270 00271 00272 00273 00274 00346 include "step.asm" 00001 00002 00003 00004 00005 0992 00006 add_mscur_to_pos_ov 00007 gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 53 LOC OBJECT CODE LINE SOURCE TEXT VALUE 0992 C02D F03F 00008 MOVFF mscur,regd0 00009 0996 501F 00010 MOVF maxpos3,W,AC 0998 621B 00011 CPFSEQ curpos3,AC 099A D017 00012 BRA addmscur 00013 099C 5020 00014 MOVF maxpos2,W,AC 099E 621C 00015 CPFSEQ curpos2,AC 09A0 D014 00016 BRA addmscur 00017 09A2 5021 00018 MOVF maxpos1,W,AC 09A4 621D 00019 CPFSEQ curpos1,AC 09A6 D011 00020 BRA addmscur 00021 09A8 5021 00022 MOVF maxpos1,W,AC 09AA 621D 00023 CPFSEQ curpos1,AC 09AC D005 00024 BRA addmscurtst0 00025 ;is equal 09AE 00026 addmscurtsteq 09AE 6A1B 00027 CLRF curpos3,AC 09B0 6A1C 00028 CLRF curpos2,AC 09B2 6A1D 00029 CLRF curpos1,AC 09B4 6A1E 00030 CLRF curpos0,AC 09B6 D009 00031 BRA addmscur 00032 09B8 00033 addmscurtst0 00034 ;here we have to test, how wide cupos0 + mscur overflows maxpos 00035 ;first subtracting curpos0 from maxpos0, showing the diff 09B8 501E 00036 MOVF curpos0,W,AC 09BA 5C22 00037 SUBWF maxpos0,W,AC ;sub curpos0 from maxpos0, store diff to wreg 00038 ;then first testing if mscur (regd0) is < diff 09BC 603F 00039 CPFSLT regd0,AC 09BE D001 00040 BRA addmscurtsteqgr 09C0 D004 00041 BRA addmscur ;we can do normal addition, 00042 ;maxpos will not be reached 00043 09C2 00044 addmscurtsteqgr 00045 ;mscur is greater, or equal diff 00046 ;so we have to test if mscur (regd0) is equal to diff 09C2 643F 00047 CPFSGT regd0,AC 09C4 D7F4 00048 BRA addmscurtsteq ;is equal, so we set all to 0 00049 ;and then add mscur to 0 00050 00051 ;here we produce more overflow, means mscur is greater then diff 00052 ;so we subs diff from mscur 00053 ;w contains diff 09C6 5E3F 00054 SUBWF regd0,1,AC ;sub diff(w) from mscur(regd0) store to regd0 09C8 D7F2 00055 BRA addmscurtsteq ;regd0 contains rest, so 00056 ;going to set all 0, and set add with rest. 00057 09CA 00058 addmscur 09CA 503F 00059 MOVF regd0,W,AC 09CC 261E 00060 ADDWF curpos0,1,AC 09CE 6AE8 00061 CLRF WREG,AC gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 54 LOC OBJECT CODE LINE SOURCE TEXT VALUE 09D0 221D 00062 ADDWFC curpos1,1,AC 09D2 221C 00063 ADDWFC curpos2,1,AC 09D4 221B 00064 ADDWFC curpos3,1,AC 09D6 0012 00065 RETURN 00066 ;max 38 cycles 00067 00068 00069 00070 00071 00072 09D8 00073 sub_mscur_from_pos_ov 00074 09D8 C02D F03F 00075 MOVFF mscur,regd0 00076 09DC 0E00 00077 MOVLW 0x00 09DE 621B 00078 CPFSEQ curpos3,AC 09E0 D019 00079 BRA submscur 00080 09E2 621C 00081 CPFSEQ curpos2,AC 09E4 D017 00082 BRA submscur 00083 09E6 621D 00084 CPFSEQ curpos1,AC 09E8 D015 00085 BRA submscur 00086 09EA 621D 00087 CPFSEQ curpos1,AC 09EC D00A 00088 BRA submscurtst0 00089 ;is equal 09EE 00090 submscurtsteq 09EE C01B F01F 00091 MOVFF curpos3,maxpos3 09F2 C01C F020 00092 MOVFF curpos2,maxpos2 09F6 C01D F021 00093 MOVFF curpos1,maxpos1 09FA C01E F022 00094 MOVFF curpos0,maxpos0 09FE 2A3F 00095 INCF regd0,1,AC ;we have to to this because underflow 00096 ;needs maxpos - 1 0A00 D009 00097 BRA submscur 00098 0A02 00099 submscurtst0 00100 ;here we have to test, how wide cupos0 - mscur underflows 0 00101 ;first testing, if curpos0 is greater then mscur 0A02 503F 00102 MOVF regd0,W,AC 0A04 641E 00103 CPFSGT curpos0,AC 0A06 D001 00104 BRA submscurtsteqsm 0A08 D005 00105 BRA submscur ;no problem curpos is greater then mscur 00106 ;we can do a normal sub 00107 00108 0A0A 00109 submscurtsteqsm 00110 ;curpos0 is smaller, or equal to mscur 0A0A 601E 00111 CPFSLT curpos0,AC 0A0C D7F0 00112 BRA submscurtsteq ;is equal, so we set all to maxpos 00113 ;and then sub mscur normal 00114 00115 ;here we produce more underflow, curpos is < mscur gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 55 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00116 ;means curpos - mscur gives a value < 0 00117 ;so we have to sub curpos from mscur, setting all to maxpos 00118 ;and from this to sub the rest. 00119 0A0E 501E 00120 MOVF curpos0,W,AC 0A10 5E3F 00121 SUBWF regd0,1,AC ;sub curpos0(w) from mscur(regd0), 00122 ;and store rest to regd0 00123 0A12 D7ED 00124 BRA submscurtsteq 00125 0A14 00126 submscur 0A14 503F 00127 MOVF regd0,W,AC 0A16 5E1E 00128 SUBWF curpos0,1,AC 0A18 6AE8 00129 CLRF WREG,AC 0A1A 5A1D 00130 SUBWFB curpos1,1,AC 0A1C 5A1C 00131 SUBWFB curpos2,1,AC 0A1E 5A1B 00132 SUBWFB curpos3,1,AC 0A20 0012 00133 RETURN 00134 ;max 38 cycles 00135 00136 00137 00138 00139 00140 00141 ;proofed 1 00142 ;this sets 00143 ;work_flags.POS_FARAWAY will be set if current, and target 00144 ;differs over 1024 / 1/32 microsteps ( = 32 fullsteps ) 00145 ;If only differs lower, or equal 512 POS_FARAWAY is cleared. 0A22 00146 test_faraway 0A22 8405 00147 BSF work_flags,POS_FARAWAY,AC 0A24 5023 00148 MOVF target3,W,AC 0A26 621B 00149 CPFSEQ curpos3,AC 0A28 D00B 00150 BRA tstfwend ;if highest bytes not equal, we are very far away 0A2A 5024 00151 MOVF target2,W,AC 0A2C 621C 00152 CPFSEQ curpos2,AC 0A2E D008 00153 BRA tstfwend ;dito for bits 16-24 00154 0A30 501D 00155 MOVF curpos1,W,AC 0A32 0BFC 00156 ANDLW 0xfc 0A34 6E3F 00157 MOVWF regd0,AC 00158 0A36 5025 00159 MOVF target1,W,AC 0A38 0BFC 00160 ANDLW 0xfc 00161 0A3A 623F 00162 CPFSEQ regd0,AC 0A3C D001 00163 BRA tstfwend ;dito for bits 9-16 00164 00165 ;for all other, we clear it. 0A3E 9405 00166 BCF work_flags,POS_FARAWAY,AC 0A40 00167 tstfwend 0A40 0012 00168 RETURN 00169 ;19 cycles max with call, return gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 56 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00170 00171 00172 00173 0A42 00174 adapt_now 00175 ;we do nothing is msmax not greater then msmin 0A42 502C 00176 MOVF msmin,W,AC 0A44 642B 00177 CPFSGT msmax,AC 0A46 0012 00178 RETURN 00179 00180 ;we adpapt only if current position is 00181 ;one of the 4 valid fullstep-positions 00182 0A48 0E00 00183 MOVLW D'0000' 0A4A 6207 00184 CPFSEQ stepctr,AC 0A4C 0E40 00185 MOVLW D'0064' 0A4E 6207 00186 CPFSEQ stepctr,AC 0A50 0E80 00187 MOVLW D'0128' 0A52 6207 00188 CPFSEQ stepctr,AC 0A54 0EC0 00189 MOVLW D'0192' 0A56 6207 00190 CPFSEQ stepctr,AC 0A58 0012 00191 RETURN 00192 ;equal 00193 0A5A EC11 F005 00194 CALL test_faraway ;19 cycles 00195 0A5E A405 00196 BTFSS work_flags,POS_FARAWAY,AC 0A60 D005 00197 BRA adaptnear 0A62 00198 adaptfar 0A62 502B 00199 MOVF msmax,W,AC 0A64 602D 00200 CPFSLT mscur,AC 0A66 0012 00201 RETURN ;mscur is greater, or equal msmax, nothing to do 00202 0A68 362D 00203 RLCF mscur,1,AC ;thats all 0A6A 0012 00204 RETURN 00205 0A6C 00206 adaptnear 0A6C 502C 00207 MOVF msmin,W,AC 0A6E 642D 00208 CPFSGT mscur,AC 0A70 0012 00209 RETURN ;mscur is smaller, or equal msmin, nothing to do 0A72 B0D8 00210 BTFSC STATUS,C,AC 0A74 322D 00211 RRCF mscur,1,AC ;thats all 0A76 0012 00212 RETURN 00213 ;max 45 cycles with call, return, and test_faraway 00214 00215 00216 00217 00218 00219 00220 00221 00222 00223 gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 57 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00224 00225 ;stepctr 00226 ;FS1 FS2 FS3 FS4 00227 ;HS1 HS2 HS3 HS4 HS5 HS6 HS7 HS8 Over-/underflow 00228 ;--------------------------------------------------------------- 00229 ; 0 32 64 96 128 160 192 224 (256) 0A78 00230 step_now 00231 0A78 502D 00232 MOVF mscur,W,AC 00233 0A7A AC05 00234 BTFSS work_flags,RUN_LEFTDOWN 0A7C D002 00235 BRA step_right 0A7E 00236 step_left 0A7E 5E07 00237 SUBWF stepctr,1,AC 0A80 D001 00238 BRA step_out 0A82 00239 step_right 0A82 2607 00240 ADDWF stepctr,1,AC 0A84 00241 step_out 00242 0A84 0E00 00243 MOVLW UPPER pwmtable 0A86 6EF8 00244 MOVWF TBLPTRU 0A88 0E30 00245 MOVLW HIGH pwmtable 0A8A 6EF7 00246 MOVWF TBLPTRH 0A8C 0E00 00247 MOVLW LOW pwmtable 0A8E 6EF6 00248 MOVWF TBLPTRL 00249 0A90 5007 00250 MOVF stepctr,W,AC 0A92 0D06 00251 MULLW D'0006' 0A94 CFF4 FFF7 00252 MOVFF PRODH,TBLPTRH 0A98 CFF3 FFF6 00253 MOVFF PRODL,TBLPTRL 00254 0A9C 0009 00255 TBLRD*+ 0A9E CFF5 FFBE 00256 MOVFF TABLAT,CCPR1L 0AA2 0009 00257 TBLRD*+ 0AA4 CFF5 FFBD 00258 MOVFF TABLAT,CCP1CON 00259 0AA8 0009 00260 TBLRD*+ 0AAA CFF5 FFBB 00261 MOVFF TABLAT,CCPR2L 0AAE 0009 00262 TBLRD*+ 0AB0 CFF5 FFBA 00263 MOVFF TABLAT,CCP2CON 00264 0AB4 0009 00265 TBLRD*+ 0AB6 CFF5 FF80 00266 MOVFF TABLAT,PORTA 00267 0ABA 0012 00268 RETURN 00269 ;max 36 cycles 00270 00271 00272 00273 00274 00275 00276 ;encodervalue has changed, means enc_tmp is unequal enc_tmpold 00277 ;new value is in enc_tmp, old value in enc_tmpold gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 58 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00278 ;We have to test, which direction is used, and set work_flags.ENC_LEFTDOWN,AC 00279 ;rule for MENCB(bit1),MENCA(bit 0) 00 10 11 01 00 10 11 01 00 10 ...... 00280 ;new when left old new when right 00281 ; 01 00 10 00282 ; 11 01 00 00283 ; 00 10 11 00284 ; 10 11 01 00285 ; 0ABC 00286 enc_now 00287 0ABC 9E05 00288 BCF work_flags,ENC_LEFTDOWN,AC 00289 0ABE 0E03 00290 MOVLW 0x03 0AC0 6078 00291 CPFSLT enc_tmpold,AC 0AC2 D012 00292 BRA encnow11 00293 0AC4 0E02 00294 MOVLW 0x02 0AC6 6078 00295 CPFSLT enc_tmpold,AC 0AC8 D00B 00296 BRA encnow10 00297 0ACA 0E01 00298 MOVLW 0x01 0ACC 6078 00299 CPFSLT enc_tmpold,AC 0ACE D004 00300 BRA encnow01 0AD0 00301 encnow00 0AD0 0E02 00302 MOVLW 0x02 0AD2 6279 00303 CPFSEQ enc_tmp,AC 0AD4 8E05 00304 BSF work_flags,ENC_LEFTDOWN,AC 0AD6 0012 00305 RETURN 0AD8 00306 encnow01 0AD8 0E00 00307 MOVLW 0x00 0ADA 6279 00308 CPFSEQ enc_tmp,AC 0ADC 8E05 00309 BSF work_flags,ENC_LEFTDOWN,AC 0ADE 0012 00310 RETURN 0AE0 00311 encnow10 0AE0 0E03 00312 MOVLW 0x03 0AE2 6279 00313 CPFSEQ enc_tmp,AC 0AE4 8E05 00314 BSF work_flags,ENC_LEFTDOWN,AC 0AE6 0012 00315 RETURN 0AE8 00316 encnow11 0AE8 0E01 00317 MOVLW 0x01 0AEA 6279 00318 CPFSEQ enc_tmp,AC 0AEC 8E05 00319 BSF work_flags,ENC_LEFTDOWN,AC 0AEE 0012 00320 RETURN 00321 ;max 16 cycles 00322 00323 00324 00325 00326 00327 ;make single-step work depending on config 00328 ;this is called from program-loop, 00329 ;or directly form interrupt ( before doing any others ) 00330 ;( if INT_AS_FRQ is set ) 0AF0 00331 STEP_WORK gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 59 LOC OBJECT CODE LINE SOURCE TEXT VALUE 0AF0 AE04 00332 BTFSS run_flags,STEP_ON,AC 0AF2 D028 00333 BRA ENC_WORK ;if it is not switched on, we do only encoderwork 00334 0AF4 062A 00335 DECF steplpctr,1,AC 0AF6 0EFF 00336 MOVLW 0xff 0AF8 622A 00337 CPFSEQ steplpctr,AC 0AFA D024 00338 BRA ENC_WORK ;skip if == 0xff 00339 0AFC C029 F02A 00340 MOVFF steplp,steplpctr 00341 00342 ;First we have to test if a step is necessary, 00343 ;means if current == target, then go to ENC_WORK 00344 0B00 ECAA F000 00345 CALL test_ifposequaltrg ;20 cycles 0B04 AA05 00346 BTFSS work_flags,POS_EQUAL,AC 0B06 D003 00347 BRA dostepwork 00348 ;here current == target 0B08 9E04 00349 BCF run_flags,STEP_ON,AC 0B0A 9C82 00350 BCF PORTC,TX,AC 0B0C D01B 00351 BRA ENC_WORK 00352 00353 0B0E 00354 dostepwork 0B0E A403 00355 BTFSS drv_flags,NO_CIRCLE,AC 0B10 D006 00356 BRA dostepworkcircle 0B12 9C05 00357 BCF work_flags,RUN_LEFTDOWN,AC 0B14 ECBB F000 00358 CALL test_pos ;max 38 cycles 0B18 A805 00359 BTFSS work_flags,POS_SMALLER,AC 0B1A 8C05 00360 BSF work_flags,RUN_LEFTDOWN,AC 0B1C D002 00361 BRA adaptstepsize 0B1E 00362 dostepworkcircle 0B1E EC30 F004 00363 CALL scan_direction ;max 107 cycles 0B22 00364 adaptstepsize 0B22 8C82 00365 BSF PORTC,TX,AC 00366 0B24 EC21 F005 00367 CALL adapt_now ;max 45 cycles 00368 ;here we do our really stepping, which effects the motors 00369 ;using mscur, and run_flags.RUN_LEFTDOWN 0B28 EC3C F005 00370 CALL step_now ;36 cycles max 00371 0B2C 00372 calcnewpos 00373 ;If RUN_LEFTDOWN, we have to decrease curpos0,1,2,3 with mscur 00374 ;if not, we have to increase it with mscur 00375 00376 ;Doing decreasing/increasing with over/underflowtest to maxpos0,1,2,3 0B2C AC05 00377 BTFSS work_flags,RUN_LEFTDOWN,AC 0B2E ECC9 F004 00378 CALL add_mscur_to_pos_ov ;38 cycles 0B32 BC05 00379 BTFSC work_flags,RUN_LEFTDOWN,AC 0B34 ECEC F004 00380 CALL sub_mscur_from_pos_ov ;38 cycles 00381 0B38 00382 endnewpos 00383 0B38 ECAA F000 00384 CALL test_ifposequaltrg ;20 cycles 0B3C AA05 00385 BTFSS work_flags,POS_EQUAL,AC gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 60 LOC OBJECT CODE LINE SOURCE TEXT VALUE 0B3E D002 00386 BRA ENC_WORK 00387 ;here current == target 0B40 9E04 00388 BCF run_flags,STEP_ON,AC 0B42 9C82 00389 BCF PORTC,TX,AC 00390 0B44 00391 ENC_WORK 00392 ;after each step ( if made, or not ) we have to test encoders. 00393 ;first reading encoder inputsignals 0B44 6A79 00394 CLRF enc_tmp 0B46 B081 00395 BTFSC PORTB,MENCA,AC 0B48 8079 00396 BSF enc_tmp,MENCA,AC 0B4A B281 00397 BTFSC PORTB,MENCB,AC 0B4C 8279 00398 BSF enc_tmp,MENCB,AC 00399 ;then compare it with old values 0B4E 5079 00400 MOVF enc_tmp,W,AC 0B50 6278 00401 CPFSEQ enc_tmpold,AC 0B52 D001 00402 BRA encvaluechanged 0B54 D00A 00403 BRA endencpos 0B56 00404 encvaluechanged 00405 ;encodervalue has changed 00406 ;new value is in enc_tmp, old value in enc_tmpold 00407 ;We have to test, which direction is used, and set work_flags.ENC_LEFTDOWN,AC 0B56 EC5E F005 00408 CALL enc_now ;16 cycles 00409 ;at least, for next changing 0B5A C079 F078 00410 MOVFF enc_tmp,enc_tmpold 0B5E 00411 calcnewencpos 00412 ;Here we have to increase/decrease encHigh,encLow 00413 ;Doing decreasing/increasing with over/underflowtest to encMaxHigh,encMaxLow 00414 0B5E AE05 00415 BTFSS work_flags,ENC_LEFTDOWN,AC 0B60 EC8E F000 00416 CALL inc_encval_ov 0B64 BE05 00417 BTFSC work_flags,ENC_LEFTDOWN,AC 0B66 EC9A F000 00418 CALL dec_encval_ov ;25 cycles 00419 0B6A 00420 endencpos 0B6A C01B F010 00421 MOVFF curpos3,spiobuf0 0B6E C01C F011 00422 MOVFF curpos2,spiobuf1 0B72 C01D F012 00423 MOVFF curpos1,spiobuf2 0B76 C01E F013 00424 MOVFF curpos0,spiobuf3 0B7A C017 F014 00425 MOVFF encHigh,spiobuf4 0B7E C018 F015 00426 MOVFF encLow,spiobuf5 0B82 0012 00427 RETURN 00428 ;max with all calls, and returns 404 cycles 00429 00430 00431 00347 include "cmd.asm" 00001 00002 00003 ;this have to be called after setting 00004 ;maxvalue in config1. 00005 ;Have a look, that we have to scan up to 24 bits 00006 ;If we do this for 3 positions ( max,cur,target) 00007 ;in STEP_WORK we go up to over 800 cycles. gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 61 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00008 ;so we have here to scan the maxvalue, and build 00009 ;a offset once a time after maxvalue is set. 00010 ;this offset, then is used by scan_direction 00011 ;Because this is not any time-sensitive stuff 00012 ;there is no calculation of cycles, and the 00013 ;code is more for good overviewing. 00014 ;after this: 00015 ;offsetbyte contains nr of byte containing the highest bit of maxval 00016 ;offsetbit contains nr to rol 00017 ;spec_flags.OFFSET_ROLLEFT is set, or not to show direction to rol 0B84 00018 init_scanoffset 00019 0B84 9E06 00020 BCF spec_flags,OFFSET_ROLLEFT,AC 00021 0B86 0E03 00022 MOVLW 0x03 0B88 6E40 00023 MOVWF offsetbyte,AC 00024 0B8A 501F 00025 MOVF maxpos3,W,AC 0B8C E018 00026 BZ inioffb3empty 00027 0B8E BE1F 00028 BTFSC maxpos3,0x07,AC 0B90 EF45 F006 00029 GOTO initscanoffbit7 0B94 BC1F 00030 BTFSC maxpos3,0x06,AC 0B96 EF41 F006 00031 GOTO initscanoffbit6 0B9A BA1F 00032 BTFSC maxpos3,0x05,AC 0B9C EF3D F006 00033 GOTO initscanoffbit5 0BA0 B81F 00034 BTFSC maxpos3,0x04,AC 0BA2 EF39 F006 00035 GOTO initscanoffbit4 0BA6 B61F 00036 BTFSC maxpos3,0x03,AC 0BA8 EF35 F006 00037 GOTO initscanoffbit3 0BAC B41F 00038 BTFSC maxpos3,0x02,AC 0BAE EF30 F006 00039 GOTO initscanoffbit2 0BB2 B21F 00040 BTFSC maxpos3,0x01,AC 0BB4 EF2B F006 00041 GOTO initscanoffbit1 0BB8 B01F 00042 BTFSC maxpos3,0x00,AC 0BBA EF26 F006 00043 GOTO initscanoffbit0 00044 0BBE 00045 inioffb3empty 0BBE 0640 00046 DECF offsetbyte,1,AC 0BC0 00047 inioffb3 00048 0BC0 5020 00049 MOVF maxpos2,W,AC 0BC2 E018 00050 BZ inioffb2empty 00051 0BC4 BE20 00052 BTFSC maxpos2,0x07,AC 0BC6 EF45 F006 00053 GOTO initscanoffbit7 0BCA BC20 00054 BTFSC maxpos2,0x06,AC 0BCC EF41 F006 00055 GOTO initscanoffbit6 0BD0 BA20 00056 BTFSC maxpos2,0x05,AC 0BD2 EF3D F006 00057 GOTO initscanoffbit5 0BD6 B820 00058 BTFSC maxpos2,0x04,AC 0BD8 EF39 F006 00059 GOTO initscanoffbit4 0BDC B620 00060 BTFSC maxpos2,0x03,AC 0BDE EF35 F006 00061 GOTO initscanoffbit3 gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 62 LOC OBJECT CODE LINE SOURCE TEXT VALUE 0BE2 B420 00062 BTFSC maxpos2,0x02,AC 0BE4 EF30 F006 00063 GOTO initscanoffbit2 0BE8 B220 00064 BTFSC maxpos2,0x01,AC 0BEA EF2B F006 00065 GOTO initscanoffbit1 0BEE B020 00066 BTFSC maxpos2,0x00,AC 0BF0 EF26 F006 00067 GOTO initscanoffbit0 00068 0BF4 00069 inioffb2empty 0BF4 0640 00070 DECF offsetbyte,1,AC 0BF6 00071 inioffb2 00072 0BF6 5021 00073 MOVF maxpos1,W,AC 0BF8 E018 00074 BZ inioffb1empty 00075 0BFA BE21 00076 BTFSC maxpos1,0x07,AC 0BFC EF45 F006 00077 GOTO initscanoffbit7 0C00 BC21 00078 BTFSC maxpos1,0x06,AC 0C02 EF41 F006 00079 GOTO initscanoffbit6 0C06 BA21 00080 BTFSC maxpos1,0x05,AC 0C08 EF3D F006 00081 GOTO initscanoffbit5 0C0C B821 00082 BTFSC maxpos1,0x04,AC 0C0E EF39 F006 00083 GOTO initscanoffbit4 0C12 B621 00084 BTFSC maxpos1,0x03,AC 0C14 EF35 F006 00085 GOTO initscanoffbit3 0C18 B421 00086 BTFSC maxpos1,0x02,AC 0C1A EF30 F006 00087 GOTO initscanoffbit2 0C1E B221 00088 BTFSC maxpos1,0x01,AC 0C20 EF2B F006 00089 GOTO initscanoffbit1 0C24 B021 00090 BTFSC maxpos1,0x00,AC 0C26 EF26 F006 00091 GOTO initscanoffbit0 00092 0C2A 00093 inioffb1empty 0C2A 0640 00094 DECF offsetbyte,1,AC 0C2C 00095 inioffb1 00096 0C2C 5022 00097 MOVF maxpos0,W,AC 0C2E E033 00098 BZ initscanoffsetend ;this should never be happens, all is 0 00099 0C30 BE22 00100 BTFSC maxpos0,0x07,AC 0C32 EF45 F006 00101 GOTO initscanoffbit7 0C36 BC22 00102 BTFSC maxpos0,0x06,AC 0C38 EF41 F006 00103 GOTO initscanoffbit6 0C3C BA22 00104 BTFSC maxpos0,0x05,AC 0C3E EF3D F006 00105 GOTO initscanoffbit5 0C42 B822 00106 BTFSC maxpos0,0x04,AC 0C44 EF39 F006 00107 GOTO initscanoffbit4 00108 0C48 EF49 F006 00109 GOTO initscanoffbx ;this is the case, if lownibble of byte 0 00110 ;contains a poor number of max 16, 00111 ;or less, or nothing. 00112 00113 ;--------------- 00114 ;now, we have to modify offsetbit, to a loopvalue 00115 ;which also shows the direction, where to rol to gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 63 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00116 ;we need the highest 4 bits, for having 16 segments. 00117 ;offsetbyte contains number of byte, containing 00118 ;the highest bit. 00119 00120 ;offsetbit has to set to nr to rol 00121 ;spec_flags.OFFSET_ROLLEFT is to set, when direction is left 00122 0C4C 00123 initscanoffbit0 00124 ;rol this, and next byte ( if any ) 3 times to left 0C4C 0E03 00125 MOVLW 0x03 0C4E 6E41 00126 MOVWF offsetbit,AC 0C50 8E06 00127 BSF spec_flags,OFFSET_ROLLEFT,AC 0C52 EF4B F006 00128 GOTO initscanoffsetend 0C56 00129 initscanoffbit1 00130 ;rol this, and next byte ( if any ) 2 times to left 0C56 0E02 00131 MOVLW 0x02 0C58 6E41 00132 MOVWF offsetbit,AC 0C5A 8E06 00133 BSF spec_flags,OFFSET_ROLLEFT,AC 0C5C EF4B F006 00134 GOTO initscanoffsetend 0C60 00135 initscanoffbit2 00136 ;rol this, and next byte ( if any ) 1 times to left 0C60 0E01 00137 MOVLW 0x01 0C62 6E41 00138 MOVWF offsetbit,AC 0C64 8E06 00139 BSF spec_flags,OFFSET_ROLLEFT,AC 0C66 EF4B F006 00140 GOTO initscanoffsetend 0C6A 00141 initscanoffbit3 00142 ;no work necessary, the lownibble contains all what we want 0C6A 0E00 00143 MOVLW 0x00 0C6C 6E41 00144 MOVWF offsetbit,AC 0C6E EF4B F006 00145 GOTO initscanoffsetend 0C72 00146 initscanoffbit4 00147 ;rol this byte 1 times to right 0C72 0E01 00148 MOVLW 0x01 0C74 6E41 00149 MOVWF offsetbit,AC 0C76 EF4B F006 00150 GOTO initscanoffsetend 0C7A 00151 initscanoffbit5 00152 ;rol this byte 2 times to right 0C7A 0E02 00153 MOVLW 0x02 0C7C 6E41 00154 MOVWF offsetbit,AC 0C7E EF4B F006 00155 GOTO initscanoffsetend 0C82 00156 initscanoffbit6 00157 ;rol this byte 3 times to right 0C82 0E03 00158 MOVLW 0x03 0C84 6E41 00159 MOVWF offsetbit,AC 0C86 EF4B F006 00160 GOTO initscanoffsetend 0C8A 00161 initscanoffbit7 00162 ;rol complete high-nibble to right, or use it directly 0C8A 0E04 00163 MOVLW 0x04 0C8C 6E41 00164 MOVWF offsetbit,AC 0C8E EF4B F006 00165 GOTO initscanoffsetend 0C92 00166 initscanoffbx 0C92 0E00 00167 MOVLW 0x00 0C94 6E41 00168 MOVWF offsetbit,AC 0C96 00169 initscanoffsetend gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 64 LOC OBJECT CODE LINE SOURCE TEXT VALUE 0C96 0012 00170 RETURN 00171 ;now, offsetbyte should contain the nr of first byte containing 00172 ;a valid value, and offsetbit the nr of the first bit which is 1 00173 00174 00175 00176 00177 00178 00179 00180 00181 00182 00183 00184 00185 00186 00187 00188 ;############# THE COMMAND WORK ####################### 00189 00190 ;Note: All positons, set by s1,s2,s3,s4 or receives during 00191 ;r1,r2,r3,r4 depening on motors are handled as 1/32 fullstepvalues. 00192 00193 ;Note: The frequency used to do motorstepping, and/or encoderscanning 00194 ;can be handled in two different ways: 00195 ;One is to set the flag INT_AS_FRQ. 00196 ;This means , every spi-int occures STEP_WORK will be called. 00197 ;Have a look for that you can send a sequence in two differnet ways, 00198 ;byte per byte, every effecting an interrupt, or all in one sequence, 00199 ;where the first byte received starts the interrupt. 00200 ;(Handling three boards, all using the same CS,and clock-line, 00201 ;ends in 21 bytes to handle, and 3 interrupts, if all send in one 00202 ;sequence. - Thats ends in a max. possible frequence of 7200 Hz ). 00203 ;The second way to handle frequencies is to use TIMER_AS_FRQ, and 00204 ;using a 16 bit timervalue. 00205 ;For all handable ways additionally a counter (steplp) is available, 00206 ;which is decremented every STEP_WORK. So with this you have additionally 00207 ;the possibility to split the frequency. 00208 ;All of this provide the feature, to set frequencies in a very sensible way. 00209 ;( A value of 0 for steplp means, no additionally splitting ). 00210 ;The encoderwork ignores steplp completely, means encoderscanning is every 00211 ;time done, STEP_WORK is called, if a step will be handled, or not. 00212 ; 00213 ;Note: The programloop of elmot-software only handles the testing for 00214 ;commands. If you use INT_HANDLES_CMD the programloop, has no effect. 00215 ; 00216 ; 00217 ;commandbyte 00218 ;this is handled by program-loop, using CMD_WORK 00219 ;or directly by interrupt, also using CMD_WORK 00220 ;(if INT_HANDLES_CMD is set ) 00221 ;first byte of sequence ( cmd-byte ) 00222 ;valid commands ( higher bits overrides lower bits ) 00223 ;7 6 5 4 3 2 1 0 ( bits 0,1,2 not used = address ) gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 65 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00224 ;------------------------------------------------------ 00225 ;0 0 0 0 0 a a a NOP Useful for nothing, reducing performance, or getting current pos. 00226 ; s1,s2,s3,s4,s5,s6 not handled 00227 ; r1,r2,r3,r4 contains current position r5,r6 current encoderpos 00228 ; 00229 ; 00230 ; 00231 ;0 0 0 0 1 a a a set TARGET, normally the mostly used command. 00232 ; 00233 ; s1,s2,s3,s4 must contain new "target" positon, 00234 ; reflecting a 1/32 fullstepvalue. 00235 ; 00236 ; s5 depends on the settings on flags in s6 00237 ; 00238 ; s6 This flag-bits steering additional the functionality 00239 ; 00240 ; s6.7 STEP_ON ;generally switch for calling STEP_WORK 00241 ; ;if this is not set, STEP_WORK 00242 ; ;only do its encoderwork, but nothing with the motors. 00243 ; ;This flag is also internally cleared, whenever 00244 ; ;current position is equal target position. 00245 ; 00246 ; 00247 ; s6.6 RESTART_FRQ ;This is also useful, for a stop after move, 00248 ; ;If this is 1, all counters, or timers, will 00249 ; ;be set to their starting conditions. 00250 ; ;Means, steplpcounter will be reset to steplp 00251 ; ;If TIMER_AS_FRQ is set timer will be restarted. 00252 ; ;After restarting the flag is internally cleared. 00253 ; ;This flag is also to use generally with the first command, 00254 ; ;if TIMER_AS_FRQ is used, to start it. 00255 ; 00256 ; s6.5 DONT_IGNORES5 ;Dont ignore content of s5 00257 ; ;If this is 1, s5 will be used, depending on s6.4 00258 ; ;If 0, s6.4, and s5 are ignored. 00259 ; ;This flag is also internally cleared, directly 00260 ; ;after setting content s5. 00261 ; ;(If your next sequence sets this flag again, 00262 ; ;also content will be set again ). 00263 ; 00264 ; s6.4 CONTENT_S5 ;content of s5, if s6.5 is set 00265 ; ;if this is 1 new steplp will be set from s5 00266 ; ;(if INT_AS_FRQ, or additional to TIMER_AS_FRQ) 00267 ; ;if this is 0 the low-byte for the timervalue 00268 ; ;will be set from s5 00269 ; ;(For case TIMER_AS_FRQ is used ) 00270 ; 00271 ; 00272 ; s6.3 reserved, currently not used 00273 ; 00274 ; s6.2 reserved, currently not used 00275 ; 00276 ; s6.1 reserved, currently not used 00277 ; gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 66 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00278 ; s6.0 reserved, currently not used 00279 ; 00280 ; 00281 ; r1,r2,r3,r4 contains current position r5,r6 current encoderpos 00282 ; 00283 ;0 0 0 1 0 a a a set POSITION origin current positions 00284 ; s1,s2,s3,s4 must contain new "current" positon, s5,s6 new encoderpos 00285 ; there are no flags to set. 00286 ; r1,r2,r3,r4 contains current position r5,r6 current encoderpos 00287 ; 00288 ;x x 1 x x a a a stop directly, and receive positions. 00289 ; This cleares the STEP_ON flag, after receiving the first 00290 ; byte (commandbyte). So, - if INT_AS_FRQ is set, this first byte 00291 ; is the only one of the complete sequence, which can effect a step. 00292 ; After receiving the last byte, the targetposition is also 00293 ; set to the current position. 00294 ; With this you can stop stepping immediately, with returning 00295 ; the real current position. 00296 ; s1,s2,s3,s4,s5,s6 undefined, not effect 00297 ; r1,r2,r3,r4 contains current position r5,r6 current encoderpos 00298 ; 00299 ; 00300 ;------------------------------------------------------------ 00301 ;The configurations have to be done, before any of the stepping works is used. 00302 ;The normally way is after start-up, to send a config1, then a config2. 00303 ;After this the stepping can be switched on by using STEP_ON 00304 ;Have a look, that config1 uses a little bit more time ( up to 200 cycles ) 00305 ;as the others depending on a generally bitscanning of maxvalues. 00306 ; 00307 ; 00308 ;0 1 0 y y a a a GENERAL CONFIG 00309 ; s1 - s6 depends on y y y ( bit 4,3 ) 00310 ; r1 contains boards address, - r2,r3,r4,r5,r6 undefined. 00311 ; 00312 ;0 1 0 0 1 a a a config 1 00313 ; s1,s2,s3,s4 have to contain 32bit value maxvalue ( maxcircle ) 00314 ; reflecting a 1/32 fullstep value. 00315 ; s5,s6 have to contain 16bit value encodervalue ( max nr. like 4000 ) 00316 ; 00317 ; currentpos will be tested after each step, if it is equal 00318 ; maxvalue. In this case currentpos is set to 0. 00319 ; If currentpos underflows 0, after going left, currentpos 00320 ; will be set automatically to maxvalue -1. 00321 ; 00322 ; The same will be doing with current encoderposition, and encodervalue. 00323 ; This provides in every case the possibility to handle 00324 ; the current position as a circle like 360 degrees. 00325 ; Be sure to handle also the setted targetposition in the right 00326 ; way. 00327 ; 00328 ; r1 contains boards address, - r2,r3,r4,r5,r6 undefined. 00329 ; 00330 ;0 1 0 1 0 a a a config 2 00331 ; gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 67 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00332 ; s1 have to contain highbyte for 16 bit timervalue. 00333 ; (If INT_AS_FRQ is used, this has no effect.) 00334 ; 00335 ; s2 have to contain lowbyte for 16 bit timervalue. 00336 ; 00337 ; s3 have to contain max. microstepvalue msmax 00338 ; (FS=32, HS=16, 1/4=8, 1/8=4, 1/16=2, 1/32=1) 00339 ; s4 have to contain min. microstepvalue msmin 00340 ; (FS=32, HS=16, 1/4=8, 1/8=4, 1/16=2, 1/32=1) 00341 ; 00342 ; Normally all steps are done with msmin,handling 00343 ; allways 1/32 fullstep * msmin, because all positions 00344 ; are handled in this size. If msmax a value wich is 00345 ; greater then msmin, internally an adapting of stepsize 00346 ; will be tried. This means if currentpos far away from 00347 ; targetpos mscur will tried to set to msmax, if next valid 00348 ; motorpositon this allowes. Also if current near target 00349 ; mscur will be tried to decrease to msmin. 00350 ; If this bother's you, set max to the same value as msmin. 00351 ; The default used value is allways msmin. 00352 ; 00353 ; s5 have to contain default value for steplp 00354 ; steplp can be used to adjust additionally the 00355 ; INT_AS_FRQ, or TIMER_AS_FRQ frequency. 00356 ; STEP_WORK funcs like this. If it is called, it 00357 ; first test for flag STEP_ON. If this is not set 00358 ; only encoder-work will be done. 00359 ; If set, it decrements a counter, if this overflows 00360 ; from 0 to 0xff, the step-work will be done, - if 00361 ; not overflow, STEP_WORK will only doing encodertest. 00362 ; A value of 0 means directly STEP_WORK. 00363 ; 00364 ; s6 sets the driver-flags, handling how the program/int works. 00365 ; 00366 ; s6.7 INT_AS_FRQ ;if 1, spi_int calls STEP_WORK, instead timer. 00367 ; ;if used spi-byte-per-int, 00368 ; ;spi-int funcs as frequency in this case. 00369 ; ;(for this, when using 3 driverboards, with the 00370 ; ;same cs-line, a max of 7200 Hz is recommended. 00371 ; ;in this 7200 Hz a complete sequence, plus 00372 ; ;CMD_WORK, and STEP_WORK can be handled for up 00373 ; ;3 boards using the same CS/CLOCK-line. 00374 ; ;If you send the sequence byte-per-byte 00375 ; ;you can use higher frequencies, but be carefull. 00376 ; ;You can also adjust this using steplp. 00377 ; ;This bit clears bits s6.6, and bit s6.2 00378 ; 00379 ; s6.6 TIMER_AS_FRQ ;If this is 1, and s6.7 is 0, a timer will be used 00380 ; ;to call STEP_WORK, instead interrupt, in the way, 00381 ; ;that progloop compares a running timer with a configured 00382 ; ;timervalue. 00383 ; ;Have a look, that for target-systems a highly stable 00384 ; ;frequency is normally not necessary, - but anyway, 00385 ; ;we provide it :-) gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 68 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00386 ; ;You can also divide this frq, using an additionally 00387 ; ;steplp for STEP_WORK. 00388 ; ;Have a look, that the spi-interrupt bother the 00389 ; ;stability of frequency. 00390 ; 00391 ; s6.5 INT_HANDLES_CMD ;if 1, spi_int handles CMD_WORK, instead progloop 00392 ; 00393 ; s6.4 reserved, currently not used 00394 ; 00395 ; s6.3 reserved, currently not used 00396 ; 00397 ; s6.2 NO_CIRCLE ;These flag shuts off, the handling of sections, instead 00398 ; ;calculation the direction dependend if currentpos is smaller 00399 ; ;then targetpos. Have a look, that over-/underflowhandling 00400 ; ;is done in the same way as for a circle. 00401 ; ;So if your motor is going along a flatline 00402 ; ;let him not move under 0, or over maxvalue. 00403 ; 00404 ; s6.1 reserved, currently not used 00405 ; 00406 ; s6.0 reserved, currently not used 00407 ; 00408 ; ATTENTION: These bits will be get as it is, so use it if 00409 ; you really know what you do. The effects of this are 00410 ; active directly next call of CMD_WORK. 00411 ; 00412 ; Have a look, that INT_AS_FRQ, and cmd-bit 7 = 1, together 00413 ; makes normally no sense, because interrupt then first call 00414 ; complete STEP_WORK, before receiving the rest of complete 00415 ; sequence. If it used anyway together, master have to wait 00416 ; after sending first byte ( cmd ), for at least the whole 00417 ; number of max. used cycles by STEP_WORK, before sending 00418 ; the rest of sequence. 00419 ; Another way, is to set INT_AS_FRQ off, with setTarget, 00420 ; before using sequence-per-int with cmd.7=1. 00421 ; 00422 ; r1 contains boards address, - r2,r3,r4,r5,r6 undefined. 00423 ; 00424 00425 ;-------------------------------------------------------------------------------- 00426 ;1 x x x x a a a ALL THE SAME, but handled as complete sequence in one interrupt 00427 ; means, not received byte per interrupt, 00428 ; instead sequence received per single interrupt 00429 ;-------------------------------------------------------------------------------- 00430 00431 00432 00433 00434 00435 00436 ;ADDITIONAL NOTES: 00437 ;The Pin PORTC6 ( TXT ) is used as an digital output. 00438 ;Whenever current pos is equal to targetpos, this output is set to low 00439 ;Whenever current pos is not equal to target, this output is set to high gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 69 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00440 ;You can use this for whatever digital inputs you want. 00441 ; 00442 ; 0C98 00443 CMD_WORK 0C98 0E00 00444 MOVLW 0x00 0C9A 6202 00445 CPFSEQ spi_cmd,AC 0C9C 0012 00446 RETURN ;is 0, we do nothing 00447 ;spi_cmd contains a valid command 00448 0C9E BC02 00449 BTFSC spi_cmd,H'0006',AC 0CA0 D03A 00450 BRA cmdwork_config 00451 0CA2 BA02 00452 BTFSC spi_cmd,H'0005',AC 0CA4 D02F 00453 BRA cmdwork_stopandclear 00454 0CA6 B802 00455 BTFSC spi_cmd,H'0004',AC 0CA8 D020 00456 BRA cmdwork_setpos 00457 0CAA B602 00458 BTFSC spi_cmd,H'0003',AC 0CAC D001 00459 BRA cmdwork_settarget 0CAE D059 00460 BRA cmdworkend 00461 0CB0 00462 cmdwork_settarget 0CB0 C00A F023 00463 MOVFF spiibuf0,target3 0CB4 C00B F024 00464 MOVFF spiibuf1,target2 0CB8 C00C F025 00465 MOVFF spiibuf2,target1 0CBC C00D F026 00466 MOVFF spiibuf3,target0 0CC0 C00F F004 00467 MOVFF spiibuf5,run_flags 00468 0CC4 AA04 00469 BTFSS run_flags,DONT_IGNORES5,AC 0CC6 D008 00470 BRA cmdworkstend 0CC8 9A04 00471 BCF run_flags,DONT_IGNORES5,AC 0CCA A804 00472 BTFSS run_flags,CONTENTS5,AC 0CCC D003 00473 BRA cmdstsettval 0CCE C00E F029 00474 MOVFF spiibuf4,steplp 0CD2 D002 00475 BRA cmdworkstend 0CD4 00476 cmdstsettval 0CD4 C00E F02F 00477 MOVFF spiibuf4,timerlow 0CD8 00478 cmdworkstend 00479 0CD8 AC04 00480 BTFSS run_flags,RESTART_FRQ,AC 0CDA D043 00481 BRA cmdworkend 0CDC C029 F02A 00482 MOVFF steplp,steplpctr 0CE0 AC03 00483 BTFSS drv_flags,TIMER_AS_FRQ,AC 0CE2 D03F 00484 BRA cmdworkend 00485 0CE4 EC6D F000 00486 CALL start_timer 00487 0CE8 D03C 00488 BRA cmdworkend 00489 00490 0CEA 00491 cmdwork_setpos 0CEA C00A F01B 00492 MOVFF spiibuf0,curpos3 0CEE C00B F01C 00493 MOVFF spiibuf1,curpos2 gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 70 LOC OBJECT CODE LINE SOURCE TEXT VALUE 0CF2 C00C F01D 00494 MOVFF spiibuf2,curpos1 0CF6 C00D F01E 00495 MOVFF spiibuf3,curpos0 0CFA C00E F017 00496 MOVFF spiibuf4,encHigh 0CFE C00E F018 00497 MOVFF spiibuf4,encLow 0D02 D02F 00498 BRA cmdworkend 00499 0D04 00500 cmdwork_stopandclear 0D04 C01B F023 00501 MOVFF curpos3,target3 0D08 C01C F024 00502 MOVFF curpos2,target2 0D0C C01D F025 00503 MOVFF curpos1,target1 0D10 C01E F026 00504 MOVFF curpos0,target0 0D14 D026 00505 BRA cmdworkend 00506 0D16 00507 cmdwork_config 00508 0D16 BA02 00509 BTFSC spi_cmd,H'0005',AC 0D18 D7F5 00510 BRA cmdwork_stopandclear 00511 0D1A B802 00512 BTFSC spi_cmd,H'0004',AC 0D1C D012 00513 BRA cmdwork_config2 00514 0D1E B602 00515 BTFSC spi_cmd,H'0003',AC 0D20 D001 00516 BRA cmdwork_config1 0D22 D01F 00517 BRA cmdworkend 00518 0D24 00519 cmdwork_config1 0D24 C00A F01F 00520 MOVFF spiibuf0,maxpos3 0D28 C00B F020 00521 MOVFF spiibuf1,maxpos2 0D2C C00C F021 00522 MOVFF spiibuf2,maxpos1 0D30 C00D F022 00523 MOVFF spiibuf3,maxpos0 0D34 C00E F019 00524 MOVFF spiibuf4,encMaxHigh 0D38 C00F F01A 00525 MOVFF spiibuf5,encMaxLow 0D3C ECC2 F005 00526 CALL init_scanoffset 0D40 D010 00527 BRA cmdworkend 00528 0D42 00529 cmdwork_config2 0D42 C00A F02E 00530 MOVFF spiibuf0,timerhigh 0D46 C00B F02F 00531 MOVFF spiibuf1,timerlow 0D4A C00C F02B 00532 MOVFF spiibuf2,msmax 0D4E C00D F02C 00533 MOVFF spiibuf3,msmin 0D52 C00D F02D 00534 MOVFF spiibuf3,mscur 0D56 C00E F029 00535 MOVFF spiibuf4,steplp 0D5A C00F F003 00536 MOVFF spiibuf5,drv_flags 0D5E A603 00537 BTFSS drv_flags,H'0003',AC 0D60 D000 00538 BRA cmdworkend ; skip if EEPROM_CFG is set 00539 00540 ;here we are if EERPROM_CFG is set. 00541 ;@@@@@? should we implement this ? 00542 0D62 00543 cmdworkend 0D62 6A02 00544 CLRF spi_cmd,AC ;at end we have to delete it 0D64 0012 00545 RETURN 00546 ;( cycles with call, and return ) 00547 ;NOP max base 8 cycles max gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 71 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00548 ;settarget max base 41 cycles max 00549 ;setpos max base 28 cycles max 00550 ;reserved max base 17 cycles 00551 ;config1 max base 30 cycles + ~ 100 init_scanoffset 00552 ;config2 max base 30 cycles max 00553 00554 00555 00556 00348 include "int.asm" 00001 00002 00003 00004 00005 ;############# THE INTERRUPTS ################################## 00006 ;interrupt uses FS2, without saving this. 00007 ;( using interrupt as counter, - frequency ) 00008 ;if we plan max. 40 cycles for every interrupt, 00009 ;we have up to 650 cycles place for program, or 00010 ;additionally step_work in interrupt, when 00011 ;transfering all 1/7200 second a byte 00012 ;so for three boards, we have 7200 / 21 = 342 00013 ;times per second to update a target-position 00014 ;by 3 boards in the program loop, or direct by interrupt. 00015 ;INT_AS_FRQ is a special flag, inticating, that the 00016 ;interrupt is used as frequency, so STEP_WORK is called 00017 ;before anything is doing with the interrupt. 00018 ;That makes sure, that the step_work is done by a 00019 ;frequency, which is stable, as the master sends 00020 ;bytes using a stable freq. ( The max. possible freq. 00021 ;to handling all is 7200. ) 00022 ;So using this, steps, will be handled every 1/7200 00023 ;second, and updating target every 1/342 second, if 00024 ;master sending a byte every 1/7200 second. 00025 ;INT_HANDLES_CMD is also special, means, if the 00026 ;last byte of a sequence is received, and spi_cmd 00027 ;is set, the command is handled directly by the 00028 ;interrupt, otherwise it will be handled by the 00029 ;programloop 00030 00031 0D66 00032 INT_SPI 0D66 969D 00033 BCF PIE1,SSPIE,AC ;disabling spi-int 00034 0D68 BE03 00035 BTFSC drv_flags,INT_AS_FRQ,AC 0D6A EC78 F005 00036 CALL STEP_WORK 00037 0D6E 50C9 00038 MOVF SSPBUF,W,AC ;read, and clear input-buffer 0D70 6E7A 00039 MOVWF spi_tmp,AC ;store to temp 0D72 6601 00040 TSTFSZ spi_ctr,AC ;if counter 0 ? 0D74 EFD2 F006 00041 GOTO ispiloop ;this is part of one of the following 6 bytes 00042 00043 00044 ;ok, this is the first byte in a sequence, or a single command gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 72 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00045 ;first we looking, if it is for us 0D78 0B07 00046 ANDLW 0x07 ;clear for address 0D7A 6E7C 00047 MOVWF spi_tmpaddr,AC 0D7C 6200 00048 CPFSEQ spi_addr,AC ;compare with board addr 0D7E EFF4 F006 00049 GOTO istart_notforus 0D82 00050 istart_forus ;ok, we have the first command, and our board is meaned. 0D82 C07A F07B 00051 MOVFF spi_tmp,spi_tmpcmd ;storing cmd for later using 00052 0D86 BA7A 00053 BTFSC spi_tmp,H'0005',AC ;test if bit 5 of command is 1 0D88 9E04 00054 BCF run_flags,STEP_ON,AC ;if so, we clear STEP_ON 00055 00056 0D8A BC7A 00057 BTFSC spi_tmp,H'0006',AC ;test if bit 6 of command is 1 0D8C C000 F010 00058 MOVFF spi_addr,spiobuf0 ;if it is 1, we send our address as first returnbyte 00059 0D90 C010 FFC9 00060 MOVFF spiobuf0,SSPBUF ;fill buffer with spival 00061 00062 0D94 BE7A 00063 BTFSC spi_tmp,H'0007',AC ;test if bit 7 of command is 1 0D96 EF02 F007 00064 GOTO ispiall_forus ;if so, we receive complete sequence in one int 00065 00066 0D9A 0E06 00067 MOVLW 0x06 ;set counter 0D9C 6E01 00068 MOVWF spi_ctr,AC 00069 ;at least switch on the interrupt again 0D9E 969E 00070 BCF PIR1,SSPIF ;clear int-req flag 0DA0 869D 00071 BSF PIE1,SSPIE,AC ;enabling spi-int 0DA2 0011 00072 RETFIE 1 00073 ;32 cycles till here 00074 00075 0DA4 00076 ispiloop ;on of the following 6 bytes, address is stored in spi_tmpaddr 00077 ;spi_ctr is the bytecounter 0DA4 507C 00078 MOVF spi_tmpaddr,W,AC 0DA6 6200 00079 CPFSEQ spi_addr,AC ;compare with board addr 0DA8 EFFD F006 00080 GOTO ispiloop_notforus 0DAC 00081 ispiloop_forus ;this is one of the following 6 bytes for us 00082 ;spi_ctr is the bytecounter 00083 00084 ;store spiibuf with spi_tmp 0DAC EE20 F010 00085 LFSR FSR2,spiibufend 0DB0 5001 00086 MOVF spi_ctr,W,AC 0DB2 5ED9 00087 SUBWF FSR2L,1,AC 0DB4 C07A FFDF 00088 MOVFF spi_tmp,INDF2 00089 00090 ;store spi_tmp from spiobuf 0DB8 EE20 F016 00091 LFSR FSR2,spiobufend 0DBC 5001 00092 MOVF spi_ctr,W,AC 0DBE 5ED9 00093 SUBWF FSR2L,1,AC 0DC0 CFDF F07A 00094 MOVFF INDF2,spi_tmp 00095 00096 0DC4 4E01 00097 DCFSNZ spi_ctr,1,AC ;decrement counter 0DC6 EFEA F006 00098 GOTO ispiloop_lastbyte ;if counter 0, we handle last byte gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 73 LOC OBJECT CODE LINE SOURCE TEXT VALUE 0DCA C07A FFC9 00099 MOVFF spi_tmp,SSPBUF 00100 ;at least switch on the interrupt again 0DCE 969E 00101 BCF PIR1,SSPIF ;clear int-req flag 0DD0 869D 00102 BSF PIE1,SSPIE,AC ;enabling spi-int 0DD2 0011 00103 RETFIE 1 00104 ;36 cycles till here 00105 0DD4 00106 ispiloop_lastbyte ;the last byte , now we can handle the cmd 0DD4 68C9 00107 SETF SSPBUF,AC ;filling output only with 0xff 0DD6 507B 00108 MOVF spi_tmpcmd,W,AC 0DD8 0BF8 00109 ANDLW 0xF8 0DDA 6E02 00110 MOVWF spi_cmd,AC ;and now storing the command 00111 0DDC BA03 00112 BTFSC drv_flags,INT_HANDLES_CMD,AC 0DDE EC4C F006 00113 CALL CMD_WORK 00114 00115 ;at least switch on the interrupt again 0DE2 969E 00116 BCF PIR1,SSPIF ;clear int-req flag 0DE4 869D 00117 BSF PIE1,SSPIE,AC ;enabling spi-int 0DE6 0011 00118 RETFIE 1 00119 ;41 cycles till here 00120 00121 00122 00123 0DE8 00124 istart_notforus ;first byte, but not for us 0DE8 68C9 00125 SETF SSPBUF,AC ;not for us, so fill only with 0xff 00126 0DEA BE7A 00127 BTFSC spi_tmp,H'0007',AC ;test if bit 7 of command is 1 0DEC EF2E F007 00128 GOTO ispiall_notforus ;if so, we receive complete sequence in one int 00129 0DF0 0E06 00130 MOVLW 0x06 ;set counter 0DF2 6E01 00131 MOVWF spi_ctr,AC 00132 ;at least switch on the interrupt again 0DF4 969E 00133 BCF PIR1,SSPIF ;clear int-req flag 0DF6 869D 00134 BSF PIE1,SSPIE,AC ;enabling spi-int 0DF8 0011 00135 RETFIE 1 00136 ;26 cycles till here 00137 0DFA 00138 ispiloop_notforus ;this is one of the following 6 bytes not for us 00139 ;spi_ctr is the bytecounter, we only fill output with 0xff 00140 ;and decrement counter 0DFA 68C9 00141 SETF SSPBUF,AC 0DFC 0601 00142 DECF spi_ctr,1,AC ;decrement counter 00143 ;at least switch on the interrupt again 0DFE 969E 00144 BCF PIR1,SSPIF ;clear int-req flag 0E00 869D 00145 BSF PIE1,SSPIE,AC ;enabling spi-int 0E02 0011 00146 RETFIE 1 00147 ; 20 cycles till here 00148 00149 00150 00151 00152 gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 74 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00153 0E04 00154 ispiall_forus 00155 ;till here are 26 cycles used 00156 ;spi_tmp, and spi_tmpcmd contain command 00157 ;SSPBUF is filled with spiobuf0 previous 00158 ;(if bit 6 is set this is our address) 00159 ;so we have to wait for 6 addtional bytes 00160 ;and return 5 bytes ( spiobuf1 - 5) 00161 00162 ;byte 1 0E04 00163 ispi_fs_0 0E04 A0C7 00164 BTFSS SSPSTAT,BF,AC 0E06 D7FE 00165 BRA ispi_fs_0 0E08 50C9 00166 MOVF SSPBUF,W,AC 0E0A 6E0A 00167 MOVWF spiibuf0,AC 00168 0E0C 5011 00169 MOVF spiobuf1,W,AC 0E0E 6EC9 00170 MOVWF SSPBUF,AC 00171 ;byte 2 0E10 00172 ispi_fs_1 0E10 A0C7 00173 BTFSS SSPSTAT,BF,AC 0E12 D7FE 00174 BRA ispi_fs_1 0E14 50C9 00175 MOVF SSPBUF,W,AC 0E16 6E0B 00176 MOVWF spiibuf1,AC 00177 0E18 5012 00178 MOVF spiobuf2,W,AC 0E1A 6EC9 00179 MOVWF SSPBUF,AC 00180 ;byte 3 0E1C 00181 ispi_fs_2 0E1C A0C7 00182 BTFSS SSPSTAT,BF,AC 0E1E D7FE 00183 BRA ispi_fs_2 0E20 50C9 00184 MOVF SSPBUF,W,AC 0E22 6E0C 00185 MOVWF spiibuf2,AC 00186 0E24 5013 00187 MOVF spiobuf3,W,AC 0E26 6EC9 00188 MOVWF SSPBUF,AC 00189 ;byte 4 0E28 00190 ispi_fs_3 0E28 A0C7 00191 BTFSS SSPSTAT,BF,AC 0E2A D7FE 00192 BRA ispi_fs_3 0E2C 50C9 00193 MOVF SSPBUF,W,AC 0E2E 6E0D 00194 MOVWF spiibuf3,AC 00195 0E30 5014 00196 MOVF spiobuf4,W,AC 0E32 6EC9 00197 MOVWF SSPBUF,AC 00198 ;byte 5 0E34 00199 ispi_fs_4 0E34 A0C7 00200 BTFSS SSPSTAT,BF,AC 0E36 D7FE 00201 BRA ispi_fs_4 0E38 50C9 00202 MOVF SSPBUF,W,AC 0E3A 6E0E 00203 MOVWF spiibuf4,AC 00204 0E3C 5015 00205 MOVF spiobuf5,W,AC 0E3E 6EC9 00206 MOVWF SSPBUF,AC gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 75 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00207 ;byte 6 0E40 00208 ispi_fs_5 0E40 A0C7 00209 BTFSS SSPSTAT,BF,AC 0E42 D7FE 00210 BRA ispi_fs_5 0E44 50C9 00211 MOVF SSPBUF,W,AC 0E46 6E0F 00212 MOVWF spiibuf5,AC 00213 00214 ;the last has to be 0xff for next 0E48 68C9 00215 SETF SSPBUF,AC 00216 0E4A 507B 00217 MOVF spi_tmpcmd,W,AC 0E4C 0BF8 00218 ANDLW 0xF8 0E4E 6E02 00219 MOVWF spi_cmd,AC ;and now storing the command 00220 0E50 BA03 00221 BTFSC drv_flags,INT_HANDLES_CMD,AC 0E52 EC4C F006 00222 CALL CMD_WORK 00223 ;at least switch on the interrupt again 0E56 969E 00224 BCF PIR1,SSPIF ;clear int-req flag 0E58 869D 00225 BSF PIE1,SSPIE,AC ;enabling spi-int 00226 ;ok, seqence for addressed driver is ready 00227 ;W,STATUS,BSR is automatically restored 0E5A 0011 00228 RETFIE 1 00229 00230 00231 00232 00233 00234 0E5C 00235 ispiall_notforus 00236 ;till here are 21 cycles used 00237 ;SSPBUF is filled with 0xff previous 00238 ;so we have to wait for 6 additional bytes, 00239 ;allways returning 0xff 00240 00241 ;byte 1 0E5C 00242 ispi_nfs_0 0E5C A0C7 00243 BTFSS SSPSTAT,BF,AC 0E5E D7FE 00244 BRA ispi_nfs_0 0E60 50C9 00245 MOVF SSPBUF,W,AC 0E62 68C9 00246 SETF SSPBUF,AC 00247 00248 ;byte 2 0E64 00249 ispi_nfs_1 0E64 A0C7 00250 BTFSS SSPSTAT,BF,AC 0E66 D7FE 00251 BRA ispi_nfs_1 0E68 50C9 00252 MOVF SSPBUF,W,AC 0E6A 68C9 00253 SETF SSPBUF,AC 00254 00255 ;byte 3 0E6C 00256 ispi_nfs_2 0E6C A0C7 00257 BTFSS SSPSTAT,BF,AC 0E6E D7FE 00258 BRA ispi_nfs_2 0E70 50C9 00259 MOVF SSPBUF,W,AC 0E72 68C9 00260 SETF SSPBUF,AC gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 76 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00261 00262 ;byte 4 0E74 00263 ispi_nfs_3 0E74 A0C7 00264 BTFSS SSPSTAT,BF,AC 0E76 D7FE 00265 BRA ispi_nfs_3 0E78 50C9 00266 MOVF SSPBUF,W,AC 0E7A 68C9 00267 SETF SSPBUF,AC 00268 00269 ;byte 5 0E7C 00270 ispi_nfs_4 0E7C A0C7 00271 BTFSS SSPSTAT,BF,AC 0E7E D7FE 00272 BRA ispi_nfs_4 0E80 50C9 00273 MOVF SSPBUF,W,AC 0E82 68C9 00274 SETF SSPBUF,AC 00275 00276 ;byte 6 0E84 00277 ispi_nfs_5 0E84 A0C7 00278 BTFSS SSPSTAT,BF,AC 0E86 D7FE 00279 BRA ispi_nfs_5 0E88 50C9 00280 MOVF SSPBUF,W,AC 0E8A 68C9 00281 SETF SSPBUF,AC 00282 00283 ;at least switch on the interrupt again 0E8C 969E 00284 BCF PIR1,SSPIF ;clear int-req flag 0E8E 869D 00285 BSF PIE1,SSPIE,AC ;enabling spi-int 00286 ;ok, seqence for non-addressed driver is ready 00287 ;W,STATUS,BSR is automatically restored 0E90 0011 00288 RETFIE 1 00289 00290 00349 00350 00351 00352 00353 ;#################################################### 00354 ;######## PWMTABLE ################################## 00355 00356 00357 #define CCPCON00 B'00001100' 00358 00359 #define CCPCON01 B'00001100' 00360 #define CCPCON02 B'00001100' 00361 #define CCPCON03 B'00011100' 00362 #define CCPCON04 B'00011100' 00363 #define CCPCON05 B'00011100' 00364 #define CCPCON06 B'00101100' 00365 #define CCPCON07 B'00101100' 00366 #define CCPCON08 B'00101100' 00367 #define CCPCON09 B'00111100' 00368 #define CCPCON10 B'00111100' 00369 #define CCPCON11 B'00111100' 00370 #define CCPCON12 B'00111100' 00371 #define CCPCON13 B'00111100' 00372 #define CCPCON14 B'00111100' gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 77 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00373 #define CCPCON15 B'00111100' 00374 00375 #define CCPCON16 B'00111100' 00376 00377 #define CCPRL_00 B'00000000' 00378 00379 #define CCPRL_01 B'01100010' 00380 #define CCPRL_02 B'11001000' 00381 #define CCPRL_03 B'00100010' 00382 #define CCPRL_04 B'01111100' 00383 #define CCPRL_05 B'11010110' 00384 #define CCPRL_06 B'00110000' 00385 #define CCPRL_07 B'01110110' 00386 #define CCPRL_08 B'11000110' 00387 #define CCPRL_09 B'00000010' 00388 #define CCPRL_10 B'00111110' 00389 #define CCPRL_11 B'01110000' 00390 #define CCPRL_12 B'10100010' 00391 #define CCPRL_13 B'10111100' 00392 #define CCPRL_14 B'11010100' 00393 #define CCPRL_15 B'11100011' 00394 00395 #define CCPRL_16 B'11101000' 00396 00397 #define PORTAHS1 B'00000100' 00398 #define PORTAHS2 B'00000100' 00399 #define PORTAHS3 B'00000000' 00400 #define PORTAHS4 B'00000000' 00401 #define PORTAHS5 B'00001000' 00402 #define PORTAHS6 B'00001000' 00403 #define PORTAHS7 B'00001100' 00404 #define PORTAHS8 B'00001100' 00405 00406 00407 ;PORTA B'0000XX00' ;MP2DIR,MP1DIR (0x00,0x04,0x08,0x0c) 00408 ;CCP1CON B'00XX1100' 10 bit highvalue duty ( XX ) and pwm on ( 0x0c | 0x00,0x10,0x20,0x30 ) 00409 ;CCPR1L low value duty 0 - 255 00410 ;CCP2CON B'00XX1100' 10 bit highvalue duty ( XX ) and pwm on ( 0x0c | 0x00,0x10,0x20,0x30 ) 00411 ;CCPR2L low value duty 0 - 255 00412 00413 ;here are 1536 bytes. 00414 ;every 6byte seqeunce represent a complete 1/32 ms. 00415 ;All values can be read directly by program, and as it is put 00416 ;to registers, and portA. 00417 ;every 6 byte sequence looks like this. 00418 ;DB Value for CCP1CON ( set to bit 5.4 ) and bit 3,2 are high ( for pwm on ); 00419 ;DB Value for CCPR1L 00420 ;DB Value for CCP2CON ( set to bit 5.4 ) and bit 3,2 are high ( for pwm on ) 00421 ;DB Value for CCPR2L 00422 ;DB dummy ( unused ) 00423 ;DB value for porta ( bits 3,2 for MP2DIR,MP1DIR ) 00424 ; 00425 ;Have a look, that always 2 byte will be packed to one word. 00426 ;So program has to read values like this: gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 78 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00427 ;1.) CCPR1L, 2.)CCP1CON, 3.)CCPR2L, 4.)CCP2CON, 5.)PORTAvalue, 6.)unused 00428 00429 ;the complete 1536 bytes represents the values for all 4 Fullsteps, 00430 ;containing the values for the 16 Microsteps per halfstep. (sinusoidal) 00431 ;the internal stepctr will be multiplicated with 6 to build a valid offset. 00432 ;the starting address must be in the normal program-mem, and a even number, 00433 ;so furthermore settings of TBLPTR affects only to TBLPTRH,TBLPTHL 00434 3000 00435 org 0x3000 00436 3000 00437 pwmtable 00438 00439 ; ccp1con, ccpr1l, ccp2con, ccpr2l, dummy, porta 00440 ;-------------------------------------------------------------------------- 00441 00442 ;FS1-HS1 3000 E83C 000C 00443 fs1hs1__cc1_00 DB CCPCON16, CCPRL_16, CCPCON00, CCPRL_00, 0x00, PORTAHS1 3004 0400 3006 E83C 620C 00444 fs1hs1__cc1_01 DB CCPCON16, CCPRL_16, CCPCON01, CCPRL_01, 0x00, PORTAHS1 300A 0400 300C E83C C80C 00445 fs1hs1__cc1_02 DB CCPCON16, CCPRL_16, CCPCON02, CCPRL_02, 0x00, PORTAHS1 3010 0400 3012 E83C 221C 00446 fs1hs1__cc1_03 DB CCPCON16, CCPRL_16, CCPCON03, CCPRL_03, 0x00, PORTAHS1 3016 0400 3018 E83C 7C1C 00447 fs1hs1__cc1_04 DB CCPCON16, CCPRL_16, CCPCON04, CCPRL_04, 0x00, PORTAHS1 301C 0400 301E E83C D61C 00448 fs1hs1__cc1_05 DB CCPCON16, CCPRL_16, CCPCON05, CCPRL_05, 0x00, PORTAHS1 3022 0400 3024 E83C 302C 00449 fs1hs1__cc1_06 DB CCPCON16, CCPRL_16, CCPCON06, CCPRL_06, 0x00, PORTAHS1 3028 0400 302A E83C 762C 00450 fs1hs1__cc1_07 DB CCPCON16, CCPRL_16, CCPCON07, CCPRL_07, 0x00, PORTAHS1 302E 0400 3030 E83C C62C 00451 fs1hs1__cc1_08 DB CCPCON16, CCPRL_16, CCPCON08, CCPRL_08, 0x00, PORTAHS1 3034 0400 3036 E83C 023C 00452 fs1hs1__cc1_09 DB CCPCON16, CCPRL_16, CCPCON09, CCPRL_09, 0x00, PORTAHS1 303A 0400 303C E83C 3E3C 00453 fs1hs1__cc1_10 DB CCPCON16, CCPRL_16, CCPCON10, CCPRL_10, 0x00, PORTAHS1 3040 0400 3042 E83C 703C 00454 fs1hs1__cc1_11 DB CCPCON16, CCPRL_16, CCPCON11, CCPRL_11, 0x00, PORTAHS1 3046 0400 3048 E83C A23C 00455 fs1hs1__cc1_12 DB CCPCON16, CCPRL_16, CCPCON12, CCPRL_12, 0x00, PORTAHS1 304C 0400 304E E83C BC3C 00456 fs1hs1__cc1_13 DB CCPCON16, CCPRL_16, CCPCON13, CCPRL_13, 0x00, PORTAHS1 3052 0400 3054 E83C D43C 00457 fs1hs1__cc1_14 DB CCPCON16, CCPRL_16, CCPCON14, CCPRL_14, 0x00, PORTAHS1 3058 0400 305A E83C E33C 00458 fs1hs1__cc1_15 DB CCPCON16, CCPRL_16, CCPCON15, CCPRL_15, 0x00, PORTAHS1 305E 0400 00459 ;FS1-HS2 3060 E83C E83C 00460 fs1hs2__cc1_00 DB CCPCON16, CCPRL_16, CCPCON16, CCPRL_16, 0x00, PORTAHS2 3064 0400 3066 E33C E83C 00461 fs1hs2__cc1_01 DB CCPCON15, CCPRL_15, CCPCON16, CCPRL_16, 0x00, PORTAHS2 306A 0400 306C D43C E83C 00462 fs1hs2__cc1_02 DB CCPCON14, CCPRL_14, CCPCON16, CCPRL_16, 0x00, PORTAHS2 gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 79 LOC OBJECT CODE LINE SOURCE TEXT VALUE 3070 0400 3072 BC3C E83C 00463 fs1hs2__cc1_03 DB CCPCON13, CCPRL_13, CCPCON16, CCPRL_16, 0x00, PORTAHS2 3076 0400 3078 A23C E83C 00464 fs1hs2__cc1_04 DB CCPCON12, CCPRL_12, CCPCON16, CCPRL_16, 0x00, PORTAHS2 307C 0400 307E 703C E83C 00465 fs1hs2__cc1_05 DB CCPCON11, CCPRL_11, CCPCON16, CCPRL_16, 0x00, PORTAHS2 3082 0400 3084 3E3C E83C 00466 fs1hs2__cc1_06 DB CCPCON10, CCPRL_10, CCPCON16, CCPRL_16, 0x00, PORTAHS2 3088 0400 308A 023C E83C 00467 fs1hs2__cc1_07 DB CCPCON09, CCPRL_09, CCPCON16, CCPRL_16, 0x00, PORTAHS2 308E 0400 3090 C62C E83C 00468 fs1hs2__cc1_08 DB CCPCON08, CCPRL_08, CCPCON16, CCPRL_16, 0x00, PORTAHS2 3094 0400 3096 762C E83C 00469 fs1hs2__cc1_09 DB CCPCON07, CCPRL_07, CCPCON16, CCPRL_16, 0x00, PORTAHS2 309A 0400 309C 302C E83C 00470 fs1hs2__cc1_10 DB CCPCON06, CCPRL_06, CCPCON16, CCPRL_16, 0x00, PORTAHS2 30A0 0400 30A2 D61C E83C 00471 fs1hs2__cc1_11 DB CCPCON05, CCPRL_05, CCPCON16, CCPRL_16, 0x00, PORTAHS2 30A6 0400 30A8 7C1C E83C 00472 fs1hs2__cc1_12 DB CCPCON04, CCPRL_04, CCPCON16, CCPRL_16, 0x00, PORTAHS2 30AC 0400 30AE 221C E83C 00473 fs1hs2__cc1_13 DB CCPCON03, CCPRL_03, CCPCON16, CCPRL_16, 0x00, PORTAHS2 30B2 0400 30B4 C80C E83C 00474 fs1hs2__cc1_14 DB CCPCON02, CCPRL_02, CCPCON16, CCPRL_16, 0x00, PORTAHS2 30B8 0400 30BA 620C E83C 00475 fs1hs2__cc1_15 DB CCPCON01, CCPRL_01, CCPCON16, CCPRL_16, 0x00, PORTAHS2 30BE 0400 00476 00477 ;FS2-HS3 30C0 000C E83C 00478 fs2hs1__cc1_00 DB CCPCON00, CCPRL_00, CCPCON16, CCPRL_16, 0x00, PORTAHS3 30C4 0000 30C6 620C E83C 00479 fs2hs1__cc1_01 DB CCPCON01, CCPRL_01, CCPCON16, CCPRL_16, 0x00, PORTAHS3 30CA 0000 30CC C80C E83C 00480 fs2hs1__cc1_02 DB CCPCON02, CCPRL_02, CCPCON16, CCPRL_16, 0x00, PORTAHS3 30D0 0000 30D2 221C E83C 00481 fs2hs1__cc1_03 DB CCPCON03, CCPRL_03, CCPCON16, CCPRL_16, 0x00, PORTAHS3 30D6 0000 30D8 7C1C E83C 00482 fs2hs1__cc1_04 DB CCPCON04, CCPRL_04, CCPCON16, CCPRL_16, 0x00, PORTAHS3 30DC 0000 30DE D61C E83C 00483 fs2hs1__cc1_05 DB CCPCON05, CCPRL_05, CCPCON16, CCPRL_16, 0x00, PORTAHS3 30E2 0000 30E4 302C E83C 00484 fs2hs1__cc1_06 DB CCPCON06, CCPRL_06, CCPCON16, CCPRL_16, 0x00, PORTAHS3 30E8 0000 30EA 762C E83C 00485 fs2hs1__cc1_07 DB CCPCON07, CCPRL_07, CCPCON16, CCPRL_16, 0x00, PORTAHS3 30EE 0000 30F0 C62C E83C 00486 fs2hs1__cc1_08 DB CCPCON08, CCPRL_08, CCPCON16, CCPRL_16, 0x00, PORTAHS3 30F4 0000 30F6 023C E83C 00487 fs2hs1__cc1_09 DB CCPCON09, CCPRL_09, CCPCON16, CCPRL_16, 0x00, PORTAHS3 30FA 0000 30FC 3E3C E83C 00488 fs2hs1__cc1_10 DB CCPCON10, CCPRL_10, CCPCON16, CCPRL_16, 0x00, PORTAHS3 3100 0000 3102 703C E83C 00489 fs2hs1__cc1_11 DB CCPCON11, CCPRL_11, CCPCON16, CCPRL_16, 0x00, PORTAHS3 3106 0000 3108 A23C E83C 00490 fs2hs1__cc1_12 DB CCPCON12, CCPRL_12, CCPCON16, CCPRL_16, 0x00, PORTAHS3 gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 80 LOC OBJECT CODE LINE SOURCE TEXT VALUE 310C 0000 310E BC3C E83C 00491 fs2hs1__cc1_13 DB CCPCON13, CCPRL_13, CCPCON16, CCPRL_16, 0x00, PORTAHS3 3112 0000 3114 D43C E83C 00492 fs2hs1__cc1_14 DB CCPCON14, CCPRL_14, CCPCON16, CCPRL_16, 0x00, PORTAHS3 3118 0000 311A E33C E83C 00493 fs2hs1__cc1_15 DB CCPCON15, CCPRL_15, CCPCON16, CCPRL_16, 0x00, PORTAHS3 311E 0000 00494 ;FS2-HS4 3120 E83C E83C 00495 fs2hs2__cc1_00 DB CCPCON16, CCPRL_16, CCPCON16, CCPRL_16, 0x00, PORTAHS4 3124 0000 3126 E83C E33C 00496 fs2hs2__cc1_01 DB CCPCON16, CCPRL_16, CCPCON15, CCPRL_15, 0x00, PORTAHS4 312A 0000 312C E83C D43C 00497 fs2hs2__cc1_02 DB CCPCON16, CCPRL_16, CCPCON14, CCPRL_14, 0x00, PORTAHS4 3130 0000 3132 E83C BC3C 00498 fs2hs2__cc1_03 DB CCPCON16, CCPRL_16, CCPCON13, CCPRL_13, 0x00, PORTAHS4 3136 0000 3138 E83C A23C 00499 fs2hs2__cc1_04 DB CCPCON16, CCPRL_16, CCPCON12, CCPRL_12, 0x00, PORTAHS4 313C 0000 313E E83C 703C 00500 fs2hs2__cc1_05 DB CCPCON16, CCPRL_16, CCPCON11, CCPRL_11, 0x00, PORTAHS4 3142 0000 3144 E83C 3E3C 00501 fs2hs2__cc1_06 DB CCPCON16, CCPRL_16, CCPCON10, CCPRL_10, 0x00, PORTAHS4 3148 0000 314A E83C 023C 00502 fs2hs2__cc1_07 DB CCPCON16, CCPRL_16, CCPCON09, CCPRL_09, 0x00, PORTAHS4 314E 0000 3150 E83C C62C 00503 fs2hs2__cc1_08 DB CCPCON16, CCPRL_16, CCPCON08, CCPRL_08, 0x00, PORTAHS4 3154 0000 3156 E83C 762C 00504 fs2hs2__cc1_09 DB CCPCON16, CCPRL_16, CCPCON07, CCPRL_07, 0x00, PORTAHS4 315A 0000 315C E83C 302C 00505 fs2hs2__cc1_10 DB CCPCON16, CCPRL_16, CCPCON06, CCPRL_06, 0x00, PORTAHS4 3160 0000 3162 E83C D61C 00506 fs2hs2__cc1_11 DB CCPCON16, CCPRL_16, CCPCON05, CCPRL_05, 0x00, PORTAHS4 3166 0000 3168 E83C 7C1C 00507 fs2hs2__cc1_12 DB CCPCON16, CCPRL_16, CCPCON04, CCPRL_04, 0x00, PORTAHS4 316C 0000 316E E83C 221C 00508 fs2hs2__cc1_13 DB CCPCON16, CCPRL_16, CCPCON03, CCPRL_03, 0x00, PORTAHS4 3172 0000 3174 E83C C80C 00509 fs2hs2__cc1_14 DB CCPCON16, CCPRL_16, CCPCON02, CCPRL_02, 0x00, PORTAHS4 3178 0000 317A E83C 620C 00510 fs2hs2__cc1_15 DB CCPCON16, CCPRL_16, CCPCON01, CCPRL_01, 0x00, PORTAHS4 317E 0000 00511 00512 ;FS3-HS5 3180 E83C 000C 00513 fs3hs1__cc1_00 DB CCPCON16, CCPRL_16, CCPCON00, CCPRL_00, 0x00, PORTAHS5 3184 0800 3186 E83C 620C 00514 fs3hs1__cc1_01 DB CCPCON16, CCPRL_16, CCPCON01, CCPRL_01, 0x00, PORTAHS5 318A 0800 318C E83C C80C 00515 fs3hs1__cc1_02 DB CCPCON16, CCPRL_16, CCPCON02, CCPRL_02, 0x00, PORTAHS5 3190 0800 3192 E83C 221C 00516 fs3hs1__cc1_03 DB CCPCON16, CCPRL_16, CCPCON03, CCPRL_03, 0x00, PORTAHS5 3196 0800 3198 E83C 7C1C 00517 fs3hs1__cc1_04 DB CCPCON16, CCPRL_16, CCPCON04, CCPRL_04, 0x00, PORTAHS5 319C 0800 319E E83C D61C 00518 fs3hs1__cc1_05 DB CCPCON16, CCPRL_16, CCPCON05, CCPRL_05, 0x00, PORTAHS5 31A2 0800 gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 81 LOC OBJECT CODE LINE SOURCE TEXT VALUE 31A4 E83C 302C 00519 fs3hs1__cc1_06 DB CCPCON16, CCPRL_16, CCPCON06, CCPRL_06, 0x00, PORTAHS5 31A8 0800 31AA E83C 762C 00520 fs3hs1__cc1_07 DB CCPCON16, CCPRL_16, CCPCON07, CCPRL_07, 0x00, PORTAHS5 31AE 0800 31B0 E83C C62C 00521 fs3hs1__cc1_08 DB CCPCON16, CCPRL_16, CCPCON08, CCPRL_08, 0x00, PORTAHS5 31B4 0800 31B6 E83C 023C 00522 fs3hs1__cc1_09 DB CCPCON16, CCPRL_16, CCPCON09, CCPRL_09, 0x00, PORTAHS5 31BA 0800 31BC E83C 3E3C 00523 fs3hs1__cc1_10 DB CCPCON16, CCPRL_16, CCPCON10, CCPRL_10, 0x00, PORTAHS5 31C0 0800 31C2 E83C 703C 00524 fs3hs1__cc1_11 DB CCPCON16, CCPRL_16, CCPCON11, CCPRL_11, 0x00, PORTAHS5 31C6 0800 31C8 E83C A23C 00525 fs3hs1__cc1_12 DB CCPCON16, CCPRL_16, CCPCON12, CCPRL_12, 0x00, PORTAHS5 31CC 0800 31CE E83C BC3C 00526 fs3hs1__cc1_13 DB CCPCON16, CCPRL_16, CCPCON13, CCPRL_13, 0x00, PORTAHS5 31D2 0800 31D4 E83C D43C 00527 fs3hs1__cc1_14 DB CCPCON16, CCPRL_16, CCPCON14, CCPRL_14, 0x00, PORTAHS5 31D8 0800 31DA E83C E33C 00528 fs3hs1__cc1_15 DB CCPCON16, CCPRL_16, CCPCON15, CCPRL_15, 0x00, PORTAHS5 31DE 0800 00529 ;FS3-HS6 31E0 E83C E83C 00530 fs3hs2__cc1_00 DB CCPCON16, CCPRL_16, CCPCON16, CCPRL_16, 0x00, PORTAHS6 31E4 0800 31E6 E33C E83C 00531 fs3hs2__cc1_01 DB CCPCON15, CCPRL_15, CCPCON16, CCPRL_16, 0x00, PORTAHS6 31EA 0800 31EC D43C E83C 00532 fs3hs2__cc1_02 DB CCPCON14, CCPRL_14, CCPCON16, CCPRL_16, 0x00, PORTAHS6 31F0 0800 31F2 BC3C E83C 00533 fs3hs2__cc1_03 DB CCPCON13, CCPRL_13, CCPCON16, CCPRL_16, 0x00, PORTAHS6 31F6 0800 31F8 A23C E83C 00534 fs3hs2__cc1_04 DB CCPCON12, CCPRL_12, CCPCON16, CCPRL_16, 0x00, PORTAHS6 31FC 0800 31FE 703C E83C 00535 fs3hs2__cc1_05 DB CCPCON11, CCPRL_11, CCPCON16, CCPRL_16, 0x00, PORTAHS6 3202 0800 3204 3E3C E83C 00536 fs3hs2__cc1_06 DB CCPCON10, CCPRL_10, CCPCON16, CCPRL_16, 0x00, PORTAHS6 3208 0800 320A 023C E83C 00537 fs3hs2__cc1_07 DB CCPCON09, CCPRL_09, CCPCON16, CCPRL_16, 0x00, PORTAHS6 320E 0800 3210 C62C E83C 00538 fs3hs2__cc1_08 DB CCPCON08, CCPRL_08, CCPCON16, CCPRL_16, 0x00, PORTAHS6 3214 0800 3216 762C E83C 00539 fs3hs2__cc1_09 DB CCPCON07, CCPRL_07, CCPCON16, CCPRL_16, 0x00, PORTAHS6 321A 0800 321C 302C E83C 00540 fs3hs2__cc1_10 DB CCPCON06, CCPRL_06, CCPCON16, CCPRL_16, 0x00, PORTAHS6 3220 0800 3222 D61C E83C 00541 fs3hs2__cc1_11 DB CCPCON05, CCPRL_05, CCPCON16, CCPRL_16, 0x00, PORTAHS6 3226 0800 3228 7C1C E83C 00542 fs3hs2__cc1_12 DB CCPCON04, CCPRL_04, CCPCON16, CCPRL_16, 0x00, PORTAHS6 322C 0800 322E 221C E83C 00543 fs3hs2__cc1_13 DB CCPCON03, CCPRL_03, CCPCON16, CCPRL_16, 0x00, PORTAHS6 3232 0800 3234 C80C E83C 00544 fs3hs2__cc1_14 DB CCPCON02, CCPRL_02, CCPCON16, CCPRL_16, 0x00, PORTAHS6 3238 0800 323A 620C E83C 00545 fs3hs2__cc1_15 DB CCPCON01, CCPRL_01, CCPCON16, CCPRL_16, 0x00, PORTAHS6 323E 0800 00546 gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 82 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00547 ;FS4-HS7 3240 000C E83C 00548 fs4hs1__cc1_00 DB CCPCON00, CCPRL_00, CCPCON16, CCPRL_16, 0x00, PORTAHS7 3244 0C00 3246 620C E83C 00549 fs4hs1__cc1_01 DB CCPCON01, CCPRL_01, CCPCON16, CCPRL_16, 0x00, PORTAHS7 324A 0C00 324C C80C E83C 00550 fs4hs1__cc1_02 DB CCPCON02, CCPRL_02, CCPCON16, CCPRL_16, 0x00, PORTAHS7 3250 0C00 3252 221C E83C 00551 fs4hs1__cc1_03 DB CCPCON03, CCPRL_03, CCPCON16, CCPRL_16, 0x00, PORTAHS7 3256 0C00 3258 7C1C E83C 00552 fs4hs1__cc1_04 DB CCPCON04, CCPRL_04, CCPCON16, CCPRL_16, 0x00, PORTAHS7 325C 0C00 325E D61C E83C 00553 fs4hs1__cc1_05 DB CCPCON05, CCPRL_05, CCPCON16, CCPRL_16, 0x00, PORTAHS7 3262 0C00 3264 302C E83C 00554 fs4hs1__cc1_06 DB CCPCON06, CCPRL_06, CCPCON16, CCPRL_16, 0x00, PORTAHS7 3268 0C00 326A 762C E83C 00555 fs4hs1__cc1_07 DB CCPCON07, CCPRL_07, CCPCON16, CCPRL_16, 0x00, PORTAHS7 326E 0C00 3270 C62C E83C 00556 fs4hs1__cc1_08 DB CCPCON08, CCPRL_08, CCPCON16, CCPRL_16, 0x00, PORTAHS7 3274 0C00 3276 023C E83C 00557 fs4hs1__cc1_09 DB CCPCON09, CCPRL_09, CCPCON16, CCPRL_16, 0x00, PORTAHS7 327A 0C00 327C 3E3C E83C 00558 fs4hs1__cc1_10 DB CCPCON10, CCPRL_10, CCPCON16, CCPRL_16, 0x00, PORTAHS7 3280 0C00 3282 703C E83C 00559 fs4hs1__cc1_11 DB CCPCON11, CCPRL_11, CCPCON16, CCPRL_16, 0x00, PORTAHS7 3286 0C00 3288 A23C E83C 00560 fs4hs1__cc1_12 DB CCPCON12, CCPRL_12, CCPCON16, CCPRL_16, 0x00, PORTAHS7 328C 0C00 328E BC3C E83C 00561 fs4hs1__cc1_13 DB CCPCON13, CCPRL_13, CCPCON16, CCPRL_16, 0x00, PORTAHS7 3292 0C00 3294 D43C E83C 00562 fs4hs1__cc1_14 DB CCPCON14, CCPRL_14, CCPCON16, CCPRL_16, 0x00, PORTAHS7 3298 0C00 329A E33C E83C 00563 fs4hs1__cc1_15 DB CCPCON15, CCPRL_15, CCPCON16, CCPRL_16, 0x00, PORTAHS7 329E 0C00 00564 ;FS4-HS8 32A0 E83C E83C 00565 fs4hs2__cc1_00 DB CCPCON16, CCPRL_16, CCPCON16, CCPRL_16, 0x00, PORTAHS8 32A4 0C00 32A6 E83C E33C 00566 fs4hs2__cc1_01 DB CCPCON16, CCPRL_16, CCPCON15, CCPRL_15, 0x00, PORTAHS8 32AA 0C00 32AC E83C D43C 00567 fs4hs2__cc1_02 DB CCPCON16, CCPRL_16, CCPCON14, CCPRL_14, 0x00, PORTAHS8 32B0 0C00 32B2 E83C BC3C 00568 fs4hs2__cc1_03 DB CCPCON16, CCPRL_16, CCPCON13, CCPRL_13, 0x00, PORTAHS8 32B6 0C00 32B8 E83C A23C 00569 fs4hs2__cc1_04 DB CCPCON16, CCPRL_16, CCPCON12, CCPRL_12, 0x00, PORTAHS8 32BC 0C00 32BE E83C 703C 00570 fs4hs2__cc1_05 DB CCPCON16, CCPRL_16, CCPCON11, CCPRL_11, 0x00, PORTAHS8 32C2 0C00 32C4 E83C 3E3C 00571 fs4hs2__cc1_06 DB CCPCON16, CCPRL_16, CCPCON10, CCPRL_10, 0x00, PORTAHS8 32C8 0C00 32CA E83C 023C 00572 fs4hs2__cc1_07 DB CCPCON16, CCPRL_16, CCPCON09, CCPRL_09, 0x00, PORTAHS8 32CE 0C00 32D0 E83C C62C 00573 fs4hs2__cc1_08 DB CCPCON16, CCPRL_16, CCPCON08, CCPRL_08, 0x00, PORTAHS8 32D4 0C00 32D6 E83C 762C 00574 fs4hs2__cc1_09 DB CCPCON16, CCPRL_16, CCPCON07, CCPRL_07, 0x00, PORTAHS8 32DA 0C00 gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 83 LOC OBJECT CODE LINE SOURCE TEXT VALUE 32DC E83C 302C 00575 fs4hs2__cc1_10 DB CCPCON16, CCPRL_16, CCPCON06, CCPRL_06, 0x00, PORTAHS8 32E0 0C00 32E2 E83C D61C 00576 fs4hs2__cc1_11 DB CCPCON16, CCPRL_16, CCPCON05, CCPRL_05, 0x00, PORTAHS8 32E6 0C00 32E8 E83C 7C1C 00577 fs4hs2__cc1_12 DB CCPCON16, CCPRL_16, CCPCON04, CCPRL_04, 0x00, PORTAHS8 32EC 0C00 32EE E83C 221C 00578 fs4hs2__cc1_13 DB CCPCON16, CCPRL_16, CCPCON03, CCPRL_03, 0x00, PORTAHS8 32F2 0C00 32F4 E83C C80C 00579 fs4hs2__cc1_14 DB CCPCON16, CCPRL_16, CCPCON02, CCPRL_02, 0x00, PORTAHS8 32F8 0C00 32FA E83C 620C 00580 fs4hs2__cc1_15 DB CCPCON16, CCPRL_16, CCPCON01, CCPRL_01, 0x00, PORTAHS8 32FE 0C00 00581 00582 00583 ;######################################################################## 00584 ;######################### EEPROM DATAS ################################# 00585 ;######################################################################## 00586 00587 ;ee_diddel DE 0x00,0x01,0x02,0x03 00588 00589 00590 gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 84 SYMBOL TABLE LABEL VALUE A 00000000 AC 00000000 ACCESS 00000000 ACKDT 00000005 ACKEN 00000004 ACKSTAT 00000006 ADCON0 00000FC2 ADCON1 00000FC1 ADCS0 00000006 ADCS1 00000007 ADCS2 00000006 ADDEN 00000003 ADFM 00000007 ADIE 00000006 ADIF 00000006 ADIP 00000006 ADON 00000000 ADRESH 00000FC4 ADRESL 00000FC3 AN0 00000000 AN1 00000001 AN2 00000002 AN3 00000003 AN4 00000005 BANKED 00000001 BCLIE 00000003 BCLIF 00000003 BCLIP 00000003 BF 00000000 BK 00000001 BOR 00000000 BRGH 00000002 BSR 00000FE0 C 00000000 CCP1 00000002 CCP1CON 00000FBD CCP1IE 00000002 CCP1IF 00000002 CCP1IP 00000002 CCP1M0 00000000 CCP1M1 00000001 CCP1M2 00000002 CCP1M3 00000003 CCP1X 00000005 CCP1Y 00000004 CCP2 00000001 CCP2A 00000003 CCP2CON 00000FBA CCP2IE 00000000 CCP2IF 00000000 CCP2IP 00000000 CCP2M0 00000000 CCP2M1 00000001 gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 85 LOC OBJECT CODE LINE SOURCE TEXT VALUE CCP2M2 00000002 CCP2M3 00000003 CCP2X 00000005 CCP2Y 00000004 CCPR1H 00000FBF CCPR1L 00000FBE CCPR2H 00000FBC CCPR2L 00000FBB CFGS 00000006 CHS0 00000003 CHS1 00000004 CHS2 00000005 CK 00000006 CKE 00000006 CKP 00000004 CLKO 00000006 CMD_WORK 00000C98 CONTENTS5 00000004 CREN 00000004 CSRC 00000007 D 00000005 DATA_ADDRESS 00000005 DC 00000001 DC1B0 00000004 DC1B1 00000005 DC2B0 00000004 DC2B1 00000005 DONE 00000002 DONT_IGNORES5 00000005 D_A 00000005 EEADR 00000FA9 EECON1 00000FA6 EECON2 00000FA7 EEDATA 00000FA8 EEIE 00000004 EEIF 00000004 EEIP 00000004 EEPGD 00000007 EEPROM_CFG 00000003 ENC_LEFTDOWN 00000007 ENC_WORK 00000B44 FAST 00000001 FERR 00000002 FREE 00000004 FSR0 00000000 FSR0H 00000FEA FSR0L 00000FE9 FSR1 00000001 FSR1H 00000FE2 FSR1L 00000FE1 FSR2 00000002 FSR2H 00000FDA FSR2L 00000FD9 GCEN 00000007 gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 86 LOC OBJECT CODE LINE SOURCE TEXT VALUE GENINIT 0000001C GENLOOP 000000C2 GIE 00000007 GIEH 00000007 GIEL 00000006 GO 00000002 GO_DONE 00000002 I2C_DAT 00000005 I2C_READ 00000002 I2C_START 00000003 I2C_STOP 00000004 INDF0 00000FEF INDF1 00000FE7 INDF2 00000FDF INT0 00000000 INT0E 00000004 INT0F 00000001 INT0IE 00000004 INT0IF 00000001 INT1 00000001 INT1IE 00000003 INT1IF 00000000 INT1IP 00000006 INT2 00000002 INT2IE 00000004 INT2IF 00000001 INT2IP 00000007 INTCON 00000FF2 INTCON1 00000FF2 INTCON2 00000FF1 INTCON3 00000FF0 INTEDG0 00000006 INTEDG1 00000005 INTEDG2 00000004 INT_AS_FRQ 00000007 INT_HANDLES_CMD 00000005 INT_SPI 00000D66 INT_TIMER 000000EE IPEN 00000007 IPR1 00000F9F IPR2 00000FA2 IRVST 00000005 LATA 00000F89 LATB 00000F8A LATC 00000F8B LVDCON 00000FD2 LVDEN 00000004 LVDIE 00000002 LVDIF 00000002 LVDIN 00000005 LVDIP 00000002 LVDL0 00000000 LVDL1 00000001 LVDL2 00000002 gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 87 LOC OBJECT CODE LINE SOURCE TEXT VALUE LVDL3 00000003 MENCA 00000000 MENCB 00000001 N 00000004 NOT_A 00000005 NOT_ADDRESS 00000005 NOT_BOR 00000000 NOT_DONE 00000002 NOT_PD 00000002 NOT_POR 00000001 NOT_RBPU 00000007 NOT_RC8 00000006 NOT_RI 00000004 NOT_T1SYNC 00000002 NOT_T3SYNC 00000002 NOT_TO 00000003 NOT_TX8 00000006 NOT_W 00000002 NOT_WRITE 00000002 NO_CIRCLE 00000002 OERR 00000001 OFFSET_ROLLEFT 00000007 OSC2 00000006 OSCCON 00000FD3 OV 00000003 P 00000004 PCFG0 00000000 PCFG1 00000001 PCFG2 00000002 PCFG3 00000003 PCL 00000FF9 PCLATH 00000FFA PCLATU 00000FFB PD 00000002 PEIE 00000006 PEN 00000002 PIE1 00000F9D PIE2 00000FA0 PIR1 00000F9E PIR2 00000FA1 PLUSW0 00000FEB PLUSW1 00000FE3 PLUSW2 00000FDB POR 00000001 PORTA 00000F80 PORTB 00000F81 PORTC 00000F82 POSTDEC0 00000FED POSTDEC1 00000FE5 POSTDEC2 00000FDD POSTINC0 00000FEE POSTINC1 00000FE6 POSTINC2 00000FDE POS_EQUAL 00000005 gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 88 LOC OBJECT CODE LINE SOURCE TEXT VALUE POS_FARAWAY 00000002 POS_GREATER 00000003 POS_SMALLER 00000004 PR2 00000FCB PREINC0 00000FEC PREINC1 00000FE4 PREINC2 00000FDC PRODH 00000FF4 PRODL 00000FF3 PSA 00000003 PSPIE 00000007 PSPIF 00000007 PSPIP 00000007 R 00000002 RA0 00000000 RA1 00000001 RA2 00000002 RA3 00000003 RA4 00000004 RA5 00000005 RA6 00000006 RB0 00000000 RB1 00000001 RB2 00000002 RB3 00000003 RB4 00000004 RB5 00000005 RB6 00000006 RB7 00000007 RBIE 00000003 RBIF 00000000 RBIP 00000000 RBPU 00000007 RC0 00000000 RC1 00000001 RC2 00000002 RC3 00000003 RC4 00000004 RC5 00000005 RC6 00000006 RC7 00000007 RC8_9 00000006 RC9 00000006 RCD8 00000000 RCEN 00000003 RCIE 00000005 RCIF 00000005 RCIP 00000005 RCON 00000FD0 RCREG 00000FAE RCSTA 00000FAB RD 00000000 RD16 00000007 READ_WRITE 00000002 gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 89 LOC OBJECT CODE LINE SOURCE TEXT VALUE RESTART_FRQ 00000006 RI 00000004 RSEN 00000001 RUN_LEFTDOWN 00000006 RX 00000007 RX9 00000006 RX9D 00000000 R_W 00000002 S 00000003 SCK 00000003 SCL 00000003 SCS 00000000 SDA 00000004 SDI 00000004 SDO 00000005 SEN 00000000 SMP 00000007 SPBRG 00000FAF SPEN 00000007 SREN 00000005 SS 00000005 SSPADD 00000FC8 SSPBUF 00000FC9 SSPCON1 00000FC6 SSPCON2 00000FC5 SSPEN 00000005 SSPIE 00000003 SSPIF 00000003 SSPIP 00000003 SSPM0 00000000 SSPM1 00000001 SSPM2 00000002 SSPM3 00000003 SSPOV 00000006 SSPSTAT 00000FC7 STATUS 00000FD8 STEP_ON 00000007 STEP_WORK 00000AF0 STKFUL 00000007 STKPTR 00000FFC STKUNF 00000006 SWDTE 00000000 SWDTEN 00000000 SYNC 00000004 T08BIT 00000006 T0CKI 00000004 T0CON 00000FD5 T0CS 00000005 T0IE 00000005 T0IF 00000002 T0IP 00000002 T0PS0 00000000 T0PS1 00000001 T0PS2 00000002 gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 90 LOC OBJECT CODE LINE SOURCE TEXT VALUE T0SE 00000004 T1CKI 00000000 T1CKPS0 00000004 T1CKPS1 00000005 T1CON 00000FCD T1INSYNC 00000002 T1OSCEN 00000003 T1OSI 00000001 T1OSO 00000000 T1SYNC 00000002 T2CKPS0 00000000 T2CKPS1 00000001 T2CON 00000FCA T3CCP1 00000003 T3CCP2 00000006 T3CKPS0 00000004 T3CKPS1 00000005 T3CON 00000FB1 T3INSYNC 00000002 T3SYNC 00000002 TABLAT 00000FF5 TBLPTRH 00000FF7 TBLPTRL 00000FF6 TBLPTRU 00000FF8 TIMER_AS_FRQ 00000006 TMR0H 00000FD7 TMR0IE 00000005 TMR0IF 00000002 TMR0IP 00000002 TMR0L 00000FD6 TMR0ON 00000007 TMR1CS 00000001 TMR1H 00000FCF TMR1IE 00000000 TMR1IF 00000000 TMR1IP 00000000 TMR1L 00000FCE TMR1ON 00000000 TMR2 00000FCC TMR2IE 00000001 TMR2IF 00000001 TMR2IP 00000001 TMR2ON 00000002 TMR3CS 00000001 TMR3H 00000FB3 TMR3IE 00000001 TMR3IF 00000001 TMR3IP 00000001 TMR3L 00000FB2 TMR3ON 00000000 TO 00000003 TOSH 00000FFE TOSL 00000FFD TOSU 00000FFF gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 91 LOC OBJECT CODE LINE SOURCE TEXT VALUE TOUTPS0 00000003 TOUTPS1 00000004 TOUTPS2 00000005 TOUTPS3 00000006 TRISA 00000F92 TRISB 00000F93 TRISC 00000F94 TRMT 00000001 TX 00000006 TX8_9 00000006 TX9 00000006 TX9D 00000000 TXD8 00000000 TXEN 00000005 TXIE 00000004 TXIF 00000004 TXIP 00000004 TXREG 00000FAD TXSTA 00000FAC UA 00000001 VREFM 00000002 VREFP 00000003 W 00000000 WCOL 00000007 WDTCON 00000FD1 WR 00000001 WREG 00000FE8 WREN 00000002 WRERR 00000003 Z 00000002 _BORV_20_2L 000000FF _BORV_27_2L 000000FB _BORV_42_2L 000000F7 _BORV_45_2L 000000F3 _BOR_OFF_2L 000000FD _BOR_ON_2L 000000FF _CCP2MX_OFF_3H 000000FE _CCP2MX_ON_3H 000000FF _CONFIG1H 00300001 _CONFIG1L 00300000 _CONFIG2H 00300003 _CONFIG2L 00300002 _CONFIG3H 00300005 _CONFIG3L 00300004 _CONFIG4H 00300007 _CONFIG4L 00300006 _CONFIG5H 00300009 _CONFIG5L 00300008 _CONFIG6H 0030000B _CONFIG6L 0030000A _CONFIG7H 0030000D _CONFIG7L 0030000C _CP0_OFF_5L 000000FF _CP0_ON_5L 000000FE gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 92 LOC OBJECT CODE LINE SOURCE TEXT VALUE _CP1_OFF_5L 000000FF _CP1_ON_5L 000000FD _CP2_OFF_5L 000000FF _CP2_ON_5L 000000FB _CP3_OFF_5L 000000FF _CP3_ON_5L 000000F7 _CPB_OFF_5H 000000FF _CPB_ON_5H 000000BF _CPD_OFF_5H 000000FF _CPD_ON_5H 0000007F _DEBUG_OFF_4L 000000FF _DEBUG_ON_4L 0000007F _DEVID1 003FFFFE _DEVID2 003FFFFF _EBTR0_OFF_7L 000000FF _EBTR0_ON_7L 000000FE _EBTR1_OFF_7L 000000FF _EBTR1_ON_7L 000000FD _EBTR2_OFF_7L 000000FF _EBTR2_ON_7L 000000FB _EBTR3_OFF_7L 000000FF _EBTR3_ON_7L 000000F7 _EBTRB_OFF_7H 000000FF _EBTRB_ON_7H 000000BF _ECIO_OSC_1H 000000FD _EC_OSC_1H 000000FC _HSPLL_OSC_1H 000000FE _HS_OSC_1H 000000FA _IDLOC0 00200000 _IDLOC1 00200001 _IDLOC2 00200002 _IDLOC3 00200003 _IDLOC4 00200004 _IDLOC5 00200005 _IDLOC6 00200006 _IDLOC7 00200007 _LP_OSC_1H 000000F8 _LVP_OFF_4L 000000FB _LVP_ON_4L 000000FF _OSCS_OFF_1H 000000FF _OSCS_ON_1H 000000DF _PWRT_OFF_2L 000000FF _PWRT_ON_2L 000000FE _RCIO_OSC_1H 000000FF _RC_OSC_1H 000000FB _STVR_OFF_4L 000000FE _STVR_ON_4L 000000FF _WDTPS_128_2H 000000FF _WDTPS_16_2H 000000F9 _WDTPS_1_2H 000000F1 _WDTPS_2_2H 000000F3 _WDTPS_32_2H 000000FB _WDTPS_4_2H 000000F5 _WDTPS_64_2H 000000FD gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 93 LOC OBJECT CODE LINE SOURCE TEXT VALUE _WDTPS_8_2H 000000F7 _WDT_OFF_2H 000000FE _WDT_ON_2H 000000FF _WRT0_OFF_6L 000000FF _WRT0_ON_6L 000000FE _WRT1_OFF_6L 000000FF _WRT1_ON_6L 000000FD _WRT2_OFF_6L 000000FF _WRT2_ON_6L 000000FB _WRT3_OFF_6L 000000FF _WRT3_ON_6L 000000F7 _WRTB_OFF_6H 000000FF _WRTB_ON_6H 000000BF _WRTC_OFF_6H 000000FF _WRTC_ON_6H 000000DF _WRTD_OFF_6H 000000FF _WRTD_ON_6H 0000007F _XT_OSC_1H 000000F9 __18F242 00000001 adapt_now 00000A42 adaptfar 00000A62 adaptnear 00000A6C adaptstepsize 00000B22 add_mscur_to_pos_ov 00000992 addmscur 000009CA addmscurtst0 000009B8 addmscurtsteq 000009AE addmscurtsteqgr 000009C2 calcnewencpos 00000B5E calcnewpos 00000B2C cmdstsettval 00000CD4 cmdwork_config 00000D16 cmdwork_config1 00000D24 cmdwork_config2 00000D42 cmdwork_setpos 00000CEA cmdwork_settarget 00000CB0 cmdwork_stopandclear 00000D04 cmdworkend 00000D62 cmdworkstend 00000CD8 cur0_1 00000900 cur0_3 000008FC cur0_7 000008F8 cur0_f 000008F4 cur2_3 00000910 cur4_5 00000924 cur4_7 00000920 cur6_7 00000934 cur8_9 0000094C cur8_b 00000948 cur8_f 00000944 cur__0 00000904 cur__1 0000090A cur__2 00000914 cur__3 0000091A gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 94 LOC OBJECT CODE LINE SOURCE TEXT VALUE cur__4 00000928 cur__5 0000092E cur__6 00000938 cur__7 0000093E cur__8 00000950 cur__9 00000956 cur__a 00000960 cur__b 00000966 cur__c 00000974 cur__d 0000097A cur__e 00000984 cur__f 0000098A cura_b 0000095C curc_d 00000970 curc_f 0000096C cure_f 00000980 curpos0 0000001E curpos1 0000001D curpos2 0000001C curpos3 0000001B cursecmatrix0 000001C0 cursecmatrix1 0000022A cursecmatrix2 00000294 cursecmatrix3 000002FE cursecmatrix4 00000368 cursecmatrix5 000003D2 cursecmatrix6 0000043C cursecmatrix7 000004A6 cursecmatrix8 00000510 cursecmatrix9 0000057A cursecmatrixa 000005E4 cursecmatrixb 0000064E cursecmatrixc 000006B8 cursecmatrixd 00000722 cursecmatrixe 0000078C cursecmatrixf 000007F6 dec_encval 00000144 dec_encval_ov 00000134 dostepwork 00000B0E dostepworkcircle 00000B1E drv_flags 00000003 encHigh 00000017 encLow 00000018 encMaxHigh 00000019 encMaxLow 0000001A enc_now 00000ABC enc_tmp 00000079 enc_tmpold 00000078 encnow00 00000AD0 encnow01 00000AD8 encnow10 00000AE0 encnow11 00000AE8 encvaluechanged 00000B56 endencpos 00000B6A gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 95 LOC OBJECT CODE LINE SOURCE TEXT VALUE endnewpos 00000B38 fs1hs1__cc1_00 00003000 fs1hs1__cc1_01 00003006 fs1hs1__cc1_02 0000300C fs1hs1__cc1_03 00003012 fs1hs1__cc1_04 00003018 fs1hs1__cc1_05 0000301E fs1hs1__cc1_06 00003024 fs1hs1__cc1_07 0000302A fs1hs1__cc1_08 00003030 fs1hs1__cc1_09 00003036 fs1hs1__cc1_10 0000303C fs1hs1__cc1_11 00003042 fs1hs1__cc1_12 00003048 fs1hs1__cc1_13 0000304E fs1hs1__cc1_14 00003054 fs1hs1__cc1_15 0000305A fs1hs2__cc1_00 00003060 fs1hs2__cc1_01 00003066 fs1hs2__cc1_02 0000306C fs1hs2__cc1_03 00003072 fs1hs2__cc1_04 00003078 fs1hs2__cc1_05 0000307E fs1hs2__cc1_06 00003084 fs1hs2__cc1_07 0000308A fs1hs2__cc1_08 00003090 fs1hs2__cc1_09 00003096 fs1hs2__cc1_10 0000309C fs1hs2__cc1_11 000030A2 fs1hs2__cc1_12 000030A8 fs1hs2__cc1_13 000030AE fs1hs2__cc1_14 000030B4 fs1hs2__cc1_15 000030BA fs2hs1__cc1_00 000030C0 fs2hs1__cc1_01 000030C6 fs2hs1__cc1_02 000030CC fs2hs1__cc1_03 000030D2 fs2hs1__cc1_04 000030D8 fs2hs1__cc1_05 000030DE fs2hs1__cc1_06 000030E4 fs2hs1__cc1_07 000030EA fs2hs1__cc1_08 000030F0 fs2hs1__cc1_09 000030F6 fs2hs1__cc1_10 000030FC fs2hs1__cc1_11 00003102 fs2hs1__cc1_12 00003108 fs2hs1__cc1_13 0000310E fs2hs1__cc1_14 00003114 fs2hs1__cc1_15 0000311A fs2hs2__cc1_00 00003120 fs2hs2__cc1_01 00003126 fs2hs2__cc1_02 0000312C fs2hs2__cc1_03 00003132 fs2hs2__cc1_04 00003138 gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 96 LOC OBJECT CODE LINE SOURCE TEXT VALUE fs2hs2__cc1_05 0000313E fs2hs2__cc1_06 00003144 fs2hs2__cc1_07 0000314A fs2hs2__cc1_08 00003150 fs2hs2__cc1_09 00003156 fs2hs2__cc1_10 0000315C fs2hs2__cc1_11 00003162 fs2hs2__cc1_12 00003168 fs2hs2__cc1_13 0000316E fs2hs2__cc1_14 00003174 fs2hs2__cc1_15 0000317A fs3hs1__cc1_00 00003180 fs3hs1__cc1_01 00003186 fs3hs1__cc1_02 0000318C fs3hs1__cc1_03 00003192 fs3hs1__cc1_04 00003198 fs3hs1__cc1_05 0000319E fs3hs1__cc1_06 000031A4 fs3hs1__cc1_07 000031AA fs3hs1__cc1_08 000031B0 fs3hs1__cc1_09 000031B6 fs3hs1__cc1_10 000031BC fs3hs1__cc1_11 000031C2 fs3hs1__cc1_12 000031C8 fs3hs1__cc1_13 000031CE fs3hs1__cc1_14 000031D4 fs3hs1__cc1_15 000031DA fs3hs2__cc1_00 000031E0 fs3hs2__cc1_01 000031E6 fs3hs2__cc1_02 000031EC fs3hs2__cc1_03 000031F2 fs3hs2__cc1_04 000031F8 fs3hs2__cc1_05 000031FE fs3hs2__cc1_06 00003204 fs3hs2__cc1_07 0000320A fs3hs2__cc1_08 00003210 fs3hs2__cc1_09 00003216 fs3hs2__cc1_10 0000321C fs3hs2__cc1_11 00003222 fs3hs2__cc1_12 00003228 fs3hs2__cc1_13 0000322E fs3hs2__cc1_14 00003234 fs3hs2__cc1_15 0000323A fs4hs1__cc1_00 00003240 fs4hs1__cc1_01 00003246 fs4hs1__cc1_02 0000324C fs4hs1__cc1_03 00003252 fs4hs1__cc1_04 00003258 fs4hs1__cc1_05 0000325E fs4hs1__cc1_06 00003264 fs4hs1__cc1_07 0000326A fs4hs1__cc1_08 00003270 fs4hs1__cc1_09 00003276 fs4hs1__cc1_10 0000327C gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 97 LOC OBJECT CODE LINE SOURCE TEXT VALUE fs4hs1__cc1_11 00003282 fs4hs1__cc1_12 00003288 fs4hs1__cc1_13 0000328E fs4hs1__cc1_14 00003294 fs4hs1__cc1_15 0000329A fs4hs2__cc1_00 000032A0 fs4hs2__cc1_01 000032A6 fs4hs2__cc1_02 000032AC fs4hs2__cc1_03 000032B2 fs4hs2__cc1_04 000032B8 fs4hs2__cc1_05 000032BE fs4hs2__cc1_06 000032C4 fs4hs2__cc1_07 000032CA fs4hs2__cc1_08 000032D0 fs4hs2__cc1_09 000032D6 fs4hs2__cc1_10 000032DC fs4hs2__cc1_11 000032E2 fs4hs2__cc1_12 000032E8 fs4hs2__cc1_13 000032EE fs4hs2__cc1_14 000032F4 fs4hs2__cc1_15 000032FA inc_encval_cmp 00000122 inc_encval_ov 0000011C inioffb1 00000C2C inioffb1empty 00000C2A inioffb2 00000BF6 inioffb2empty 00000BF4 inioffb3 00000BC0 inioffb3empty 00000BBE init_scanoffset 00000B84 initscanoffbit0 00000C4C initscanoffbit1 00000C56 initscanoffbit2 00000C60 initscanoffbit3 00000C6A initscanoffbit4 00000C72 initscanoffbit5 00000C7A initscanoffbit6 00000C82 initscanoffbit7 00000C8A initscanoffbx 00000C92 initscanoffsetend 00000C96 ispi_fs_0 00000E04 ispi_fs_1 00000E10 ispi_fs_2 00000E1C ispi_fs_3 00000E28 ispi_fs_4 00000E34 ispi_fs_5 00000E40 ispi_nfs_0 00000E5C ispi_nfs_1 00000E64 ispi_nfs_2 00000E6C ispi_nfs_3 00000E74 ispi_nfs_4 00000E7C ispi_nfs_5 00000E84 ispiall_forus 00000E04 ispiall_notforus 00000E5C gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 98 LOC OBJECT CODE LINE SOURCE TEXT VALUE ispiloop 00000DA4 ispiloop_forus 00000DAC ispiloop_lastbyte 00000DD4 ispiloop_notforus 00000DFA istart_forus 00000D82 istart_notforus 00000DE8 litmp_bsr 0000007F litmp_status 0000007E litmp_w 0000007D maxpos0 00000022 maxpos1 00000021 maxpos2 00000020 maxpos3 0000001F mscur 0000002D msmax 0000002B msmin 0000002C offsetbit 00000041 offsetbyte 00000040 pwmtable 00003000 rega0 00000033 rega1 00000032 rega2 00000031 rega3 00000030 regb0 00000037 regb1 00000036 regb2 00000035 regb3 00000034 regc0 0000003B regc1 0000003A regc2 00000039 regc3 00000038 regd0 0000003F regd1 0000003E regd2 0000003D regd3 0000003C run_flags 00000004 scan_direction 00000860 scandirbstart 000008B6 scandiroftb0 00000862 scandiroftb1 00000876 scandiroftb2 0000088E scandiroftb3 000008A6 scandirrleft 000008CA scandirrright 000008C0 scandirsecend 00000990 scandirsection 000008F4 scandirsetit 000008DE spec_flags 00000006 spi_addr 00000000 spi_cmd 00000002 spi_ctr 00000001 spi_tmp 0000007A spi_tmpaddr 0000007C spi_tmpcmd 0000007B gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 99 LOC OBJECT CODE LINE SOURCE TEXT VALUE spiibuf 0000000A spiibuf0 0000000A spiibuf1 0000000B spiibuf2 0000000C spiibuf3 0000000D spiibuf4 0000000E spiibuf5 0000000F spiibufend 00000010 spiobuf 00000010 spiobuf0 00000010 spiobuf1 00000011 spiobuf2 00000012 spiobuf3 00000013 spiobuf4 00000014 spiobuf5 00000015 spiobufend 00000016 start_timer 000000DA step_left 00000A7E step_now 00000A78 step_out 00000A84 step_right 00000A82 stepctr 00000007 steplp 00000029 steplpctr 0000002A sub_mscur_from_pos_ov 000009D8 submscur 00000A14 submscurtst0 00000A02 submscurtsteq 000009EE submscurtsteqsm 00000A0A target0 00000026 target1 00000025 target2 00000024 target3 00000023 test_faraway 00000A22 test_ifposequaltrg 00000154 test_pos 00000176 testcurisequal 000001B4 testcurisgreater 000001B8 testcurissmaller 000001BC timer0int 000000F4 timerhigh 0000002E timerlow 0000002F trgc0_0_1 000001CC trgc0_0_3 000001C8 trgc0_0_7 000001C4 trgc0_0_f 000001C0 trgc0_2_3 000001D4 trgc0_4_5 000001E0 trgc0_4_7 000001DC trgc0_6_7 000001E8 trgc0_8_9 000001F8 trgc0_8_b 000001F4 trgc0_8_f 000001F0 trgc0___0 000001D0 gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 100 LOC OBJECT CODE LINE SOURCE TEXT VALUE trgc0___1 000001D2 trgc0___2 000001D8 trgc0___3 000001DA trgc0___4 000001E4 trgc0___5 000001E6 trgc0___6 000001EC trgc0___7 000001EE trgc0___8 000001FC trgc0___9 000001FE trgc0___a 00000206 trgc0___b 0000020A trgc0___c 00000216 trgc0___d 0000021A trgc0___e 00000222 trgc0___f 00000226 trgc0_a_b 00000202 trgc0_c_d 00000212 trgc0_c_f 0000020E trgc0_e_f 0000021E trgc1_0_1 00000236 trgc1_0_3 00000232 trgc1_0_7 0000022E trgc1_0_f 0000022A trgc1_2_3 00000240 trgc1_4_5 0000024C trgc1_4_7 00000248 trgc1_6_7 00000254 trgc1_8_9 00000264 trgc1_8_b 00000260 trgc1_8_f 0000025C trgc1___0 0000023A trgc1___1 0000023E trgc1___2 00000244 trgc1___3 00000246 trgc1___4 00000250 trgc1___5 00000252 trgc1___6 00000258 trgc1___7 0000025A trgc1___8 00000268 trgc1___9 0000026A trgc1___a 00000270 trgc1___b 00000274 trgc1___c 00000280 trgc1___d 00000284 trgc1___e 0000028C trgc1___f 00000290 trgc1_a_b 0000026C trgc1_c_d 0000027C trgc1_c_f 00000278 trgc1_e_f 00000288 trgc2_0_1 000002A0 trgc2_0_3 0000029C trgc2_0_7 00000298 trgc2_0_f 00000294 gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 101 LOC OBJECT CODE LINE SOURCE TEXT VALUE trgc2_2_3 000002AC trgc2_4_5 000002B8 trgc2_4_7 000002B4 trgc2_6_7 000002C0 trgc2_8_9 000002D0 trgc2_8_b 000002CC trgc2_8_f 000002C8 trgc2___0 000002A4 trgc2___1 000002A8 trgc2___2 000002B0 trgc2___3 000002B2 trgc2___4 000002BC trgc2___5 000002BE trgc2___6 000002C4 trgc2___7 000002C6 trgc2___8 000002D4 trgc2___9 000002D6 trgc2___a 000002DC trgc2___b 000002DE trgc2___c 000002EA trgc2___d 000002EE trgc2___e 000002F6 trgc2___f 000002FA trgc2_a_b 000002D8 trgc2_c_d 000002E6 trgc2_c_f 000002E2 trgc2_e_f 000002F2 trgc3_0_1 0000030A trgc3_0_3 00000306 trgc3_0_7 00000302 trgc3_0_f 000002FE trgc3_2_3 00000316 trgc3_4_5 00000324 trgc3_4_7 00000320 trgc3_6_7 0000032C trgc3_8_9 0000033C trgc3_8_b 00000338 trgc3_8_f 00000334 trgc3___0 0000030E trgc3___1 00000312 trgc3___2 0000031A trgc3___3 0000031E trgc3___4 00000328 trgc3___5 0000032A trgc3___6 00000330 trgc3___7 00000332 trgc3___8 00000340 trgc3___9 00000342 trgc3___a 00000348 trgc3___b 0000034A trgc3___c 00000354 trgc3___d 00000358 trgc3___e 00000360 trgc3___f 00000364 gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 102 LOC OBJECT CODE LINE SOURCE TEXT VALUE trgc3_a_b 00000344 trgc3_c_d 00000350 trgc3_c_f 0000034C trgc3_e_f 0000035C trgc4_0_1 00000374 trgc4_0_3 00000370 trgc4_0_7 0000036C trgc4_0_f 00000368 trgc4_2_3 00000380 trgc4_4_5 00000390 trgc4_4_7 0000038C trgc4_6_7 00000398 trgc4_8_9 000003A8 trgc4_8_b 000003A4 trgc4_8_f 000003A0 trgc4___0 00000378 trgc4___1 0000037C trgc4___2 00000384 trgc4___3 00000388 trgc4___4 00000394 trgc4___5 00000396 trgc4___6 0000039C trgc4___7 0000039E trgc4___8 000003AC trgc4___9 000003AE trgc4___a 000003B4 trgc4___b 000003B6 trgc4___c 000003C0 trgc4___d 000003C2 trgc4___e 000003CA trgc4___f 000003CE trgc4_a_b 000003B0 trgc4_c_d 000003BC trgc4_c_f 000003B8 trgc4_e_f 000003C6 trgc5_0_1 000003DE trgc5_0_3 000003DA trgc5_0_7 000003D6 trgc5_0_f 000003D2 trgc5_2_3 000003EA trgc5_4_5 000003FA trgc5_4_7 000003F6 trgc5_6_7 00000404 trgc5_8_9 00000414 trgc5_8_b 00000410 trgc5_8_f 0000040C trgc5___0 000003E2 trgc5___1 000003E6 trgc5___2 000003EE trgc5___3 000003F2 trgc5___4 000003FE trgc5___5 00000402 trgc5___6 00000408 trgc5___7 0000040A gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 103 LOC OBJECT CODE LINE SOURCE TEXT VALUE trgc5___8 00000418 trgc5___9 0000041A trgc5___a 00000420 trgc5___b 00000422 trgc5___c 0000042C trgc5___d 0000042E trgc5___e 00000434 trgc5___f 00000438 trgc5_a_b 0000041C trgc5_c_d 00000428 trgc5_c_f 00000424 trgc5_e_f 00000430 trgc6_0_1 00000448 trgc6_0_3 00000444 trgc6_0_7 00000440 trgc6_0_f 0000043C trgc6_2_3 00000454 trgc6_4_5 00000464 trgc6_4_7 00000460 trgc6_6_7 00000470 trgc6_8_9 00000480 trgc6_8_b 0000047C trgc6_8_f 00000478 trgc6___0 0000044C trgc6___1 00000450 trgc6___2 00000458 trgc6___3 0000045C trgc6___4 00000468 trgc6___5 0000046C trgc6___6 00000474 trgc6___7 00000476 trgc6___8 00000484 trgc6___9 00000486 trgc6___a 0000048C trgc6___b 0000048E trgc6___c 00000498 trgc6___d 0000049A trgc6___e 000004A0 trgc6___f 000004A2 trgc6_a_b 00000488 trgc6_c_d 00000494 trgc6_c_f 00000490 trgc6_e_f 0000049C trgc7_0_1 000004B2 trgc7_0_3 000004AE trgc7_0_7 000004AA trgc7_0_f 000004A6 trgc7_2_3 000004BE trgc7_4_5 000004CE trgc7_4_7 000004CA trgc7_6_7 000004DA trgc7_8_9 000004EC trgc7_8_b 000004E8 trgc7_8_f 000004E4 gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 104 LOC OBJECT CODE LINE SOURCE TEXT VALUE trgc7___0 000004B6 trgc7___1 000004BA trgc7___2 000004C2 trgc7___3 000004C6 trgc7___4 000004D2 trgc7___5 000004D6 trgc7___6 000004DE trgc7___7 000004E2 trgc7___8 000004F0 trgc7___9 000004F2 trgc7___a 000004F8 trgc7___b 000004FA trgc7___c 00000504 trgc7___d 00000506 trgc7___e 0000050C trgc7___f 0000050E trgc7_a_b 000004F4 trgc7_c_d 00000500 trgc7_c_f 000004FC trgc7_e_f 00000508 trgc8_0_1 0000051C trgc8_0_3 00000518 trgc8_0_7 00000514 trgc8_0_f 00000510 trgc8_2_3 00000526 trgc8_4_5 00000536 trgc8_4_7 00000532 trgc8_6_7 00000542 trgc8_8_9 00000556 trgc8_8_b 00000552 trgc8_8_f 0000054E trgc8___0 00000520 trgc8___1 00000522 trgc8___2 0000052A trgc8___3 0000052E trgc8___4 0000053A trgc8___5 0000053E trgc8___6 00000546 trgc8___7 0000054A trgc8___8 0000055A trgc8___9 0000055C trgc8___a 00000562 trgc8___b 00000564 trgc8___c 0000056E trgc8___d 00000570 trgc8___e 00000576 trgc8___f 00000578 trgc8_a_b 0000055E trgc8_c_d 0000056A trgc8_c_f 00000566 trgc8_e_f 00000572 trgc9_0_1 00000586 trgc9_0_3 00000582 trgc9_0_7 0000057E gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 105 LOC OBJECT CODE LINE SOURCE TEXT VALUE trgc9_0_f 0000057A trgc9_2_3 0000058E trgc9_4_5 0000059E trgc9_4_7 0000059A trgc9_6_7 000005AA trgc9_8_9 000005BE trgc9_8_b 000005BA trgc9_8_f 000005B6 trgc9___0 0000058A trgc9___1 0000058C trgc9___2 00000592 trgc9___3 00000596 trgc9___4 000005A2 trgc9___5 000005A6 trgc9___6 000005AE trgc9___7 000005B2 trgc9___8 000005C2 trgc9___9 000005C6 trgc9___a 000005CC trgc9___b 000005CE trgc9___c 000005D8 trgc9___d 000005DA trgc9___e 000005E0 trgc9___f 000005E2 trgc9_a_b 000005C8 trgc9_c_d 000005D4 trgc9_c_f 000005D0 trgc9_e_f 000005DC trgca_0_1 000005F0 trgca_0_3 000005EC trgca_0_7 000005E8 trgca_0_f 000005E4 trgca_2_3 000005F8 trgca_4_5 00000606 trgca_4_7 00000602 trgca_6_7 00000612 trgca_8_9 00000626 trgca_8_b 00000622 trgca_8_f 0000061E trgca___0 000005F4 trgca___1 000005F6 trgca___2 000005FC trgca___3 000005FE trgca___4 0000060A trgca___5 0000060E trgca___6 00000616 trgca___7 0000061A trgca___8 0000062A trgca___9 0000062E trgca___a 00000636 trgca___b 00000638 trgca___c 00000642 trgca___d 00000644 trgca___e 0000064A gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 106 LOC OBJECT CODE LINE SOURCE TEXT VALUE trgca___f 0000064C trgca_a_b 00000632 trgca_c_d 0000063E trgca_c_f 0000063A trgca_e_f 00000646 trgcb_0_1 0000065A trgcb_0_3 00000656 trgcb_0_7 00000652 trgcb_0_f 0000064E trgcb_2_3 00000662 trgcb_4_5 0000066E trgcb_4_7 0000066A trgcb_6_7 0000067A trgcb_8_9 0000068E trgcb_8_b 0000068A trgcb_8_f 00000686 trgcb___0 0000065E trgcb___1 00000660 trgcb___2 00000666 trgcb___3 00000668 trgcb___4 00000672 trgcb___5 00000676 trgcb___6 0000067E trgcb___7 00000682 trgcb___8 00000692 trgcb___9 00000696 trgcb___a 0000069E trgcb___b 000006A2 trgcb___c 000006AC trgcb___d 000006AE trgcb___e 000006B4 trgcb___f 000006B6 trgcb_a_b 0000069A trgcb_c_d 000006A8 trgcb_c_f 000006A4 trgcb_e_f 000006B0 trgcc_0_1 000006C4 trgcc_0_3 000006C0 trgcc_0_7 000006BC trgcc_0_f 000006B8 trgcc_2_3 000006CC trgcc_4_5 000006D8 trgcc_4_7 000006D4 trgcc_6_7 000006E2 trgcc_8_9 000006F6 trgcc_8_b 000006F2 trgcc_8_f 000006EE trgcc___0 000006C8 trgcc___1 000006CA trgcc___2 000006D0 trgcc___3 000006D2 trgcc___4 000006DC trgcc___5 000006DE trgcc___6 000006E6 gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 107 LOC OBJECT CODE LINE SOURCE TEXT VALUE trgcc___7 000006EA trgcc___8 000006FA trgcc___9 000006FE trgcc___a 00000706 trgcc___b 0000070A trgcc___c 00000716 trgcc___d 00000718 trgcc___e 0000071E trgcc___f 00000720 trgcc_a_b 00000702 trgcc_c_d 00000712 trgcc_c_f 0000070E trgcc_e_f 0000071A trgcd_0_1 0000072E trgcd_0_3 0000072A trgcd_0_7 00000726 trgcd_0_f 00000722 trgcd_2_3 00000736 trgcd_4_5 00000742 trgcd_4_7 0000073E trgcd_6_7 0000074A trgcd_8_9 0000075E trgcd_8_b 0000075A trgcd_8_f 00000756 trgcd___0 00000732 trgcd___1 00000734 trgcd___2 0000073A trgcd___3 0000073C trgcd___4 00000746 trgcd___5 00000748 trgcd___6 0000074E trgcd___7 00000752 trgcd___8 00000762 trgcd___9 00000766 trgcd___a 0000076E trgcd___b 00000772 trgcd___c 0000077E trgcd___d 00000782 trgcd___e 00000788 trgcd___f 0000078A trgcd_a_b 0000076A trgcd_c_d 0000077A trgcd_c_f 00000776 trgcd_e_f 00000784 trgce_0_1 00000798 trgce_0_3 00000794 trgce_0_7 00000790 trgce_0_f 0000078C trgce_2_3 000007A0 trgce_4_5 000007AC trgce_4_7 000007A8 trgce_6_7 000007B4 trgce_8_9 000007C6 trgce_8_b 000007C2 gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 108 LOC OBJECT CODE LINE SOURCE TEXT VALUE trgce_8_f 000007BE trgce___0 0000079C trgce___1 0000079E trgce___2 000007A4 trgce___3 000007A6 trgce___4 000007B0 trgce___5 000007B2 trgce___6 000007B8 trgce___7 000007BA trgce___8 000007CA trgce___9 000007CE trgce___a 000007D6 trgce___b 000007DA trgce___c 000007E6 trgce___d 000007EA trgce___e 000007F2 trgce___f 000007F4 trgce_a_b 000007D2 trgce_c_d 000007E2 trgce_c_f 000007DE trgce_e_f 000007EE trgcf_0_1 00000802 trgcf_0_3 000007FE trgcf_0_7 000007FA trgcf_0_f 000007F6 trgcf_2_3 0000080A trgcf_4_5 00000816 trgcf_4_7 00000812 trgcf_6_7 0000081E trgcf_8_9 0000082E trgcf_8_b 0000082A trgcf_8_f 00000826 trgcf___0 00000806 trgcf___1 00000808 trgcf___2 0000080E trgcf___3 00000810 trgcf___4 0000081A trgcf___5 0000081C trgcf___6 00000822 trgcf___7 00000824 trgcf___8 00000832 trgcf___9 00000836 trgcf___a 0000083E trgcf___b 00000842 trgcf___c 0000084E trgcf___d 00000852 trgcf___e 0000085A trgcf___f 0000085E trgcf_a_b 0000083A trgcf_c_d 0000084A trgcf_c_f 00000846 trgcf_e_f 00000856 tstcursm1 00000184 tstcursm2 0000018A gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 109 LOC OBJECT CODE LINE SOURCE TEXT VALUE tstcursm3 00000192 tstcursm4 00000198 tstcursm5 000001A0 tstcursm6 000001A6 tstcursm7 000001AE tstfwend 00000A40 waitforrxdhigh 000000CC work_flags 00000005 CCPCON00 B'00001100' CCPCON01 B'00001100' CCPCON02 B'00001100' CCPCON03 B'00011100' CCPCON04 B'00011100' CCPCON05 B'00011100' CCPCON06 B'00101100' CCPCON07 B'00101100' CCPCON08 B'00101100' CCPCON09 B'00111100' CCPCON10 B'00111100' CCPCON11 B'00111100' CCPCON12 B'00111100' CCPCON13 B'00111100' CCPCON14 B'00111100' CCPCON15 B'00111100' CCPCON16 B'00111100' CCPRL_00 B'00000000' CCPRL_01 B'01100010' CCPRL_02 B'11001000' CCPRL_03 B'00100010' CCPRL_04 B'01111100' CCPRL_05 B'11010110' CCPRL_06 B'00110000' CCPRL_07 B'01110110' CCPRL_08 B'11000110' CCPRL_09 B'00000010' CCPRL_10 B'00111110' CCPRL_11 B'01110000' CCPRL_12 B'10100010' CCPRL_13 B'10111100' CCPRL_14 B'11010100' CCPRL_15 B'11100011' CCPRL_16 B'11101000' CPUFREQ D'20000000' DDRA TRISA DDRB TRISB DDRC TRISC PORTAHS1 B'00000100' PORTAHS2 B'00000100' PORTAHS3 B'00000000' PORTAHS4 B'00000000' PORTAHS5 B'00001000' PORTAHS6 B'00001000' PORTAHS7 B'00001100' PORTAHS8 B'00001100' gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 110 LOC OBJECT CODE LINE SOURCE TEXT VALUE SETBANK0 movlb 0x00 SETBANK1 movlb 0x01 SETBANK2 movlb 0x02 MEMORY USAGE MAP ('X' = Used, '-' = Unused) 00000000 : XXXX----XXXX---- --------XXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 00000040 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 00000080 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 000000c0 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 00000100 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 00000140 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 00000180 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 000001c0 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 00000200 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 00000240 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 00000280 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 000002c0 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 00000300 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 00000340 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 00000380 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 000003c0 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 00000400 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 00000440 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 00000480 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 000004c0 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 00000500 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 00000540 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 00000580 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 000005c0 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 00000600 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 00000640 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 00000680 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 000006c0 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 00000700 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 00000740 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 00000780 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 000007c0 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 00000800 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 00000840 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 00000880 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 000008c0 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 00000900 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 00000940 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 00000980 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 000009c0 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 00000a00 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 00000a40 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 00000a80 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 00000ac0 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 00000b00 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 00000b40 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 00000b80 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX gpasm-0.13.3 beta elmot.asm 4-11-2007 11:56:23 PAGE 111 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00000bc0 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 00000c00 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 00000c40 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 00000c80 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 00000cc0 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 00000d00 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 00000d40 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 00000d80 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 00000dc0 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 00000e00 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 00000e40 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 00000e80 : XXXXXXXXXXXXXXXX XX-------------- ---------------- ---------------- 00003000 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 00003040 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 00003080 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 000030c0 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 00003100 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 00003140 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 00003180 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 000031c0 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 00003200 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 00003240 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 00003280 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 000032c0 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 00300000 : XXXX------------ ---------------- ---------------- ---------------- All other memory blocks unused. Program Memory Words Used: 2243 Errors : 0 Warnings : 0 reported, 0 suppressed Messages : 0 reported, 0 suppressed