electro-music.com   Dedicated to experimental electro-acoustic
and electronic music
 
    Front Page  |  Radio
 |  Media  |  Forum  |  Wiki  |  Links
Forum with support of Syndicator RSS
 FAQFAQ   CalendarCalendar   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   LinksLinks
 RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in  Chat RoomChat Room 
go to the radio page Live at electro-music.com radio 1 Please visit the chat
poster
 Forum index » DIY Hardware and Software » Developers' Corner
ASM30 Question
Post new topic   Reply to topic Moderators: DrJustice
Page 1 of 1 [8 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Author Message
JovianPyx



Joined: Nov 20, 2007
Posts: 1988
Location: West Red Spot, Jupiter
Audio files: 224

PostPosted: Wed Jul 03, 2013 12:19 pm    Post subject: ASM30 Question Reply with quote  Mark this post and the followings unread

I use ASM30 to assemble code for a dsPIC33F.

I like to keep peripheral device initialization code in separate files for each device, such as UART1.init for initializing UART1.

I use the .include directive to include the files into the main .s file.

There are no directives in the .init files.

This works and assembles into a working executable.

The only problem I have is that the disassembly listing comes out weird. Weird in that while all of the instructions are included with their proper program memory addresses, the order of the lines is not sequential according to address and the source code is not listed with the machine language output. In fact, it's scrambled to the point of looking rather random. This makes troubleshooting using the disassembly listing rather useless when I'm looking at the initialization code. If I replace the .include directives with the code from those .init files, the disassembly listing looks perfectly normal. Using the .include method, The actual address lines contain the correct instruction data, but they are not in sequential order.

I am using MPLAB version 8.87.00.00

Has anyone else seen this?

If so - is there a solution?

_________________
FPGA, dsPIC and Fatman Synth Stuff

Time flies like a banana.
Fruit flies when you're having fun.
BTW, Do these genes make my ass look fat?
corruptio optimi pessima
Back to top
View user's profile Send private message Visit poster's website
bubzy



Joined: Oct 27, 2010
Posts: 594
Location: United Kingdom
Audio files: 64

PostPosted: Thu Sep 19, 2013 11:52 am    Post subject: Reply with quote  Mark this post and the followings unread

arduino
_________________
_Richard_ Smile
Back to top
View user's profile Send private message
JovianPyx



Joined: Nov 20, 2007
Posts: 1988
Location: West Red Spot, Jupiter
Audio files: 224

PostPosted: Thu Sep 19, 2013 1:01 pm    Post subject: Reply with quote  Mark this post and the followings unread

Well, I need 40 MIPS, 16 bit processing and DSP instructions. Arduino got that? Wink
_________________
FPGA, dsPIC and Fatman Synth Stuff

Time flies like a banana.
Fruit flies when you're having fun.
BTW, Do these genes make my ass look fat?
corruptio optimi pessima
Back to top
View user's profile Send private message Visit poster's website
bubzy



Joined: Oct 27, 2010
Posts: 594
Location: United Kingdom
Audio files: 64

PostPosted: Thu Sep 19, 2013 2:00 pm    Post subject: Reply with quote  Mark this post and the followings unread

pff arduino has that for breakfast !!!
_________________
_Richard_ Smile
Back to top
View user's profile Send private message
yerpa58



Joined: Mar 08, 2008
Posts: 57
Location: Wisconsin
Audio files: 4

PostPosted: Fri Sep 20, 2013 1:31 pm    Post subject: Reply with quote  Mark this post and the followings unread

Check out this link at the Microchip forums:
http://www.microchip.com/forums/tm.aspx?m=618596&high=lst+file+order

Also check my YouTube channel, I've got some dsPIC waveguide stuff you might be interested in.
Back to top
View user's profile Send private message Visit poster's website
blue hell
Site Admin


Joined: Apr 03, 2004
Posts: 24075
Location: The Netherlands, Enschede
Audio files: 277
G2 patch files: 320

PostPosted: Fri Sep 20, 2013 1:48 pm    Post subject: Reply with quote  Mark this post and the followings unread

stuff like this, and also macro code getting messed up while debugging in MPLAB made me add a postprocessor to my forth compiler ... so everything is inlined properly - it was not that hard to write ...
_________________
Jan
also .. could someone please turn down the thermostat a bit.
Posted Image, might have been reduced in size. Click Image to view fullscreen.
Back to top
View user's profile Send private message Visit poster's website
JovianPyx



Joined: Nov 20, 2007
Posts: 1988
Location: West Red Spot, Jupiter
Audio files: 224

PostPosted: Fri Sep 20, 2013 2:12 pm    Post subject: Reply with quote  Mark this post and the followings unread

I believe that this is some compiler bug, haven't researched it very extensively on the Microchip forums yet.

What I did find was that I could copy the randomized stuff and paste it into a document and use a sort program (really just linux sort) to put all of the lines in numerical order. Since the address of each instruction line is first, this works nicely. Just seems to me that I should NOT have to do such things, but at least there are tools that can be pressed into use. So far, this method has been effective enough.

Fortunately, I don't need this very much, but when troubleshooting weird problems with initialization, this really helps.

_________________
FPGA, dsPIC and Fatman Synth Stuff

Time flies like a banana.
Fruit flies when you're having fun.
BTW, Do these genes make my ass look fat?
corruptio optimi pessima
Back to top
View user's profile Send private message Visit poster's website
JovianPyx



Joined: Nov 20, 2007
Posts: 1988
Location: West Red Spot, Jupiter
Audio files: 224

PostPosted: Fri Sep 20, 2013 2:19 pm    Post subject: Reply with quote  Mark this post and the followings unread

yerpa58 wrote:
Check out this link at the Microchip forums:
http://www.microchip.com/forums/tm.aspx?m=618596&high=lst+file+order

Also check my YouTube channel, I've got some dsPIC waveguide stuff you might be interested in.


Thank you yerpa58. I am now wondering if the problem I am having is that I use the extension .init instead of .s.

I shall at some point test changing the files to *.init.s to see if the problem abates.

One thing that parallels the Microchip thread cited is that the actual source code text from the .init files does not appear (as does the .s source code) in the disassembly listing.

Speaking of waveguides, I have 2 dsPIC synths that use Karplus-Strong methods (also known as digital waveguides). One is an 8 voice polysynth (using 3 dsPICS, one for MIDI controller, 2 for voice engines) and a single dsPIC 4 string Karplus-Strong bass synth (MIDI controller and voice engine share one dsPIC).

EDIT ADD:

I found this in the thread....

Quote:
The .include'd code DOES show up in the Disassembly window, though not in a natural address order (this is a known "bugture" of MPLAB). To see everything in a natural order, open a Program Memory window and select a symbolic view. See the attached files with exported Disassembly and ProgMem window contents.

So at least I know it's a bug that is already reported (and apparently they ignore it)...

_________________
FPGA, dsPIC and Fatman Synth Stuff

Time flies like a banana.
Fruit flies when you're having fun.
BTW, Do these genes make my ass look fat?
corruptio optimi pessima
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic Moderators: DrJustice
Page 1 of 1 [8 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
 Forum index » DIY Hardware and Software » Developers' Corner
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Forum with support of Syndicator RSS
Powered by phpBB © 2001, 2005 phpBB Group
Copyright © 2003 through 2009 by electro-music.com - Conditions Of Use