Subject: Writhing a MM BASIC complier with MM BASIC.
From: paul lamar
Date: 1/2/2016, 10:24 AM
To: A10-Me-Earthlink

All you need is a PIC disassembler and a PIC assembler.

What is a "real" disassembler's job?  Its job is to produce an assembly listing that when put through an assembler will produce the same binary (or in this case Intel Hex formatted file) as was originally given.

Once you have done that MM BASIC will work to write a compiler. You start with one MMB instruction at
a time and write a assembly language  source code using the MMB DOS capabilities. .

You read the MMB source with Input.

INPUT$(nbr, [#]fnbr)

Will return a string composed of ‘nbr’ characters read from a file
previously opened for INPUT with the file number ‘fnbr’. This function
will read all characters including carriage return and new line without
translation.

You then correlate that with the disassembled version and
write out the new assembly language source using MMB.
.
OPEN fname$ FOR mode AS [#]fnbr

‘fname’ is the filename (8 chars max) with an optional extension (3 chars
max) separated by a dot (.). It can be prefixed with a directory path. For
example:"B:\DIR1\DIR2\FILE.EXT".

PRINT #nbr, expression [[,; ]expression] ... etc

The output is directed to a file previously on SD card
opened for OUTPUT or APPEND as ‘nbr’. See the OPEN command.

Plan B
If there is no PIC disassembler available you could use MMB to translate
MMB to  Mikro Electronica compiled PIC BASIC and then use
Mikro Electronic PIC hard ware to run it on.

http://www.mikroe.com/easypic-fusion/

Lots of libraries   lots and lots of libraries   Save your time!
What’s the point of compiler if you have to write libraries from scratch?
With our compilers, you’ll have over 500 library functions/, and a head
start in development.

I am working on convincing Mikro Elect. to add a 64 Gig MicroSD
card DOS just like the MM. I have one of their very powerful
big boards. More than enough ports to do almost anything.

Paul Lamar


The Rotary Engine News Letter. Powered by Linux.
If you want off the list PLEASE let me know and I will
remove  you.  ACRE NL web site. http://www.rotaryeng.net
You Tube http://tinyurl.com/beqqxas
Copyright 1998-2015 All world wide rights reserved.