bits in macro's


+ Reply to Thread
Results 1 to 7 of 7

Thread: bits in macro's1198 days old

  1. #1
    Prolific Poster hadv215's Avatar
    Join Date
    Sep 2009
    Posts
    1,136
    Thumbs Up
    Received: 66
    Given: 26
    Total Downloaded
    3.61 GB

    0 Not allowed!

    Default bits in macro's

    I try to test a bit in a macro like this 'if byte.0 = 1', but I get an error message that I use an invalid cast.
    Any help (or is this an anomaly).

  2. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  3. #2
    Fanatical Contributor top204's Avatar
    Join Date
    Feb 2002
    Posts
    3,599
    Thumbs Up
    Received: 341
    Given: 162
    Total Downloaded
    1.99 GB

    0 Not allowed!

    Default Re: bits in macro's

    If Byte is a macro parameter, this will not work because macros are, essentially, asm.

    We need to see the macro in full to give more help.

  4. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  5. #3
    Prolific Poster hadv215's Avatar
    Join Date
    Sep 2009
    Posts
    1,136
    Thumbs Up
    Received: 66
    Given: 26
    Total Downloaded
    3.61 GB

    0 Not allowed!

    Default Re: bits in macro's

    double post
    Last edited by hadv215; 23rd February 2017 at 16:10.

  6. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  7. #4
    Prolific Poster hadv215's Avatar
    Join Date
    Sep 2009
    Posts
    1,136
    Thumbs Up
    Received: 66
    Given: 26
    Total Downloaded
    3.61 GB

    0 Not allowed!

    Default Re: bits in macro's

    double post
    Last edited by hadv215; 23rd February 2017 at 16:10.

  8. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  9. #5
    Prolific Poster hadv215's Avatar
    Join Date
    Sep 2009
    Posts
    1,136
    Thumbs Up
    Received: 66
    Given: 26
    Total Downloaded
    3.61 GB

    0 Not allowed!

    Default Re: bits in macro's

    $define SendAByte(arg1)
    WS = 1 '
    If arg1.0 = 1 Then '
    DelayCS 9 '
    WS = 0 '
    DelayCS 2 '
    Else '
    DelayCS 3 '
    WS = 0 '
    DelayCS 8 '
    EndIf

    for arg1 I use a byte

    I changed it to :
    Dim argb as byte
    $define SendAByte(arg1)
    WS = 1 '
    argB = arg1 '
    If argB.0 = 1 Then '
    DelayCS 9 '
    WS = 0 '
    DelayCS 2 '
    Else '
    DelayCS 3 '
    WS = 0 '
    DelayCS 8 '
    EndIf
    This compiles without an error
    Last edited by hadv215; 23rd February 2017 at 16:11.

  10. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  11. #6
    Fanatical Contributor top204's Avatar
    Join Date
    Feb 2002
    Posts
    3,599
    Thumbs Up
    Received: 341
    Given: 162
    Total Downloaded
    1.99 GB

    0 Not allowed!

    Default Re: bits in macro's

    You're missing the comment character after the $define, which makes all the code below it, belong to it, as long as the comment characters have nothing after them:

    Code:
        Device = 18F452
        
        Dim WS As Byte
        Dim MyByte As Byte
        
    $define SendAByte(arg1) '
        WS = 1              '
        If arg1.0 = 1 Then  '
            DelayCS 9       '
            WS = 0          '
            DelayCS 2       '
        Else                '
            DelayCS 3       '
            WS = 0          '
            DelayCS 8       '
        EndIf
    
        SendAByte(MyByte)
    Last edited by top204; 23rd February 2017 at 17:24.

  12. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  13. #7
    Prolific Poster hadv215's Avatar
    Join Date
    Sep 2009
    Posts
    1,136
    Thumbs Up
    Received: 66
    Given: 26
    Total Downloaded
    3.61 GB

    0 Not allowed!

    Default Re: bits in macro's

    Stupid me.
    Thanks for helping me back on the track

  14. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Bits and pieces
    By flosigud in forum Tips 'n Tricks
    Replies: 2
    Last Post: 28th October 2019, 22:29
  2. [SOLVED !] 20 bits to one byte
    By Sargon in forum Proton Plus Compiler v3
    Replies: 16
    Last Post: 23rd November 2011, 20:58
  3. Cannot place a user defined macro within a user defined macro?!?
    By DmitriK in forum Proton Plus Compiler v3
    Replies: 10
    Last Post: 19th August 2011, 02:24
  4. Macro calling another macro inside a library
    By pdgnr in forum Library Manager
    Replies: 2
    Last Post: 27th March 2008, 07:20
  5. High Bits' and Low Bits
    By cotang in forum Proton Plus Compiler v3
    Replies: 7
    Last Post: 8th April 2006, 05:48

Tags for this Thread

Posting Permissions

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