Jump to content

jess

EstablishedMember
  • Content Count

    10
  • Joined

  • Last visited

Community Reputation

0 Neutral

About jess

  • Rank
    Newbrie
  1. I've tested this at all the different "org's" and it works, I haven't tested with 256 different strings but it should be ok. jess include "p16F876.inc" str_idx equ 40 str_num equ 41 ;------------------------------- org 0 clrf PCLATH goto main ;------------------------------- org 4 retfie ;------------------------------- org H'fc' org H'105' org H'1fe' org H'2ef' org H'2df' const_str_code movwf str_num movlw HIGH($+7) movwf PCLATH movlw LOW($+5) addwf str_num,w btfsc STATUS,C incf PCLATH,f movf str_num,w addwf PCL, F goto arr000 goto arr001 goto arr002 arr000 movlw HIGH($+7) movwf PCLATH movlw LOW($+5) addwf str_idx,w btfsc STATUS,C incf PCLATH,f movf str_idx, W addwf PCL, F retlw D'83' retlw D'84' retlw D'79' retlw D'80' retlw D'0' arr001 movlw HIGH($+7) movwf PCLATH movlw LOW($+5) addwf str_idx,w btfsc STATUS,C incf PCLATH,f movf str_idx, W addwf PCL, F retlw D'82' retlw D'83' retlw D'84' retlw D'32' retlw D'0' arr002 movlw HIGH($+7) movwf PCLATH movlw LOW($+5) addwf str_idx,w btfsc STATUS,C incf PCLATH,f movf str_idx, W addwf PCL, F retlw D'83' retlw D'69' retlw D'78' retlw D'68' retlw D'0' ;------------------------------- main movlw 3 ;index movwf str_idx movlw 1 ;array number call const_str_code end
  2. mind you that doesn't help with having more than 32 (256/8) strings, that would require a complete rewrite of the const string code. Need to find a way to give each string a sequential index number instead of multiples of 8, preferrably without doing extra subroutine calls. tricky.
  3. sorry, this forum does weird things when two uderscores are used together, i'll try again const_param_code movwf w_temp movlw HIGH($) movwf PCLATH movf w_temp,w addlw LOW($+4) btfsc STATUS, C incf PCLATH,f movf w_temp,w addwf PCL, F movf _const_ptr_param00, W
  4. i haven't tested this in all situations but it should work, however it does use a variable. const_paramconst_ptr__param00, W .....
  5. I've faced this problem. This is what i have found... The problem lies here: 0100 00612 const_param__code 0100 018A 00613 clrf PCLATH 0101 0782 00615 addwf PCL, F 0102 087B 00614 movf _const_ptr_param00, W 0103 3ED4 00617 addlw LOW(arr008+1) 0104 3001 00618 movlw HIGH(arr008+1) etc.. if the const_param_code is called and the const string code lies across a 0xff - 0x100 boundary the recalculated program counter (addwf PCL,F) will be wrong because PCL is only eight bits. if this is the case insert this code between the clrf and addwf addlw LOW($+4) btfsc STATUS, C incf PCLATH,f addlw -(LOW($+1)) however!!! if the start of the code (as in my piece) is past 0x100 but not across a boundary insert this code incf PCLATH,f bascially the PCLATH has to be set up before the recalculated program counter jump, 0 for 00-ff 1 for 100 -1ff, 2 for 200-2ff etc. You can use scripts to do this. hope this help
  6. I just downloaded the latest version 4.6 and found it came up with a number of complie errors that the previous version didn't. As far as i can tell it is having problems with #define (no all just some, seemingly random, but consistant). I replace the define with a constant and it seems to be happy. Has anyone else found this?
  7. Now that i read some of the other posts, this has been raised. I'll endevor to use some scripts to fix it up.
  8. I'm not sure if this has been reported before but I found a problem with string constant jump table code. If this code lies across two 00..ff address blocks, ie starts at 0xCE ends at 0x103, then you request a string who's offset when added to the PCL (second instruction in the jump code) goes beyond 0xff the PCL overflows and ends up somewhere in the interrupt routine. So having a biggish interrupt routine, having lots of functions (because of the function jump table) or a few too many strings can cause havoc. Keeping the string jump code below address 0xff is fine (the strings themselves can be beyond this limit). hope this saves someone else some debugging time. jess
  9. for PicAntIDE 4.52 I've found that the replace facility hangs the program when trying to replace all, single replaces don't seem to do a thing (finds ok). Once crashed is unable to be closed down via the task manager. I'm running win2000 otherwise very happy with the editor, vast imporvement on ver 3 jess
×
×
  • Create New...