Compiling using PBP mode causes funnies


Closed Thread
Results 1 to 10 of 10

Hybrid View

  1. #1
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,604


    Did you find this post helpful? Yes | No

    Default Re: Compiling using PBP mode causes funnies

    Hi again,
    I just tried it here with 8 different sequences of bytes in DATA_OUT[4] to DATA_OUT[9] and it generates the same with PBP as it does with PBPL:
    Code:
    Program start with PBP
    
     0   1   2   3   4   5   6   7   8   9
    255,042,068,042,000,000,000,000,000,000
    ERROR_OUT: 255
    
     0   1   2   3   4   5   6   7   8   9
    255,042,068,042,001,002,003,004,005,006
    ERROR_OUT: 234
    
     0   1   2   3   4   5   6   7   8   9
    255,042,068,042,001,002,004,008,016,032
    ERROR_OUT: 192
    
     0   1   2   3   4   5   6   7   8   9
    255,042,068,042,045,091,110,200,201,199
    ERROR_OUT: 177
    
     0   1   2   3   4   5   6   7   8   9
    255,042,068,042,045,097,210,225,079,120
    ERROR_OUT: 247
    
     0   1   2   3   4   5   6   7   8   9
    255,042,068,042,123,123,123,123,123,123
    ERROR_OUT: 029
    
     0   1   2   3   4   5   6   7   8   9
    255,042,068,042,092,091,090,091,092,093
    ERROR_OUT: 218
    
     0   1   2   3   4   5   6   7   8   9
    255,042,068,042,255,255,255,255,255,255
    ERROR_OUT: 005
    
    ---------------------------------------
    
    Program start with PBP
    
     0   1   2   3   4   5   6   7   8   9
    255,042,068,042,000,000,000,000,000,000
    ERROR_OUT: 255
    
     0   1   2   3   4   5   6   7   8   9
    255,042,068,042,001,002,003,004,005,006
    ERROR_OUT: 234
    
     0   1   2   3   4   5   6   7   8   9
    255,042,068,042,001,002,004,008,016,032
    ERROR_OUT: 192
    
     0   1   2   3   4   5   6   7   8   9
    255,042,068,042,045,091,110,200,201,199
    ERROR_OUT: 177
    
     0   1   2   3   4   5   6   7   8   9
    255,042,068,042,045,097,210,225,079,120
    ERROR_OUT: 247
    
     0   1   2   3   4   5   6   7   8   9
    255,042,068,042,123,123,123,123,123,123
    ERROR_OUT: 029
    
     0   1   2   3   4   5   6   7   8   9
    255,042,068,042,092,091,090,091,092,093
    ERROR_OUT: 218
    
     0   1   2   3   4   5   6   7   8   9
    255,042,068,042,255,255,255,255,255,255
    ERROR_OUT: 005
    Now, this IS with PBP3 but I'd be surprised if using PBP2.60C would make it any different. For reference, here's the exact code I used to generate the above output, compiled once with PBP and once witl PBPL:
    Code:
    DATA_OUT VAR BYTE[11]
    TEMP1 VAR BYTE
    TEMP2 VAR BYTE
    HEAD_OUT VAR BYTE
    FUNC_OUT VAR BYTE
    PAN_OUT VAR BYTE
    TILT_OUT VAR BYTE
    ZOOM_OUT VAR BYTE
    FOCUS_OUT VAR BYTE
    
    ERROR_OUT VAR BYTE
    
    PAUSE 2500
    HSEROUT["Program start with PBP",13,13]
    
    Main:
        HEAD_OUT = 0 : FUNC_OUT = 0 : PAN_OUT  = 0
        TILT_OUT = 0 : ZOOM_OUT = 0 : FOCUS_OUT = 0
        GOSUB DOUT
        
        HEAD_OUT = 1 : FUNC_OUT = 2 : PAN_OUT  = 3
        TILT_OUT = 4 : ZOOM_OUT = 5 : FOCUS_OUT = 6
        GOSUB DOUT
        
        HEAD_OUT = 1 : FUNC_OUT = 2 : PAN_OUT  = 4
        TILT_OUT = 8 : ZOOM_OUT = 16 : FOCUS_OUT = 32
        GOSUB DOUT
    
        HEAD_OUT = 45 : FUNC_OUT = 91 : PAN_OUT  = 110
        TILT_OUT = 200 : ZOOM_OUT = 201 : FOCUS_OUT = 199
        GOSUB DOUT
        HEAD_OUT = 45 : FUNC_OUT = 97 : PAN_OUT  = 210
        TILT_OUT = 225 : ZOOM_OUT = 79 : FOCUS_OUT = 120
        GOSUB DOUT
        
        HEAD_OUT = 123 : FUNC_OUT = 123 : PAN_OUT  = 123
        TILT_OUT = 123 : ZOOM_OUT = 123 : FOCUS_OUT = 123
        GOSUB DOUT
        
        HEAD_OUT = 92 : FUNC_OUT = 91 : PAN_OUT  = 90
        TILT_OUT = 91 : ZOOM_OUT = 92 : FOCUS_OUT = 93
        GOSUB DOUT
    
        HEAD_OUT = 255 : FUNC_OUT = 255 : PAN_OUT  = 255
        TILT_OUT = 255 : ZOOM_OUT = 255 : FOCUS_OUT = 255
        GOSUB DOUT
    PAUSE 100
    END
    
    
    
    '================================================
    DOUT:  
    			
            DATA_OUT [1] = "*"
            DATA_OUT [2] = "D"
            DATA_OUT [3] = "*"
            DATA_OUT [4] = HEAD_OUT
            DATA_OUT [5] = FUNC_OUT
            DATA_OUT [6] = PAN_OUT
            DATA_OUT [7] = TILT_OUT
            DATA_OUT [8] = ZOOM_OUT
            DATA_OUT [9] = FOCUS_OUT
                
            TEMP2 = 0
            FOR TEMP1 = 4 TO 9
                TEMP2 = TEMP2 + DATA_OUT [TEMP1]
            NEXT
            ERROR_OUT = TEMP2 ^ $FF
            DATA_OUT [10] = ERROR_OUT
    
    SendIt:
            HSEROUT[" 0   1   2   3   4   5   6   7   8   9", 13]
            For TEMP1 = 0 to 8
                HSEROUT[DEC3 DATA_OUT[TEMP1],","]
            NEXT
            HSEROUT[DEC3 DATA_OUT[TEMP1],13]
            HSEROUT["ERROR_OUT: ", DEC3 DATA_OUT[10],13,13]
    RETURN
    By the way, compiled with PBP it's 995 bytes. With PBPL it's 1173 bytes. Don't use PBPL if you don't specifically need support for LONGs (or don't care).

    /Henrik.

  2. #2
    Join Date
    Apr 2011
    Location
    Kent, UK
    Posts
    52


    Did you find this post helpful? Yes | No

    Default Re: Compiling using PBP mode causes funnies

    Thanks for the responses, the typical values that exhibit a problem are

    HEAD_OUT = 101
    FUNC_OUT = 38
    PAN_OUT = 0
    TILT_OUT = 0
    ZOOM_OUT = 1
    FOCUS_OUT = 6

    ERROR_OUT should calculate as 109 but the ERROR_OUT is 45?
    All values are decimal.
    All variables are bytes.
    Array DATA_OUT has 15 elements

Similar Threads

  1. Replies: 2
    Last Post: - 19th June 2012, 21:24
  2. MikroBasic to PBP Pro: Boost mode SMPS
    By jmgelba in forum mel PIC BASIC Pro
    Replies: 28
    Last Post: - 25th November 2011, 02:27
  3. I need HELP with compiling!!!!!!
    By kenny_m in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 15th February 2008, 20:34
  4. Compiling problems
    By ngeronikolos in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 7th June 2005, 00:58
  5. Sleep Mode in PBP
    By Keith in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 4th March 2005, 20:58

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