Menu

Meaning of error message

Help
MBB
2024-06-25
2024-06-25
  • MBB

    MBB - 2024-06-25

    I'm using Great Cow BASIC (0.99.01 2022-01-27 (Windows 64 bit) : Build 1073).

    I wrote this code:

    ;Chip Settings

    chip 18F4550,48

    config PLLDIV=1, CPUDIV=OSC1_PLL2, OSC=HSPLL_HS, LVP=OFF, MCLRE=ON ;OFF

    dim Bz as long
    dim Z_Total as long

    dim TwoCompliment, RawWordValueINT as integer
    dim Z_Total_Comp as integer

    wait 100 ms

    '**********

        Twos_Complement_SUB (Z_Total)
          Z_Total_Comp = TwoCompliment
            Bz = 100000 * Abs(Z_Total_Comp)
              Bz = Bz / 65536
                Bz = Bz * 160 ;160 if BR = 80 mT.  80 if BR = 40 mT.
    

    '**********
    Sub Twos_Complement_SUB ( RawWordValue as word )

     If (RawWordValue.15 = 1) then
      RawWordValueINT = (RawWordValue XOR 65535) + 1 ;convert twos complement to decimal by xor'ing with 65535 and adding 1
        TwoCompliment = 0 - RawWordValueINT
          Else
            TwoCompliment = [integer]RawWordValue
              End If
    

    '
    End Sub
    '******

    When I compile it I get this error message:

    Error: GCASM:Bad ORG overwriting location 0

    Does any one know what this means?

     
  • Anobium

    Anobium - 2024-06-25

    BZ is an assembler instruction. So, you cannot use BZ as a variable.

    Change BZ to BZz and it will compile.

    If I get time. I will add all assembler instructions to the reserved names.

     
  • MBB

    MBB - 2024-06-25

    Thanks!

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.