Where should I discuss SD/MMC FAT issues?


Closed Thread
Results 1 to 40 of 93

Hybrid View

  1. #1
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    If _Variable is a CONSTANT, it will work indeed. You can still declare it on asm level

    Code:
    @MyVar=.30
    and later call the macro
    Code:
    NOP?C MyVar+10
    Last edited by mister_e; - 2nd April 2008 at 17:51.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mister_e View Post
    If _Variable is a CONSTANT, it will work indeed.
    That's what I meant...a CONSTANT...
    I think this little tidbit is going to save me a bunch of typing soon...

  3. #3
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    In this case, it could be better to change it too.
    Code:
    ASM
    NOP?C   macro Cin
        local a
    a=0
        while a<(Cin+MyByte)
            nop
    a++=1
            endw
        endm
    ENDASM
    and at the top of your code you define MyByte like
    Code:
    @MyByte=.10 ; your value.. whatever
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  4. #4
    Join Date
    Mar 2008
    Location
    Texas, USA
    Posts
    114


    Did you find this post helpful? Yes | No

    Default

    When you first typed "=.30", I thought the decimal and the zero were a type-o. Then I see you used "=.10". It's been a long time (close to 10 years ago) that I've been through the MPASM manual, and I can still go back and read it, but can you explain the "=.30" and "=.10" for defining 3 and 1? I would have thought it would just be "=3" or "=1".

    Thanks for taking your time to explain all this to us.
    No, I'm not Superman, but I did stay at a Holiday Inn Express last night!

  5. #5
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    It's just a MPASM naming convention. Depending the current MPASM radix setting
    @a=10
    @B=30
    Those above could be considered as decimal or hexa.

    Let's open a PBP .INC file, let's say 16F628.inc, you'll discover...
    Code:
        else
            LIST
            LIST p = 16F628, r = dec, w = -302
            INCLUDE "P16F628.INC"   ; MPASM  Header
            ;__config _XT_OSC & _WDT_ON & _PWRTE_ON & _MCLRE_ON & _LVP_OFF & _CP_OFF
            NOLIST
        endif
            LIST
    so every value should be considered as decimal using PBP.

    MPASM naming convention
    .10 or d'10' will always be considered as 10 decimal whatever your Radix setting is.. kinda safe way to write things.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  6. #6
    Join Date
    Mar 2008
    Location
    Texas, USA
    Posts
    114


    Did you find this post helpful? Yes | No

    Default

    Thanks Mr.E. Now that you mentioned it, I remember dealing with the radix before, but never much explored it many uses. Again, that was a long time ago... and I've had several beers since then.
    No, I'm not Superman, but I did stay at a Holiday Inn Express last night!

  7. #7
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    oh... think we ALL had few beer... in case you're thirsty
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Similar Threads

  1. Reading and Writing from SD/MMC cards as FAT filesystem?
    By charliez in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 22nd June 2006, 23:26

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