A method to create banked NextBASIC modules

This is where most of us started. Classic Spectrum basic.

Moderator: Programming Moderators

User avatar
programandala.net
Posts: 45
Joined: Thu Nov 02, 2017 11:55 am
Location: Spain
Contact:

A method to create banked NextBASIC modules

Postby programandala.net » Sat May 23, 2020 10:21 am

Since `BANK n LINE start,end` is a direct command and cannot be used in a program (yet?), I've been investigating how to create a NextBASIC program file, ready to be loaded into a memory bank.

The solution was easy to find: the only requirement is a "file" signature "BC" (from "Basic Code", I presume) at the start of the bank, before the tokenized BASIC.

Therefore, a banked program can be created as usual with a zmakebas with NextBASIC support, but using its `-r` (raw) option, and finally adding "BC" at the start of the file. Then any program can load it with `LOAD "filespec" BANK n`.

I didn't find any mention about this in the manual or in the wiki.

I think It wouldn't be difficult to write a dot command to load an ordinary BAS file directly into a memory bank, but I always prefer cross-development on Linux, thus this method is perfect for me.
Marcos Cruz (programandala.net)

garrylancaster
Posts: 36
Joined: Mon Feb 19, 2018 2:44 pm

Re: A method to create banked NextBASIC modules

Postby garrylancaster » Wed May 27, 2020 8:45 pm

.txt2bas also supports banked sections - see the help

User avatar
programandala.net
Posts: 45
Joined: Thu Nov 02, 2017 11:55 am
Location: Spain
Contact:

Re: A method to create banked NextBASIC modules

Postby programandala.net » Wed May 27, 2020 9:43 pm

I know, thanks. It provides a good set of directives. But I prefer to create all of the target files on Linux, if possible.
Marcos Cruz (programandala.net)


Who is online

Users browsing this forum: No registered users and 2 guests