40 Best Machine Code Routines for the ZX Spectrum - 2nd Ed

Stuff for sale or wanted, hopefully MEGA+@rare!!!, or commercial projects
Post Reply
User avatar
PeterJ
Site Admin
Posts: 6919
Joined: Thu Nov 09, 2017 7:19 pm
Location: Surrey, UK

40 Best Machine Code Routines for the ZX Spectrum - 2nd Ed

Post by PeterJ »

Found via Facebook

User avatar
Jbizzel
Dynamite Dan
Posts: 1537
Joined: Mon May 04, 2020 4:34 pm
Location: Hull
Contact:

Re: 40 Best Machine Code Routines for the ZX Spectrum - 2nd Ed

Post by Jbizzel »

£12 for the paperback. That seems decent.
Dr beep
Manic Miner
Posts: 382
Joined: Mon Oct 01, 2018 8:53 pm

Re: 40 Best Machine Code Routines for the ZX Spectrum - 2nd Ed

Post by Dr beep »

How do you define the 40 best machinecode routines?

I have a 5 byte routine which is used in several emulators to find an opcode in shortest time.
User avatar
Bubu
Manic Miner
Posts: 542
Joined: Fri Apr 02, 2021 8:24 pm
Location: Spain

Re: 40 Best Machine Code Routines for the ZX Spectrum - 2nd Ed

Post by Bubu »

Just 5 bytes? May I have a look?
If something works, don't touch it !!!! at all !!!
Dr beep
Manic Miner
Posts: 382
Joined: Mon Oct 01, 2018 8:53 pm

Re: 40 Best Machine Code Routines for the ZX Spectrum - 2nd Ed

Post by Dr beep »

Bubu wrote: Fri Jul 29, 2022 7:34 pm Just 5 bytes? May I have a look?
DE=PC in this code

LD A,(DE) ; get opcode
LD L,A ; set lowbyte jumppointer
LD H,B ; fixed value to a highbyte table
LD H,(HL) ; get highbyte jumppointer from table
JP (HL) ; go to your opcode routine

table at #XX00
db i00 / 256
db i01 / 256 ; table of 256 pointers

code at #XX00+ 256
i00 do something in the bytes needed ie 4
i04 next code etc....
fill program with all routines


This is how SP2X81 is coded and de GAlaksija-emulator on the SAM
User avatar
PeterJ
Site Admin
Posts: 6919
Joined: Thu Nov 09, 2017 7:19 pm
Location: Surrey, UK

Re: 40 Best Machine Code Routines for the ZX Spectrum - 2nd Ed

Post by PeterJ »

Dr beep wrote: Fri Jul 29, 2022 6:53 pm How do you define the 40 best machinecode routines?
It's a reprint of this book from 1983: Probably you may not be the intended audience.

https://spectrumcomputing.co.uk/entry/2 ... X_Spectrum
Dr beep
Manic Miner
Posts: 382
Joined: Mon Oct 01, 2018 8:53 pm

Re: 40 Best Machine Code Routines for the ZX Spectrum - 2nd Ed

Post by Dr beep »

PeterJ wrote: Fri Jul 29, 2022 7:54 pm It's a reprint of this book from 1983: Probably you may not be the intended audience.

https://spectrumcomputing.co.uk/entry/2 ... X_Spectrum
Indeed, I know enough of Z80 that these routine are familiar for me by heart.
User avatar
uglifruit
Manic Miner
Posts: 703
Joined: Thu Jan 17, 2019 12:41 pm
Location: Leicester
Contact:

Re: 40 Best Machine Code Routines for the ZX Spectrum - 2nd Ed

Post by uglifruit »

Be interesting to see what the updated/additional material in there is.
CLEAR 23855
merman
Microbot
Posts: 125
Joined: Wed Sep 29, 2021 2:50 pm

Re: 40 Best Machine Code Routines for the ZX Spectrum - 2nd Ed

Post by merman »

PeterJ wrote: Fri Jul 29, 2022 7:54 pm It's a reprint of this book from 1983: Probably you may not be the intended audience.

https://spectrumcomputing.co.uk/entry/2 ... X_Spectrum
It’s more than just a reprint - Jim Bagley is writing new material.
User avatar
PeterJ
Site Admin
Posts: 6919
Joined: Thu Nov 09, 2017 7:19 pm
Location: Surrey, UK

Re: 40 Best Machine Code Routines for the ZX Spectrum - 2nd Ed

Post by PeterJ »

merman wrote: Sat Jul 30, 2022 2:57 pm It’s more than just a reprint - Jim Bagley is writing new material.
Indeed, you are quite right. Are you clear about how much will be new? I couldn't get that from the Kickstarter page.
merman
Microbot
Posts: 125
Joined: Wed Sep 29, 2021 2:50 pm

Re: 40 Best Machine Code Routines for the ZX Spectrum - 2nd Ed

Post by merman »

PeterJ wrote: Sat Jul 30, 2022 3:05 pm Indeed, you are quite right. Are you clear about how much will be new? I couldn't get that from the Kickstarter page.
From reading the Kickstarter page again, there are new introductions from the original authors plus new material from Jim Bagley - looks like Jim will be writing new routines/code as well as talking about the Next.
User avatar
PeterJ
Site Admin
Posts: 6919
Joined: Thu Nov 09, 2017 7:19 pm
Location: Surrey, UK

Re: 40 Best Machine Code Routines for the ZX Spectrum - 2nd Ed

Post by PeterJ »

merman wrote: Sun Jul 31, 2022 11:23 am looks like Jim will be writing new routines/code as well as talking about the Next.
Excellent! Backed.
User avatar
Nitrowing
Manic Miner
Posts: 612
Joined: Mon Sep 21, 2020 8:38 pm
Location: Cleethorpes

Re: 40 Best Machine Code Routines for the ZX Spectrum - 2nd Ed

Post by Nitrowing »

Mad Fritz
Dizzy
Posts: 59
Joined: Wed Jun 27, 2018 1:21 pm

Re: 40 Best Machine Code Routines for the ZX Spectrum - 2nd Ed

Post by Mad Fritz »

PeterJ wrote: Sun Jul 31, 2022 11:41 am Excellent! Backed.
Me too 8-)
drdivago
Dizzy
Posts: 57
Joined: Sat Apr 02, 2022 3:11 pm
Location: Barcelona, Spain

Re: 40 Best Machine Code Routines for the ZX Spectrum - 2nd Ed

Post by drdivago »

Same here :geek:
User avatar
Morkin
Bugaboo
Posts: 3286
Joined: Mon Nov 13, 2017 8:50 am
Location: Bristol, UK

Re: 40 Best Machine Code Routines for the ZX Spectrum - 2nd Ed

Post by Morkin »

My copy is a bit tatty. It also contains an 'erratum' sheet. That probably drove someone mad in 1983... :lol:

Image
My Speccy site: thirdharmoniser.com
User avatar
PeterJ
Site Admin
Posts: 6919
Joined: Thu Nov 09, 2017 7:19 pm
Location: Surrey, UK

Re: 40 Best Machine Code Routines for the ZX Spectrum - 2nd Ed

Post by PeterJ »

Morkin wrote: Mon Aug 01, 2022 2:24 pm It also contains an 'erratum' sheet.
Please would you be able to scan that?
User avatar
flatduckrecords
Manic Miner
Posts: 797
Joined: Thu May 07, 2020 11:47 am
Location: Oban, Scotland
Contact:

Re: 40 Best Machine Code Routines for the ZX Spectrum - 2nd Ed

Post by flatduckrecords »

Seems the going rate for a 2nd hand copy is about £40. (Mutant Caterpillar has one if you fancy it!) so £12 for the reprint sounds like a bargain.

I actually thought that price was *just* for the PDF so I’m glad I looked again, thanks for pointing that out @Jbizzel.
User avatar
Jbizzel
Dynamite Dan
Posts: 1537
Joined: Mon May 04, 2020 4:34 pm
Location: Hull
Contact:

Re: 40 Best Machine Code Routines for the ZX Spectrum - 2nd Ed

Post by Jbizzel »

flatduckrecords wrote: Mon Aug 01, 2022 5:56 pm Seems the going rate for a 2nd hand copy is about £40. (Mutant Caterpillar has one if you fancy it!) so £12 for the reprint sounds like a bargain.

I actually thought that price was *just* for the PDF so I’m glad I looked again, thanks for pointing that out @Jbizzel.
No problem. I think that's good value..if you printed a pdf copy it would probably cost the same or more.

I'm not familiar with the book, is it worth a punt?
User avatar
PeterJ
Site Admin
Posts: 6919
Joined: Thu Nov 09, 2017 7:19 pm
Location: Surrey, UK

Re: 40 Best Machine Code Routines for the ZX Spectrum - 2nd Ed

Post by PeterJ »

Jbizzel wrote: Tue Aug 02, 2022 11:43 pm I'm not familiar with the book, is it worth a punt?
There's a PDF of the original book in the archive if you want to take a look.

https://spectrumcomputing.co.uk/entry/2 ... X_Spectrum
Post Reply