Problem with << ?


Closed Thread
Results 1 to 14 of 14

Hybrid View

  1. #1
    Join Date
    Oct 2004
    Location
    Hangover, Germany
    Posts
    289


    Did you find this post helpful? Yes | No

    Default

    Dummy... are defined to be in bank0,
    Warte_Drive is located at $C2.

    If there is some time tommorow I will test it again on the dedicated hardware and can deliver the .lst-files.
    I use MPASM !

    I just looked inside the lst-file.
    I think there is an error !
    DummyW<<1 is recognized as a 1-bit shift of a word-variable.
    First, C is cleared. OK.
    Then, RP is set to BANK0 in order to acces DummyW,
    DummyW is rotated left into WREG,
    RP is set to BANK1,
    W is stored in Warte_Drive,
    DummyW+1 is rotated left into WREG, (without choosing Bank0!)
    W is stored in Warte_Drive+1.

    There is a bug !

    Here is the part of the lst-file:

    06090 ; D:\_\ENTWIC~1\BIOFUE~1\BFC220~1.BAS 01795 Dummy=Cod_Time_Drive:Gosub Cod2Wert:Warte_Drive=DummyW<<1
    06091 SHIFTL?WCW _DummyW, 001h, _Warte_Drive
    M if (001h == 1)
    1681 1003 M bcf STATUS, C
    M if (_Warte_Drive == _DummyW)
    [...]
    M else
    M CHK?RP _DummyW
    [...]
    1682 0D3C M rlf _DummyW, W
    M MOVE?AB _Warte_Drive
    M CHK?RP _Warte_Drive
    [...]
    1683 1683 M bsf STATUS, RP0
    [...]
    1684 00C2 M movwf _Warte_Drive
    M CHK?RP _Warte_Drive
    [...]
    1685 0D3D M rlf _DummyW + 1, W
    M MOVE?AB _Warte_Drive + 1
    [...]
    1686 00C3 M movwf _Warte_Drive + 1
    M endif
    M else
    M MOVE?WW _DummyW, R0
    M MOVE?CA 001h
    M L?CALL SHIFTL
    M MOVE?AWW R0, _Warte_Drive
    M endif
    06092
    PBP 2.50C, MCS+ 3.0.0.5, MPLAB 8, MPASM 5.14, ASIX Presto, PoScope, mE mikroBasic V7.2, PICKIT2

  2. #2
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    If you're using MPASM, start MPLAB, select the PIC you've compiled for,
    then use File >> Import, and select the .COD file.

    Next click View >> Program Memory. It's much easier to follow than looking
    at cryptic .lst files generated by PBP. This allows you to view all code without
    macros & includes all your routine labels making it very easy to follow all the
    assembly routines PBP generates.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  3. #3
    Join Date
    Oct 2004
    Location
    Hangover, Germany
    Posts
    289


    Did you find this post helpful? Yes | No

    Default

    puuuuhh....

    I've never used MPLAB....


    But, the bug must be inside the macro SHIFTL?WCW !
    In front of the access to the high-byte of the source-word the CHKRP? is missing !
    PBP 2.50C, MCS+ 3.0.0.5, MPLAB 8, MPASM 5.14, ASIX Presto, PoScope, mE mikroBasic V7.2, PICKIT2

  4. #4
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default Code that Compiled previously doesn't Compile anymore

    I just thought I'd add an aside to this...

    I have experienced a peculiar situation that perfect working code suddenly won't compile without a stream of compile errors.

    Nothing had changed. No code, no compiler versions, nothing.

    However, I run my PC 24/7 every day. It NEVER gets switched OFF. I must have maxed out memory (1GB) with a host of applications, and good old Windows XP Pro though working perfectly, somewhere behind the scenes had screwed up.

    A REBOOT of the PC and everything was back to normal, but for a while I was wondering what on earth was happening with my code.

  5. #5
    Join Date
    Oct 2004
    Location
    Hangover, Germany
    Posts
    289


    Did you find this post helpful? Yes | No

    Default

    @ Mel:
    nice try ! ;-)

    But, inside PBPPIC18.MAC:

    SHIFTL?WCW macro Win, Cin, Wout
    if (Cin == 1)
    bcf STATUS, C
    if (Wout == Win)
    CHK?RP Wout
    rlcf Wout, F
    rlcf Wout + 1, F
    else
    CHK?RP Win
    rlcf Win, W
    MOVE?AB Wout
    CHK?RP Wout <----- meeeeep
    rlcf Win + 1, W
    MOVE?AB Wout + 1
    endif
    else
    MOVE?WW Win, R0
    MOVE?CA Cin
    L?CALL SHIFTL
    MOVE?AWW R0, Wout
    endif
    endm



    The marked part should be:
    CHK?RP Win



    Is this right ????
    PBP 2.50C, MCS+ 3.0.0.5, MPLAB 8, MPASM 5.14, ASIX Presto, PoScope, mE mikroBasic V7.2, PICKIT2

  6. #6
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    I don't change the PIC (16F876),
    But, inside PBPPIC18.MAC
    Are you compiling for a 16F or 18F part?
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  7. #7
    Join Date
    Oct 2004
    Location
    Hangover, Germany
    Posts
    289


    Did you find this post helpful? Yes | No

    Default

    I compile for PIC16F, but there is the same error in PBPPIC18.MAC and PBPPIC14.MAC.
    PBP 2.50C, MCS+ 3.0.0.5, MPLAB 8, MPASM 5.14, ASIX Presto, PoScope, mE mikroBasic V7.2, PICKIT2

Similar Threads

  1. Problem to compile my program
    By wagner in forum Off Topic
    Replies: 5
    Last Post: - 7th July 2008, 21:17
  2. Problem with ASM IRQ using FSR0 on PIC18F252
    By mytekcontrols in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 11th March 2008, 21:48
  3. USART Problem , but don't know where, in pc? or in PIC?
    By precision in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 15th July 2007, 09:12
  4. 1 slave 1 master 1 MAX232 1 problem ?
    By SuB-ZeRo in forum mel PIC BASIC Pro
    Replies: 19
    Last Post: - 31st July 2005, 23:59
  5. PORTA.PinNo = 1 ' problem
    By frank small in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 6th May 2004, 15:30

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts