SETQ - Quick question for Chip
Cluso99            
            
                Posts: 18,071            
            
            
                            
                                  in Propeller 2             
        
                    Chip,
Just wanted to confirm this is OK to do...
ie the setq may not be immediately before the rdlong
                            Just wanted to confirm this is OK to do...
  if_e    setq    #len1-1
  if_ne   setq    #len2-1
          rdlong  cog0,hubptr
ie the setq may not be immediately before the rdlong

                            
Comments
So no non-executed instructions can intervene.
if_e setq #len1-1 if_ne setq #len2-1 rdlong cog0,hubptryou could useif_e altd zero,#len1-1 setq #len2-1 rdlong cog0,hubptrwhere "zero" is a cog register containg #0if_ne mov reply, #cog_len-1 ' set to copy whole cog (496 longs) if_e mov reply, #cog_len80-1 ' set to copy 512 bytes (128 longs) setq reply ' length -1 rdlong cog_start0, _hubdata ' copy loaded code into cog if_ne jmp #$0 ' NZ: execute loaded cog code jmp #$020 ' Z: execute loaded cog code from $080+