### 1983 program listing

Posted:

**Sun 03 Feb 2019, 17:34**Hi,

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.)

The PROC in question is defined below:

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.)

The PROC in question is defined below:

Code: Select all

```
780 DEFPROCAS : DIM ZZ%352 : FOR C%=0 TO 2 STEP 2 : P%=ZZ% : [OPT C%
790 .RT LDA&71:CMP#3:BMIR1:BEQR2:RTS
800 .R2 LDA&70:CMP#72:BMIR1:RTS
810 .R1 LDA&70:CLC:ADC#20:STA&70:LDA&71:ADC#0:STA&71:LDA#128:STA&7F:JSRM1
820 JSRG1:LDA#20:STA&7F:JSRM2:LDA#4:STA&7F:JSRM3:LDA#85:STA&7F:JSRM4
830 LDA#88:STA&7F:JSRM1:LDA#18:JSR&FFEE:LDA#0:JSR&FFEE:LDA#0:JSR&FFEE:LDA#60
840 STA&7F:JSRM2:LDA#4:STA&7F:JSRM3:LDA#40:STA&7F:JSRM2:LDA#85:STA&7F:JSRM3:RTS
850 .LT LDA#1:CMP&71:BMIL1:BEQL2:RTS
860 .L2 LDA#174:CMP&70:BMIL1:RTS
870 .L1 LDA&70:SEC:SBC#20:STA&70:LDA&71:SBC#0:STA&71:LDA#88:STA&7F:JSRM1:JSRG1
880 LDA#40:STA&7F:JSRM2:LDA#4:STA&7F:JSRM3:LDA#20:STA&7F:JSRM2:LDA#85:STA&7F
890 JSRM3:JSRG1:LDA#128:STA&7F:JSRM1
900 LDA#18:JSR&FFEE:LDA#0:JSR&FFEE:JSR&FFEE:LDA#4:STA&7F:JSRM4
910 LDA&70:CLC:ADC#20:STA&80:LDA&71:ADC#0:STA&81:LDA#85:STA&7F:JSRM3:RTS
920 .M1 LDA#25:JSR&FFEE:LDA#4:JSR&FFEE:LDA&7F:JSR&FFEE:LDA#2:JSR&FFEE:LDA#0:JSR&FFEE:JSR&FFEE:RTS
930 .G1 LDA#18:JSR&FFEE:LDA#0:JSR&FFEE:LDA#15:JSR&FFEE:RTS
940 .M2 LDA&70:SEC:SBC&7F:STA&B0:LDA&71:SBC#0:STA&81:RTS
950 .M3 LDA#25:JSR&FFEE:LDA&7F:JSR&FFEE:LDA&80:JSR&FFEE:LDA&81:JSR&FFEE:LDA#160:JSR&FFEE:LDA#0:JSR&FFEE:RTS
960 .M4 LDA#25:JSR&FFEE:LDA&7F:JSR&FFEE:LDA&70:JSR&FFEE:LDA&71:JSR&FFEE:LDA#160:JSR&FFEE:LDA#0:JSR&FFEE:RTS
970 ] : NEXT : ENDPROC
```