Jump to content

HCS12 - CodeWarrior Error

- - - - -

  • Please log in to reply
10 replies to this topic

#1
spcm0012

spcm0012

    Newbie

  • Members
  • PipPip
  • 13 posts
Hey guys and gals,

Having an issue with the following code,

Error   : A12202: Not a hc12 instruction or directive

main.asm line 18   

Error   : A12202: Not a hc12 instruction or directive

main.asm line 20   

Error   : Compile failed
That is the error Im receiving, it is saying that 'DB 0' is not an HC12 instruction.
Although when I compile this exact code in the lab at my college it compiles just fine.

Has anyone used CodeWarrior before and know what might be causing this issue?
I have mc9s12dp512.inc included in the project. Its an absolute assembly program, so no C,
and is not relocatable, so there is no prm file to edit.

Any idea? this is driving me nuts as I'm working on a micro mouse and would much rather work
home than sit in the college's labs.




;***********************************************

;*    Program Name: LCD_Test.asm

;*   

;*    Name: Mike 

;*    Date: 11/07/2011

;*

;*  This program test the micromouse LCD

;************************************************

lcd_banner:   EQU     $0FEE

lcd_clear:    EQU     $0FE4

lcd_cmd:      EQU     $0FEA

lcd_init:     EQU     $0FEC

lcd_putc:     EQU     $0FE8

lcd_puts:     EQU     $0FE6


        ORG  $1000

Msg1:   FCC  "Line 1"

        DB   0

Msg2:   FCC  "Line 2"

        DB   0

        ORG  $2000

start:  JSR  [lcd_init-*-4,PC] 

        LDD  #Msg1

        JSR  [lcd_puts-*-4,PC]

        LDAB #$C0              

        JSR  [lcd_cmd-*-4,PC]

        LDD  #Msg2

        JSR  [lcd_puts-*-4,PC]

        SWI

        ldd  #$FFFF

        END


#2
dargueta

dargueta

    Writes binary right handed and hex left handed

  • Moderators
  • 4,705 posts
  • Programming Language:C, Java, C++, PHP, Python, Perl, Assembly, Bash, Others
  • Learning:JavaScript
Why are you trying to stick nulls in a code segment? It's treating the db directive as if it were an instruction, which it isn't. That'll only work in a data section.
sudo rm -rf /

#3
spcm0012

spcm0012

    Newbie

  • Members
  • PipPip
  • 13 posts
Was attempting to Null terminate the msg's? If I remove both the db lines, I end up with a bunch of garbage on the lcd after the messages.

Also the lines:
 LDAB #$C0              

        JSR  [lcd_cmd-*-4,PC]
are supposed to works as a line jump, so msg1 prints on one line and msg2 prints on the second, but with out the 'db 0' it prints msg1 and msg2 on the first line, garbage, then msg2 on the second line followed by garbage.
Obviously, Im going about clearing the lcd in the wrong fashion, how should I go about removing the garbage?

#4
dargueta

dargueta

    Writes binary right handed and hex left handed

  • Moderators
  • 4,705 posts
  • Programming Language:C, Java, C++, PHP, Python, Perl, Assembly, Bash, Others
  • Learning:JavaScript
What exactly does FCC do?
sudo rm -rf /

#5
spcm0012

spcm0012

    Newbie

  • Members
  • PipPip
  • 13 posts
fcc (form constant character)
This directive allows us to define a string of characters (a message). The first character in
the string is used as the delimiter. The last character must be the same as the first character
because it will be used as the delimiter. The delimiter must not appear in the string. The
space character cannot be used as the delimiter. Each character is encoded by its corresponding ASCII code.
For example, the statement:
alpha fcc “def”
will generate the following values in memory:
$64
$65
$66
and the assembler will use the label alpha to refer to the address of the first letter, which is
stored as the byte $64. A character string to be output to the LCD display is often defined using
this directive.

TAKEN FROM: http://support.techn...2 Assembler.pdf

#6
dargueta

dargueta

    Writes binary right handed and hex left handed

  • Moderators
  • 4,705 posts
  • Programming Language:C, Java, C++, PHP, Python, Perl, Assembly, Bash, Others
  • Learning:JavaScript
Wait...is FCC a directive or an assembly instruction?
sudo rm -rf /

#7
spcm0012

spcm0012

    Newbie

  • Members
  • PipPip
  • 13 posts
its a directive. Sorry if I'm a little confusing, Im a tad confused as its my first time working with the HCS12 and havent done any assembly work in about a year.

#8
dargueta

dargueta

    Writes binary right handed and hex left handed

  • Moderators
  • 4,705 posts
  • Programming Language:C, Java, C++, PHP, Python, Perl, Assembly, Bash, Others
  • Learning:JavaScript
No worries. :)

This is strange, though...you should be able to do something like this. Try doing something like FCC "",$0,""
sudo rm -rf /

#9
spcm0012

spcm0012

    Newbie

  • Members
  • PipPip
  • 13 posts
As in:

FCC "Line 1", $0, ""
FCC "LIne2", $0, ""

where the second set of quotations on each line is the delimiter?

OR:

FCC "Line 1", $0, "Line 2"

where the $0 is the delimiter?
If the second way, would that not impede the ability to print out each msg block on separate lines of the LCD?


EDIT:
FCC "Line 1", $0, ""
FCC "LIne2", $0, ""

Will not work, expects an end of line statement.

---------- Post added at 12:04 PM ---------- Previous post was at 11:36 AM ----------

So, I replaced DB with FCB and that seems to work fine, in my mind DB and FCB have the same function, as well as DC.B, Oh well.

;***********************************************

;*    Program Name: LCD_Test.asm

;*   

;*    Name: Mike 

;*    Date: 11/07/2011

;*

;*  This program test the micromouse LCD

;************************************************

lcd_banner:   EQU     $0FEE

lcd_clear:    EQU     $0FE4

lcd_cmd:      EQU     $0FEA

lcd_init:     EQU     $0FEC

lcd_putc:     EQU     $0FE8

lcd_puts:     EQU     $0FE6




          ORG   $1000 

MSG1:     FCC   "LINE 1 " 

          FCB   0 

MSG2:     FCC   "LINE 2" 

          FCB   0

          

          

        ORG  $2000

start:  JSR  [lcd_init-*-4,PC] 

        LDD  #MSG1

        JSR  [lcd_puts-*-4,PC]

        LDAB #$C0              

        JSR  [lcd_cmd-*-4,PC]

        LDD  #MSG2

        JSR  [lcd_puts-*-4,PC]

        SWI

        ldd  #$FFFF

        END


#10
dargueta

dargueta

    Writes binary right handed and hex left handed

  • Moderators
  • 4,705 posts
  • Programming Language:C, Java, C++, PHP, Python, Perl, Assembly, Bash, Others
  • Learning:JavaScript
Well there you go. Might want to read the documentation a bit more next time. :D
sudo rm -rf /

#11
spcm0012

spcm0012

    Newbie

  • Members
  • PipPip
  • 13 posts
:-P




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users