The 16-bit (data) PICs are completely different than the smaller devices. Although it may be possible to use the retlw method for reading tables it is extremely inefficient, there are much better options. For instance: ; Initialization, needed only once mov.w #psvpage(Table),w0 mov.w w0,0x0034 ; Make PSVPAG point to the page that contains 'Table' bset.w 0x0044,#2 ; Activates bit CORCON.PSV ; In real word this value varies mov.w #0,w0 ; The index to read ; This assignment may be done only once mov.w #Table,w1 ; Get the address of the table ; The important part mov.b [w0+w1],w0 ; Read the byte .section psv,psv Table: .byte 0x75, 0x01, 0x02 Best regards, Isaac Em 13/7/2011 21:22, IVP escreveu: > Hi all, > > I'm porting some code from a 16F to a dsPIC33 and have a question > about PCL > > It's a simple routine to redefine a couple of LCD characters for a disk > file system > > The problem is that 'add PCL' does not modify PCL as I expected, in > either MPLAB or the actual chip. All that is returned from the fetch is > 16 x 0b00000010. The disassembly shows add.w 0x002e, where > 0x002e is the address of PCL > > The address of 'redef:' is 0xAB2C. Whatever value is in w0, the PCL > advances to 0xAB2E and executes the first RETLW > > I've read the d/s and PRM but find no special mention of modifying > PCL > > Any suggestions ? > > TIA > > Joe > > ;=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > ; Re-define characters > ;=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > redef: mov #16,w5 ;data byte counter > > mov.b #0b01000000,w0 ;send data to CGRAM > call write_c > > clr w4 > get_redef: mov w4,w0 > call new_chars ;get data into w0 > call write_d ;write to CGRAM > inc2 w4,w4 ;increment index by 2 > dec w5,w5 ;decrement counter by 1 > bra nz,get_redef > return > > ;=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > ; Redefined character data > ;=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > =20 > new_chars: add PCL ;add w0 to PCL > > retlw.b #0b00000010,w0 ;carriage return - character 00 > retlw.b #0b00000010,w0 > retlw.b #0b00000010,w0 > retlw.b #0b00001010,w0 > retlw.b #0b00011110,w0 > retlw.b #0b00001000,w0 > retlw.b #0b00000000,w0 > retlw.b #0b00000000,w0 > > retlw.b #0b00010000,w0 ;backslash - character 01 > retlw.b #0b00010000,w0 > retlw.b #0b00001000,w0 > retlw.b #0b00000100,w0 > retlw.b #0b00000010,w0 > retlw.b #0b00000001,w0 > retlw.b #0b00000001,w0 > retlw.b #0b00000000,w0 --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .