EASy68K  
It is currently Thu Nov 15, 2018 1:26 pm

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Fri Nov 09, 2018 3:20 pm 
Offline

Joined: Sun Nov 01, 2009 4:02 pm
Posts: 20
Location: Belgium
Hallo prof Kelly,

I did a lot of programming in 68K ASM, since my youth.
So, I have a lot of old well working asm files I like to use for my small robots.
They are all created with an old ASM assembler who uses other controls.
And one of the things are the use of other commands for the old $, %, &
the program used to determine hexadecimal, binary, decimal and octal values,
h', b', d', o'.

So, is it possible to change this in the Easy68K environment ?
And if so, where can I change this in the source code to replace them ?

decimal become d'
binary becomes b'
hexadecimal becomes h'
octal becomes o'

Some examples:

AND.B #d'31,d0 * clear D5...D7
AND.B #h'1F,d0 * clear D5...D7
AND.B #b'00011111,d0 * clear D5...D7


thanks,
marc

_________________
Greetings from Belgium
Hobby robot builder
www.marc-systems.be


Top
 Profile  
 
PostPosted: Sat Nov 10, 2018 12:35 pm 
Offline
User avatar

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 1086
    EVAL.CPP contains the parser code that evaluates numeric literals. Currently in EASy68K:
    $ = hexadecimal
    % = binary
    @ = base 8
    default = base 10
Code:
  else if (*p == '$' && isxdigit(*(p+1))) {
    /* Convert hex digits until another character is
       found. (At least one hex digit is present.) */
    x = 0;
    while (isxdigit(*++p)) {
      if ((unsigned int)x > (unsigned int)LONGLIMIT/16)
   NEWERROR(*errorPtr, NUMBER_TOO_BIG);
      if (*p > '9')
   x = 16 * x + (*p - 'A' + 10);
      else
   x = 16 * x + (*p - '0');
    }
    *numberPtr = x;
    return p;
  }
  else if (*p == '%' || *p == '@' || isdigit(*p)) {
    /* Convert digits in the appropriate base (binary,
       octal, or decimal) until an invalid digit is found. */
    if (*p == '%') {
      base = 2;
      p++;
    }
    else if (*p == '@') {
      base = 8;
      p++;
    }
    else
      base = 10;

Modifying EASy68K would require an old copy of Borland C++ Builder 6.x.

_________________
Prof. Kelly


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group