NOOB QUESTION: learning machine code

Anything QL Software or Programming Related.
User avatar
TMD2003
Trump Card
Posts: 168
Joined: Sat Oct 10, 2020 12:18 pm

NOOB QUESTION: learning machine code

Post by TMD2003 »

Yes, yes, I know, someone's going to say "Dilwyn's got everything you need to know..." But let me stop you there. When I decided to dive headlong into Z80 machine code, the first thing I did was give Spectrum Computing the inquisition on what the finest text was to aid my learning. Was it Toni Baker's book that everyone knows about, was it William Tang's that I already had a hard copy of... or was it New Generation's interactive program with a try-it-all-for-yourself-and-it-won't-crash sandpit? (Hint: it was the latter).

So while I've already found something among Dilwyn's wares that has a huge long list of 68000 opcodes, what I haven't found is a "teach yourself 68000 assembler" text that comes recommended by those who know what they're talking about. I'm assuming there is one. Am I right?

Let's just say at this stage that there's something I could do in SuperBASIC easily enough, but I'd rather hide it away in machine code so it takes a determined bit of disassembly to crack...


Spectribution: Dr. Jim's Sinclair computing pages.
Features my own programs, modified type-ins, RZXs, character sets & UDGs, and QL type-ins... so far!
User avatar
dilwyn
Mr QL
Posts: 2753
Joined: Wed Dec 01, 2010 10:39 pm

Re: NOOB QUESTION: learning machine code

Post by dilwyn »

My preferred learning reference was Andrew Pennell's book "Assembly Language Programming On The QL-Programming The 68008 Microprocessor". Out of print for many years now, it was originally published by Sunshine. You occasionally get second hand copies on sites like eBay and sellmyretro.com

Not sure of its legality, you can read a scanned copy at https://sinclairql.speccy.org/archivo/d ... alpsql.pdf

Once you've got started, the same author wrote the Sinclair QDOS Companion from Sunshine, although that's more of a reference guide than a learn assembler book.


User avatar
Pr0f
QL Wafer Drive
Posts: 1298
Joined: Thu Oct 12, 2017 9:54 am

Re: NOOB QUESTION: learning machine code

Post by Pr0f »

you'll probably need more than one book - as there's 68000 assembly programming - and then there's the specific application of programmming 68008 code on the Sinclair QL.

The book Dilwyn mentions is a good one, for more general techniques I found the cybex "Programming the 68000" a useful guide.

There was also a good site called DTACK grounded - which is still available as a downloadable archive - lot's of trips and tricks. http://www.easy68k.com/paulrsm/dg/


Derek_Stewart
Font of All Knowledge
Posts: 3929
Joined: Mon Dec 20, 2010 11:40 am
Location: Sunny Runcorn, Cheshire, UK

Re: NOOB QUESTION: learning machine code

Post by Derek_Stewart »

HI,

Why not read Norman's Assembley Magazine, really good read for upto date QL assembley language.


Regards,

Derek
User avatar
Pr0f
QL Wafer Drive
Posts: 1298
Joined: Thu Oct 12, 2017 9:54 am

Re: NOOB QUESTION: learning machine code

Post by Pr0f »

And with some good examples too :-)


User avatar
tofro
Font of All Knowledge
Posts: 2685
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: NOOB QUESTION: learning machine code

Post by tofro »

One thing that is really advisable before you start torturing the real thing is Easy68k, a CPU simulator that was originally created to help teach students 68k machine code. Obviously, you will not be able to work with QDOS, but the first steps are way easier than on the real QL (or even an emulator).

Once you made yourself a bit more familiar with 68k assembly, you can always change to the real matter.


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
User avatar
pjw
QL Wafer Drive
Posts: 1286
Joined: Fri Jul 11, 2014 8:44 am
Location: Norway
Contact:

Re: NOOB QUESTION: learning machine code

Post by pjw »



Per
dont be happy. worry
- ?
User avatar
bwinkel67
QL Wafer Drive
Posts: 1187
Joined: Thu Oct 03, 2019 2:09 am

Re: NOOB QUESTION: learning machine code

Post by bwinkel67 »

Btw, this will also be a perfect time, while learning machine code, to port David Murray's Attack of the PETSCII Robots to the QL. Their have been ports now for many 6502 platforms since his original versions with the Pet and C64, but now there is a Spectrum one (Z80), an Amiga one (68000), and a Sega Genesis one (68000/Z80). The source is available for distribution.


User avatar
M68008
Trump Card
Posts: 223
Joined: Sat Jan 29, 2011 1:55 am
Contact:

Re: NOOB QUESTION: learning machine code

Post by M68008 »

tofro wrote:One thing that is really advisable before you start torturing the real thing is Easy68k, a CPU simulator that was originally created to help teach students 68k machine code. Obviously, you will not be able to work with QDOS, but the first steps are way easier than on the real QL (or even an emulator).
Easy68k binary output can also be converted to run on a QL/emulator.


User avatar
NormanDunbar
Forum Moderator
Posts: 2251
Joined: Tue Dec 14, 2010 9:04 am
Location: Leeds, West Yorkshire, UK
Contact:

Re: NOOB QUESTION: learning machine code

Post by NormanDunbar »

I'll just leave this here ....
https://github.com/NormanDunbar/QLAssem ... tober-2020

Cheers,
Norm.


Why do they put lightning conductors on churches?
Author of Arduino Software Internals
Author of Arduino Interrupts

No longer on Twitter, find me on https://mastodon.scot/@NormanDunbar.
Post Reply