Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Assembly 

with calling recursive/iterative function that findsminValue of type Int

Hello,

I've currently got an assignment utilizing the m68000 processor. To objective of the assignment is to call a recursive function that finds the minimum value and sort it using one of two methods.

The basic idea is that the minimum value is either the first element of the list, or it is the minimum value from the rest of list. You should correctly implement the above psuedocode in your findmin.s file.
Here is the high level abstraction I am using for pseudocode:
Code
int findmin(int* vals, int count)
{
    if(count == 1)
    {
        return vals[0];
    }
    else
    {
        int minrest = findmin(vals+1,count-1);
        if (minrest < vals[0])
        {
            return minrest
        }
        else
        {
            return vals[0]
        }
    }
}

Here is my current code, as you can see I've just started and I've currently got an error:
Code
start:      initIO                  * Initialize (required for I/O)
            setEVT            * Error handling routines
*        initF            * For floating point macros only    

    *move hardcoded values into d0 and d1
    
    move.l #0,D0
    move.l #1,D1
    cmp.l D0,D1
    bgt less
    lineout greater
less:    
    lineout less
    

            break                   * Terminate execution
*
*----------------------------------------------------------------------
*       Storage declarations

greater: dc.b 'greater'
less: dc.b 'less'

            end
ppasm template.s
Macro preprocessing complete.
ERROR in line 157: Symbol value differs between first and second pass
1 error detected
No warnings generated
68000 Assembler by PGM


Please help when possible, thank you.
the error is because you are using the symbol "less" in 2 x places

less:
lineout less

and a second time

less: dc.b 'less'

call the second one "lessmsg" or something


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Assembly] by samuelrizzoMay 8, 2018 12:19 PM 3 267 May 8, 2018 12:19 PM
Last Post: spiderfruit
[Help] by mrgoodcatOct 1, 2016 08:46 AM 0 87 Oct 1, 2016 08:46 AM
Last Post: mrgoodcat
by severosJul 17, 2016 10:00 AM 4 224 Jul 17, 2016 10:00 AM
Last Post: ng-Coder