Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BRA in assembler #119

Closed
ojwb opened this issue Jan 22, 2025 · 1 comment · Fixed by #122
Closed

BRA in assembler #119

ojwb opened this issue Jan 22, 2025 · 1 comment · Fixed by #122

Comments

@ojwb
Copy link
Collaborator

ojwb commented Jan 22, 2025

I noticed 47eaa14 included a change which seems entirely unrelated to the described change:

-                    /ADC|AND|ASL|B(CC|CS|EQ|MI|NE|PL|VC|VS)|BIT|BRK|CL[CDIV]|CMP|CP[XY]|DE[CXY]|EOR|IN[CXY]|JMP|JSR|LD[AXY]|LSR|NOP|ORA|PH[AP]|PL[AP]|RO[LR]|RTI|RTS|SBC|SE[CDI]|ST[AXY]|TA[XY]|TSX|TX[AS]|TYA/,
+                    /ADC|AND|ASL|B(CC|CS|EQ|MI|NE|PL|VC|VS)|BIT|BR[AK]|CL[CDIV]|CMP|CP[XY]|DE[CXY]|EOR|IN[CXY]|JMP|JSR|LD[AXY]|LSR|NOP|ORA|PH[AP]|PL[AP]|RO[LR]|RTI|RTS|SBC|SE[CDI]|ST[AXY]|TA[XY]|TSX|TX[AS]|TYA/,

The change here is BRK -> BR[AK] - i.e. it adds BRA as a valid assembler instruction. However it isn't on the original 6502 and isn't recognised by BBC BASIC II, so doesn't actually work on the emulated BBC B inside Owlet:

https://bbcmic.ro/#%7B%22v%22%3A1%2C%22program%22%3A%22P%25%3D%40%25%3A%5BBRAP%25%3A%5D%22%7D

That seems unhelpful and I'm wondering if this was an accidentally included change?

It could be useful for Owlet to support newer versions of BBC BASIC for people wanting to edit programs to run on a BBC master or even on RISC OS, or if #100 gets implemented, but it seems the version of BBC BASIC to target really should be a configuration setting. Also there's rather more to do than just allow BRA - for 65c12 assembler there are more assembler instructions (at least CLR, PHX, PHY, PLX, PLY, STZ, TRB, TSB); COLOR was added as a synonym for COLOUR at some point; in (or by) RISC OS BASIC V quite a few things new tokens had been added (e.g. CASE...OF...WHEN, ENDIF, WHILE...ENDWHILE, BY, OVERLAY, <<, >>, +=, -=).

@mattgodbolt
Copy link
Owner

That's 100% my fault: I had a Master when I was programming the Beeb so I naturally lean towards the newer opcode - oops!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants