Toggle bug with MEGA1280

Merlin
Administrator
Avatar
Gender:
Age: 24
Posts: 1372
Registered: 03 / 2005
Subject:

Toggle bug with MEGA1280

 · 
Posted: 04.06.2019 - 16:08  ·  #1
There is a bug with toggle as shown in the following code. Amazingly, this occurs with a MEGA1280 but not with a MEGA128!

Code
program Bug;

Device = mega1280, VCC=5;


Import SysTick, LCDPort;

From System Import;

Define
  ProcClock      = 7372800;       {Hertz}
  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;

  loop
    ExecDebug;
  
  endloop;
end Bug.


the assembler for ExecDebug is

Code
                        .FUNC     ExecDebug, 00027h, 00020h
Bug.ExecDebug:
                        .RETURNS   0
                        .BLOCK    40
                        .LINE     41
                        LDI      _ACCB, 004h
                        OUT       023h, _ACCB
                        .ENDBLOCK 42
Bug.ExecDebug_X:
                        .LINE     42
                        .BRANCH   19
                        RET
                        .ENDFUNC  42


As you can see the IN and EOR lines are missing. As I say, if I change the processor to a MEGA128 the lines are there!
rh
Administrator
Avatar
Gender:
Location: Germany
Age: 24
Homepage: e-lab.de
Posts: 5558
Registered: 03 / 2002
Subject:

Re: Toggle bug with MEGA1280

 · 
Posted: 10.06.2019 - 22:15  ·  #2
Hello Merlin,

bug fixed in the new update.

rolf
Selected quotes for multi-quoting:   0

Registered users in this topic

Currently no registered users in this section

The statistic shows who was online during the last 5 minutes. Updated every 90 seconds.
MySQL Queries: 15 · Cache Hits: 14   50   64 · Page-Gen-Time: 0.027796s · Memory Usage: 2 MB · GZIP: on · Viewport: SMXL-HiDPI