this short program crashes the spectrum

The place for codemasters or beginners to talk about programming any language for the Spectrum.
sn3j
Manic Miner
Posts: 501
Joined: Mon Oct 31, 2022 12:29 am
Location: Germany

Re: this short program crashes the spectrum

Post by sn3j »

Image
POKE 23614,10: STOP      1..0 hold, SS/m/n colors, b/spc toggle
sn3j
Manic Miner
Posts: 501
Joined: Mon Oct 31, 2022 12:29 am
Location: Germany

Re: this short program crashes the spectrum

Post by sn3j »

Spoiler
Image
POKE 23614,10: STOP      1..0 hold, SS/m/n colors, b/spc toggle
sn3j
Manic Miner
Posts: 501
Joined: Mon Oct 31, 2022 12:29 am
Location: Germany

Re: this short program crashes the spectrum

Post by sn3j »

Image
Spoiler
Image
POKE 23614,10: STOP      1..0 hold, SS/m/n colors, b/spc toggle
sn3j
Manic Miner
Posts: 501
Joined: Mon Oct 31, 2022 12:29 am
Location: Germany

Re: this short program crashes the spectrum

Post by sn3j »

Image
Spoiler
Image
Spoiler
Image
POKE 23614,10: STOP      1..0 hold, SS/m/n colors, b/spc toggle
User avatar
PeteProdge
Bugaboo
Posts: 3588
Joined: Mon Nov 13, 2017 9:03 am

Re: this short program crashes the spectrum

Post by PeteProdge »

equinox wrote: Mon Oct 02, 2023 10:09 pm10 NEW
Say what you like about this program, but it gives you a flawless Spectrum emulator on any physical ZX Spectrum.
Reheated Pixels - a combination of retrogaming, comedy and factual musing, is here!
New video: Nine ZX Spectrum magazine controversies - How Crash, Your Sinclair and Sinclair User managed to offend the world!
equinox
Dynamite Dan
Posts: 1052
Joined: Mon Oct 08, 2018 1:57 am
Location: SE England

Re: this short program crashes the spectrum

Post by equinox »

PeteProdge wrote: Wed Nov 01, 2023 3:24 pm Say what you like about this program, but it gives you a flawless Spectrum emulator on any physical ZX Spectrum.
I've been trying to do a bit of -- never mind -- dealing with someone else's machine code. And it made me thought about CLEAR. Like, suppose I only wanted to reserve exactly one byte, could i do like CLEAR 65534

JUST SAYING. Arguing with AIs. shut up leaev me alone.
equinox
Dynamite Dan
Posts: 1052
Joined: Mon Oct 08, 2018 1:57 am
Location: SE England

Re: this short program crashes the spectrum

Post by equinox »

Sokurah wrote: Tue Oct 03, 2023 1:58 pm Well, to be precise that command doesn't crash the Spectrum - it resets it. Big difference ;)
This is the kind of pedantry I come here for.
(HAHAH! I ended a sentence with a preposition. fight me)
SNG
Drutt
Posts: 13
Joined: Sat Dec 23, 2023 12:16 am

Re: this short program crashes the spectrum

Post by SNG »

equinox wrote: Fri Nov 03, 2023 5:46 am suppose I only wanted to reserve exactly one byte, could i do like CLEAR 65534
Yes.

The byte reserved will be at 65535.

Enjoy POKEing it.
AndyC
Dynamite Dan
Posts: 1409
Joined: Mon Nov 13, 2017 5:12 am

Re: this short program crashes the spectrum

Post by AndyC »

SNG wrote: Sat Dec 23, 2023 4:08 pm Yes.

The byte reserved will be at 65535.

Enjoy POKEing it.
Can you move RAMTOP that high? I thought BASIC stores it's UDGs etc above RAMTOP and so I'd assume it would complain about it (though I've never tried)
User avatar
1024MAK
Bugaboo
Posts: 3123
Joined: Wed Nov 15, 2017 2:52 pm
Location: Sunny Somerset in the U.K. in Europe

Re: this short program crashes the spectrum

Post by 1024MAK »

@AndyC well try it!
Spoiler
A Spectrum has no trouble setting RAMTOP to a higher than normal value by using CLEAR 65534. It doesn't care where the UDG data is, or even if it's just garbage. Just don't try to redefine the UDG if it's not in a protected RAM area.
Mark
:!: Standby alert :!:
“There are four lights!”
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb :dance
Looking forward to summer later in the year.
User avatar
uglifruit
Manic Miner
Posts: 703
Joined: Thu Jan 17, 2019 12:41 pm
Location: Leicester
Contact:

Re: this short program crashes the spectrum

Post by uglifruit »

(As found in my signature) I love the behaviour of a 48k spectrum when CLEAR 23855 is entered.

Wish I'd done it in Dixon's.
CLEAR 23855
User avatar
arjun
Microbot
Posts: 151
Joined: Sat Sep 19, 2020 7:34 am
Location: India
Contact:

Re: this short program crashes the spectrum

Post by arjun »

equinox wrote: Mon Oct 02, 2023 10:09 pm10 NEW
A crash is an unexpected behaviour during the normal course of a program. The BASIC command "NEW" however behaves exactly like it should. So I would argue that it's not a crash in the technical sense. :P
User avatar
ParadigmShifter
Manic Miner
Posts: 671
Joined: Sat Sep 09, 2023 4:55 am

Re: this short program crashes the spectrum

Post by ParadigmShifter »

You can also write a basic program that does a CLEAR, pokes some assembler above the clear address and then do a new then save out the data if you want I suppose (although probably better just to save the data and do a full reset lol).

NEW just clears all variables and up to RAMTOP or whatever the end of the BASIC reserved area is (and moves the stack to immediately below the CLEAR address I think).
akeley
Dynamite Dan
Posts: 1048
Joined: Sat Feb 01, 2020 5:47 pm

Re: this short program crashes the spectrum

Post by akeley »

uglifruit wrote: Sat Dec 23, 2023 7:09 pm (As found in my signature) I love the behaviour of a 48k spectrum when CLEAR 23855 is entered.

Wish I'd done it in Dixon's.
My old time favourite is RANDOMIZE USR 5050.

Found exactly how you'd imagine: by a bunch of us kids bashing the keyboard to see what happens.
equinox
Dynamite Dan
Posts: 1052
Joined: Mon Oct 08, 2018 1:57 am
Location: SE England

Re: this short program crashes the spectrum

Post by equinox »

SNG wrote: Sat Dec 23, 2023 4:08 pm Yes.

The byte reserved will be at 65535.

Enjoy POKEing it.
But couldn't that be part of like USR "U"? Are you telling me that I have to CLEAR space for my UDGs? mind blown

(My first Speccy was a +2 so I don't consider U a real UDG, but.)

Okay, I know the real answer (I think): no sane BASIC program could stretch into the 65000s so you should technically clear that address (so your BASIC can't get up there) but it's just theoretical. 64K should be enough for everybody. (And +2 owners can rejoice in having 16 free bytes up there -- that's mostly why they bought a +2, isn't it?)
Last edited by equinox on Wed Dec 27, 2023 9:30 pm, edited 2 times in total.
equinox
Dynamite Dan
Posts: 1052
Joined: Mon Oct 08, 2018 1:57 am
Location: SE England

Re: this short program crashes the spectrum

Post by equinox »

arjun wrote: Sun Dec 24, 2023 10:19 am A crash is an unexpected behaviour during the normal course of a program. The BASIC command "NEW" however behaves exactly like it should. So I would argue that it's not a crash in the technical sense. :P
Very smart. Hire this man for a 10% reduction in IT support tickets without actually changing what you do, except saying "ACTUALLY" in the voice that women around the world have come to hate.
User avatar
TMD2003
Rick Dangerous
Posts: 2045
Joined: Fri Apr 10, 2020 9:23 am
Location: Airstrip One
Contact:

Re: this short program crashes the spectrum

Post by TMD2003 »

equinox wrote: Wed Dec 27, 2023 8:59 pm Okay, I know the real answer (I think): no sane BASIC program could stretch into the 65000s so you should technically clear that address (so your BASIC can't get up there) but it's just theoretical. 64K should be enough for everybody. (And +2 owners can rejoice in having 16 free bytes up there -- that's mostly why they bought a +2, isn't it?)
I use those for high scores that won't be cleared by RUN, or a quick and dirty LDIR routine that only needs 12 bytes.
Spectribution: Dr. Jim's Sinclair computing pages.
Features my own programs, modified type-ins, RZXs, character sets & UDGs, and QL type-ins... so far!
Post Reply