Variable error in Hex entry program
-
- Drutt
- Posts: 4
- Joined: Sun May 05, 2019 6:06 pm
Variable error in Hex entry program
Hi all. My name is Steve. I am a long term Sinclair lover and have a nice collection of hardware including around 4 rubber key 48s, one 48 with a HI/LO keyboard, several interfaces including a Multiface, a MIDI interface mongst other and an Opus Discovery One disc interface (fully working. I love it.)
I have gone from just playimg games to wanting to start learning machine code properly. I have started reading the book "Cracking the code on the ZX Spectrum" by John Wilson.
I have entered a hex entry program which asks for an address which you enter in hex and then start inputting the program. I have entered and checked the entry code but after it asks me for the address (which I do) it then throws me a 2 Variable not found error on line 170. I am hoping someone could help me in finding where the typo is in the program. I've included a copy of it. I've checked it over twice but cant see the fault. Please help ..
Thanks,
Steve.S
I have gone from just playimg games to wanting to start learning machine code properly. I have started reading the book "Cracking the code on the ZX Spectrum" by John Wilson.
I have entered a hex entry program which asks for an address which you enter in hex and then start inputting the program. I have entered and checked the entry code but after it asks me for the address (which I do) it then throws me a 2 Variable not found error on line 170. I am hoping someone could help me in finding where the typo is in the program. I've included a copy of it. I've checked it over twice but cant see the fault. Please help ..
Thanks,
Steve.S
Re: Variable error in Hex entry program
Hi [mention]stevie232323[/mention]
That's a great book. What address are you entering, and what listing are you trying?
Are you typing this in on an emulator? If so upload the .tap file to Dropbox or similar and post it here.
Are you sure it's line 170? That looks like a Gosub?..
Finally, although it's a bit old in the tooth, ZXSpin which is an emulator has a built in assembler which makes things much easier. You also have the option of Pasmo, and other PC based assemblers. I used Pasmo when working through that book.
That's a great book. What address are you entering, and what listing are you trying?
Are you typing this in on an emulator? If so upload the .tap file to Dropbox or similar and post it here.
Are you sure it's line 170? That looks like a Gosub?..
Finally, although it's a bit old in the tooth, ZXSpin which is an emulator has a built in assembler which makes things much easier. You also have the option of Pasmo, and other PC based assemblers. I used Pasmo when working through that book.
-
- Drutt
- Posts: 4
- Joined: Sun May 05, 2019 6:06 pm
Re: Variable error in Hex entry program
Hi [mention]PeterJ[/mention]
Oops. Its line 270!!
Yeah it is a great book. I got a load of Spectrum books and hardware gear in a house clearance a couple of years ago!!
I also got 2 copies of Super Charge your Spectrum.
I'm not a ZX newbie, in fact, my 1st computer was a 1K ZX81 in 1984. I have loads of love for the ZX81 and the Spectrum.
The program is the Spectrum Monitor program with the listing on pages 77 / 78.
Yeah I am using an emulator. Im using Speccy 5.1 which is OK but lacking in debugger utilities...
I dont understand the error.
I'll look in to ZXSpin. Thanks.
Oops. Its line 270!!
Yeah it is a great book. I got a load of Spectrum books and hardware gear in a house clearance a couple of years ago!!
I also got 2 copies of Super Charge your Spectrum.
I'm not a ZX newbie, in fact, my 1st computer was a 1K ZX81 in 1984. I have loads of love for the ZX81 and the Spectrum.
The program is the Spectrum Monitor program with the listing on pages 77 / 78.
Yeah I am using an emulator. Im using Speccy 5.1 which is OK but lacking in debugger utilities...
I dont understand the error.
I'll look in to ZXSpin. Thanks.
- 1024MAK
- Bugaboo
- Posts: 3123
- Joined: Wed Nov 15, 2017 2:52 pm
- Location: Sunny Somerset in the U.K. in Europe
Re: Variable error in Hex entry program
Standby alert
“There are four lights!”
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb
Looking forward to summer later in the year.
“There are four lights!”
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb
Looking forward to summer later in the year.
-
- Drutt
- Posts: 4
- Joined: Sun May 05, 2019 6:06 pm
Re: Variable error in Hex entry program
Yep. Line 270.
I can't see where the error is. Because my BASIC has rusted over the years...
It appears lines 270 and 280 form part of the numbers for the address... but I dont know where the 2 error is thrown...
I can't see where the error is. Because my BASIC has rusted over the years...
It appears lines 270 and 280 form part of the numbers for the address... but I dont know where the 2 error is thrown...
- 1024MAK
- Bugaboo
- Posts: 3123
- Joined: Wed Nov 15, 2017 2:52 pm
- Location: Sunny Somerset in the U.K. in Europe
Re: Variable error in Hex entry program
After the error, can you try this:
Mark
Code: Select all
PRINT a$
Standby alert
“There are four lights!”
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb
Looking forward to summer later in the year.
“There are four lights!”
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb
Looking forward to summer later in the year.
- 1024MAK
- Bugaboo
- Posts: 3123
- Joined: Wed Nov 15, 2017 2:52 pm
- Location: Sunny Somerset in the U.K. in Europe
Re: Variable error in Hex entry program
The function x() in line 310 cannot be calculated because at the point that line 270 calls function x(), no value has been assigned to a$.
This appears to be an error in the listing.
Try changing line 170 to
Then try again...
Mark
This appears to be an error in the listing.
Try changing line 170 to
Code: Select all
170 GO SUB 220
Mark
Standby alert
“There are four lights!”
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb
Looking forward to summer later in the year.
“There are four lights!”
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb
Looking forward to summer later in the year.
- 1024MAK
- Bugaboo
- Posts: 3123
- Joined: Wed Nov 15, 2017 2:52 pm
- Location: Sunny Somerset in the U.K. in Europe
Re: Variable error in Hex entry program
Line 290, the last character should be a lower case L and not a 1.
Mark
Mark
Standby alert
“There are four lights!”
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb
Looking forward to summer later in the year.
“There are four lights!”
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb
Looking forward to summer later in the year.
-
- Drutt
- Posts: 4
- Joined: Sun May 05, 2019 6:06 pm
Re: Variable error in Hex entry program
YES!! Thanks 1024MAK . . 2 Typos in the text. The first going to a wrong subroutine. The second getting a character wrong making the start address wrong. Your deductions are right! Thankyou.
Now I can enter the 5 pages of Opcodes and get the monitor working.
Now I can enter the 5 pages of Opcodes and get the monitor working.
- 1024MAK
- Bugaboo
- Posts: 3123
- Joined: Wed Nov 15, 2017 2:52 pm
- Location: Sunny Somerset in the U.K. in Europe
Re: Variable error in Hex entry program
No problem (well, not now!)
It did have me scratching my head for a bit...
Mark
It did have me scratching my head for a bit...
Mark
Standby alert
“There are four lights!”
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb
Looking forward to summer later in the year.
“There are four lights!”
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb
Looking forward to summer later in the year.