I've been attempting to run an old 1983 BBC Micro User program taken from a listing in said magazine. I've typed it all in, but it contains a PROC that jumps into assembly code (which I freely confess I don't understand). The problem I have is that the program is throwing up syntax errors when it gets to that PROC, but I don't know where to start in terms of debugging it. Is there anyone here who might be able to shed some light on (a) what this assembly language is doing and (b) what might be wrong with it and/or if there's a way to achieve the same goal but without having to go into assembly code?
(Apologies if this sounds like a dim-witted question, I'm still learning.)
What version of BBC BASIC are you trying to run that program under?
If you are trying to run the program under 'BBC BASIC for Windows' or 'BBC BASIC for SDL 2.0' then it couldn't possibly work because their built-in assemblers don't understand 6502 assembly language (the BBC Micro is based on the 6502 CPU, whereas PCs and Macs are based on Intel or ARM processors which use entirely different, mutually incompatible instruction sets).
If you want that program to run on a PC or Mac, then you will need an BBC Micro emulator (my personal favourite is BeebEm, although B-em is also excellent).
Thank you for clearing this up for me, David. I was indeed attempting to run the program under BB4W and so your explanation makes perfect sense. I'll try it using BeebEm (which I agree is a very good emulator) and see how I get on.
Not sure what you are asking. As far as I'm aware there isn't a version of BBC4SDL with a 6502 assembler built in.
It's possible to write transcompilers (which take a program in one language and translate it into another language), so I guess you could write one which converted the 6502 assembler into (say) x86 code to run on a PC, but it wouldn't be easy! Since BBC4SDL is a good general purpose language it would be possible to do it in BBC4SDL, but I'm not sure it would be worth it unless you had a lot of programs you wanted to translate.
These days computers are so much faster it would probably be easier, and acceptably fast, simply to rewrite the assembler sections in BBC BASIC.
Happy to be corrected if anyone has a better opinion!
DDRM wrote: ↑Tue 31 Aug 2021, 10:05...These days computers are so much faster it would probably be easier, and acceptably fast, simply to rewrite the assembler sections in BBC BASIC...
That might be simply automated - in BBC Basic.
IIRC the 6502 instruction set is simple compared to even the Z80, let alone the x86.
Started using BASIC circa 1981 with CP/M, Video Genie, Sinclair ZX81, Acorn Atom, and progressed with ZX Spectrum, BBC Micro and Sinclair QL, Cambridge Z88, DOS, Windows. Wrote A-level project using school's BBC Micro with dual 800K floppy drive.