Author Topic: MPLAB X-IDE why y?  (Read 2122 times)

0 Members and 1 Guest are viewing this topic.

Offline PerranOakTopic starter

  • Frequent Contributor
  • **
  • Posts: 548
  • Country: gb
MPLAB X-IDE why y?
« on: September 06, 2019, 05:20:14 pm »
Yesterday, I did a little work on my assembly prog in MPLAB and saved the work.

Today, I opened the .asm file and it was blank! This even though it showed as a size of 19k in the directory.

I opened the file in MSWord and examined it and it was actually not blank but full of a weird character - lowercase "y" with two dots over it.

Any idea what on Earth happened and how I can avoid it in future?

Cheers.
You can release yourself but the only way to go is down!
RJD
 

Offline Sal Ammoniac

  • Super Contributor
  • ***
  • Posts: 1705
  • Country: us
Re: MPLAB X-IDE why y?
« Reply #1 on: September 06, 2019, 06:20:28 pm »
Did this happen in MPLAB or MPLAB-X? They are not the same.
Complexity is the number-one enemy of high-quality code.
 

Offline andersm

  • Super Contributor
  • ***
  • Posts: 1198
  • Country: fi
Re: MPLAB X-IDE why y?
« Reply #2 on: September 06, 2019, 06:33:11 pm »
Try setting the encoding when opening the file. The "ÿ" character has the character code 0xFF, so I'm guessing it's the LSB of the Unicode byte order mark.

Offline NorthGuy

  • Super Contributor
  • ***
  • Posts: 3151
  • Country: ca
Re: MPLAB X-IDE why y?
« Reply #3 on: September 06, 2019, 07:26:03 pm »
Any idea what on Earth happened

Looks like it got corrupted somehow.

Opening it with "Notepad" would be more suitable than MS Word.

You can look at it with a HEX editor to see if some remnants of the text are still there and may be salvaged.

and how I can avoid it in future?

Make backups. Or, better yet, use Git.
 

Offline PerranOakTopic starter

  • Frequent Contributor
  • **
  • Posts: 548
  • Country: gb
Re: MPLAB X-IDE why y?
« Reply #4 on: September 07, 2019, 09:24:25 am »
Sal Ammoniac: Sorry about the confusion, it's: MPLAB X IDE.

andersm: I'm afraid I don't understand.

NorthGuy: Yes, I looked and the entire file was this character - completely filled. I did a backup of the files (in the project directory) after I'd saved it but of course, this backup had all the "y" fill, darn it! Fortunately, I had copied the file (directly from the running MPLAB X IDE before closing) to play with it and was able to cut/paste it back!  ;D
You can release yourself but the only way to go is down!
RJD
 

Offline MarkF

  • Super Contributor
  • ***
  • Posts: 2556
  • Country: us
Re: MPLAB X-IDE why y?
« Reply #5 on: September 07, 2019, 01:02:19 pm »
Try setting the encoding when opening the file. The "ÿ" character has the character code 0xFF, so I'm guessing it's the LSB of the Unicode byte order mark.

I don't see an encoding section when opening a file.

The only see an encoding section during project creation:

829125-0

and in a project properties:

829131-1
 

Offline PerranOakTopic starter

  • Frequent Contributor
  • **
  • Posts: 548
  • Country: gb
Re: MPLAB X-IDE why y?
« Reply #6 on: September 07, 2019, 01:15:49 pm »
… and I've never changed any of that and the file is 100% full of the "y" character.
You can release yourself but the only way to go is down!
RJD
 

Offline NorthGuy

  • Super Contributor
  • ***
  • Posts: 3151
  • Country: ca
Re: MPLAB X-IDE why y?
« Reply #7 on: September 07, 2019, 03:18:34 pm »
I did a backup of the files (in the project directory) after I'd saved it but of course, this backup had all the "y" fill, darn it!

Git would let you revert to any version of your file ever committed. It's written by the same guy who wrote Linux.
 

Offline PerranOakTopic starter

  • Frequent Contributor
  • **
  • Posts: 548
  • Country: gb
Re: MPLAB X-IDE why y?
« Reply #8 on: September 08, 2019, 05:00:28 pm »
Sure that does sound interesting (if it's free) but why the "y"? It's such a mental thing. I can understand a corrupted file that is unreadable or full of random junk but every character space on every line being on character … mad!  :-//
You can release yourself but the only way to go is down!
RJD
 

Offline mariush

  • Super Contributor
  • ***
  • Posts: 5078
  • Country: ro
  • .
Re: MPLAB X-IDE why y?
« Reply #9 on: September 08, 2019, 05:24:55 pm »
Open the file with a hex editor, see for example HxD : https://mh-nexus.de/en/hxd/  or WinHEX : https://www.x-ways.net/winhex/

Those y characters are simply binary data that Notepad can't render with regular font, it's not plain text.

I would guess that MPLAB-X stored the actual assembly code you wrote in a file, and compiled it to binary assembly in the file with the ASM extension and you only copied the already compiled ASM code.

 

Offline Kilrah

  • Supporter
  • ****
  • Posts: 1852
  • Country: ch
Re: MPLAB X-IDE why y?
« Reply #10 on: September 08, 2019, 06:19:43 pm »
ÿ is 255 in Unicode. https://www.codetable.net/decimal/255
A blank EEPROM, which is usually full of 0xFF will come up as full of ÿ.
Your file somehow became full of 0xFF.

It could have been a wrong manipulation from you where you compiled something and overwrote your source file with the output file - the file would be the size of the controller's flash and nearly all of it would be unprogrammed, and thus ÿ's.
 

Offline Sal Ammoniac

  • Super Contributor
  • ***
  • Posts: 1705
  • Country: us
Re: MPLAB X-IDE why y?
« Reply #11 on: September 09, 2019, 04:15:51 pm »
Does MPLAB X create listing files for ASM code? Something with a .lst extension perhaps? If so, you may be able to recover your assembly code from that.
Complexity is the number-one enemy of high-quality code.
 

Offline PerranOakTopic starter

  • Frequent Contributor
  • **
  • Posts: 548
  • Country: gb
Re: MPLAB X-IDE why y?
« Reply #12 on: September 10, 2019, 12:00:58 pm »
Cheers all. I have recovered the code so that's ok; I just want to ensure it doesn't recur and the best way to do that is to understand it. Ah well.
You can release yourself but the only way to go is down!
RJD
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf