Dunno about 17C44, does this 16CXX solution apply? ascii_con sublw 10 skpnc addlw 7 addlw 58 return On Mon, 23 Oct 2000, Ryan Miller wrote: > Date: Mon, 23 Oct 2000 09:57:47 -0700 > From: Ryan Miller > To: PICLIST@MITVMA.MIT.EDU > Subject: [PIC]: Table bug > > I need some help here. > > Can anyone see a reason why the program might go off into > never-neverland during this subroutine? The part is a 17C44. > > org 0x7E4 ;place routine here to prevent > ;crossing page boundary > > ascii_con ;value to convert is in wreg > movwf offset ;save wreg > movlw HIGH (ascii_con1) ; > movwf PCLATH ;initialize PC high latch > > movfp offset,wreg ;load offset back into wreg > andlw 0x0F ;clear high nibble to prevent overflow > addlw LOW (ascii_con1) ;add desired offset to PC low > movwf PCL ;jump > > ascii_con1 > retlw 0x30 ;0 > retlw 0x31 ;1 > retlw 0x32 ;2 > retlw 0x33 ;3 > retlw 0x34 ;4 > retlw 0x35 ;5 > retlw 0x36 ;6 > retlw 0x37 ;7 > retlw 0x38 ;8 > retlw 0x39 ;9 > retlw 0x41 ;a > retlw 0x42 ;b > retlw 0x43 ;c > retlw 0x44 ;d > retlw 0x45 ;e > retlw 0x46 ;f > > We fill all unused program memory spaces with a GOTO > Watchdog_timout statement. Using an emulator, we'll let the > program run and, occasionally, we'll find the program in > that timeout routine (the watchdog is disabled for debug > reasons). The last thing in the stack is the Call ascii_con > statement. Interrupts are disabled during the routine that > calls ascii_con. > > I appreciate any help. > > Ryan > > -- > http://www.piclist.com hint: To leave the PICList > mailto:piclist-unsubscribe-request@mitvma.mit.edu > > > > -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu