Porting BASIC2 to a homebrew system

handy tools that can assist in the development of new software
SparkyNZ
Posts: 68
Joined: Tue Feb 06, 2024 5:05 am
Contact:

Porting BASIC2 to a homebrew system

Post by SparkyNZ »

I'd like to be able to build the BASIC4.zip source found here: https://mdfs.net/Software/BBCBasic/6502/

The website mentions an assembler called "ARM BASIC 65" but can't find any assembler with that name and I don't think the link on that page is correct (??)

Does anyone know of a Windows 6502 assembler that will happily build this source?
Last edited by SparkyNZ on Sat Feb 17, 2024 6:37 pm, edited 1 time in total.
tom_seddon
Posts: 889
Joined: Tue Aug 30, 2005 12:42 am
Contact:

Re: Building BASIC4 source

Post by tom_seddon »

The link is correct, but it is for the Archimedes. Are you hoping to build on a PC? Hoglet's disassembly might be more useful if so: https://github.com/hoglet67/BBCBasic4r32/

There's some additional commentary here: http://8bs.com/basic/basic4.htm

There's also official source here: https://github.com/stardot/AcornCmosBasic, https://github.com/stardot/AcornDmosBasic - only marginally less inscrutable than a disassembly to my eyes though!

--Tom
User avatar
jgharston
Posts: 5321
Joined: Thu Sep 24, 2009 12:22 pm
Location: Whitby/Sheffield
Contact:

Re: Building BASIC4 source

Post by jgharston »

Code: Select all

$ bbcbasic
PDP11 BBC BASIC IV Version 0.45
(C) Copyright J.G.Harston 1989,2005-2024
>_
SparkyNZ
Posts: 68
Joined: Tue Feb 06, 2024 5:05 am
Contact:

Re: Building BASIC4 source

Post by SparkyNZ »

tom_seddon wrote: Tue Feb 06, 2024 2:27 pm The link is correct, but it is for the Archimedes. Are you hoping to build on a PC? Hoglet's disassembly might be more useful if so: https://github.com/hoglet67/BBCBasic4r32/

There's some additional commentary here: http://8bs.com/basic/basic4.htm

There's also official source here: https://github.com/stardot/AcornCmosBasic, https://github.com/stardot/AcornDmosBasic - only marginally less inscrutable than a disassembly to my eyes though!

--Tom
Yeah I was hoping to build on the PC - Windows or Linux - I don't really mind too much. I thought something like CCS65 may have done the job (that's a cross-assembler I've used for the C64/Vic20 in the past).

To be honest, I haven't even tried CCS65 yet but looking at the BASIC4 source I'm guessing the syntax will be different. I've never even seen assembly code with multiple mnemonics on the same line before.

Those 2 links you provided claim to be in MASM format so that should do the trick. I'll see if I can assemble with either source. I wonder if BeebEm would allow me to test out my own assembled ROM image. I'll have to check that out later. Thanks.
SparkyNZ
Posts: 68
Joined: Tue Feb 06, 2024 5:05 am
Contact:

Re: Building BASIC4 source

Post by SparkyNZ »

I can't find any links to an assembler at this link.
SparkyNZ
Posts: 68
Joined: Tue Feb 06, 2024 5:05 am
Contact:

Re: Building BASIC4 source

Post by SparkyNZ »

Sorry, I'm still not clear on which assembler is used to compile the BASIC4.ZIP at the MDFS site:

Code: Select all

REM > Basic4/src
REM Source code for 65C02 BBC BASIC IV for the BBC
:
IF PAGE>&8000:SYS "OS_GetEnv"TOA$:IFLEFT$(A$,5)<>"B6502":OSCLI"B6502"+MID$(A$,INSTR(A$," "))
ON ERROR REPORT:PRINT" at line ";ERL:END
:
P=P:IF P=0:CLEAR:P=0:DIM mcode% &11FF
OS_CLI=&FFF7:OSBYTE=&FFF4:OSWORD=&FFF1:OSWRCH=&FFEE
OSWRCR=&FFEC:OSNEWL=&FFE7:OSASCI=&FFE3:OSRDCH=&FFE0
OSFILE=&FFDD:OSARGS=&FFDA:OSBGET=&FFD7:OSBPUT=&FFD4
OSGBPB=&FFD1:OSFIND=&FFCE:BRKV=&202:WRCHV=&020E
:
load%=&8000   :REM load%=&B800
fixDIM%=FALSE :REM fixDIM%=TRUE
:
Whereabouts can I find documentation on the assembler used?

I like this source because it has lots of comments but the syntax of this assembler isn't going to work on one of my vanilla 6502 assemblers. I'm probably going to have to write something to parse the source so I can modify and use it with the comments intact - and yes, I will be using a PC to assemble the code.
paulb
Posts: 1767
Joined: Mon Jan 20, 2014 9:02 pm
Contact:

Re: Building BASIC4 source

Post by paulb »

SparkyNZ wrote: Wed Feb 07, 2024 12:07 am Sorry, I'm still not clear on which assembler is used to compile the BASIC4.ZIP at the MDFS site:

Code: Select all

REM > Basic4/src
REM Source code for 65C02 BBC BASIC IV for the BBC
So, if I understand this correctly, the source code in Basic4/src is the textual representation of a BASIC program which presumably utilises the BASIC assembler to generate the object code.

Meanwhile, the Guide link on the page that was mentioned indicates that the Basic65v3J program on that page is something that takes ARM BASIC V and patches it, generating a new BASIC V module that can process 6502 assembly language instead of ARM assembly language.

So, I think the suggestion is that, on a RISC OS machine, you run this program as instructed in the Guide file, generate a new BASIC module, load that, and then use that to run the BASIC4 program. Since the source code mentioned above is textual, I guess you first have to load it into an editor and then save it as tokenised BASIC (or use some command like *EXEC on the file directly) to actually have a runnable program. Or maybe there's an already-tokenised program in the archive: I haven't looked.

Yes, it all seems a bit complicated, but I guess it is a consequence of wanting to use the BASIC assembler (and employing the corresponding source representation) instead of something that runs on a more modern system.
User avatar
Rich Talbot-Watkins
Posts: 2054
Joined: Thu Jan 13, 2005 5:20 pm
Location: Palma, Mallorca
Contact:

Re: Building BASIC4 source

Post by Rich Talbot-Watkins »

hoglet's BASIC4r32 source that Tom linked (here) can be assembled on Windows with BeebAsm, which you can find here!
SparkyNZ
Posts: 68
Joined: Tue Feb 06, 2024 5:05 am
Contact:

Re: Building BASIC4 source

Post by SparkyNZ »

Rich Talbot-Watkins wrote: Wed Feb 07, 2024 8:57 am hoglet's BASIC4r32 source that Tom linked (here) can be assembled on Windows with BeebAsm, which you can find here!
Why does this claim to be annotated? I'm missing something - the below file is just raw assembly with no comments:

https://github.com/hoglet67/BBCBasic4r3 ... sic432.asm

Thanks for the BeebAsm link.
SparkyNZ
Posts: 68
Joined: Tue Feb 06, 2024 5:05 am
Contact:

Re: Building BASIC4 source

Post by SparkyNZ »

paulb wrote: Wed Feb 07, 2024 12:33 am Yes, it all seems a bit complicated, but I guess it is a consequence of wanting to use the BASIC assembler (and employing the corresponding source representation) instead of something that runs on a more modern system.
It does but it seems to be the best commented source I've seen so far. Thanks for the explanation - silly me didn't realise it was BASIC with embedded assembly.
tom_seddon
Posts: 889
Joined: Tue Aug 30, 2005 12:42 am
Contact:

Re: Building BASIC4 source

Post by tom_seddon »

SparkyNZ wrote: Wed Feb 07, 2024 12:07 am Sorry, I'm still not clear on which assembler is used to compile the BASIC4.ZIP at the MDFS site:

Code: Select all

REM > Basic4/src
REM Source code for 65C02 BBC BASIC IV for the BBC
:
IF PAGE>&8000:SYS "OS_GetEnv"TOA$:IFLEFT$(A$,5)<>"B6502":OSCLI"B6502"+MID$(A$,INSTR(A$," "))
ON ERROR REPORT:PRINT" at line ";ERL:END
:
P=P:IF P=0:CLEAR:P=0:DIM mcode% &11FF
OS_CLI=&FFF7:OSBYTE=&FFF4:OSWORD=&FFF1:OSWRCH=&FFEE
OSWRCR=&FFEC:OSNEWL=&FFE7:OSASCI=&FFE3:OSRDCH=&FFE0
OSFILE=&FFDD:OSARGS=&FFDA:OSBGET=&FFD7:OSBPUT=&FFD4
OSGBPB=&FFD1:OSFIND=&FFCE:BRKV=&202:WRCHV=&020E
:
load%=&8000   :REM load%=&B800
fixDIM%=FALSE :REM fixDIM%=TRUE
:
Whereabouts can I find documentation on the assembler used?
Documentation for the original BBC BASIC 6502 inline assembler, such as it is, can be found in the User Guide: https://archive.org/details/BBCUG/page/n439/mode/2up

This source assembles with a hacked version of the later Archimedes BASIC, which had a few additional features, so there might be no documentation as such for this precise syntax.
SparkyNZ wrote: Wed Feb 07, 2024 12:07 am I like this source because it has lots of comments but the syntax of this assembler isn't going to work on one of my vanilla 6502 assemblers. I'm probably going to have to write something to parse the source so I can modify and use it with the comments intact - and yes, I will be using a PC to assemble the code.
I have a Python 3.x script that attempts to transform this sort of syntax into something palatable to 64tass: https://github.com/tom-seddon/electron_ ... s/fixup.py - at your own risk, etc., and more than some DIY will be required. I've previously used this to successfully convert some of jgharston's other stuff from mdfs.net (such as his original disassembly from which that repo started), so this might handle the worst of it for you. Since you're assembling to a known output it should be easy to find and fix any issues with the converted result anyway.

--Tom
User avatar
hoglet
Posts: 12665
Joined: Sat Oct 13, 2012 7:21 pm
Location: Bristol
Contact:

Re: Building BASIC4 source

Post by hoglet »

SparkyNZ wrote: Wed Feb 07, 2024 11:15 am Why does this claim to be annotated? I'm missing something - the below file is just raw assembly with no comments:
https://github.com/hoglet67/BBCBasic4r3 ... sic432.asm
Sorry, I have no idea why my README says this.

Maybe my intent was to do some annotiation, but I never got around to it.

Dave
SparkyNZ
Posts: 68
Joined: Tue Feb 06, 2024 5:05 am
Contact:

Re: Building BASIC4 source

Post by SparkyNZ »

hoglet wrote: Wed Feb 07, 2024 1:23 pm Sorry, I have no idea why my README says this.

Maybe my intent was to do some annotiation, but I never got around to it.
All good.. Well maybe we I can share something that contains both comments and "vanilla" 6502 assembly.
SparkyNZ
Posts: 68
Joined: Tue Feb 06, 2024 5:05 am
Contact:

Re: Building BASIC4 source

Post by SparkyNZ »

tom_seddon wrote: Wed Feb 07, 2024 11:21 am I have a Python 3.x script that attempts to transform this sort of syntax into something palatable to 64tass: https://github.com/tom-seddon/electron_ ... s/fixup.py - at your own risk, etc., and more than some DIY will be required. I've previously used this to successfully convert some of jgharston's other stuff from mdfs.net (such as his original disassembly from which that repo started), so this might handle the worst of it for you. Since you're assembling to a known output it should be easy to find and fix any issues with the converted result anyway.
Sounds like a good place to start. I'm not a Python expert but I'll give it a try. May be a while but I'm happy to share whatever pops out the other end :-) Thanks for that.
SparkyNZ
Posts: 68
Joined: Tue Feb 06, 2024 5:05 am
Contact:

Re: Building BASIC4 source

Post by SparkyNZ »

Code: Select all

STZ $1F
What on earth is STZ ?

Is this the same as STA $1F (ie. store accumulator in zero page) ?

OK.. so I see it is a zero page clear instruction (ie. store 0 in location $1f). I never came across that one before.. I'm using CBMPrgStudio to try compiling this code (just because I like it) but maybe that's never been supported in the Vic20/C64 6502/6510 chips.

I guess I better try another 6502 assembler..
Last edited by SparkyNZ on Fri Feb 09, 2024 1:16 am, edited 1 time in total.
User avatar
sweh
Posts: 3314
Joined: Sat Mar 10, 2012 12:05 pm
Location: 07410 New Jersey
Contact:

Re: Building BASIC4 source

Post by sweh »

Store's a zero at the location. Not a 6502 code, but present on the 65C12 (and maybe others?). See viewtopic.php?t=22312 for more
Rgds
Stephen
SparkyNZ
Posts: 68
Joined: Tue Feb 06, 2024 5:05 am
Contact:

Re: Building BASIC4 source

Post by SparkyNZ »

Oh.. the 65C12?

Basic4.zip is the source for 65C02 BBC BASIC, it requires a 65C02 or later CPU.

Aha! There's quite a difference between the 65C02 and 6502:

https://en.wikipedia.org/wiki/WDC_65C02

I might have to use the Basic2.zip code instead.. I do have a WD65C02 on my homebrew machine that I'd intended to port BBC BASIC over too.. but I'll be using Fake6502 on Windows to debug/emulate which possibly won't support those instructions.

Wow, I learn something new every day :-) I had no idea there even was a 65C12 either. Thanks for that.
User avatar
sweh
Posts: 3314
Joined: Sat Mar 10, 2012 12:05 pm
Location: 07410 New Jersey
Contact:

Re: Building BASIC4 source

Post by sweh »

Yeah, the Master used the 65C12; I wasn't sure of the same instructions also applied to the 65C02. Which, as you've learned is different to the 6502. It's almost as confusing as Microsoft product names! (How many different versions of "copilot" do they have?!)
Rgds
Stephen
SparkyNZ
Posts: 68
Joined: Tue Feb 06, 2024 5:05 am
Contact:

Re: Building BASIC4 source

Post by SparkyNZ »

I don't suppose anybody knows what all of the various assembly options are for?

I'm trying to manually massage the BASIC2.zip (https://mdfs.net/Software/BBCBasic/BBC/Basic2.zip) source into something my assembler will understand.. but I keep getting tripped up by all of the conditional assembly options.

For example, what is split%, drop%, opt% .. and what's the difference between target="system" and target="bbc"? (I've just assumed system and bbc are the same for now)

I've just assumed I have INTVALVersion and VALVersion of 3.

At the end of the day, I'm hoping I'll end up with a lump of 6502 code that I can store/execute at $8000 and then fill in the various hook routines for input and output - that's my primary goal - and that's all running with Fake6502 on Windows.
User avatar
sweh
Posts: 3314
Joined: Sat Mar 10, 2012 12:05 pm
Location: 07410 New Jersey
Contact:

Re: Building BASIC4 source

Post by sweh »

SparkyNZ wrote: Fri Feb 09, 2024 5:52 am I don't suppose anybody knows what all of the various assembly options are for?

I'm trying to manually massage the BASIC2.zip (https://mdfs.net/Software/BBCBasic/BBC/Basic2.zip) source into something my assembler will understand.. but I keep getting tripped up by all of the conditional assembly options.
So that source is a BASIC program, not pure assembler. It uses the BASIC built in assembler to do the hard work, so it's a combination of BASIC and assembler. So you can see opt% defined as "FOR opt%=4 to 7 STEP 3-1" (so it's a variable in a FOR loop).

If you set target$="system" then it'll cange the load address to A000 (instead of 8000) and a few other things.
Rgds
Stephen
tom_seddon
Posts: 889
Joined: Tue Aug 30, 2005 12:42 am
Contact:

Re: Building BASIC4 source

Post by tom_seddon »

SparkyNZ wrote: Fri Feb 09, 2024 5:52 am I don't suppose anybody knows what all of the various assembly options are for?

I'm trying to manually massage the BASIC2.zip (https://mdfs.net/Software/BBCBasic/BBC/Basic2.zip) source into something my assembler will understand.. but I keep getting tripped up by all of the conditional assembly options.

For example, what is split%, drop%, opt% .. and what's the difference between target="system" and target="bbc"? (I've just assumed system and bbc are the same for now)

I've just assumed I have INTVALVersion and VALVersion of 3.
I think assume the following:

target$="bbc" (I think System will refer to this: https://en.wikipedia.org/wiki/Acorn_Eurocard_systems)
split%=FALSE (looks like this assembles the code in 2 parts - I think the System line has quite a fragmented address space?)
drop%=FALSE (looks this this drops support for a few things - perhaps the System line doesn't support this stuff?)
version$="2.00" (BASIC 2 is the one you want)

(BTW, VALversion$ and INTVALversion$ are expressions, not variables, and equivalent to VAL(version$) and INT(VAL(version$)) respectively. BBC BASIC tokenizes greedily, and you can typically omit the brackets with unary functions.)

opt% is is used for the OPT mechanism, which drives the multi-pass assembly. See the archive.org User Guide link I posted above.

--Tom
SparkyNZ
Posts: 68
Joined: Tue Feb 06, 2024 5:05 am
Contact:

Re: Building BASIC4 source

Post by SparkyNZ »

Thanks guys - I think I'll have to start again :-) I assumed "bbc" and "system" as well as version=3. The "system" bits are the ones I've probably messed up..

It may be worth a try seeing if I can get it to build as version 3 first.. I'm assuming that once assembled I should be able to compare the labels with the addresses in a listing file to make sure they all line up. If I have produced a hybrid of some sort then I won't be able to compare against a ROM binary image.. and I can't seem to find a BASIC 3 ROM anyway.. so maybe I'll have to go back and do the BASIC 2.

I should have knocked up a program to filter out the OPT bits I don't want and the ones I want to keep. Think I'll do that next - more fun than going through and manually deleting stuff. :-)
SparkyNZ
Posts: 68
Joined: Tue Feb 06, 2024 5:05 am
Contact:

Re: Building BASIC4 source

Post by SparkyNZ »

Well... after much fiddling around.. I have successfully assembled the BASIC2.zip source with CBMPrgStudio.

I haven't had a chance to byte compare with the original BASIC2.ROM but I'll do that next before trying to use it.

Time for a beer now..
SparkyNZ
Posts: 68
Joined: Tue Feb 06, 2024 5:05 am
Contact:

Re: Building BASIC4 source

Post by SparkyNZ »

OK.. I have 3 bytes of difference left to resolve.. Only 3 bytes in my re-assembled code..

First difference is just the case on the word "Match" vs "match". Probably doesn't matter if no ROM CRC check is done.. but I wonder where that came from. My BBC User Guide lists the error as "Can't match".. so I guess my code is correct. I wonder why the ROM image is different?
Image

The second difference is more of a concern. My code is doing this:
Image

This calls:

Code: Select all

00AFB0  1               ; BBC - Call MOS to wait for keypress
00AFB0  1               ; -----------------------------------
00AFB0  1  A9 81        	LDA #$81
00AFB2  1               LAFB2:
00AFB2  1  A6 2A        	LDX $2A
00AFB4  1  A4 2B        	LDY $2B
00AFB6  1  4C F4 FF     	JMP OSBYTE
It looks like the original ROM is doing this - jumping straight to OSBYTE instead of calling the routine at LAFB2:
Image

Any idea why this difference is here? The only thing I can see different is that $2b is being put into the Y register.

In the Advanced User Guide I can see that OSBYTE call $80 (used in my code) is calling "Read ADC channel or get buffer status".. in both cases. Pages 151 and 152 make no sense to me. I'm reading it as X contains $2A - the size of an input buffer and Y contains..... PASS?? Help!
tom_seddon
Posts: 889
Joined: Tue Aug 30, 2005 12:42 am
Contact:

Re: Building BASIC4 source

Post by tom_seddon »

I thought I'd included this link in my original links, but it looks like I didn't: there might be some more useful info to be found in this collection of BASIC documentation: https://github.com/bitshifters/bbc-docu ... ster/BASIC (The BASIC ROM User Guide and Advanced BASIC ROM User Guide have discussion of the BASIC workspace layout and useful entry points. BBCMicroCompendium has a complete disassembly of BASIC II.)
SparkyNZ wrote: Sun Feb 11, 2024 12:59 am First difference is just the case on the word "Match" vs "match". Probably doesn't matter if no ROM CRC check is done.. but I wonder where that came from. My BBC User Guide lists the error as "Can't match".. so I guess my code is correct. I wonder why the ROM image is different?
Image
The BBC Micro Compendium lists it as "Can't Match", suggesting the ROM image is correct and this error message is just capitalized inconsistently.

(There is no CRC check or anything, so there's no harm in fixing this...)
SparkyNZ wrote: Sun Feb 11, 2024 12:59 am Any idea why this difference is here? The only thing I can see different is that $2b is being put into the Y register.
Only X is an input for OSBYTE $80 on the 8-bit BBC Micro series, so only the bottom 8 bits of the ADVAL operand are relevant.

Presumably Y is an input for OSBYTE $80 on at least one of the other targets that this build of BASIC supports? So you need to load Y as well, so that you can pass 16 bits of data to OSBYTE $80.

--Tom
SparkyNZ
Posts: 68
Joined: Tue Feb 06, 2024 5:05 am
Contact:

Re: Building BASIC4 source

Post by SparkyNZ »

tom_seddon wrote: Sun Feb 11, 2024 2:19 pm BBCMicroCompendium has a complete disassembly of BASIC II.)
This Compendium looks really helpful - especially from page 189 and the likes. I found the keyboard input buffer in the BASIC ROM User Guide but yeah.. it is a bit of a mission when the info seems to be spread across multiple places.

I recently went through the exercise of making a Vic20 emulator to follow through what the Kernal and BASIC ROM were doing so I'll make use of the same source and see how far the execution (with diassembly) gets before crashing or simply looping. I'd like to see some read accesses between $700-7ff in there.

The Vic was relatively straight forward. It was easy enough to fill the keyboard buffer and execute lines of BASIC. Supporting actual keypresses with IRQ/NMI interrupts was a bit more fiddly but I'm not intending to emulate the BBC here so I'll try and stub in as little as possible.

I did of course load the Vic Kernel into memory too so it had pretty much everything it needed in the 64K address space. I can't see BBC BASIC kicking into life without vectors and the likes being set up first though. I'm sure the Kernel (MOS?) would normally intialise BASIC in some way but I guess I'll find out :-)

Update: I have had a bit of a play getting the ROM into my "emulator". First thing I notice is that the BASIC seems to make a lot of direct calls to OSBYTE :-) Haha.. This is actually quite different from the CBM BASIC. Maybe the CBM (Microsoft?) BASIC has more indirection and configurability .. and perhaps this is why its slower than BBC BASIC in general?

So.. I wonder if I just need to implement OSBYTE calls or if there are other MOS calls that the BASIC calls as well? I guess we'll find out. I'm quite excited in a way..
User avatar
sweh
Posts: 3314
Joined: Sat Mar 10, 2012 12:05 pm
Location: 07410 New Jersey
Contact:

Re: Building BASIC4 source

Post by sweh »

You might want to look at what Bobbi did for the Apple IIe; "Applecorn" ( https://github.com/bobbimanners/Applecorn ). Basically it emulates all the necessary MOS calls to let unmodified language ROMs run. It's not the same path you're taking, but I suspect there's a lot of helpful hints there!

FWIW, OSBYTE/OSWORD/OSRDCH/OSWRCH etc are the official MOS entry points. These are effectively stub routines that indirect via a vector in page 2 that points to the real routines; eg OSBYTE (&FFF4) is "JMP (&020A)". Different MOS versions will have &020A point to different locations, and programs can even modify the value to point to their own handler to add/modify functionality.

So it's not surprising BASIC calls them directly; that's how it's meant to work!
Rgds
Stephen
SparkyNZ
Posts: 68
Joined: Tue Feb 06, 2024 5:05 am
Contact:

Re: Building BASIC4 source

Post by SparkyNZ »

sweh wrote: Mon Feb 12, 2024 1:43 pm You might want to look at what Bobbi did for the Apple IIe; "Applecorn" ( https://github.com/bobbimanners/Applecorn ). Basically it emulates all the necessary MOS calls to let unmodified language ROMs run. It's not the same path you're taking, but I suspect there's a lot of helpful hints there!

FWIW, OSBYTE/OSWORD/OSRDCH/OSWRCH etc are the official MOS entry points. These are effectively stub routines that indirect via a vector in page 2 that points to the real routines; eg OSBYTE (&FFF4) is "JMP (&020A)". Different MOS versions will have &020A point to different locations, and programs can even modify the value to point to their own handler to add/modify functionality.

So it's not surprising BASIC calls them directly; that's how it's meant to work!
Heh I'll take all the help I can get - thanks. The odd hint here and there is great - gives me different sections of the 3 main books to look at.

I think I'd better grab a complete RAM/ROM snapshot so I can refer to memory location content - I can't seem to get BeebEm to write anything out though. Any suggestions? I don't mind which emulator I run to grab a memory snapshot.

Code: Select all

file w 0000 65536 BBC.mem
Image

B-em may be an option.. I can't see any file dump commands in the debugger help but maybe the source can be quickly hacked to serve my purpose :-) Nah.. I can't be bothered to fight with Allegro..
SparkyNZ
Posts: 68
Joined: Tue Feb 06, 2024 5:05 am
Contact:

Re: Building BASIC4 source

Post by SparkyNZ »

tom_seddon wrote: Sun Feb 11, 2024 2:19 pm I thought I'd included this link in my original links, but it looks like I didn't: there might be some more useful info to be found in this collection of BASIC
Hey Tom. I've just built your b2 emu on Linux (don't have access to my Windows machine at the moment).

I've managed to save 64k of memory to file.. but I'm not seeing 6C 02 0A at FFF4 as I expected. (or 6C 0A 02 if I have the bytes the wrong way around).

Code: Select all

000ffe0 106c c902 d00d a907 200a ffee 0da9 0e6c
000fff0 6c02 020c 0a6c 6c02 0208 0d00 d9cd dc1c
Do I need a different Hardware config from the default ones provided in b2? I was expecting to see a Model B Basic 2 32k system somewhere.. Maybe that's why things are different?

Shouldn't I be seeing the same 3 bytes sweh mentioned previously?
sweh wrote: Mon Feb 12, 2024 1:43 pm eg OSBYTE (&FFF4) is "JMP (&020A)
Am I using the wrong hardware config?
User avatar
sweh
Posts: 3314
Joined: Sat Mar 10, 2012 12:05 pm
Location: 07410 New Jersey
Contact:

Re: Building BASIC4 source

Post by sweh »

FWIW, from inside the emulator you can verify the contents with something like

Code: Select all

>PRINT ~!&FFF4 AND &FFFFFF
    020A6C
>
Rgds
Stephen
Post Reply

Return to “development tools”