INPUT Magazine Listing / Electron Error ?

discussion of beeb/electron applications, languages, utils and educational s/w
BeebMan2018
Posts: 117
Joined: Sun Nov 04, 2018 3:01 am
Contact:

INPUT Magazine Listing / Electron Error ?

Post by BeebMan2018 » Sun May 12, 2019 7:46 pm

Hey guys,

I'm trying to learn Acorn Basic on an Electron and have typed in some programs from the 1st Issue of INPUT Magazine. However i get errors and funny shit happening. I've identified some typing errors but am currently getting error " at line 110" there seems to be a space at the start of the error but no actual word so the error seems incomplete. Can anyone elaborate on this error ?

User avatar
CMcDougall
Posts: 6690
Joined: Wed Feb 02, 2005 3:13 pm
Location: Shadow in a Valley of Scotland
Contact:

Re: INPUT Magazine Listing / Electron Error ?

Post by CMcDougall » Sun May 12, 2019 7:50 pm

INPUT Magazine was not the best BITD, always full of errs :roll:

plus it was more for the beeb, NOT the elk, as no Mode7

try The Micro User !

or in your case, Electron User!!
ImageImageImage

User avatar
flaxcottage
Posts: 3673
Joined: Thu Dec 13, 2012 8:46 pm
Location: Derbyshire
Contact:

Re: INPUT Magazine Listing / Electron Error ?

Post by flaxcottage » Sun May 12, 2019 7:52 pm

Can you list lines 80 to 110?

We might be able to spot something from the listing.
- John

Image

BeebMan2018
Posts: 117
Joined: Sun Nov 04, 2018 3:01 am
Contact:

Re: INPUT Magazine Listing / Electron Error ?

Post by BeebMan2018 » Sun May 12, 2019 8:12 pm

I can do better than that :)

Follow this link :- https://archive.org/details/Input_Vol_1 ... B/page/n13

Then look at pages 11 and 12. I'm trying to define a tank. The magazine format means lines are not typed in all at once in sequence but are dealt with section at a time explaining what they do so line 110 is not entered until page 12

User avatar
0xC0DE
Posts: 264
Joined: Tue Mar 19, 2019 7:52 pm
Location: The Netherlands
Contact:

Re: INPUT Magazine Listing / Electron Error ?

Post by 0xC0DE » Sun May 12, 2019 8:38 pm

Have you been using $0A00 instead of $0E00 throughout the entire program?
0xC0DE
Visit my YouTube channel featuring my demos for Acorn Electron and BBC Micro

BeebMan2018
Posts: 117
Joined: Sun Nov 04, 2018 3:01 am
Contact:

Re: INPUT Magazine Listing / Electron Error ?

Post by BeebMan2018 » Sun May 12, 2019 8:40 pm

CMcDougall wrote:
Sun May 12, 2019 7:50 pm
INPUT Magazine was not the best BITD, always full of errs :roll:

plus it was more for the beeb, NOT the elk, as no Mode7

try The Micro User !

or in your case, Electron User!!
I will but I bought all the input magazines as a kid or first half of them before I even got my first Computer which was an MSX. Which isnt covered by the magazine. So I've held on to them all this time and only got my first Electron a few months ago as i want to learn basic. I could not find any resources for the MSX back in the 80's that really taught the MSX Basic. Oh well ! I will look for the Electron User mags though. Thanks

BeebMan2018
Posts: 117
Joined: Sun Nov 04, 2018 3:01 am
Contact:

Re: INPUT Magazine Listing / Electron Error ?

Post by BeebMan2018 » Sun May 12, 2019 8:44 pm

0xC0DE wrote:
Sun May 12, 2019 8:38 pm
Have you been using $0A00 instead of $0E00 throughout the entire program?
Im not sure i see that in the listing. I don't have disk drive so stuck with &D00 in preference to &A00 which is for the disk drive ?

User avatar
0xC0DE
Posts: 264
Joined: Tue Mar 19, 2019 7:52 pm
Location: The Netherlands
Contact:

Re: INPUT Magazine Listing / Electron Error ?

Post by 0xC0DE » Sun May 12, 2019 8:52 pm

The error is almost certainly generated by the CALL &D00 at line 110. It would greatly help if you could paste your actual listing here (not from the magazine but the one you've typed in so far). Even a screenshot of your listing if you don't have a way of easily transferring it out of your Electron :mrgreen:
0xC0DE
Visit my YouTube channel featuring my demos for Acorn Electron and BBC Micro

BeebMan2018
Posts: 117
Joined: Sun Nov 04, 2018 3:01 am
Contact:

Re: INPUT Magazine Listing / Electron Error ?

Post by BeebMan2018 » Sun May 12, 2019 9:22 pm

0xC0DE wrote:
Sun May 12, 2019 8:52 pm
The error is almost certainly generated by the CALL &D00 at line 110. It would greatly help if you could paste your actual listing here (not from the magazine but the one you've typed in so far). Even a screenshot of your listing if you don't have a way of easily transferring it out of your Electron :mrgreen:
Hi, Im not sure if this will work but ive uploaded a photo to Photobucket ! On a side note can anyone recommend a good image hosting service thats free and fast. Photobucket used to be quite good but its currently NFFP Not Fit For Purpose and i need something thats fast and simple as i dont have time to waste and its a complete faf. Anyway the immage is here :-

https://i265.photobucket.com/albums/ii2 ... M_3472.jpg

User avatar
0xC0DE
Posts: 264
Joined: Tue Mar 19, 2019 7:52 pm
Location: The Netherlands
Contact:

Re: INPUT Magazine Listing / Electron Error ?

Post by 0xC0DE » Sun May 12, 2019 9:37 pm

Is the FramePrint routine loaded and active at address &D00? Otherwise CALL &D00 will definitely not work.
Last edited by 0xC0DE on Sun May 12, 2019 9:37 pm, edited 1 time in total.
0xC0DE
Visit my YouTube channel featuring my demos for Acorn Electron and BBC Micro

User avatar
SimonSideburns
Posts: 378
Joined: Mon Aug 26, 2013 8:09 pm
Location: Purbrook, Hampshire
Contact:

Re: INPUT Magazine Listing / Electron Error ?

Post by SimonSideburns » Sun May 12, 2019 9:58 pm

BeebMan2018 wrote:
Sun May 12, 2019 9:22 pm
Hi, Im not sure if this will work but ive uploaded a photo to Photobucket ! On a side note can anyone recommend a good image hosting service thats free and fast. Photobucket used to be quite good but its currently NFFP Not Fit For Purpose and i need something thats fast and simple as i dont have time to waste and its a complete faf. Anyway the immage is here :-

https://i265.photobucket.com/albums/ii2 ... M_3472.jpg
You can add pictures to posts in this forum. Ok, they may be size restricted, but a simple resize should be fine for all but the smallest text.
I'm writing a game where you can change your character from a Wizard to a monkey to a cat.

Well, Imogen that!

BeebMan2018
Posts: 117
Joined: Sun Nov 04, 2018 3:01 am
Contact:

Re: INPUT Magazine Listing / Electron Error ?

Post by BeebMan2018 » Sun May 12, 2019 9:59 pm

0xC0DE wrote:
Sun May 12, 2019 9:37 pm
Is the FramePrint routine loaded and active at address &D00? Otherwise CALL &D00 will definitely not work.
I may be having some issue there ! I've tried saving the frameprint routine and loading it but got bad program error. I've retyped it and changed the filename from FramePrint to MACHCODE as Im guessing that there is a limit on the number of characters you can use in a file name ? Please confirm !

I've saved the MACHCODE on a new tape using the command *SAVE"MACHCODE"0D00+59. This seemed to save it correctly and i then loaded what i call TANKFROG into memory and run it. It seemed to run but displayed only a blank screen and on pressing any of the move keys it crashes. When i run it again i then get the error "at line 110"

Grrr.

BeebMan2018
Posts: 117
Joined: Sun Nov 04, 2018 3:01 am
Contact:

Re: INPUT Magazine Listing / Electron Error ?

Post by BeebMan2018 » Sun May 12, 2019 10:02 pm

SimonSideburns wrote:
Sun May 12, 2019 9:58 pm
BeebMan2018 wrote:
Sun May 12, 2019 9:22 pm
Hi, Im not sure if this will work but ive uploaded a photo to Photobucket ! On a side note can anyone recommend a good image hosting service thats free and fast. Photobucket used to be quite good but its currently NFFP Not Fit For Purpose and i need something thats fast and simple as i dont have time to waste and its a complete faf. Anyway the immage is here :-

https://i265.photobucket.com/albums/ii2 ... M_3472.jpg
You can add pictures to posts in this forum. Ok, they may be size restricted, but a simple resize should be fine for all but the smallest text.
Where do i do that ?

User avatar
SimonSideburns
Posts: 378
Joined: Mon Aug 26, 2013 8:09 pm
Location: Purbrook, Hampshire
Contact:

Re: INPUT Magazine Listing / Electron Error ?

Post by SimonSideburns » Sun May 12, 2019 10:03 pm

BeebMan2018 wrote:
Sun May 12, 2019 10:02 pm
Where do i do that ?
The Attachments area below the text entry area, then you can place them inline into the post at the current cursor position.
I'm writing a game where you can change your character from a Wizard to a monkey to a cat.

Well, Imogen that!

User avatar
SimonSideburns
Posts: 378
Joined: Mon Aug 26, 2013 8:09 pm
Location: Purbrook, Hampshire
Contact:

Re: INPUT Magazine Listing / Electron Error ?

Post by SimonSideburns » Sun May 12, 2019 10:05 pm

Like this:
Star Dot Forums - Attachments.PNG
I'm writing a game where you can change your character from a Wizard to a monkey to a cat.

Well, Imogen that!

BeebMan2018
Posts: 117
Joined: Sun Nov 04, 2018 3:01 am
Contact:

Re: INPUT Magazine Listing / Electron Error ?

Post by BeebMan2018 » Sun May 12, 2019 10:10 pm

SimonSideburns wrote:
Sun May 12, 2019 10:05 pm
Like this:

Star Dot Forums - Attachments.PNG
Cool Thx
Attachments
SAM_3472.JPG

User avatar
0xC0DE
Posts: 264
Joined: Tue Mar 19, 2019 7:52 pm
Location: The Netherlands
Contact:

Re: INPUT Magazine Listing / Electron Error ?

Post by 0xC0DE » Mon May 13, 2019 9:54 am

BeebMan2018 wrote:
Sun May 12, 2019 9:59 pm
0xC0DE wrote:
Sun May 12, 2019 9:37 pm
Is the FramePrint routine loaded and active at address &D00? Otherwise CALL &D00 will definitely not work.
I may be having some issue there ! I've tried saving the frameprint routine and loading it but got bad program error. I've retyped it and changed the filename from FramePrint to MACHCODE as Im guessing that there is a limit on the number of characters you can use in a file name ? Please confirm !

I've saved the MACHCODE on a new tape using the command *SAVE"MACHCODE"0D00+59. This seemed to save it correctly and i then loaded what i call TANKFROG into memory and run it. It seemed to run but displayed only a blank screen and on pressing any of the move keys it crashes. When i run it again i then get the error "at line 110"

Grrr.
Filename doesn't matter. As long as the machine code part is loaded at &D00 when running the main program.
After *LOAD "MACHCODE" D00, what does the following litte program show on your screen? (screenshot please)

Code: Select all

10@%=&020203
20FOR B=0 TO &72
30PRINT ~B":"~B?&D00",";
40NEXT B
0xC0DE
Visit my YouTube channel featuring my demos for Acorn Electron and BBC Micro

User avatar
Elk Towers
Posts: 501
Joined: Sun Apr 23, 2006 2:10 am
Location: Kettering, Northants
Contact:

Re: INPUT Magazine Listing / Electron Error ?

Post by Elk Towers » Mon May 13, 2019 5:42 pm

do you have a plus 1 attached, if you do Page &d00 is the extended vector area for the plus 1.

try relocating/re compiling the machine code to reside at a different location, obviously changing any "call &d00" to whatever place you put the machine code
Nick

BeebMan2018
Posts: 117
Joined: Sun Nov 04, 2018 3:01 am
Contact:

Re: INPUT Magazine Listing / Electron Error ?

Post by BeebMan2018 » Mon May 13, 2019 5:57 pm

0xC0DE wrote:
Mon May 13, 2019 9:54 am
BeebMan2018 wrote:
Sun May 12, 2019 9:59 pm
0xC0DE wrote:
Sun May 12, 2019 9:37 pm
Is the FramePrint routine loaded and active at address &D00? Otherwise CALL &D00 will definitely not work.
I may be having some issue there ! I've tried saving the frameprint routine and loading it but got bad program error. I've retyped it and changed the filename from FramePrint to MACHCODE as Im guessing that there is a limit on the number of characters you can use in a file name ? Please confirm !

I've saved the MACHCODE on a new tape using the command *SAVE"MACHCODE"0D00+59. This seemed to save it correctly and i then loaded what i call TANKFROG into memory and run it. It seemed to run but displayed only a blank screen and on pressing any of the move keys it crashes. When i run it again i then get the error "at line 110"

Grrr.
Filename doesn't matter. As long as the machine code part is loaded at &D00 when running the main program.
After *LOAD "MACHCODE" D00, what does the following litte program show on your screen? (screenshot please)

Code: Select all

10@%=&020203
20FOR B=0 TO &72
30PRINT ~B":"~B?&D00",";
40NEXT B
Any idea why when i try to load this program i get the error Bad Program ?

User avatar
0xC0DE
Posts: 264
Joined: Tue Mar 19, 2019 7:52 pm
Location: The Netherlands
Contact:

Re: INPUT Magazine Listing / Electron Error ?

Post by 0xC0DE » Mon May 13, 2019 5:59 pm

No. It shouldn't. Even after a clean startup of your Electron?
0xC0DE
Visit my YouTube channel featuring my demos for Acorn Electron and BBC Micro

alex_farlie
Posts: 142
Joined: Sun Jul 07, 2013 9:46 pm
Contact:

Re: INPUT Magazine Listing / Electron Error ?

Post by alex_farlie » Mon May 13, 2019 7:34 pm

CMcDougall wrote:
Sun May 12, 2019 7:50 pm
INPUT Magazine was not the best BITD, always full of errs :roll:

plus it was more for the beeb, NOT the elk, as no Mode7

try The Micro User !

or in your case, Electron User!!
Are you sure the machine code portion is entered correctly? When I keyed it in manually in IDA to see what it was doing , I made a number of typo/confusions between HEX and decimal input modes.. :lol:

The machine code once entered properly should work without concern.

Someone else here will probably eventually post a version that's the full assembler source derived.
Last edited by alex_farlie on Mon May 13, 2019 8:18 pm, edited 1 time in total.

User avatar
0xC0DE
Posts: 264
Joined: Tue Mar 19, 2019 7:52 pm
Location: The Netherlands
Contact:

Re: INPUT Magazine Listing / Electron Error ?

Post by 0xC0DE » Mon May 13, 2019 8:10 pm

This is not true. The machine code as typed in from the magazine seems to make sense. No error occurs when I CALL &D00.

This is what the code looks like after disassembling:

Code: Select all

oswrch  = $FFEE

        org     $0D00

        CLC
        LDA     #$E0
        DEX
        BMI     L0D35

        BEQ     L0D0F

        DEX
        BEQ     L0D0D

        ADC     #$09
.L0D0D
        ADC     #$09
.L0D0F
        LDX     #$03
.L0D11
        LDY     #$03
.L0D13
        JSR     oswrch

        CLC
        ADC     #$01
        DEY
        BNE     L0D13

        DEX
        BEQ     L0D34

        PHA
        LDA     #$0A
        JSR     oswrch

        LDA     #$08
        JSR     oswrch

        JSR     oswrch

        JSR     oswrch

        PLA
        JMP     L0D11

.L0D34
        RTS

.L0D35
        LDA     #$20
        LDX     #$03
.L0D39
        LDY     #$03
.L0D3B
        JSR     oswrch

        DEY
        BNE     L0D3B

        DEX
        BEQ     L0D34

        LDA     #$0A
        JSR     oswrch

        LDA     #$08
        JSR     oswrch

        JSR     oswrch

        JSR     oswrch

        LDA     #$20
        JMP     L0D39

In other words, if you haven't made any typing errors then at least the machine code part should work.

And if you inspect the bytes from &D00 in memory (with the little program I gave earlier) its contents should look like this:

memory.png

Example on my Electron (emulator):

screenshot.png.png
Last edited by 0xC0DE on Mon May 13, 2019 8:18 pm, edited 2 times in total.
0xC0DE
Visit my YouTube channel featuring my demos for Acorn Electron and BBC Micro

alex_farlie
Posts: 142
Joined: Sun Jul 07, 2013 9:46 pm
Contact:

Re: INPUT Magazine Listing / Electron Error ?

Post by alex_farlie » Mon May 13, 2019 8:20 pm

0xC0DE wrote:
Mon May 13, 2019 8:10 pm
This is not true. The machine code as typed in from the magazine seems to make sense. No error occurs when I CALL &D00.
Seems I'd made some typos as well, post amended.

BeebMan2018
Posts: 117
Joined: Sun Nov 04, 2018 3:01 am
Contact:

Re: INPUT Magazine Listing / Electron Error ?

Post by BeebMan2018 » Tue May 14, 2019 9:21 am

OK GUYS,

As requested a screenshot of my "MachCode" Listing. I couldn't get it to load so i've typed it in again this morning. I have a few query's.
In line 10 we specify T as &D00 to &D58 In line 40 though we say &D00+59 which is 1 higher than the range we specified in line 10 ?
should there be a question mark before ?T=A in line 20.
In the DATA there appears &D0 appears two times. Should this be the case when everything else is in numbers ? I'm just relearning Machine code and vaguely remember hexadecimal so expect its fine. Just asking.
Attachments
MachCode.JPG

User avatar
0xC0DE
Posts: 264
Joined: Tue Mar 19, 2019 7:52 pm
Location: The Netherlands
Contact:

Re: INPUT Magazine Listing / Electron Error ?

Post by 0xC0DE » Tue May 14, 2019 11:32 am

Before I can help you any further... please compare the output of this little program on your Electron

Code: Select all

10@%=&020203
20FOR B=0 TO &72
30PRINT ~B":"~B?&D00",";
40NEXT B
with this screenshot from my Electron emulator

screenshot.png
screenshot.png (28.91 KiB) Viewed 468 times

They should be the same. Which then means your machine code routine at &D00 will be correct.
0xC0DE
Visit my YouTube channel featuring my demos for Acorn Electron and BBC Micro

BeebMan2018
Posts: 117
Joined: Sun Nov 04, 2018 3:01 am
Contact:

Re: INPUT Magazine Listing / Electron Error ?

Post by BeebMan2018 » Tue May 14, 2019 12:49 pm

0xC0DE wrote:
Tue May 14, 2019 11:32 am
Before I can help you any further... please compare the output of this little program on your Electron

Code: Select all

10@%=&020203
20FOR B=0 TO &72
30PRINT ~B":"~B?&D00",";
40NEXT B
with this screenshot from my Electron emulator


screenshot.png


They should be the same. Which then means your machine code routine at &D00 will be correct.
Hi :)

OK sorry but im a novice. Do i have to load the MachCode program first and then type in your program and run it ? My electron is upstairs in the back room and my pc is downstairs in the living room as i can get internet there. Makes the whole process a bit awkward ! Will try to load the MachCode program i typed this morning and then enter your little program to see what happens in the meantime while i wait for your reply. Thanks for your help BTW. Its awesome we can still get support for a machine thats what ? 35 years old ?

BeebMan2018
Posts: 117
Joined: Sun Nov 04, 2018 3:01 am
Contact:

Re: INPUT Magazine Listing / Electron Error ?

Post by BeebMan2018 » Tue May 14, 2019 1:04 pm

OK Whatever i was thinking didn't work so i reset the Electron and typed your program in and got this :

Could you explain what we just did please ?
Attachments
TEST.JPG

BeebMan2018
Posts: 117
Joined: Sun Nov 04, 2018 3:01 am
Contact:

Re: INPUT Magazine Listing / Electron Error ?

Post by BeebMan2018 » Tue May 14, 2019 1:09 pm

OK I spotted my Typo :
Attachments
TYPO.JPG

BeebMan2018
Posts: 117
Joined: Sun Nov 04, 2018 3:01 am
Contact:

Re: INPUT Magazine Listing / Electron Error ?

Post by BeebMan2018 » Tue May 14, 2019 1:12 pm

NEW OUTPUT

:/ Have i done something wrong or is my Electron Faulty ?
Attachments
OUTPUT.JPG
Last edited by BeebMan2018 on Tue May 14, 2019 1:13 pm, edited 1 time in total.

User avatar
0xC0DE
Posts: 264
Joined: Tue Mar 19, 2019 7:52 pm
Location: The Netherlands
Contact:

Re: INPUT Magazine Listing / Electron Error ?

Post by 0xC0DE » Tue May 14, 2019 1:16 pm

I always welcome new users of the Electron :mrgreen: =D> =D>

OK, step by step instructions.

First, load this BASIC program from your tape:

MachCode.JPG

Then RUN it. This will do 2 things. 1, create a small machine code routine at address &D00, and 2, *SAVE that routine to tape. I noticed you have saved both programs as "MachCode" on your tape which should not be confused! One is the BASIC program mentioned above. The other is the little machine code routine to be loaded at address &D00. Two completely different programs!

Next, do NOT restart the Electron or even press BREAK. Just type NEW to start a new BASIC program. And then type in my little test program:

Code: Select all

10@%=&020203
20FOR B=0 TO &72
30PRINT ~B":"~B?&D00",";
40NEXT B
Save it to tape if you want. Then RUN it. This should PRINT the following numbers on your screen:

screenshot.png
screenshot.png (28.91 KiB) Viewed 445 times

It shows the machine code routine at &D00 in hexadecimal numbers.
Please post a screenshot of what your screen looks like after all these steps.
So we can confirm that your machine code at &D00 is indeed correct.
0xC0DE
Visit my YouTube channel featuring my demos for Acorn Electron and BBC Micro

Post Reply