Propeller start up procedure ?
Chris Micro
Posts: 160
Hello together,
how is the start up procedure of the propeller?
If we have the following code:
Where in the Hub memory the assembler code is starting?
If I take a look at the hex dump in the propeller tool, the
mov r0,#2 instruction seems to begin at address 0x18.
Is the first dat section always begining at this address?
Help appreciated,
chris
how is the start up procedure of the propeller?
If we have the following code:
pub xx cognew(@start,0) dat org 0 start mov r0,#2 add r0,#1 ...
Where in the Hub memory the assembler code is starting?
If I take a look at the hex dump in the propeller tool, the
mov r0,#2 instruction seems to begin at address 0x18.
Is the first dat section always begining at this address?
Help appreciated,
chris
Comments
The Propeller's bootloader always starts up an initial Spin interpreter in a single cog and that interpreter finds its program based on the information stored in the 1st 16 bytes of the hub memory. That program starts with the first method in the outermost object, in your case "xx" and that method does whatever is needed by the overall program. In your case, it starts up a new cog with the assembly routine at the label "start".
I would need it for my little emulator project.
Because the memory is so small, I can run only propeller assembler routines.
The only idea I have at the moment is to begin the assembler routines with a dummy fixed starting sequence like
I can search for this sequence to get the start of the routine.
Mike, thank you for the quick answer,
chris
How about:
Your emulator would just search for marker and begin emulation immediately after that word. Something like:
thank you,
chris
I guess what you want is to extract some PASM-code to let it run on your emulator, right? With a propeller setup it's easy. Just write the dat section to an SD-Card. A while ago I posted some code which is doing that. PASMStore was the name ... if I'm right with my guess I can search for it or post it again.
Edit: Currently it's the last post of this thread http://forums.parallax.com/showthread.php?p=794696·. Of course you could also replace the save to SD-Card with a send to PC via serial port. HyperTerminal allows to save data it receives via serial port.
Post Edited (MagIO2) : 6/23/2009 8:54:00 PM GMT
If you only ever have one spin method then yes, it always starts at 0x18. For each object and spin method you add, you add 4 bytes to that offset.
PBASE is always 0x10 for the top object, so you will _always_ find the method table at 0x10. Each entry in the method table takes 4 bytes, plus 4 bytes for the table header. The DAT segment is always located directly after the method table.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Missed it by ->" "<- that much!
It took me ages to figure this out for myself - and it seems that as we continue to push the limits of the Prop, more and more people need to know this kind of thing. Is this actually documented anywhere that you know of? Searching these forums to try and find little gems such as this is very frustrating.
Ross.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Catalina - a FREE C compiler for the Propeller - see Catalina
Try this: http://forums.parallax.com/showthread.php?p=736449
Guess we could make better use of the Wiki ....
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
--Steve
Propalyzer: Propeller PC Logic Analyzer
http://forums.parallax.com/showthread.php?p=788230
Boomarked. Thanks.
Ross.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Catalina - a FREE C compiler for the Propeller - see Catalina
www.cliff.biffle.org/software/propeller/propasm/
Usage: java <vm options> -jar propasm.jar <flags> <input files>
Any number of input files may be specified, though specifying zero
will get you this message.
Flags:
-raw Generate raw machine code without a bootloader.
The Propeller won't load the output directly; this is useful for making
a "coglet" to include in larger assembly programs.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.
Hippy, Bill and Aextrix(spelling?) were the first to document it apart from chip. You probably know all this know but heres a couple of files that Hippy did up ages ago (before he had the spin source). I think that purpose of one of the other numbers in the object header was figured out but I can't remember. Most of it should be able to figure out from the spin code now but that isn't necessarily the easiest thing to do.
There are other ways as well. So it really depends on what you are trying to achieve.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:
· Home of the MultiBladeProps: TriBladeProp, RamBlade, TwinBlade,·SixBlade, website
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
· Prop Tools under Development or Completed (Index)
· Emulators: Micros eg Altair, and Terminals eg VT100 (Index) ZiCog (Z80), MoCog (6809)
· Search the Propeller forums (via Google)
My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
For the first version of the cog-emulator I used the magic number principle.
It is compiled for a LINUX command line ( because for some strange reasons my installed visual c++ express studio couldn't find stdio.h ).
So, if you have linux, you can try the cog-emulator with my little example program ( see attached file ).
I would be very glad, if someone could try the program.
chris