• AVR Freaks

Hot!Exxtremely annoying fault.

Author
peterg1000
Super Member
  • Total Posts : 182
  • Reward points : 0
  • Joined: 2009/01/29 13:07:52
  • Location: Flamstead, Herts, UK
  • Status: offline
2020/02/20 06:37:45 (permalink)
0

Exxtremely annoying fault.

Discovered this ridiculous situation when preparing assembler files.
 
Acceptable syntax for externals declaration - system builds correctly
 
    .text
    .global    __reset
    .extern    _PIC_init
    .extern    _wreg_init


Unacceptable syntax - fails after "," in .extern
 
    .text
    .global __reset
    .extern    _PIC_init,  _wreg_init
 
In both cases source file declaration is
 
    .global    _PIC_init, _wreg_init


I rest my case!!
#1

9 Replies Related Threads

    Gort2015
    Klaatu Barada Nikto
    • Total Posts : 3956
    • Reward points : 0
    • Joined: 2015/04/30 10:49:57
    • Location: 0
    • Status: offline
    Re: Exxtremely annoying fault. 2020/02/20 08:20:46 (permalink)
    -1 (1)
    Four lines of code and you have decided that the assembler is broken or has a bug in it?
     
    Why do you need to use ".extern" ?
    post edited by Gort2015 - 2020/02/20 08:23:26

    MPLab X playing up, bug in your code? Nevermind, Star Trek:Discovery will be with us soon.
    https://www.youtube.com/watch?v=Iu1qa8N2ID0
    + ST:Continues, "What Ships are Made for", Q's back.
    #2
    Gort2015
    Klaatu Barada Nikto
    • Total Posts : 3956
    • Reward points : 0
    • Joined: 2015/04/30 10:49:57
    • Location: 0
    • Status: offline
    Re: Exxtremely annoying fault. 2020/02/20 08:37:56 (permalink)
    +1 (1)
    I apologize.
     
    It is indeed a bug, I would not worry about it though, I have never found a use for .extern in assembler since using .globl makes them external to all files anyway.
     
    Any global variable or function in C is gobal to asm.
    post edited by Gort2015 - 2020/02/20 08:42:05

    MPLab X playing up, bug in your code? Nevermind, Star Trek:Discovery will be with us soon.
    https://www.youtube.com/watch?v=Iu1qa8N2ID0
    + ST:Continues, "What Ships are Made for", Q's back.
    #3
    peterg1000
    Super Member
    • Total Posts : 182
    • Reward points : 0
    • Joined: 2009/01/29 13:07:52
    • Location: Flamstead, Herts, UK
    • Status: offline
    Re: Exxtremely annoying fault. 2020/02/20 10:24:41 (permalink)
    0
    Hi,
     
    Rather than put everything in one enormous cumbersome file, I partition functions into manageable chunks of code - e.g. Initialisation, Main, RS232, I2C, Maths etc.  Just the way I like to do things - can't change the habits of a lifetime (well 40 years anyway!!) 
     
    Just another annoyance to add to the plethora of silly bugs in MPLA-X when debugging assembler.
    post edited by peterg1000 - 2020/02/20 10:54:35
    #4
    Gort2015
    Klaatu Barada Nikto
    • Total Posts : 3956
    • Reward points : 0
    • Joined: 2015/04/30 10:49:57
    • Location: 0
    • Status: offline
    Re: Exxtremely annoying fault. 2020/02/20 13:00:14 (permalink)
    0
    It looks like 16bit asm.

    MPLab X playing up, bug in your code? Nevermind, Star Trek:Discovery will be with us soon.
    https://www.youtube.com/watch?v=Iu1qa8N2ID0
    + ST:Continues, "What Ships are Made for", Q's back.
    #5
    peterg1000
    Super Member
    • Total Posts : 182
    • Reward points : 0
    • Joined: 2009/01/29 13:07:52
    • Location: Flamstead, Herts, UK
    • Status: offline
    Re: Exxtremely annoying fault. 2020/02/20 14:46:26 (permalink)
    0
    Gort2015
    It looks like 16bit asm.

    Correct - I don't "do" C!!
     
    For small embedded applications I believe assembler is superior in both size and integrity. Many of the systems I worked on before retiring were real time control applications (i.e gas turbine gen sets) where software failure could result in £millions of damage and possible risk to life.  Don't take any chances there, and old habits die hard.

    Attachment(s)

    Attachments are not available: Download requirements not met
    #6
    Gort2015
    Klaatu Barada Nikto
    • Total Posts : 3956
    • Reward points : 0
    • Joined: 2015/04/30 10:49:57
    • Location: 0
    • Status: offline
    Re: Exxtremely annoying fault. 2020/02/20 15:28:23 (permalink)
    0
    Not a CK, the one with the bad i2c slave?
     
    I know i2c slave works on the CH, I've had it running at 1,500KHz.

    MPLab X playing up, bug in your code? Nevermind, Star Trek:Discovery will be with us soon.
    https://www.youtube.com/watch?v=Iu1qa8N2ID0
    + ST:Continues, "What Ships are Made for", Q's back.
    #7
    peterg1000
    Super Member
    • Total Posts : 182
    • Reward points : 0
    • Joined: 2009/01/29 13:07:52
    • Location: Flamstead, Herts, UK
    • Status: offline
    Re: Exxtremely annoying fault. 2020/02/20 15:41:46 (permalink)
    0
    Gort2015
    Not a CK, the one with the bad i2c slave?
     I know i2c slave works on the CH, I've had it running at 1,500KHz.

    Gort2015
    Sorry - you lost me there   CK?  CH?  I know not to what you refer sir!!
    That's pretty damn fast for I2C - I normally use it to update LCD displays, can't read that fast anyway!!
    #8
    ric
    Super Member
    • Total Posts : 27716
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: offline
    Re: Exxtremely annoying fault. 2020/02/20 15:51:25 (permalink)
    +1 (1)
    He's talking about variants of DSPIC33 chips.
    You haven't revealed what device you are talking about, so we have to guess.
    post edited by ric - 2020/02/20 15:59:08

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #9
    Gort2015
    Klaatu Barada Nikto
    • Total Posts : 3956
    • Reward points : 0
    • Joined: 2015/04/30 10:49:57
    • Location: 0
    • Status: offline
    Re: Exxtremely annoying fault. 2020/02/20 16:03:12 (permalink)
    0
    CK and CH and the most recent 16bit cpus.
    CH is dual core.
     
    That is excellant speed for standard i2c and I believe it will go higher.
     

    MPLab X playing up, bug in your code? Nevermind, Star Trek:Discovery will be with us soon.
    https://www.youtube.com/watch?v=Iu1qa8N2ID0
    + ST:Continues, "What Ships are Made for", Q's back.
    #10
    Jump to:
    © 2020 APG vNext Commercial Version 4.5