Where should I discuss SD/MMC FAT issues?


Closed Thread
Results 1 to 40 of 93

Hybrid View

  1. #1
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by JD123 View Post
    If you have to be corrupted by someone, Darrel seems to be a good choice!
    Ya, no kidding, and of course, you're absolutely right about the 9 Tcyc.
    A guy should never post 'from the hip', but I do it anyways...

    If you use @ NOP?C 1 it will paste 1 NOP and so on.
    And this little tidbit right here could be the solution to one of my ongoing 'issues' on another project...

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


    Did you find this post helpful? Yes | No

    Default

    Great! But you where wrong about the 9Tcy... Read previous post again... or build an ASM project then watch the Program Memory window.
    Steve

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

  3. #3
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mister_e View Post
    Great! But you where wrong about the 9Tcy... Read previous post again... or build an ASM project then watch the Program Memory window.
    And yet again, that's what I get for posting off the hip... Since when is a macro...a subroutine? Must forgive my blatent stupidity...the house payment is due today
    So, does that little @ NOP?C trick work any other little way that I'm not knowing of yet with anything else?

    BTW...Self-Expanding Macro is my new buzzword...

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


    Did you find this post helpful? Yes | No

    Default

    So, does that little @ NOP?C trick work any other little way that I'm not knowing of yet with anything else?
    Well i don't know.. i'm not in your own short

    When you call a Macro, the compiler just copy/paste the whole macro code where you called the macro.

    let see...
    Code:
    OneMacro  macro
        MOVE?CT 1,PORTA,0
        MOVE?BB _MyVar,_YourVar
        endm
    EACH TIME you call the macro like this...
    Code:
    @ OneMacro
    This will paste
    Code:
        MOVE?CT 1,PORTA,0
        MOVE?BB _MyVar,_YourVar
    so...
    Code:
    @ OneMacro
    @ OneMacro
    will obviously generate
    Code:
        MOVE?CT 1,PORTA,0
        MOVE?BB _MyVar,_YourVar
        MOVE?CT 1,PORTA,0
        MOVE?BB _MyVar,_YourVar
    Hence why we often suggest to reduce your macro size.

    in NOP?C, The Conditional While (not sure if conditional or MPASM directive.. but anyway), just copy the amount of NOP you asked in the argument parameter

    NOP?C 5

    will juste paste
    @ NOP
    @ NOP
    @ NOP
    @ NOP
    @ NOP

    that's it. No code overhead, no nothing.... self expanding... or expandOnDemand ... huh?
    Steve

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

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


    Did you find this post helpful? Yes | No

    Default

    Ok, now it's clear and I understnad why it's 5 Tcy for the example. Though it's still going to load tons of NOP's in the code (for my program), it's still strait line. Like you said, it sure will reduce the time needed to tweek the NOP's for clocking speed adjustments. Excelent tip and thanks!
    No, I'm not Superman, but I did stay at a Holiday Inn Express last night!

  6. #6
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by JD123 View Post
    Like you said, it sure will reduce the time needed to tweek the NOP's for clocking speed adjustments. Excelent tip and thanks!
    Might even work with a separate variable...as in...
    @ NOP?C _variable
    ? maybe? maybe not?
    then you could set the variable at the top and only change it once and in your code use something like
    @ NOP?C _variable+2
    or
    @ NOP?C _variable+10
    and so on...
    But then again, if you go that far, all you're doing is reinventing the wheel (i.e. pauseus)

  7. #7
    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 16:51.
    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, 22: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