PROMAL 3.1

C, Cobol, Durex, Fortran, Pascal, etc, etc
User avatar
Heart
Member
Member
Posts: 38
Joined: Fri Aug 22, 2014 3:52 pm
Location: Minnesota
Contact:

PROMAL 3.1

Post by Heart »

Continuing with my experiment to port PROMAL to the SuperCPU is this version which I have tentatively called PROMAL 3.1. This is different than 3.0 in that, while 3.0 supported 65C02 opcodes (to accomodate the TurboMaster), this version is not backwards compatible with the 65C02, but instead supports 65816 addressing modes, opcodes, and 16-bit registers. Being an experiment, anyone interested should look at this as beta-ware and likely to contain an occasional bug. However, if you try the examples on disk, I think you will find that it is nevertheless fairly stable.

I should also warn that I have NOT tried to follow PROMAL 1.0 faithfully. One might really call this a fork of that version, although, the syntax between versions 1.0 and 3.1 are almost identical. The biggest differences are in the environment itself, notably to make more memory available for PROMAL programs, and obviously to make everything run faster. Other major differences include removing what I considered outdated functions and procedures, updating others, and adding new ones.

To try out this version, you need a SuperCPU64 or SuperCPU128 (in 64 mode). You also need RAM expansion. I realize not every SuperCPU has SuperRAM, so PROMAL 3.1 will happily accomodate GeoRAM or an REU too. So load up the first program, called PROMAL, and RUN it. PROMAL will take some time to load a bunch of stuff into RAM expansion, but eventually should (if everything goes right) drop to a prompt.

At this point, hit F3 and then type card followed by a RETURN. This will load up the editor and the source code to card.s. You can examine the code with F1 and F2 to page down and up, or the cursor keys. After you're bored with that press SHIFT-STOP, which is the RUN key. PROMAL will save the code to RAM expansion, call the compiler, compile the code, and start the program.

Again, if everything worked correctly, you should find yourself playing "backbone" solitaire, which requires a mouse in port 1. The mouse driver is my own and also experimental. I can't guarantee it will work with every mouse, but I have tried it with four different mice and at least two C128 computers, so I'm hopeful it will work with other mouse/computer combinations.

Not interested in backbone solitaire? Well, you could try some of the other programs on disk, such as ball. Exit the game by pressing stop. Exit the editor by pressing control-e and another e to really truly exit. Load up ball in a similar way to the card game. That is, press F3, then type ball and finally the RETURN key. RUN the program by pressing the RUN key (shift-stop) as before. After a short compilation you should see a demonstration of opening the top and bottom VIC borders and some sprites travelling through the borders. Exit the program by pressing the stop key. You should be back in the editor.

There are other programs on disk to try, such as numnuts or traverse or graphdemo or grdemo or maze.

I won't go into detail about programming in PROMAL since...well...nobody seemed particularly interested in it before. :roll: But you never know. If anyone would like to know more about writing in PROMAL feel free to reply.
Attachments
PROMAL.D64.zip
(75.01 KiB) Downloaded 437 times


User avatar
Heart
Member
Member
Posts: 38
Joined: Fri Aug 22, 2014 3:52 pm
Location: Minnesota
Contact:

Re: PROMAL 3.1

Post by Heart »

Geez, I would forget the friggin' card font. My apologies. Any other issues, please let me know.
Attachments
PROMAL.D64.zip
(75.96 KiB) Downloaded 419 times
ca_groundhog
Member
Member
Posts: 2
Joined: Tue Sep 11, 2018 3:45 am
Contact:

Re: PROMAL 3.1

Post by ca_groundhog »

I'm trying to get it setup in VICE and I would love to use it with an REU. So many thanks, I'm going to give your download a run and see how it works.
ca_groundhog
Member
Member
Posts: 2
Joined: Tue Sep 11, 2018 3:45 am
Contact:

Re: PROMAL 3.1

Post by ca_groundhog »

Gave it a run, didn't have much luck though. I got it to compile Card.s but then it came up with a message "no font" and wouldn't run. Do you happen to have some documentation for your version of PROMAL?
User avatar
Heart
Member
Member
Posts: 38
Joined: Fri Aug 22, 2014 3:52 pm
Location: Minnesota
Contact:

Re: PROMAL 3.1

Post by Heart »

From my second post, I downloaded and retested "card.s" using xscpu64.exe from WINVice 3.2 and didn't have any trouble compiling or running the card.s program. The only difficulty was in getting WINVice configured to grab mouse events, but that's mostly due to my unfamiliarity with WINVice's features. After a few minutes of tinkering with the control port settings in WINVice's menus, I got card.s to work.

Did you download PROMAL from the first post or the second post? I'm not running into the problem of not finding the font.

What follows, is documentation from an earlier 3.0 version. As there was absolutely zero interest with that version, I didn't update the documentation, or add to it, when I made 3.1 available on Melon64. However, if answering questions here will help anyone get started using PROMAL 3.1, I'll try to check in from time to time. I still use PROMAL 3.1 and have fun developing code for it. It would be great if someone else contributed a working program.

----------------------------------------------------------------------
PROMAL 3.0



This is a modified version of PROMAL mainly supporting the SuperCPU, but a TurboMaster may also be used. I imagine a Flash8 cartridge could be made to work, with some modifications to PROMAL, but I know next to nothing about how the Flash8 cartridge works or how to program for it.

I know of only two versions of PROMAL, version 1.0 and version 2.1. So not knowing what else to call it, I chose to call this version, PROMAL 3.0. I am not the author of PROMAL 1.0 or PROMAL 2.1 (both released in the mid 1980s) and had nothing to do with either of those versions.

To run PROMAL 3.0, you will need (besides the SuperCPU or TurboMaster) some form of RAM expansion. For the SuperCPU you can use SuperRAM, a Commodore REU, or a GEORAM cartridge. For the TurboMaster you can use a GEORAM cartridge--an expansion port expander will be needed to do this. A TurboMaster with a MasterAdapter could theoretically support a Commodore REU, but I have no way of testing this. My guess is that this combination is not currently working, but could be made to work with some minor modifications to the PROMAL kernal.

So you might be wondering why I went to the trouble of changing PROMAL in the first place. I think that the PROMAL language is a good language, but the versions available for the C64 have some obvious problems. Versions 1.0 and 2.1 don't quite work as a practical programming language for the C64. However, most of the problems have little to do with the language itself, and mostly to do with the environment it runs in. Version 3.0 attempts to fix some of these shortcomings.

Version 3.0 frees up more memory for the user. The 1541 drive is no longer a requirement. Device 8 is no longer assumed. RAM expansion is utilized efficiently to reduce the time required for accessing files. PROMAL has okay speed, but really needs an accelerator cartridge to be practical. To this end, I added 65C02 opcodes to PROMAL to further boost performance.

If you have never programmed in PROMAL before, a good place to start learning would be to read through the PROMAL reference guide which can be found online in a couple places. Whether you are familiar with PROMAL or not, keep in mind that in this newer version, many things have changed. Another way to learn to program in PROMAL is simply to study the examples on disk. PROMAL's syntax is very clean.




Changes to the shell:

The shell (previously called 'executive') is simpler. Only one program resides in memory at a time. You might think this is a step backward, but I doubt if you'll miss having multiple programs in memory at the same time, or even notice the difference. Thank your RAM expander for this one.

Many commands have been removed from the shell or moved to disk. Rather than list what has been removed, I will list what stayed. If the documentation for a command seems scanty, it's probably because the original documentation is still relevant.

@ This command replaces several of the older ones. Type the @ symbol FOLLOWED BY A SPACE, and then the command you wish to send to the drive DOS. Quotes may be used around your command if your command requires spaces, otherwise you may leave them out.

bye This command simply exits PROMAL and returns you to BASIC.

copy Copies files from one place to another.

dir Previously called 'files', this command expects an argument which you may alter before pressing RETURN.

edit Use this command to edit your source code. More details covered later in this text.

fill 'fill xxxx yyyy zz' fills the address range from xxxx to yyyy with the value zz.

fkey 'fkey' by itself, displays the current function key definitions. 'fkey x "text"' changes function key x to the string in "text".

get 'get file' will attempt to load in 'file.c' as a PROMAL program. 'get file xxxx' will attempt to load 'file' in at whatever hex address you provided.

job 'job file.j' executes 'file.j' as a script.

map Gives a few details about what program currently resides in memory and how much memory is available.

mem 'mem xxxx' displays a line of memory in hex. 'mem xxxx yyyy' displays a range of memory.

set 'set xxxx yy' changes hex location xxxx to hex value yy.

type 'type file.s' displays file 'file.s' on screen.




Changes to the compiler:

The 'b' option has been removed--the compiler always uses all the available memory to compile a program.

The 'l' option for listing a file has been removed--it's the job of the compiler to compile, not print.

The compiler doesn't display it's progress for every line, just the lines for PROCedures or FUNCtions.

The compiler no longer substitutes 'l' for 'library' in INCLUDEs. To include the library you would typically use 'include l'. This is the library read from RAM expansion.

I tried not to make changes to the language itself, but there are a few.


PROMAL reserved words must now be uppercase. 'RETURN' instead of 'return'. 'CHOOSE' and not 'choose'. The lone exception is 'nothing'.

'begin' has been renamed. It is now four big-dashes (shifted *).

'end' has been renamed. It is now two big-dashes. These two elements of the language were renamed to make source code more readable.


An array of bytes can now be called directly. For example,

ASM FUNC BYTE rreg[]=
$88,$d0,$12,$68,$68,$8d, 0,$d6,
$a4,$8b,$2c, 0,$d6,$10,$fb,$ad,
1,$d6,$4c,$73, 0,$4c,$a9,$0e

ASM PROC wreg[]=
$c0, 2,$d0,$15,$68,$68,$aa,$68,
$68,$8d, 0,$d6,$a4,$8b,$2c, 0,
$d6,$10,$fb,$8e, 1,$d6,$4c,$74,
0,$4c,$a9,$0e

defines an assembly function and an assembly procedure which can be called later on,

val=rreg(31)
wreg 4,$27

Assembly functions and procedures must still be relocatable, however.


Functions in PROMAL which do not require any arguments must now be parenthesized anyway. I made this change to get rid of an ambiguity. For instance,

n=getc

If you didn't know that getc was a function, you might wonder if this is assigning one variable to another. 'n=getc()' makes it plain. Still not a believer? Try this one,

IF identify
IF symbol>$3e

Is 'identify' a function or variable? How about 'symbol'? But I can make this clear,

IF identify()
IF symbol>$3e

Now the ambiguity is gone.




Changes to the editor:

Use control-h for help, instead of F7.

Use control-e instead of F8 to bring up the editors 'options' menu. Pay attention to the filename! If you have been compiling your source code directly from the editor, the filename has been changed to 'w', so if you want to resave your program back to disk, you need to use the 'n' option to enter a different filename. I know this is a pain in the butt, but the editor is a work in progress and I was not the original author.

Use F1 and F2 to page down and up in your document, instead of control-n and control-p.

Use F7 and F8 to insert or delete a line, instead of F1 and F2.

'edit file' or 'edit file.s' will load 'file.s' from disk. From within the editor, press the RUN key (shifted STOP) to save your source code to the workspace, compile the source code in the workspace, and execute the resulting object program. When you leave your program, you will be returned to the editor, your source code, and the same line that you left.

'edit' by itself will attempt to edit whatever is in the workspace. This is useful if you unexpectedly crashed the computer after compiling from the editor. Your source code should still be in RAM expansion when you reset your computer and boot up PROMAL again.




Changes to the workspace:

The workspace now resides in RAM expansion. There are no options to change. It's size is limited to about 2/3 of 64K.




Changes to the library:

There is a file called 'w' for the workspace and a file called 'l' for the library. 'library.s' gets copied into 'l' when PROMAL is first booted up. The file 'l' resides in RAM expansion. It's size is limited to about 1/3 of 64K.




Changes to the PROMAL kernal:

'abort' has been removed. Use 'exit' instead.

'chksum' has been removed.

'dir' has been removed.

'edline' has been removed.

'fkeyget' has been removed.

'fkeyset' has been removed.

'inline' has been removed.

'rename' has been removed.

'toupper' has been removed.

'zapfile' has been removed.

'cmpstr' no longer has a 'fold' argument.

'curset' has reversed it arguments. Call 'curset' with the row value first and an optional column value second.

'lookstr' now requires the array of strings to be sorted in increasing order. 'nstr' is also required and denotes the number of strings in the array. The 'fold' argument has been removed.


'output' has changed.

When calling 'output' with a '#b' in the format string, put the number of blanks desired as one of the arguments. For instance, 'output "#b",4' will output four blanks. This was done so that the number of blanks can be computed--as in, 'output "#b",20-lenstr(line)'. If a value is included, such as "#42b" that ASCII character will be used instead of a blank--in this case, decimal 42, or the '*' character.

When calling 'output' with a field width for strings, as in '#20s' the string will be right-justified instead of left-justified.


'dos' has been added. It is a function and replaces 'rename' and 'zapfile'. Called without any argument, it reads the string from the dos error channel and places it into the buffer at $2a7. Called with an argument string, it is sent as a command to the drive. The error channel is queried afterward and the dos error string is placed in $2a7. 'dos' returns the error code as a byte. So if "62, file not found,00,00" has been read into the buffer at $2a7, then the value 62 will be returned as a byte.

'stash' has been added. It is a procedure requiring 3 or 4 arguments. Example, 'stash $d800,0,0,1000' stashes 1000 bytes from color RAM at $d800 and puts it into location 0 of bank 0 in RAM expansion. 'stash buffer,$100,2' stashes 256 bytes (stash defaults to a page) from buffer into RAM expansion address $20100.

'fetch' has been added. It's syntax is the same as for stash. The 64's address comes first, then a 16-bit RAM expansion address, followed by an 8-bit RAM expansion bank, and then an optional 16-bit value defaulting to 256. Example, 'fetch #var,$400,rambank,1' will fetch 1 byte into var, from RAM expansion address rambank*65536+$400.




Other changes:

PROMAL 3.0 now supports running programs in other banks. The default bank is with just I/O visible. If you wanted to run your program in all RAM, you might use the assignment, 'bank=$34' or maybe just 'bank=0'. You do not need to disable/enable interrupts to switch banks. Be careful not to modify anything above $ff80. It might be best to limit yourself to RAM below $ff00.

If you boot up PROMAL 3.0 in uppercase/graphics, the reals will be available. Switch to lowercase/uppercase before booting and they will not be available.

There is no longer a backtrack buffer for the shell. However, the editor still has it's own backtrack buffer.




Programs on disk:

'graphdemo.s'
The_Other_Shaun_B
Member
Member
Posts: 12
Joined: Sat Feb 12, 2022 2:00 pm
Contact:

Re: PROMAL 3.1

Post by The_Other_Shaun_B »

Hello,

Many thanks for this. I will let you know when I've tried it out with something, but I'm very interested that it builds 65816 binaries.

Regards,

Shaun.
Post Reply Previous topicNext topic

Who is online

Users browsing this forum: No registered users and 1 guest