MPLAB X-IDE why y? - Page 1
Forum section: electronics / general

author: PerranOak
author_rank: Frequent Contributor
timestamp: September 06, 2019, 05:20:14 pm
content: 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.

author: Sal Ammoniac
author_rank: Super Contributor
timestamp: September 06, 2019, 06:20:28 pm
content: Did this happen in MPLAB or MPLAB-X? They are not the same.

author: andersm
author_rank: Super Contributor
timestamp: September 06, 2019, 06:33:11 pm
content: 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.

author: NorthGuy
author_rank: Super Contributor
timestamp: September 06, 2019, 07:26:03 pm
content: Quote from: PerranOak on September 06, 2019, 05:20:14 pmLooks 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.Quote from: PerranOak on September 06, 2019, 05:20:14 pmMake backups. Or, better yet, use Git.

author: PerranOak
author_rank: Frequent Contributor
timestamp: September 07, 2019, 09:24:25 am
content: 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!

author: MarkF
author_rank: Super Contributor
timestamp: September 07, 2019, 01:02:19 pm
content: Quote from: andersm on September 06, 2019, 06:33:11 pmI don't see an encoding section when opening a file.The only see an encoding section during project creation:and in a project properties:

author: PerranOak
author_rank: Frequent Contributor
timestamp: September 07, 2019, 01:15:49 pm
content: … and I've never changed any of that and the file is 100% full of the "y" character.

author: NorthGuy
author_rank: Super Contributor
timestamp: September 07, 2019, 03:18:34 pm
content: Quote from: PerranOak on September 07, 2019, 09:24:25 amGit would let you revert to any version of your file ever committed. It's written by the same guy who wrote Linux.

author: PerranOak
author_rank: Frequent Contributor
timestamp: September 08, 2019, 05:00:28 pm
content: 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!

author: mariush
author_rank: Super Contributor
timestamp: September 08, 2019, 05:24:55 pm
content: 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.

author: Kilrah
author_rank: Unknown
timestamp: September 08, 2019, 06:19:43 pm
content: ÿ is 255 in Unicode.https://www.codetable.net/decimal/255A 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.

author: Sal Ammoniac
author_rank: Super Contributor
timestamp: September 09, 2019, 04:15:51 pm
content: 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.

author: PerranOak
author_rank: Frequent Contributor
timestamp: September 10, 2019, 12:00:58 pm
content: 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.