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

Basic Fails When Assembled With CPU_6309 #14

Open
jason6502 opened this issue Aug 16, 2023 · 1 comment
Open

Basic Fails When Assembled With CPU_6309 #14

jason6502 opened this issue Aug 16, 2023 · 1 comment

Comments

@jason6502
Copy link

This is on a simple HD6309-based SBC with 48K RAM (minus some I/O space) and 16K ROM at 0xC000-0xFFFF.

My build command line:

% asm6809 -3S --define BASEADDR=0xC000 --define SBC09=1 --define NATIVE --define CPU_6309 -o sbc6809bas.srec 6809bas.asm

Execute one of the generic ASCII Mandelbrot programs:

SBC6309N

>10 FOR Y=-12 TO 12
>20 FOR X=-39 TO 39
>30 CA=X*0.0458
>40 CB=Y*0.08333
>50 A=CA
>60 B=CB
>70 FOR I=0 TO 15
>80 T=A*A-B*B+CA
>90 B=2*A*B+CB
>100 A=T
>110 IF (A*A+B*B)>4 GOTO 200
>120 NEXT I
>130 PRINT " ";
>140 GOTO 210
>200 IF I>9 THEN I=I+7
>205 PRINT CHR$(48+I);
>210 NEXT X
>220 PRINT
>230 NEXT Y
>                                                                                                                       
>RUN                                                                                                                    
0                                                                                                                       
>

Changing the build line to specify --define CPU_6809 results in the correct output.

There are about 70 sections in the code where modifications for the 6309 have been made. If I find the culprit, I will post a followup here. However, given the small impact to performance of the changes (2-3%), it's not a high priority for me). Just wanted to document the issue.

@dominicbeesley
Copy link
Owner

Sorry, I only just spotted this - I will try and dig out my 6809/6309 debugging stuff this week and have a look. It could well be the use of GOTO's which I think have 6309 tweaks but I've probably not tested as well as I could.

D

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

No branches or pull requests

2 participants