• AVR Freaks

AnsweredHot!My dt is getting chopped

Author
upand_at_them
Super Member
  • Total Posts : 584
  • Reward points : 0
  • Joined: 2005/05/16 07:02:38
  • Location: Pennsylvania
  • Status: online
2020/04/30 05:57:07 (permalink)
0

My dt is getting chopped

I have this data table:
 
ssd1306initstr: dt SSD1306_ADDRESS, 0x00, SSD1306_DISPLAYOFF, SSD1306_SETDISPLAYCLOCKDIV, 0x80, SSD1306_CHARGEPUMP, 0x14, SSD1306_SEGREMAP | 0x1, SSD1306_COMSCANDEC, SSD1306_SETPRECHARGE, 0xF1, SSD1306_SETVCOMDETECT, 0x40, SSD1306_DISPLAYON

 
With the constants defined in an include.  They're all byte values (0xYY).  I'm using MPASM 5.46, and it is chopping off my table prematurely:
 
Error[113] : Symbol not previously defined (SSD130)
18AC 3478 3400 34AE 00383 ssd1306initstr: dt SSD1306_ADDRESS, 0x00, SSD1306_DISPLAYOFF, SSD1306_SETDISPLAYCLOCKDIV, 0x80, SSD1306_
CHARGEPUMP, 0x14, SSD1306_SEGREMAP | 0x1, SSD1306_COMSCANDEC, SSD1306_SETPRECHARGE, 0xF1, SSD130

 
If I stick a "0x00" in front of the "offending" item, the assembler doesn't complain, but ends the data table right there.
#1
ric
Super Member
  • Total Posts : 28004
  • Reward points : 0
  • Joined: 2003/11/07 12:41:26
  • Location: Australia, Melbourne
  • Status: online
Re: My dt is getting chopped 2020/04/30 05:59:34 (permalink) ☼ Best Answerby upand_at_them 2020/05/08 16:00:24
0
You have struck the maximum line length supported by the assembler.
You will have to break it up into multiple DT lines to avoid hitting the limit.
 

I also post at: PicForum
Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
NEW USERS: Posting images, links and code - workaround for restrictions.
To get a useful answer, always state which PIC you are using!
#2
upand_at_them
Super Member
  • Total Posts : 584
  • Reward points : 0
  • Joined: 2005/05/16 07:02:38
  • Location: Pennsylvania
  • Status: online
Re: My dt is getting chopped 2020/04/30 06:04:07 (permalink)
0
Ugh.  Thanks.  I thought it was something like that, but didn't see any mention under "DT" in the MPASM User's Guide.
#3
ric
Super Member
  • Total Posts : 28004
  • Reward points : 0
  • Joined: 2003/11/07 12:41:26
  • Location: Australia, Melbourne
  • Status: online
Re: My dt is getting chopped 2020/04/30 06:05:17 (permalink)
0
It wouldn't be under DT, because it's nothing specific to that command.
The line length limit applies to every assembler directive.
 

I also post at: PicForum
Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
NEW USERS: Posting images, links and code - workaround for restrictions.
To get a useful answer, always state which PIC you are using!
#4
upand_at_them
Super Member
  • Total Posts : 584
  • Reward points : 0
  • Joined: 2005/05/16 07:02:38
  • Location: Pennsylvania
  • Status: online
Re: My dt is getting chopped 2020/04/30 06:07:19 (permalink)
0
Does this achieve the same thing?
 
ssd1306initstr: dt SSD1306_ADDRESS, 0x00
                dt SSD1306_DISPLAYOFF
                dt SSD1306_SETDISPLAYCLOCKDIV, 0x80
                dt SSD1306_CHARGEPUMP, 0x14
                dt SSD1306_SEGREMAP | 0x1
                dt SSD1306_COMSCANDEC
                dt SSD1306_SETPRECHARGE, 0xF1
                dt SSD1306_SETVCOMDETECT, 0x40
                dt SSD1306_DISPLAYON

 
post edited by upand_at_them - 2020/04/30 06:09:26
#5
ric
Super Member
  • Total Posts : 28004
  • Reward points : 0
  • Joined: 2003/11/07 12:41:26
  • Location: Australia, Melbourne
  • Status: online
Re: My dt is getting chopped 2020/04/30 06:12:03 (permalink)
4 (1)
Yes. It's easier to read too.
 

I also post at: PicForum
Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
NEW USERS: Posting images, links and code - workaround for restrictions.
To get a useful answer, always state which PIC you are using!
#6
upand_at_them
Super Member
  • Total Posts : 584
  • Reward points : 0
  • Joined: 2005/05/16 07:02:38
  • Location: Pennsylvania
  • Status: online
Re: My dt is getting chopped 2020/04/30 06:25:50 (permalink)
0
I guess that's the drawback from me using EQU instead of #DEFINE.  With #DEFINE the assembler would have thrown a more helpful "148" error.
#7
1and0
Access is Denied
  • Total Posts : 10999
  • Reward points : 0
  • Joined: 2007/05/06 12:03:20
  • Location: Harry's Gray Matter
  • Status: offline
Re: My dt is getting chopped 2020/04/30 07:29:40 (permalink)
5 (1)
upand_at_them
I thought it was something like that, but didn't see any mention under "DT" in the MPASM User's Guide.

The MPASM User's Guide states the maximum column width is 255 characters, but the maximum length of a line is actually about 200 characters.
 
#8
upand_at_them
Super Member
  • Total Posts : 584
  • Reward points : 0
  • Joined: 2005/05/16 07:02:38
  • Location: Pennsylvania
  • Status: online
Re: My dt is getting chopped 2020/04/30 07:56:33 (permalink)
0
Yep:
 
ERRORS:
148 Expanded source line exceeded 200 characters.
The maximum length of a source line, after #DEFINE and macro
parameter substitution, is 200 characters. Note that #DEFINE
substitution does not include comments, but macro parameter
substitution does.

#9
Jump to:
© 2020 APG vNext Commercial Version 4.5