Shop OBEX P1 Docs P2 Docs Learn Events
Cog symbol must be long aligned? — Parallax Forums

Cog symbol must be long aligned?

Ran into this error message while troubleshooting this assembly driver.

I think it's a bug in the prop tool.
Doesn't like me adding in a byte in a dat section after the assembly driver, test1 below.

fname           res     3                       ' 8+3+1
_hubdata        res     1

FIT 496


dat         '' singleton spin mailbox
'alignl
test1   byte 3
cmd     long 0

I guess it thinks it's still part of the cog driver, but it's not.
No error message in Flexprop.

Comments

  • If it's a hub symbol you need to put an ORGH, otherwise you'll get fun errors where it thinks you're still in cog mode

  • RaymanRayman Posts: 13,800

    I added orgh symbol to start of assembly and it still gives this error:

    dat
    orgh
                    org
    _asm_start      mov     ptr_to_mbox,    ptra                ' save mbox address for later
    
  • ElectrodudeElectrodude Posts: 1,614
    edited 2022-07-28 12:56

    @Rayman said:
    I added orgh symbol to start of assembly and it still gives this error:

    dat
    orgh
                    org
    _asm_start      mov     ptr_to_mbox,    ptra                ' save mbox address for later
    

    But then you immediately follow the orgh with an org, putting the assembler right back into cog mode.

  • RaymanRayman Posts: 13,800

    It is cog code, but with orgh forcing it’s location in hub to be >= $400

  • ElectrodudeElectrodude Posts: 1,614
    edited 2022-07-28 15:05

    Try putting the orgh at the beginning of the singleton spin mailbox definition, just before the 'alignl line, since that's what the assembler needs to know will be accessed via hub and can therefore have byte alignment.

  • RaymanRayman Posts: 13,800

    That does fix Prop Tool error. But, there's already an orgh at the start of the dat section, so not sure why needed.

    Also, is there a reason Prop Tool and FlexProp treat this differently?

  • evanhevanh Posts: 15,126

    The ORG changes the assembly memory mode. It con only be one mode at a time, either ORG or ORGH. Probably need the whole source listing to pick out all details.

Sign In or Register to comment.