Is "Tevent" a reserved word ??

Go To Last Post
12 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I Named my R16 Register "Tevent"

As I was testing with the Simulator..

The Branch test failed

CPI Tevent,244
BREQ Done

The total at the time was 244
but the branch test failed..

I had to re-Name "Tevent" to "Tcycles" (Then it worked) ??

Is "Tevent" a reserved word in the ASM Compiler of Atmel Studio 6 ??

"We look for things.. Things that make us go."

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Not that I know of.

Quote:
The Branch test failed
Did it assemble OK?

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

js wrote:
Not that I know of.
Quote:
The Branch test failed
Did it assemble OK?

Yes all was OK.. 0 Errors 0 Warnings

Even before, or after the "Re-Name" of the register

Ony time the "Branch Test" worked was after the
Re-Nameing of the "Register"

So was wondering if "Tevent" is a reserved word
and compiled with a different instruction code..
to cause the "Branch Test" to fail

Just find it odd..

To me "Tevent" is not a reserved word
This should have worked..

"Tevent" is just a Name.. ?? Not a command ??

Could it be a bug in the Simulator ??

"We look for things.. Things that make us go."

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I never trust simulators! Do you have a debugger you can use?

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

js wrote:
I never trust simulators! Do you have a debugger you can use?

No.. I don't think the AVRISP mkii can do that.. ??

Simulator is a pain.. But good enough for my simple
stuff.

Flashing Lights :)

But what ever, (Note to self) don't use "Tevent"
as a "Variable name" :)

What are the chances.

Maybe the word "event" is.. and it ignored the "T"

Any way.. my little program works now after the change..
just stumped as to why it won't accept the "Tevent" word.

Thanks

"We look for things.. Things that make us go."

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I built this:

 .def Tevent=R16

 .include "m16def.inc"

	ldi Tevent, low(RAMEND)
	out SPL, r16
	ldi r17, high(RAMEND)
	out SPH, r17
foo:
	in Tevent, PINB
	cpi Tevent, 244
	breq Done
	call delay2
	rjmp foo

Done:
	rjmp Done

then this:

.include "m16def.inc"

	ldi r16, low(RAMEND)
	out SPL, r16
	ldi r17, high(RAMEND)
	out SPH, r17
foo:
	in r16, PINB
	cpi r16, 244
	breq Done
	call delay2
	rjmp foo

Done:
	rjmp Done

The generated .hex files were 100% identical so the use of "Tevent" has no effect on the code generated. Whatever you saw, it was something else.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:
The generated .hex files were 100% identical so the use of "Tevent" has no effect on the code generated. Whatever you saw, it was something else.
Yes, but he has told it: he saw the simulator failing, not the code generation... ;-)

JW

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It should be very easy for kds12345 to supply a repeatable case for this alleged problem´.

All I see (read) is "I had a problem when the register was def'ed as "Tevent", so I changed it to "Tcycles" and didn't see the problem.

What about doing the switch back to "Tevent" and see if the problem resurfaces?

What about isolating this (cut out all code that has nothing to do with this) and present that complete case here?

Until then, I am sceptical re the report. (Not saying "impossible", but I am sceptical.)

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

kds12345, if this is a bug in the simulator as you claim, it would be very interesting if you could provide us with a repeatable case so we would be able to fix it.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

je_ruud wrote:
kds12345, if this is a bug in the simulator as you claim, it would be very interesting if you could provide us with a repeatable case so we would be able to fix it.

Well I tried to make a NEW "Very" simple ASM program
using "Tevent" then "Tcycle" for counting a loop.

My previouse program was no longer applicable
I changed the routines to count in a different way

Then a TEST in the Simulator.

But.. Like a tooth ache.. The problem went away :)

So.. for now will have to say.. (WTF !!)

I also found it ODD (then and now)

But in future I will include my embarrassing (unfinished) code.
If something like this happens again..

I swear I saw a Pink Elephant Oslifer

"We look for things.. Things that make us go."

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
So.. for now will have to say.. (WTF !!)

Perhaps, but thee is a lesson to be learned here.

Not always, but almost always, errors/problems are with my/your own code, setup, use-of-tool etc.

Whenever you feel tempted to cry "compiler bug!" or "bad IDE!" or similar, you should take a step back, do some repeated experiments with the assumption that it is rather something with your code, setup etc..

At least 99 times of 100 this is the worthwhile approach.

And if it in the end turns out to be a genuine compiler problem (or some such) you will have a small project demonstrating it which you can attach to the bug report. Remember that a bug report without a repreatable case is more or less worthless.

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm just guessing but perhaps your Tevent and Tcycle were actually different registers (perhaps R16 and R17?) and when using Tevent it was the case that a separate R16 was being used too (perhaps in a CALLd function or something?). Changing to Tcycle would then avoid such a clash.