EASy68K
http://easy68k.com/EASy68Kforum/

Easy68K change ... for dec, hex, bin, oct use
http://easy68k.com/EASy68Kforum/viewtopic.php?f=5&t=1656
Page 1 of 1

Author:  marc_256 [ Fri Nov 09, 2018 3:20 pm ]
Post subject:  Easy68K change ... for dec, hex, bin, oct use

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

Author:  profkelly [ Sat Nov 10, 2018 12:35 pm ]
Post subject:  Re: Easy68K change ... for dec, hex, bin, oct use

    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.

Author:  RyanFaeScotland [ Thu Mar 21, 2019 2:09 pm ]
Post subject:  Re: Easy68K change ... for dec, hex, bin, oct use

You'd likely be easier to change your files marc_256, unless there is good reason not to?

Programs like Notepad++ or Visual Studio Code can quickly search and replace even through multiple files.

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/