How to align a table to a specific address?
ManAtWork
Posts: 2,178
Hello,
I'd like to replace the standard sine table with my own version. (The reason is my hardware causes distortions, so I have to add precompensation). Of course, I could simply write my table into a DAT section. But the standard sine/cosine routines (Prop manual appendix are highly optimized and rely on the fact that the table starts at an adress with the least significant bits equal to zero.
How can I align my table to a specific address in hub RAM? Is there a way to include/import a hex data file?
Thanks for any help
·
I'd like to replace the standard sine table with my own version. (The reason is my hardware causes distortions, so I have to add precompensation). Of course, I could simply write my table into a DAT section. But the standard sine/cosine routines (Prop manual appendix are highly optimized and rely on the fact that the table starts at an adress with the least significant bits equal to zero.
How can I align my table to a specific address in hub RAM? Is there a way to include/import a hex data file?
Thanks for any help
·
Comments
Ok, this example is only valid for the top object. This will import the binary file called "fred" and locate it at $2000 in the hub
Basically we take the address of "here" and pad it out until it is $2000 into the object. Given the object is the top object it's $10 into the hub.
This takes any file of bytes and inserts it where you want it.
List file output to verify what went where.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
If you always do what you always did, you always get what you always got.
You can't include or import a hex data file, but you can include a binary file by using the FILE statement. This copies the binary content of a file so that it appears in your program in the place of the FILE statement. Normally you'd use cut and paste to place a hex source table into a program's DAT section.
thanks, that's exactly what I'm looking for. I think I can combine the two:
because it's much easier to copy/paste directly into the source instead of generating a binary file out of Excel...
BTW, stupid question, where can I find the list file output?
Cheers
I've noticed that stack space and the GRAPHICS object buffers can be absolutely addressed,
and stuff can be moved and stored and used in known BYTE[noparse][[/noparse] ] addresses, especially within the
offscreen buffer if it is not used for video.
I suppose that everything could be rearranged but would be hard to keep track of; and if there is
any advantage to putting the table at a nice address like hex $2000, using BYTEMOVE,
its former Hub RAM location becomes free and available relative to its label.
Oh, sorry. I don't use the Propeller Tool or Windows. It can't give you a list output.
If you are on Windows and have .NET installed, grab mparks homespun compiler.
propeller.wikispaces.com/Homespun+Spin+Compiler
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
If you always do what you always did, you always get what you always got.
homespun requires a compiler switch so, presuming Windoze, open a dos window and type c>homespun /? for a list of options (or is it -?)
bst has an option in the titlebar for listing which opens a window, then compile, then open the window again and the listing is there.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:
· Home of the MultiBladeProps: TriBlade,·RamBlade,·SixBlade, website
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
· Prop Tools under Development or Completed (Index)
· Emulators: CPUs Z80 etc; Micros Altair etc;· Terminals·VT100 etc; (Index) ZiCog (Z80) , MoCog (6809)
· Search the Propeller forums·(uses advanced Google search)
My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm