Page 4 of 5
Re: ehBasic on 65816
Posted: Wed May 08, 2019 2:13 pm
by SpaceCoaster
The link at
http://sbc.rictor.org/download/EhBASIC.zip seems to be suffering from bit rot.
Does anyone have a copy of EhBASIC modified for 65816 native mode?
Cheers,
Derek
Re: ehBasic on 65816
Posted: Thu May 09, 2019 11:39 am
by 8BIT
Hi Derek,
Give me a day or two, and I'll dig up my latest copy and post it here for you.
thanks!
Daryl
Re: ehBasic on 65816
Posted: Thu May 09, 2019 1:27 pm
by kakemoms
Someone has made a reconstructed web site here:
http://retro.hansotten.nl/lee-davison-web-site/
Re: ehBasic on 65816
Posted: Thu May 09, 2019 7:59 pm
by SpaceCoaster
Thanks kakemoms but the code from 8BIT has modifications for the 65816 in native mode and that is of interest. I do have EhBASIC running at the moment but in 6502 emulation mode.
Re: ehBasic on 65816
Posted: Fri May 10, 2019 3:37 pm
by 8BIT
This is the most recent copy of the source I could find. It was written for my SBC-3. The included change log will help you with the mods I made for native mode.
Be sure to apply these to your existing source vs using mine - I added a "SYS" command to exit back to my Monitor and have my own links to LOAD and SAVE routines. Adding commands can make binary copies of BASIC programs incompatible across builds, as the command TOKENS get changed.
Good luck!
Daryl
Re: ehBasic on 65816
Posted: Sun May 12, 2019 1:53 am
by SpaceCoaster
Thanks Daryl, that looks great. The ChangeLog is just what I needed to understand the differences. I didn't think it would be an issue at all and then the stack initialization was mentioned and it made me wonder what else is lurking.
Cheers,
Derek
Re: ehBasic on 65816
Posted: Sun Aug 04, 2019 11:02 am
by handyandy
I looked over the EhBasic source and I don't see any explicit switch to native mode in the source code.
This isn't necessarily a problem for a 65816 as the fix for stack initialization works in native or emulation
mode. There doesn't seem to be any switches to 16 bit accumulator or index registers just 8 bit registers.
I saw some places where:
LDA #0
STA ...
could be replaced with:
STZ ...
Cheers,
Andy
Re: ehBasic on 65816
Posted: Sun Aug 04, 2019 3:08 pm
by 8BIT
Hi Andy,
On my system, it was put into native mode right after power up and stayed there. As for other optimizations, I did not do any. I only made the changes necessary for it to run in native mode. There are certainly many changes that can be made to improve performance on a 65816. Lee had written this for an NMOS 6502, so there won't be any STZ commands present, but they could be replaced for 65c02 and 65816 operation.
thanks!
Daryl
Re: ehBasic on 65816
Posted: Sun Aug 04, 2019 5:22 pm
by barrym95838
I think floobydust (Kevin M.) has already successfully implemented many 65c02 improvements to ehBASIC, but I'm link-challenged at the moment.
Re: ehBasic on 65816
Posted: Mon Aug 05, 2019 5:28 am
by floobydust
I think floobydust (Kevin M.) has already successfully implemented many 65c02 improvements to ehBASIC, but I'm link-challenged at the moment.
True... I made quite a few changes to the code. It only runs on a CMOS processor now as a result. One link for download is here:
viewtopic.php?f=5&t=5346&start=15#p63899
Re: ehBasic on 65816
Posted: Tue Jul 28, 2020 12:17 am
by tokafondo
I think floobydust (Kevin M.) has already successfully implemented many 65c02 improvements to ehBASIC, but I'm link-challenged at the moment.
True... I made quite a few changes to the code. It only runs on a CMOS processor now as a result. One link for download is here:
viewtopic.php?f=5&t=5346&start=15#p63899
Hi. I'd like to know what exactly should I do to compile this 65816 compliant EhBASIC version, to run it in my W65C265SXB clone.
I've read that there are several changes made, and at one point it was available for download, but now it's only the source code linked above, and I don't know if the changes are already applied, or if I should apply the changes listeed in changelog.log.
Thanks.
Re: ehBasic on 65816
Posted: Tue Jul 28, 2020 8:02 am
by drogon
I think floobydust (Kevin M.) has already successfully implemented many 65c02 improvements to ehBASIC, but I'm link-challenged at the moment.
True... I made quite a few changes to the code. It only runs on a CMOS processor now as a result. One link for download is here:
viewtopic.php?f=5&t=5346&start=15#p63899
Hi. I'd like to know what exactly should I do to compile this 65816 compliant EhBASIC version, to run it in my W65C265SXB clone.
I've read that there are several changes made, and at one point it was available for download, but now it's only the source code linked above, and I don't know if the changes are already applied, or if I should apply the changes listeed in changelog.log.
Thanks.
Just assemble it for the '816 - mostly to make sure it's not using the few instructions that are in the C02 that are not in the '816. (that tripped me up initially with some of my own code when I moved the the '816).
It won't take advantage of any '816 extra op-codes though, but it will work in Bank 0.
-Gordon
Re: ehBasic on 65816
Posted: Tue Jul 28, 2020 11:56 am
by tokafondo
Just assemble it for the '816 - mostly to make sure it's not using the few instructions that are in the C02 that are not in the '816. (that tripped me up initially with some of my own code when I moved the the '816).
It won't take advantage of any '816 extra op-codes though, but it will work in Bank 0.
-Gordon
Thanks. I'm trying several TASS versions and my results are that I could only compile the source "as is" with 64tass1.46-r38, and leaving out basldsv.asm, because of errors:
WITH .include basldsv.asm
Code: Select all
S:\Proyecto Ordenador\EhBASIC>..\64tass-1.46-r38\64tass_1.46_r38.exe -x -W basic222.asm -o ehbasic.out
6502/65C02 Turbo Assembler Version 1.3 Copyright (c) 1997 Taboo Productions
6502/65C02 Turbo Assembler Version 1.35 ANSI C port by [BiGFooT/BReeZe^2000]
6502/65C02/65816/CPU64/DTV TASM Version 1.46 r38 Fixing by Soci/Singular 2001-2010
64TASS comes with ABSOLUTELY NO WARRANTY; This is free software, and you
are welcome to redistribute it under certain conditions; See LICENSE!
Assembling file: basic222.asm
basldsv.asm:13: (basic222.asm:22) Not defined print2byte "jsr print2byte"
basldsv.asm:17592186044430: (basic222.asm:17592186044438) Not defined print_cr "jsr print_cr"
basldsv.asm:17592186044437: (basic222.asm:17592186044438) Not defined print2byte "jsr print2byte"
basldsv.asm:17592186044438: (basic222.asm:17592186044438) Not defined print_cr "jsr print_cr"
Error messages: 4
Warning messages: None
Passes: 2
Range: $000000-$00001c
WITH
OUT .include basldsv.asm
Code: Select all
S:\Proyecto Ordenador\EhBASIC>..\64tass-1.46-r38\64tass_1.46_r38.exe -x -W basic222.asm -o ehbasic.out
6502/65C02 Turbo Assembler Version 1.3 Copyright (c) 1997 Taboo Productions
6502/65C02 Turbo Assembler Version 1.35 ANSI C port by [BiGFooT/BReeZe^2000]
6502/65C02/65816/CPU64/DTV TASM Version 1.46 r38 Fixing by Soci/Singular 2001-2010
64TASS comes with ABSOLUTELY NO WARRANTY; This is free software, and you
are welcome to redistribute it under certain conditions; See LICENSE!
Assembling file: basic222.asm
Error messages: None
Warning messages: None
Passes: 2
Range: $009000-$00b840
As this version of TASS only output one format (that I can't figure which is), I used utils from s-record.com, to convert the output binary file to a "s-record" that I will be able to push through internal Mensch monitor:
Code: Select all
S:\Proyecto Ordenador\EhBASIC>..\bin2srec.exe ehbasic.out > ehbasic.s28
BIN2SREC 1.51 - Convert binary to Motorola S-Record file.
Copyright (c) 2000-2019 Ant Goffart - http://www.s-record.com/
Input binary file: ehbasic.out
Begin address = 0h
End address = 2842h
Address offset = 0h
Maximum address = 2842h
Address bytes = 2
Processing complete
I'm not actually sure if the
ehbasic.out that I got earlier is the right one to be converted to "s-record" type. Also, the addresses mentioned in both TASS output and the previous output don't seem right to me. Should I add
-b 0300 like this?? :
Code: Select all
S:\Proyecto Ordenador\EhBASIC>..\bin2srec.exe -b 0300 ehbasic.out > ehbasic.s28
BIN2SREC 1.51 - Convert binary to Motorola S-Record file.
Copyright (c) 2000-2019 Ant Goffart - http://www.s-record.com/
Input binary file: ehbasic.out
Begin address = 300h
End address = 2842h
Address offset = 300h
Maximum address = 2842h
Address bytes = 2
Processing complete
Thanks for your help.
Re: ehBasic on 65816
Posted: Tue Jul 28, 2020 3:52 pm
by BitWise
Re: ehBasic on 65816
Posted: Tue Jul 28, 2020 5:02 pm
by tokafondo
Thank you very, very much!!!
I'm having a problem that is, that the XMODEM transfer is VERY slow.

- Portapapeles01.png (9.94 KiB) Viewed 15021 times
The garbage you see in the first line is that this COM port was using 9600 and then changed it to 19200.
Tinkering with the '265 hacker does actually works, but the XMODEM transfer stays like the picture for a while and then gets interrupted...
I'm using another FTDI chip for the second UART. Maybe changing to a prolific 2303...