AUGS not cancelling after a ALTD instruction

ozpropdevozpropdev Posts: 2,604
edited 2019-02-16 - 23:21:54 in Propeller 2
Hi Chip

I know it's a too late now but I discovered this bug this morning.
When I try to AUGS a ALTD instruction the AUG is not being cancelled afte the AUTD.

For example
	mov	pa,#myreg
	altd	pa,##1 << 9	'alter D in next instruction,increment pa
	mov	0-0,#$55	'returns $255 not $55 ****
	altd	pa,##1 << 9	'alter D in next instruction,increment pa
	mov	0-0,#$aa	'returns $2aa not $aa  ****

A simple fix is to use a register instead of a immediate.
	mov	pa,#myreg
	altd	pa,autoinc	'alter D in next instruction,increment pa
	mov	0-0,#$55	'returns $55 Ok
	altd	pa,autoinc	''alter D in next instruction,increment pa
	mov	0-0,#$aa	'returns $aa Ok
.
.
autoinc	long	1 << 9

BTW. The increment\decrement option for ALTD/ALTS needs to be added to the documentation.

Cheers
Brian
Melbourne, Australia

Comments

  • Ah, I had been wondering about that. I suspect the ALTx instructions and the AUGx instructions have an exclusion from each other. This will be so that they can both be stacked onto a target instruction.

    Not that I've tried to reason it completely.

    We have the vastness of the internet and yet billions of people decided to spend most of their time within a horribly designed, fake-news emporium of a website that sucks every possible piece of personal information out of you so it can sell it to others. And they see nothing wrong with that.
  • If this is a bug that needs fixing, perhaps the issue of next S vs. next D for SCA/SCAS/GETXACC/XORO32 could be looked at the same time?
    http://forums.parallax.com/discussion/169585/xoro32-scrambler-output#latest
    Formerly known as TonyB
  • I'd guess pasm will be bug fixed to prevent ## with ALTx instructions.
    We have the vastness of the internet and yet billions of people decided to spend most of their time within a horribly designed, fake-news emporium of a website that sucks every possible piece of personal information out of you so it can sell it to others. And they see nothing wrong with that.
  • Although it could be a deliberate feature...
  • heh, posted 2 seconds apart.
    We have the vastness of the internet and yet billions of people decided to spend most of their time within a horribly designed, fake-news emporium of a website that sucks every possible piece of personal information out of you so it can sell it to others. And they see nothing wrong with that.
  • Thank you for finding this, Guys.

    This needs to be documented, but I don't count it as a bug, because if we used up the AUGx on the ALTx instruction, the instruction being modified by the ALTx couldn't have an augmented constant. I figured the ALTx instructions would be best served by registers containing any needed large constants.
  • Couldn't you have made ALTx not get used up until a non-AUGx instruction, similarly to how AUGx doesn't get used until an instruction with an immediate value?
  • Couldn't you have made ALTx not get used up until a non-AUGx instruction, similarly to how AUGx doesn't get used until an instruction with an immediate value?

    ALTx instructions affect the very next instruction in the pipeline through mux's. It would take a bunch of flops and more mux's to hold those states for later.
Sign In or Register to comment.