It is currently Mon May 20, 2019 3:21 pm

 All times are UTC

 Page 1 of 1 [ 3 posts ]
 Print view Previous topic | Next topic
Author Message
 Post subject: Easy68K change ... for dec, hex, bin, oct usePosted: Fri Nov 09, 2018 3:20 pm

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'
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

 Post subject: Re: Easy68K change ... for dec, hex, bin, oct usePosted: Sat Nov 10, 2018 12:35 pm

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 1095
EVAL.CPP contains the parser code that evaluates numeric literals. Currently in EASy68K:
% = 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)
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

 Post subject: Re: Easy68K change ... for dec, hex, bin, oct usePosted: Thu Mar 21, 2019 2:09 pm

Joined: Wed Jan 06, 2016 9:24 am
Posts: 9
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.

Top

 Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending
 Page 1 of 1 [ 3 posts ]

 All times are UTC

#### Who is online

Users browsing this forum: Bing [Bot] and 4 guests

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

Search for:
 Jump to:  Select a forum ------------------ EASy68K Forum    FAQ    Latest Features    EASy68K Questions    68000 Programming Questions    Wish List    Wishes Granted    Undocumented Features    Documented Features    General Discussion    EASy68K Projects