This is a multi-part message in MIME format. ------=_NextPart_000_0007_01C3F0A7.133CEB30 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit I think Aubrey may have been confused by the doubling of addresses in the HEX file. The DE874.HEX file for use with the ICD that I have loads at 0xF00 through 0xFFF when imported into MPLAB. I'm not sure how she got non-aliased values from 1F00-1FFF, though. I am just about completely finished disassembling the entire DE874.HEX file. I have attached my work so far. The code uses a few neat tricks, but there are a couple basic things that could be greatly improved. For instance, they use the following code: movf PCL,W ; remember return address movwf xIoRetAddr movlw low(IoRoutine) movwf PCL many times to perform a pseudo-CALL to the IoRoutine without using a stack level. The IoRoutine returns by: movf xIoRetAddr,W addlw 3 movwf PCL This is sneaky, but could be greatly improved by: movf PCL,W goto IoRoutine Then, at the entry point of the I/O routine: movwf xIoRetAddr And the exit code could be changed to: incf xIoRetAddr,W movwf PCL This saves 2 words for each use of the pseudo-CALL. Given that there are 20 such pseudo-calls it would save 40 words of memory. This is 40/256 or 15.6% of the total memory used by the debug code. Bob Ammerman RAm Systems ----- Original Message ----- From: "Bob Blick" To: Sent: Wednesday, February 11, 2004 12:37 PM Subject: Re: [PIC:] ICSP (DS30277) location, homebrew OCD > Aubrey McIntosh, Ph.D. said: > > > last 100H words of memory, but other documents say that it uses the > > addresses at 1F00-1FFF. Guess what? I programmed code at 1F00-1FFF, > > read back code from 0000-1FFF, and I get that code back, without > > aliasing. I interpret this to mean that the 16F874 does have 100H words > > at 1F00-1FFF. > > Now that is interesting. So program memory is not sacrificed when using > ICD on the smaller parts. > > I'll stay tuned to this thread. > > Thanks, > > Bob > > -- > http://www.piclist.com hint: PICList Posts must start with ONE topic: > [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads > -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads ------=_NextPart_000_0007_01C3F0A7.133CEB30 Content-Type: application/octet-stream; name="de874.disasm" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="de874.disasm" xStatus = 0x1FF xW = 0x1FE xFSR = 0x1FD xPCLATH = 0x1FC xTMR1 = 0x1FB xTMR1H = 0x1FA xBuf = 0x1F9 xBytesLSB = 0x1F8 xBytesMSB = 0x1F7 xFlags = 0x1F6 xCount = 0x1F5 xIoRetAddr = 0x1F4 READ_FLAG = 1 org 0xF00 PERFORM_IO Macro movf PCL,W ; remember return address movwf xIoRetAddr movlw low(IoRoutine) movwf PCL endM ; On entry we do not know what the RP0/RP1 bits are set to. ; Therefore the following code will write to either addresses ; 0x7X or 0xFx in RAM. bcf xStatus,Z ; Copy Z-Bit btfsc STATUS,Z bsf xStatus,Z bcf xStatus,RP1 ; Copy RP1 btfsc STATUS,RP1 bsf xStatus,RP1 bcf xStatus,RP0 ; Copy RP0 btfsc STATUS,RP0 bsf x,RP0 movwf xW ; Save W ; Clear all bits in xStatus except the three ; we just saved movlw (1<