Ian Osborne
JREF Kid
- Joined
- Aug 4, 2001
- Messages
- 8,945
Does anyone here have experience with the Spectrum Next, or one of its clones? I just bought an Xberry Pi (Next clone) and would be interested in swapping ideas with other users.
No but it looks intriguing. I've got a preorder in on the Retro Spectrum being released next month, rubber keys and all!
I hadn't known about the SNext - have to say even the Kickstarter prices seem a rip-off, yeah it looks quite pretty but 300 quid for a computer that cost less than that when it was first introduced? As you say some of the eBay prices take it to silly money.
I hadn't known about the SNext - have to say even the Kickstarter prices seem a rip-off, yeah it looks quite pretty but 300 quid for a computer that cost less than that when it was first introduced? As you say some of the eBay prices take it to silly money.
To be fair, the 48K Spectrum would be nearly £800 today after accounting for inflation. Which makes me wish I could thank my parents a bit more profusely than I did back then.
I also hadn't heard of it before, but it looks like it's expensive because it's more than just a quick knockoff, and the market for it is just too small to bring the price down.
Co Pilot
Certainly! Here's an example of assembly code for the ZX Spectrum to display "Hello, World!" on the screen:
This code uses the ROM routine at address 8252 to print the string to the screen. The message is stored in memory and is terminated with a null byte (0).Code:org 32768 ; Start of the program in memory ld hl, message ; Load the address of the message into HL ld de, 16384 ; Start of the screen memory ld bc, 13 ; Length of the message call 8252 ; ROM routine to print the string ret ; Return from the program message: db 'Hello, World!', 0 ```
Feel free to ask if you need any more details or have other questions!
Interesting question. Any assembly code uses a very restricted set of allowed instructions and syntax. I'd guess once the "meaning" was derived by the LLM it should be fairly simple as these things go but could it find a data source that "explained" assembler to it? For varying values of several words used.
.org $6000 ; Start of the program in memory
; Set up the Display List
lda #$70 ; LMS instruction with DLI enabled
sta $2300 ; Store at the start of the display list
lda #$00
sta $2301
lda #$40
sta $2302
lda #$0A ; Mode 10 with DLI enabled
sta $2303
lda #$02
sta $2304
lda #$02
sta $2305
lda #$02
sta $2306
lda #$02
sta $2307
lda #$02
sta $2308
lda #$02
sta $2309
lda #$02
sta $230A
lda #$02
sta $230B
lda #$02
sta $230C
lda #$02
sta $230D
lda #$02
sta $230E
lda #$02
sta $230F
lda #$02
sta $2310
lda #$02
sta $2311
lda #$02
sta $2312
lda #$02
sta $2313
lda #$02
sta $2314
lda #$02
sta $2315
lda #$02
sta $2316
lda #$02
sta $2317
lda #$02
sta $2318
lda #$02
sta $2319
lda #$02
sta $231A
lda #$02
sta $231B
lda #$02
sta $231C
lda #$02
sta $231D
lda #$02
sta $231E
lda #$02
sta $231F
lda #$02
sta $2320
lda #$02
sta $2321
lda #$02
sta $2322
lda #$02
sta $2323
lda #$02
sta $2324
lda #$02
sta $2325
lda #$02
sta $2326
lda #$02
sta $2327
lda #$02
sta $2328
lda #$02
sta $2329
lda #$02
sta $232A
lda #$02
sta $232B
lda #$02
sta $232C
lda #$02
sta $232D
lda #$02
sta $232E
lda #$02
sta $232F
lda #$02
sta $2330
lda #$02
sta $2331
lda #$02
sta $2332
lda #$02
sta $2333
lda #$02
sta $2334
lda #$02
sta $2335
lda #$02
sta $2336
lda #$02
sta $2337
lda #$02
sta $2338
lda #$02
sta $2339
lda #$02
sta $233A
lda #$02
sta $233B
lda #$02
sta $233C
lda #$02
sta $233D
lda #$02
sta $233E
lda #$02
sta $233F
lda #$02
sta $2340
lda #$02
sta $2341
lda #$02
sta $2342
lda #$02
sta $2343
lda #$02
sta $2344
lda #$02
sta $2345
lda #$02
sta $2346
lda #$02
sta $2347
lda #$02
sta $2348
lda #$02
sta $2349
lda #$02
sta $234A
lda #$02
sta $234B
lda #$02
sta $234C
lda #$02
sta $234D
lda #$02
sta $234E
lda #$02
sta $234F
lda #$02
sta $2350
lda #$02
sta $2351
lda #$02
sta $2352
lda #$02
sta $2353
lda #$02
sta $2354
lda #$02
sta $2355
lda #$02
sta $2356
lda #$02
sta $2357
lda #$02
sta $2358
lda #$02
sta $2359
lda #$02
sta $235A
lda #$02
sta $235B
lda #$02
sta $235C
lda #$02
sta $235D
lda #$02
sta $235E
lda #$02
sta $235F
lda #$02
sta $2360
lda #$02
sta $2361
lda #$02
sta $2362
lda #$02
sta $2363
lda #$02
sta $2364
lda #$02
sta $2365
lda #$02
sta $2366
lda #$02
sta $2367
lda #$02
sta $2368
lda #$02
sta $2369
lda #$02
sta $236A
lda #$02
sta $236B
lda #$02
sta $236C
lda #$02
sta $236D
lda #$02
sta $236E
lda #$02
sta $236F
lda #$02
sta $2370
lda #$02
sta $2371
lda #$02
sta $2372
lda #$02
sta $2373
lda #$02
sta $2374
lda #$02
sta $2375
lda #$02
sta $2376
lda #$02
sta $2377
lda #$02
sta $2378
lda #$02
sta $2379
lda #$02
sta $237A
lda #$02
sta $237B
lda #$02
sta $237C
lda #$02
sta $237D
lda #$02
sta $237E
lda #$02
sta $237F
lda #$02
sta $2380
lda #$02
sta $2381
lda #$02
sta $2382
lda #$02
sta $2383
lda #$02
sta $2384
lda #$02
sta $2385
lda #$02
sta $2386
lda #$02
sta $2387
lda #$02
sta $2388
lda #$02
sta $2389
lda #$02
sta $238A
lda #$02
sta $238B
lda #$02
sta $238C
lda #$02
sta $238D
lda #$02
sta $238E
lda #$02
sta $238F
lda #$02
sta $2390
lda #$02
sta $2391
lda #$02
sta $2392
lda #$02
sta $2393
lda #$02
sta $2394
lda #$02
sta $2395
lda #$02
sta $2396
lda #$02
sta $2397
lda #$02
sta $2398
lda #$02
sta $2399
lda #$02
sta $239A
lda #$02
sta $239B
lda #$02
sta $239C
lda #$02
sta $239D
lda #$02
sta $239E
lda #$02
sta $239F
lda #$02
sta $23A0
lda #$02
sta $23A1
lda #$02
Microsoft BASIC was also optimized for size, not speed. The first version - for the Altair 8800 - was squeezed into 4k bytes of memory. It had no string or integer types, only 32 bit floating point. As you can imagine, forcing an 8 bit integer-only CPU to do all numeric calculations in floating point doesn't help with speed.CALL THE BLOODY SINCLAIR ROM ROUTINE? Now I'm triggered. I'll huff and I'll puff and I'll blow your Sinclair computer off your table. The Sinclair ROMs were always optimized for size, not speed.
The ZX81 doesn't have dedicated screen memory, it has a 'display file' whose position in memory can vary. During display time the CPU 'executes' the characters on the line, with the CPU data bus forced to a NOP instruction so it fetches each character in turn until the end of the line.if we're talking ZX-81, what happened to just flippin' taking the address in the screen and just LDIR the string there?
Modern computers are so incredibly powerful and inscrutable that (almost) nobody talks about coding efficiency anymore, which takes a lot of the fun out of it. That's why I prefer writing code for retro computers from the 80's and 90's. I also eschew enhanced modern recreations like the Spectrum Next for the same reason.*Walks away shaking his cane and muttering about how old people should keep off his lawn too*
Ah, coding efficiency. I started coding on a Dragon 32 forty years ago and all the proper coding I did for the next decade was extremely resource restricted. The core executable within my MSc project work in 1992 weighed in at a highly optimised 19K.
My oldest nephew is a dev at a specialist software house and their solution to every problem is to throw more power at it. His main machine has something stupid like 64 cores and 2 tera of memory and he wouldn’t recognise optimisation if it punched him in the face.
Microsoft BASIC was also optimized for size, not speed. The first version - for the Altair 8800 - was squeezed into 4k bytes of memory. It had no string or integer types, only 32 bit floating point. As you can imagine, forcing an 8 bit integer-only CPU to do all numeric calculations in floating point doesn't help with speed.
The first Sinclair BASIC - for the ZX80 - also used up 4k of memory. It only had integer math, but did have strings. It also had a line editor with cursor control, unlike Microsoft BASIC (which forced you to type in the whole line again to modify it!).
ZX Spectrum BASIC was much larger at 16k, but had a lot more in it - including 40 bit floating point numbers. However it kept the same slow parser as the earlier ZX80 version, made even slower by having more to do. An empty FOR-NEXT loop is 5 times slower on the Spectrum than on the ZX80.
The ZX81 doesn't have dedicated screen memory, it has a 'display file' whose position in memory can vary. During display time the CPU 'executes' the characters on the line, with the CPU data bus forced to a NOP instruction so it fetches each character in turn until the end of the line.
A stock ZX81 only has 1k of RAM, so allocating space for a full screen (32 characters x 24 lines = 768 bytes) would leave very little for user programs.
The display list technique uses only one byte for blank lines and no bytes for white space at the end of each line. That can save a 'lot' of memory, but means the character positions are not at fixed memory locations.
To print a message on a line you first have to make space on the line, then insert the characters into it. A simple LDIR would work only if the line already contained at least as many characters as were being copied, otherwise it would overwrite the Newline character and corrupt the display list
If you use the ROM routine you don't have to worry about all that. It will be slower, but uses up a lot less of your precious RAM. That's fine for just printing a 'hello world' message. For a game you would probably want to create a display list of appropriate size first, then you can poke into it knowing that the screen addresses won't change.
It's not just a Spectrum, it offers numerous enhancements over Sir Clive's invention. It's very well thought of among tinkerers, and there's even a magazine for it (Next magazine).
And as I said, there's a clone for less than a hundred pounds.
FTFYAh, coding efficiency. I started coding on a Dragon 32 forty years ago and all the proper coding I did for the next decade was extremely resource restricted. The core executable within my MSc project work in 1992 weighed in at a highly optimised 19K.
My oldest nephew is a dev at a specialist software house and their solution to every problem is to throw more power at it. His main machine has something stupid like 64 cores and 2 tera of memory and he wouldn’t recognise optimisation if it punched him in the face.
Never had my own Spectrum, after my ZX81 it was an Atari 400 but I can feel my hands' muscle memory causing twitches 10 ff Shift 0 1 shift 4 10 Enter 20 p shift P Hello World Shift P Enter 30 N Enter R Enter