closed

Loginbox

Please enter your username and password into the following fields to log in.


  • Username:
  • Password:
  •  
  • Auto log in on every visit.


  •  

INCL und EXCL gehen nicht bei Register?



Lschreyer offline
Benutzer
Avatar
Gender: n/a
Location: n/a 
Age:
Posts: 467
Registered: 02 / 2007
Private message
Subject: INCL und EXCL gehen nicht bei Register?  -  Posted: 24.06.2019 - 13:07   -  
Ich habe versucht mit INCL(INT0MASKB, 1) ein Bit eines Registers zu setzen, was aber nicht geht.
Gibt es dafür einen bestimmten Grund warum das da nicht geht?

Kann ich das nur auf normale Variablen anwenden?
go down go up
Merlin offline
Schreiberling
Avatar
Gender: male
Location: UNITED KINGDOM 
Age:
Posts: 877
Registered: 03 / 2005
Private message
Subject: Re: INCL und EXCL gehen nicht bei Register?  -  Posted: 25.06.2019 - 10:21   -  
Which processor? What is definition of INT0MASKB?

For example

Code
  incl( PCICR, 1 );


Works fine with mega1280 and others.
Merlin.

:magic:

Software is a black art.
This post has been edited 1-times. Last edit: 25.06.2019 - 10:50 by Merlin.
go down go up
miparo offline
Schreiberling
Avatar
Gender: male
Location: GERMANY  Germany
Age: 53
Posts: 682
Registered: 09 / 2007
Private message
Subject: Re: INCL und EXCL gehen nicht bei Register?  -  Posted: 25.06.2019 - 14:31   -  
Hi Merlin,

Incl(INT0MASKB,1) used the new "atomic" opcode LAS = Load and Store on Xmega Devices.
Code

LDI       _ACCBLO, INT0MASKB AND 0FFh
LDI       _ACCCHI, INT0MASKB SHRB 8
MOV       _ACCCLO, _ACCBLO
LDI       _ACCA, 002h
LAS       Z, _ACCA


a simple INT0MASKB.1:= True creates read AND write code
Code

LDS       _ACCA, 0062Ah
SBR       _ACCA, 002h
STS       0062Ah, _ACCA


Leider wissen wir nicht , ob Lschreyer ein PIC,ARM,Mega oder so benutzt?

miparo
Kein Support per PN! | No support via PM!
This post has been edited 1-times. Last edit: 25.06.2019 - 16:32 by miparo.
go down go up
Merlin offline
Schreiberling
Avatar
Gender: male
Location: UNITED KINGDOM 
Age:
Posts: 877
Registered: 03 / 2005
Private message
Subject: Re: INCL und EXCL gehen nicht bei Register?  -  Posted: 25.06.2019 - 16:16   -  
Hi miparo.

You write Incl (INTCTRLB, 1) but the code generated uses INT0MASKB. Is that a typo?
Merlin.

:magic:

Software is a black art.
go down go up
miparo offline
Schreiberling
Avatar
Gender: male
Location: GERMANY  Germany
Age: 53
Posts: 682
Registered: 09 / 2007
Private message
Subject: Re: INCL und EXCL gehen nicht bei Register?  -  Posted: 25.06.2019 - 16:33   -  
Hi Merlin,
copy&paste error :)

miparo
Kein Support per PN! | No support via PM!
go down go up
Lschreyer offline
Benutzer
Avatar
Gender: n/a
Location: n/a 
Age:
Posts: 467
Registered: 02 / 2007
Private message
Subject: Re: INCL und EXCL gehen nicht bei Register?  -  Posted: 26.06.2019 - 13:53   -  
It is a Xmega256A3U
go down go up
Merlin offline
Schreiberling
Avatar
Gender: male
Location: UNITED KINGDOM 
Age:
Posts: 877
Registered: 03 / 2005
Private message
Subject: Re: INCL und EXCL gehen nicht bei Register?  -  Posted: 26.06.2019 - 16:12   -  
Hi

I cannot reproduce your problem. The following compiles in the latest version

Code
program Bug;

Device = Xmega256A3U, VCC=5;


Import SysTick, LCDPort;

From System Import;

Define
  OSCtype        = int32MHz,
                   PLLmul = 4,
                   prescB = 1,
                   prescC = 1;
  SysTick        = 10;             {msec}
  StackSize      = 50, iData;
  FrameSize      = 50, iData;
  LCDtype = 44780; {66712}
  LCDport = PortA; {Port Address}
  LCDRows = 2; {2-lined display}
  LCDcolumns = 16; {16-character display}

uses
  ;
  
Implementation

{$IDATA}
const

type

{--------------------------------------------------------------}
{ Var Declarations }

var
  DebugLED [@PORTB, 2] : bit;


{--------------------------------------------------------------}
{ functions }
procedure ExecDebug;
begin
    Toggle( DebugLED );
end;

{ Main Program }
{$IDATA}

begin

  EnableInts($87);

  INCL (INT0MASKB, 1);

  loop
  
  endloop;
end Bug.


Can you give a similar example that does not compile?

Regards
Merlin.

:magic:

Software is a black art.
go down go up
Lschreyer offline
Benutzer
Avatar
Gender: n/a
Location: n/a 
Age:
Posts: 467
Registered: 02 / 2007
Private message
Subject: Re: INCL und EXCL gehen nicht bei Register?  -  Posted: 30.06.2019 - 15:06   -  
It compiles, that is not a problem, but the command does not change anything in the register.


I tried to set Bit 1 from INT0MASKB with
INCL(INT0MASKB, 1)

But bit 1 from INT0MASKB stays "0" after the command.

Only if I do a
INT0MASKB:=INT0MASKB OR %00000010
I can see the bit switched to "1"

The strange thing is, if I do a

Code
var 
  dummy: byte

INCL(dummy, 1); 

it works! But not on INT0MASKB, at least not here.
go down go up
Merlin offline
Schreiberling
Avatar
Gender: male
Location: UNITED KINGDOM 
Age:
Posts: 877
Registered: 03 / 2005
Private message
Subject: Re: INCL und EXCL gehen nicht bei Register?  -  Posted: 01.07.2019 - 21:30   -  
Sorry - I was wrong. Post now deleted.

The code generated was correct.
Merlin.

:magic:

Software is a black art.
This post has been edited 3-times. Last edit: 03.07.2019 - 10:54 by Merlin.
go down go up
miparo offline
Schreiberling
Avatar
Gender: male
Location: GERMANY  Germany
Age: 53
Posts: 682
Registered: 09 / 2007
Private message
Subject: Re: INCL und EXCL gehen nicht bei Register?  -  Posted: 02.07.2019 - 11:43   -  
deleted :)
Kein Support per PN! | No support via PM!
This post has been edited 2-times. Last edit: 02.07.2019 - 12:34 by miparo.
go down go up
Merlin offline
Schreiberling
Avatar
Gender: male
Location: UNITED KINGDOM 
Age:
Posts: 877
Registered: 03 / 2005
Private message
Subject: Re: INCL und EXCL gehen nicht bei Register?  -  Posted: 03.07.2019 - 11:03   -  
As another thought, since this is a 256, if the memory used or code is more than 64K, maybe the RAMPZ register needs to be set?
Merlin.

:magic:

Software is a black art.
go down go up
Lschreyer offline
Benutzer
Avatar
Gender: n/a
Location: n/a 
Age:
Posts: 467
Registered: 02 / 2007
Private message
Subject: Re: INCL und EXCL gehen nicht bei Register?  -  Posted: 04.07.2019 - 18:43   -  
The code ist 190 kb large.
go down go up
rh offline
Administrator
Avatar
Gender: male
Location: GERMANY  Germany
Age:
Posts: 5464
Registered: 03 / 2002
Homepage Private message
Subject: Re: INCL und EXCL gehen nicht bei Register?  -  Posted: 04.07.2019 - 19:34   -  
Also,
der generierte Code ist absolut korrekt!
Code
                        .LINE     61
                        LDI       _ACCBLO, INT0MASKB AND 0FFh
                        LDI       _ACCBHI, INT0MASKB SHRB 8
                        PUSH      _ACCBLO
                        PUSH      _ACCBHI
                        LDI       _ACCA, 002h
                        POP       _ACCCHI
                        POP       _ACCCLO
                        LAS       Z, _ACCA

und mit dem Opti sieht es so aus:
Code
                        LDI       _ACCCLO, INT0MASKB AND 0FFh
                        LDI       _ACCCHI, INT0MASKB SHRB 8
                        LDI       _ACCA, 002h
                        LAS       Z, _ACCA

Und im SIM sieht es dann so aus:
You must be logged in or your permissions are to low to see this Attachment(s).
Cars don't buy cars -- Autos kaufen keine Autos.
Henry Ford
go down go up
Merlin offline
Schreiberling
Avatar
Gender: male
Location: UNITED KINGDOM 
Age:
Posts: 877
Registered: 03 / 2005
Private message
Subject: Re: INCL und EXCL gehen nicht bei Register?  -  Posted: 06.07.2019 - 11:17   -  
@LSchreyer

You could try

Code
  RAMPZ := 0;
  INCL (INT0MASKB, 1);


I am not saying it will work, but if it does it will prove what the issue is.

Regards
Merlin.

:magic:

Software is a black art.
go down go up
 


Registered users in this topic
Currently no registered users in this section

Delete cookies of this forum  •  FAQ / Help  •  Team page  •  Imprint   |  Local time: 18.09.2019 - 11:49