BBC basic assembler and tube

bbc micro/electron/atom/risc os coding queries and routines
Post Reply
wemb
Posts: 32
Joined: Fri Aug 07, 2020 5:41 pm
Contact:

BBC basic assembler and tube

Post by wemb »

So - probably something obvious I'm misunderstanding..

I've added a PiTubeDirect to my BBC master - and it's great. But I understood that when this is setup, the applications, such as the BBC interpreter will run on the co-processor, but the built-in CPU from the master is used to do I/O tasks. This makes a lot of sense with the behaviour of different Tube CPUs. e..g the 6502 co-processors and their derivatives all run the Basic interpreter, but the z80 one, for instance, does not.

However, but confused about what happens with the BBC Basic built-in assembler. The master's native cpu, the 65SC12 - has some opcodes that the 6502 does not. E.g. BRA

When a write a small program that skips over a call to OSASCI using a BRA to jump over it, it works as expected - but with the PiTube set to emulator 6502 - the same code also works in the same way - the BRA instruction is honoured. What's going on here? The BASIC appears to be running on the co-processor, but is the assembled MC running on the Master's native CPU?

Dave
User avatar
SKS1
Posts: 330
Joined: Sat Sep 19, 2020 12:04 am
Location: Highland Perthshire
Contact:

Re: BBC basic assembler and tube

Post by SKS1 »

wemb wrote: Wed May 08, 2024 11:34 am I've added a PiTubeDirect to my BBC master - and it's great. But I understood that when this is setup, the applications, such as the BBC interpreter will run on the co-processor, but the built-in CPU from the master is used to do I/O tasks. This makes a lot of sense with the behaviour of different Tube CPUs. e..g the 6502 co-processors and their derivatives all run the Basic interpreter, but the z80 one, for instance, does not.

However, but confused about what happens with the BBC Basic built-in assembler. The master's native cpu, the 65SC12 - has some opcodes that the 6502 does not. E.g. BRA

When a write a small program that skips over a call to OSASCI using a BRA to jump over it, it works as expected - but with the PiTube set to emulator 6502 - the same code also works in the same way - the BRA instruction is honoured. What's going on here? The BASIC appears to be running on the co-processor, but is the assembled MC running on the Master's native CPU?
All 6502-based second processors were CMOS.
Miserable old curmudgeon who still likes a bit of an ARM wrestle now and then. Pi 4, 3, ARMX6, SA Risc PC, A540, A440
User avatar
lovebug
Posts: 1763
Joined: Sun Jan 31, 2021 5:07 pm
Location: Magrathea
Contact:

Re: BBC basic assembler and tube

Post by lovebug »

the machine code will be running on the 2nd processor

it looks like pitube is emulating the 65c02 if it allows BRA

im just having a look through the source code here https://github.com/hoglet67/PiTubeClien ... 5tubeasm.S
Image Image Image Image
wemb
Posts: 32
Joined: Fri Aug 07, 2020 5:41 pm
Contact:

Re: BBC basic assembler and tube

Post by wemb »

Ah, yes, that's it - I have a feeling the msg on start of the pitube in 65c02 mode (or some of them, there's several varients/speed options) may have just reported '6502' on boot up. That must have thrown me - yeah- looking at the project mage, they're all the 65c02 - my bad. Thanks!
User avatar
hoglet
Posts: 12683
Joined: Sat Oct 13, 2012 7:21 pm
Location: Bristol
Contact:

Re: BBC basic assembler and tube

Post by hoglet »

lovebug wrote: Wed May 08, 2024 11:47 am im just having a look through the source code here https://github.com/hoglet67/PiTubeClien ... 5tubeasm.S
That's the wrong place.

You need to be looking here:
https://github.com/hoglet67/PiTubeDirect

All of the "6502" Co Processors in PiTubeDirect implement the 65C02 (CMOS) instruction set.

Dave
User avatar
lovebug
Posts: 1763
Joined: Sun Jan 31, 2021 5:07 pm
Location: Magrathea
Contact:

Re: BBC basic assembler and tube

Post by lovebug »

hoglet wrote: Wed May 08, 2024 12:15 pm That's the wrong place.
You need to be looking here:
https://github.com/hoglet67/PiTubeDirect
All of the "6502" Co Processors in PiTubeDirect implement the 65C02 (CMOS) instruction set.
Dave
oops :oops: brain obviously not awake ! thanks
Image Image Image Image
Post Reply

Return to “programming”