HELP WITH SOME Nbit MATH


Results 1 to 11 of 11

Threaded View

  1. #7
    Join Date
    Sep 2009
    Posts
    755


    Did you find this post helpful? Yes | No

    Default Re: HELP WITH SOME Nbit MATH

    This is ASM code:
    Code:
    @MOVE?BP _ARRAY[1] , TMP_32BIT
    In ASM arrays are not defined. Instead of defining each byte or word or long of array ASM use base address(like _Array) and offset.
    So if your array is byte I think that you can do it like this for array[1]
    Code:
    @MOVE?BP _ARRAY+1 , TMP_32BIT
    'TMP_32BIT=Array[2]
    @MOVE?BP _ARRAY+2 , TMP_32BIT
    For word
    Code:
    TMP_32BIT=Array[1]
    @MOVE?WP _ARRAY+2 , TMP_32BIT
    TMP_32BIT=Array[2]
    @MOVE?WP _ARRAY+4 , TMP_32BIT ;Because each word in array uses 2 bytes, you increase index by 2.
    For long index are 4,8 etc... Index must be constants!
    For variable index is much easier to use temporally variable to hold result, than to work with pointers, etc in ASM. It can be done, I think that I post somewhere i TFT topic code for that.
    Example for variable index:
    Code:
    pbpTmp VAR BYTE/ WORD/LONG
    pbpTmp = Array[i]
    @MOVE?BP _pbpTmp  , TMP_32BIT
    Last edited by pedja089; - 24th March 2016 at 09:00.

Similar Threads

  1. some help with math
    By longpole001 in forum mel PIC BASIC Pro
    Replies: 64
    Last Post: - 16th October 2015, 02:03
  2. Help with the math
    By Ramius in forum FAQ - Frequently Asked Questions
    Replies: 3
    Last Post: - 5th September 2014, 07:15
  3. Math help please...
    By Ioannis in forum General
    Replies: 2
    Last Post: - 20th June 2008, 10:18
  4. PBPL Math...new math takes more cycles...Always?
    By skimask in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 10th February 2008, 10:22
  5. math help
    By houa in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 30th January 2006, 16: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