News:

;) This forum is the property of Proton software developers

Main Menu

Lost code extracting data from ASM

Started by TimB, Feb 23, 2023, 09:25 PM

Previous topic - Next topic

Dompie

@Pepe Hmmm, I use the same one as you, Windows Defender (I called it accidentally Microsoft Defender).
Doesn't matter.

Johan

Pepe

#21
new version, added dimension variables and symbols, can not be correctly melted type, must be verified by the user look #26

John Drew

Pepe, BitDefender also suggested a Virus in the latest file. There must be a match to some sections of code. The Virus checker wouldn't let me proceed. I see I'm not the only one.
Cheers
John

Pepe


JohnB

@John Lawton Positron Backup zips the source files up and you can unzip them from the application.  You can either restore over the original or create a new file.  If you open the zip files using windows only the info.txt file will be visible.

@TimB If you want automatic backup, go to Tools, Options, Miscellaneous. Make sure Backup on Successful compile is checked.  Otherwise you will have to make manual backups using the backup wizard.
JohnB

TimB


Hi John

As J Lawton was eluding to the issue is that the zip file is essentially empty with just a file called Zipinfoo.txt in it and that just says the file name and location etc

Tim

Pepe

#26
Look #31

TimB


Pepe

Can you give an explnation on how to run the code?

I tried opening command prompt. changing directory to where the asm then running the exe followed by the asm name and path

C:\Users\timbo\Documents\Test code\ASM> asm_bas.exe C:\Users\timbo\Documents\Test code\ASM\OptoBoard 13k22 i2c v1.asm

but it does nothing


Pepe

#28
Put the file asm_bas.exe where the 13k22 i2c v1.asm file is

and the name of the file without the .asm extension.

write asm_bas 13k22 i2c v1

redownload the file because bugs were fixed

I clarify that the type of variables must be verified by the user because it does not detect variables of the type with sign and with decimal point, and vectors consider them of type byte.
Tested for some 12f, 16f and 18f pics.

look #31

TimB



Just as feed back it generated vars and Symbols for the code but did not extract the basic code


Pepe

You could send me the.asm file to see if I can fix anything.

Pepe

Could you try now

Dompie

@Pepe No Windows Defender messages this time any more

Johan

top204

#33
Also remember, the "F1" refers to the ".bas" code listing's file, and any include files used in the program will be referenced as "F2" and "F3" and "F4" etc... With "Fx_SOF equ $" to signal the start of a file and "Fx_EOF equ $" to signal the end of a file, where "Fx" is either the ".bas" code listing's "F" value or an include file's code listing "F" value. These were placed in the compiler for the ISIS simulator.

As a test, I used my old friend UltraEdit with its search and regular expressions enabled on a simple program's assembler listing and I got a block of text that included the "F" directive, then after a few search/replace passes of start of line character removals with regular expressions, I got:


Dim MyTable8[10]  As byte Heap = 10, 20, 30, 40, 50, 60, 70
Dim MyTable16[10] As Word Heap = 100, 200, 300, 400, 500, 600, 700
Dim MyTable24[10] As Long Heap = 10000, 20000, 30000, 40000, 50000, 60000, 70000
Dim MyTable32[10] As Dword Heap = 100000, 200000, 300000, 400000, 500000, 600000, 700000
Dim MyTableFloat[10] As Float Heap = 3.14, 6.28, 12.56, 25.12, 50.24, 100.48, 200.96
wFSR0 = AddressOf(MyTable8)
MyByte.Byte0 = POSTINC0
HRsout Dec MyByte, ","
MyByte.Byte0 = POSTINC0
HRsout Dec MyByte, ","
MyByte.Byte0 = POSTINC0
HRsout Dec MyByte, ","
yByte.Byte0 = POSTINC0
HRsout Dec MyByte, ","
MyByte.Byte0 = POSTINC0
HRsoutLn Dec MyByte
wFSR0 = AddressOf(MyTable16)
MyWord.Byte0 = POSTINC0
HRsout Dec MyWord, ","
MyWord.Byte0 = POSTINC0
HRsout Dec MyWord, ","
MyWord.Byte0 = POSTINC0
HRsout Dec MyWord, ","
MyWord.Byte0 = POSTINC0
HRsout Dec MyWord, ","
MyWord.Byte0 = POSTINC0
HRsoutLn Dec MyWord
wFSR0 = AddressOf(MyTable24)
MyLong.Byte0 = POSTINC0
HRsout Dec MyLong, ","
MyLong.Byte0 = POSTINC0
HRsout Dec MyLong, ","
MyLong.Byte0 = POSTINC0
HRsout Dec MyLong, ","
MyLong.Byte0 = POSTINC0
HRsout Dec MyLong, ","
MyLong.Byte0 = POSTINC0
HRsoutLn Dec MyLong
wFSR0 = AddressOf(MyTable32)
MyDword.Byte0 = POSTINC0
HRsout Dec MyDword, ","
MyDword.Byte0 = POSTINC0
HRsout Dec MyDword, ","
MyDword.Byte0 = POSTINC0
HRsout Dec MyDword, ","
MyDword.Byte0 = POSTINC0
HRsout Dec MyDword, ","
MyDword.Byte0 = POSTINC0
HRsoutLn Dec MyDword
wFSR0 = AddressOf(MyTableFloat)
MyFloat.Byte0 = POSTINC0
HRsout Dec2 MyFloat, ","
MyFloat.Byte0 = POSTINC0
HRsout Dec2 MyFloat, ","
MyFloat.Byte0 = POSTINC0
HRsout Dec2 MyFloat, ","
MyFloat.Byte0 = POSTINC0
HRsout Dec2 MyFloat, ","
MyFloat.Byte0 = POSTINC0
HRsoutLn Dec2 MyFloat
Stop

And it took abput 5 minutes, and is, essentially, the original ".bas" code. However, if there is assembler in the .bas file it will not have the preceeding Fx directives, and neither will variable declarations or preprocessor meta-macros, so they will need to be extracted seperately, but they are all listed in the asm code.

If you also have the ".lst" file, the variables and include files are listed at the top of it, for example, the above program's ".lst" file has:

                      00002         LIST
                      00003 ;{
                      00004 ;FILE F1 = C:\USERS\LES\PDS\TESTS\TEST_18F25K20.BAS
                      00005 ;}
;[Variable Listing]
                      00007 ;MyByte,0028,DT_BYTE,1
                      00008 ;MyWord,0029,DT_WORD,2
                      00009 ;MyLong,002B,DT_LONG,3
                      00010 ;MyDword,002E,DT_DWORD,4
                      00011 ;MyFloat,0032,DT_MCHP_FLOAT,4
                      00012 ;MyTable8,0036,DT_BYTE,10
                      00013 ;MyTable16,0040,DT_WORD,20
                      00014 ;MyTable24,0054,DT_LONG,30
                      00015 ;MyTable32,0072,DT_DWORD,40
                      00016 ;MyTableFloat,009A,DT_MCHP_FLOAT,40
                      00017 ;wFSR0,0FE9,DT_WORD,2
;[End Listing]
                      00019 ;[TOTAL VARS] 194

These give the include file names and the variable names and the variable types and address' and array sizes etc... And are what the Proteus simulator actually reads for its simulation of a BASIC program.

Gary Scott

Quote from: rick.curl on Feb 25, 2023, 12:54 PM
Quote from: TimB on Feb 24, 2023, 05:13 PMI'm investing now in a 3rd party backup to my G cloud account and going to see why backup in Positron IDE is not running.
Hi Tim- I'm using Insync to keep files and libraries backed up and sync'ed across multiple computers.  It's affordable and the support is very good.

-Rick

Sale at the moment:
QuoteSpring is here!🌸

Get 40% off on your Insync license until March 28, 2023!

How to get the discount:

    Head to our pricing page and click Buy Insync now, or click "BUY NOW" below.
    Enter the code SPRING40 where it says Click here to add a voucher.
    Enter your payment details. Make sure to type in the correct email you want the license for.
    Proceed to checkout.

Yves

I use OneDrive but not in sync mode but always save my work in in desktop OneDrive folder after regulars code improvement.
Also save files in separate hard drive. Sound parano but I have learn my lesson in the past.

Yves 
Yves

joesaliba

Quote from: Yves on Mar 25, 2023, 03:54 PMI use OneDrive but not in sync mode but always save my work in in desktop OneDrive folder after regulars code improvement.
Also save files in separate hard drive. Sound parano but I have learn my lesson in the past.

Yves

Same here.

Joe

SeanG_65

For backups in real time, try this;

https://www.tgrmn.com/web/viceversa.pro/?camp=goog_bac_p&t=backup&gclid=CjwKCAjw5pShBhB_EiwAvmnNV4kR8cQIefJTLxEgh01pfhSen3TtmT2P5yEa0YWfMhVVDg5bn_dQExoCHvoQAvD_BwE

When you write a file to one directory, it mirrors the contents of theat directory into another one, better if this is done on a cloud drive maybe?

TimB



If you use a mirroring system then the changes made are just mirrored, 1 day later you just have 2 copies of the damaged file.

I now use EaseUs ToDo Backup and the backup in the IDE. The main backup sticks it in my Gdrive and is sequential so I have versions based on dates.




top204

Over the years, I have gotten in the habit of saving the project I am working on, then backing up any modified files in it at the end of each day. And every week I backup complete folders, zipped and with version numbers and dates as the file name. That means I still have the unmodified project files, and the modified files in case there was something incorrect with the code or circuit, and I have only a day's work to go back into and correct if a problem is found.

I have never trusted any cloud based novelty for important files, and never will, and I always use external hard drives. I have a few 2tb hard drives and back up to each of them. They are now only about £48 each, so I save up and buy one when I can, so my backups are also backed up. Better safe than sorry. :-)