Hot!PIC16F57 Old Assembly files

Author
seppi94
New Member
  • Total Posts : 3
  • Reward points : 0
  • Joined: 2018/09/13 05:37:55
  • Location: 0
  • Status: offline
2018/09/13 23:37:21 (permalink)
0

PIC16F57 Old Assembly files

Hello everyone,
 
I have a very old Assembly Project with 3 .ASM files. Very old means 1995. :D
I am new to Assembly and the MPLAB IDE v5.05 and I have the problem that i can´t recompile the Project.
 
Why recompiling such an old Project?
In future there should be made some changes in the code but that is useles if i can´t build the original files.
 
 
The original code shoud be ok because it worked and the old program is still in use.
The project was created on a Windows 3 operating system so I can´t reuse the old setup. Even the guy who created this Project does not know what environment he used.
 
My my idea was to install MPLAB X IDE v5.05 and create a new Standalone Project. Then I added my .ASM files (two of them are headder files the other one is a Source File)
Then I tried to Build and got an enomous number of compiler errors.
My compiler:
  • mpasm (v5.81)
  • XC8 (v2.00)
Google could not realy help me (all the topics are about creating Projects with combining C and Assembly)
The last two days I tried ALOT of different settings with both compiler and also some IDE settings.
I am not really shure which compiler to use but I think it should be the XC8 right?
I habe atached two files with the compiler Errors from both compilers with the default configuration.
It would be great if anyone could help me I am really at the end.
 
Thank you and sorry for my bad English
#1

9 Replies Related Threads

    David
    Super Member
    • Total Posts : 1277
    • Reward points : 0
    • Joined: 2007/12/17 23:19:53
    • Location: uk sussex
    • Status: offline
    Re: PIC16F57 Old Assembly files 2018/09/13 23:51:40 (permalink)
    +1 (1)
    can you upload the files ?
     
    maybe this MPLAB project file might help... rename to just *dot zip
    post edited by David - 2018/09/14 00:01:57

    David
    I support http://picforum.ric323.com because this forum is often too broken to use!
    #2
    1and0
    Access is Denied
    • Total Posts : 8351
    • Reward points : 0
    • Joined: 2007/05/06 12:03:20
    • Location: Harry's Gray Matter
    • Status: offline
    Re: PIC16F57 Old Assembly files 2018/09/14 01:15:11 (permalink)
    +3 (3)
    For such old assembly project and old PIC device, I suggest you to use MPLAB v8.92 instead of MPLAB X because of better supports for assembly projects. Looking at the error message, my guess is that IOBRD_L.ASM is the main assembly file. To create a new project in MPLAB v8.92,
    • click Project > Project Wizard and click Next,
    • select PIC16F57 for Device and click Next,
    • select MPASM Assembler toolsuite and click Next,
    • browse to the folder containing the ASM files, type in a project file name, and click Save then Next,
    • select IOBRD_L.ASM and click Add >> then Next,
    • click Finish.
     
    To assemble (not compile) the assembly files, click the Build All icon and select Absolute.
    #3
    seppi94
    New Member
    • Total Posts : 3
    • Reward points : 0
    • Joined: 2018/09/13 05:37:55
    • Location: 0
    • Status: offline
    Re: PIC16F57 Old Assembly files 2018/09/14 02:45:17 (permalink)
    0
    Thank you very much for your reply
     
    I tried the MPLAB project file and it worked fine with the test.asm
    So there must be something wrong with my Assembly files :/
    I will upload the files on monday but all the koments are in german.
     
    I will install the MPLAB v8.92 and tell you about the results.
    hope this would work because I don´t know what I could try next.
     
    Thanks for the support! 
    #4
    qhb
    Superb Member
    • Total Posts : 6832
    • Reward points : 0
    • Joined: 2016/06/05 14:55:32
    • Location: One step ahead...
    • Status: online
    Re: PIC16F57 Old Assembly files 2018/09/14 07:12:19 (permalink)
    +1 (1)
    Your Assembler files are written for "absolute mode".
    MPLABX defaults to selecting "relocatable mode". You need to edit the project properties to say you want "Absolute mode".
     
    Your C code is written for older versions of XC8.
    Version 2.0 defaults to "C99 mode", which uses different syntax to the older "C90" mode.
    Again, this is selected in the project properties.
     

    Worst forum problems are now fixed, but the damn firewall is still there.
    #5
    1and0
    Access is Denied
    • Total Posts : 8351
    • Reward points : 0
    • Joined: 2007/05/06 12:03:20
    • Location: Harry's Gray Matter
    • Status: offline
    Re: PIC16F57 Old Assembly files 2018/09/14 07:25:56 (permalink)
    +1 (1)
    What C code?  I think OP is using XC8 in C99 mode to "compile" assembly files written in "relocatable (?)" mode, as indicated by the use of the RES directive (I did not look at the XC8 errors.txt file yesterday).
     
    "C:\Program Files (x86)\Microchip\xc8\v2.00\bin\xc8-cc.exe" -c -mcpu=16F57 -o build/default/production/_ext/1472/ADDR.o ../ADDR.ASM
    "C:\Program Files (x86)\Microchip\xc8\v2.00\bin\xc8-cc.exe" -c -mcpu=16F57 -o build/default/production/_ext/1472/IOBRD_L.o ../IOBRD_L.ASM
    "C:\Program Files (x86)\Microchip\xc8\v2.00\bin\xc8-cc.exe" -c -mcpu=16F57 -o build/default/production/_ext/1472/RS485.o ../RS485.ASM
     
    build/default/production/_ext/1472\IOBRD_L.i:8:: error: (876) syntax error
    build/default/production/_ext/1472\IOBRD_L.i:27:: error: (844) lexical error
    build/default/production/_ext/1472\IOBRD_L.i:19:: error: (876) syntax error
    build/default/production/_ext/1472\IOBRD_L.i:20:: error: (845) symbol "RES" defined more than once
     
    #6
    qhb
    Superb Member
    • Total Posts : 6832
    • Reward points : 0
    • Joined: 2016/06/05 14:55:32
    • Location: One step ahead...
    • Status: online
    Re: PIC16F57 Old Assembly files 2018/09/14 07:30:00 (permalink)
    0
    You're right.
    Why the hell are they trying to use XC8 at all if it's only ASM files...
     

    Worst forum problems are now fixed, but the damn firewall is still there.
    #7
    1and0
    Access is Denied
    • Total Posts : 8351
    • Reward points : 0
    • Joined: 2007/05/06 12:03:20
    • Location: Harry's Gray Matter
    • Status: offline
    Re: PIC16F57 Old Assembly files 2018/09/14 07:33:23 (permalink)
    +1 (1)
    qhb
    Why the hell are they trying to use XC8 at all if it's only ASM files...

    I did not want to go there. ;)
     
    #8
    seppi94
    New Member
    • Total Posts : 3
    • Reward points : 0
    • Joined: 2018/09/13 05:37:55
    • Location: 0
    • Status: offline
    Re: PIC16F57 Old Assembly files 2018/09/19 02:52:33 (permalink)
    0
    Hello guys
     
    unfortunately i did not have time so sorry for my late reply
     
    I followed the instruction form 1and0 (thanks for that)
    It took a while because i did not know whre to put my .ASM files.
     
    The IOBRD_L file contains the main and i put in the folder "Source Filse" in the IDE (IOBRD_L icludes RS485.ASM and ADDR.ASM)
    The ADDR.ASM and RS485.ASM are in de Project Folder.
    That is the needed configuration to build it in absolute mode.
     
    The good thing:
    if i make right-click on the IBRD.ASM file and choos "Assemble" the build cuccseds. (but only iif I dont choose "build in absolute mode")
     
    I have been verry happy about that but I am not shure if thats right because i did not assemble in not in absolute mode
     
    The bad Thing:
    If I try to build the whole project I get a bunch of errors "Overwriting previous address contents (0008)"
    the full list is atached.
    So i can´t generate a .HEX file which I need to program my PIC 
     
    Is there a way to upload the program to my pic wihout building the wohle Project just with the assembled file? (sorry for that question I am really new to PIC programming but I have to solve this Problem)
     
    I have also tryed to use the 
     
    Do you have any idea what I am doing wrong?
    I think it´s an adressing problem, could this be possible?
    post edited by seppi94 - 2018/09/19 02:54:39
    #9
    qhb
    Superb Member
    • Total Posts : 6832
    • Reward points : 0
    • Joined: 2016/06/05 14:55:32
    • Location: One step ahead...
    • Status: online
    Re: PIC16F57 Old Assembly files 2018/09/19 03:10:28 (permalink)
    +2 (2)
    Can you post your actual source files?
    It sounds like you are trying to merge multiple absolute files, which you just can't do unless you manually set them all to occupy unique addresses. That is the whole idea of relocatable mode, to allow the assembler and linker to do that for you.
     

    The IOBRD_L file contains the main and i put in the folder "Source Filse" in the IDE (IOBRD_L icludes RS485.ASM and ADDR.ASM)
    The ADDR.ASM and RS485.ASM are in de Project Folder.

    This sounds horribly confused. All your files should be in a single folder.
    Again, it would be easier to see what you are actually trying to do if you shows us the actual files.
     

    Worst forum problems are now fixed, but the damn firewall is still there.
    #10
    Jump to:
    © 2018 APG vNext Commercial Version 4.5