sources/Desktop/codedrop.cpp
// get the address from a line (first 6 bytes need to be hex in ascii)
// this was only tested with cc65's output .lst files!

get the address from a line (first 6 bytes need to be hex in ascii)
this was only tested with cc65's output .lst files!
get the address from a line ( first 6 bytes need to be hex in ascii ) this was only tested with cc65 ' s output . lst files!
int CodeDrop::GetLineAddress( const char * line )
{
    char buf[8];
    if( !line || strlen( line ) < 8 ) return -1;
    if( line[6] == 'r' ) return -2;
    for( int i=0 ; i<6 ; i++ ) {
        char ch = line[i];
        if( !byteIsHex( ch )) return -10;
        buf[i] = ch;
    }
    buf[7] = '\0';
    return strtol( buf, NULL, 16 );
}
int CodeDrop :: GetLineAddress ( const char * line ) { char buf [ 8 ] ; if ( ! line || strlen ( line ) < 8 ) return -1 ; if ( line [ 6 ] == ' ' ) return -2 ; for ( int i = 0 ; i < 6 ; i ++ ) { char ch = line [ i ] ; if ( ! byteIsHex ( ch ) ) return -10 ; buf [ i ] = ch ; } buf [ 7 ] = ' \0 ' ; return strtol ( buf , NULL , 16 ) ; }
get the address from a line (first 6 bytes need to be hex in ascii)
this was only tested with cc65's output .lst files!
get the address from a line ( first 6 bytes need to be hex in ascii ) this was only tested with cc65 ' s output . lst files!
// copy and validate
 // make sure it's valid
 // and copy it
 // terminate the string
 // and convert hex string to int
