Mastering Machine Code on Your ZX81
By Toni Baker

Sinclair ZX Spectrum
INDEX

FRONT COVER


THUNOR'S FOREWORD

[Thunor: Notes on my HTML transcription of this book.]

FOREWORD

By Tim Hartnell, National ZX80 and ZX81 Users' Club, London, August 1981.

CHAPTER 1 - AN INTRODUCTION

A brief summary of the book.

CHAPTER 2 - INTRODUCTION TO HEXADECIMAL AND MACHINE CODE

Computers count in sixteens, not tens. This system is called hexadecimal, and is quite useful to get to know.

CHAPTER 3 - SIMPLE ARITHMETIC

"Simple" means very simple! Plusses and minuses only. Shares and timeses are left till later!

CHAPTER 4 - PEEKING AND POKING AND MORE ABOUT LOADING

An explanation of how to use memory in RAM. A "SCROLL backwards" program is included to demonstrate this.

CHAPTER 5 - MORE PLACES TO STORE MACHINE CODE

A very explicit guide to the use of REM statements, variables area, and protected regions of RAM.

CHAPTER 6 - STACKING AND JUMPING

How to use the stack to store data. Jumping and conditional jumping, and the use of subroutines explained.

CHAPTER 7 - PRINTING THINGS TO THE SCREEN

In BASIC the PRINT instruction is perhaps the most widely used instruction of all. Here's how to use it in machine code.

CHAPTER 8 - A DICTIONARY OF MACHINE CODE

All the instructions. A complete explanation of every single machine language instruction used by the ZX.

CHAPTER 9 - A PROGRAM TO HELP YOU DEBUG

A machine code editing program, itself written largely in machine code. The speed it offers is likely to make your fluency in machine code develop very strongly.

CHAPTER 10 - SCANNING THE KEYBOARD

Using the keyboard in programs has obvious advantages. Here we cover the function INKEY$ for the NEW ROM and explain how to recreate it on the OLD. An elegant little program called GRAFFITTI is developed which shows how the character set is generated.

CHAPTER 11 - DRAUGHTS PART ONE

The first part of a program, which allows a player to input a move, and checks for cheats!

CHAPTER 12 - A TOUCH OF CULTURE

Music and pictures. Music from the keyboard, and pictures from the screen. Watch out for the program LIFE.

CHAPTER 13 - DRAUGHTS PART TWO

The output of the computer's move. This section does not decide upon a move to make; it merely outputs a move assuming the decision has been made already.

CHAPTER 14 - GRAPHICS GAMES

A section intended only for the ZX81 because the games included here rely on the SLOW mechanism. (And in machine code the word "SLOW" should absolutely not be taken literally.)

CHAPTER 15 - DRAUGHTS PART THREE

The making of the big decision...Which move to choose.

CHAPTER 16 - HOW TO DISASSEMBLE THE ROM

The ROM holds many secrets, but it, and any other machine code program, may be disassembled fairly simply. A hex-listing program is given, and an outline as to how a full disassembler-program may be written is also given.

CHAPTER 17 - THE ARITHMETIC SUBROUTINES

Have you ever wondered how floating point numbers work in machine code? How you can add and subtract them? Multiply and divide them? Even take sines and cosines!? This chapter will tell you how.

APPENDIX ONE - A LISTING OF THE PROGRAM HEXLD3


APPENDIX TWO - THE SYSTEM VARIABLES


APPENDIX THREE - A CONVERSION TABLE FROM HEX TO ASSEMBLY


APPENDIX FOUR - A CONVERSION TABLE FROM ASSEMBLY TO HEX

Including the effect of each instruction on the flags.

APPENDIX FIVE - THE ZX CHARACTER SET


APPENDIX SIX - A LISTING OF THE PROGRAM DRAUGHTS

[Thunor: Added by myself to assist with typing-in the author's program.]

A FAREWELL PROGRAM

[Thunor: A very nice farewell program by the author Toni Baker for the NEW ROM i.e. ZX81.]

ALL AVAILABLE DOWNLOADS

[Thunor: Added by myself to list all available downloads to date in one accessible location.]


[FINISHING THE BOOK]


LENSLIST2

[Thunor: Disassembles bytes into groups of bytes that represent Z80 instructions.]

DUMP

[Thunor: Dumps bytes to the screen in either hexadecimal or Sinclair character code representation.]

HEXLD3E

[Thunor: A much improved hex loader incorporating both LENSLIST2 and DUMP.]

DISASM

[Thunor: A program that disassembles bytes into Z80 instructions with mnemonics.]

BACK COVER


Sinclair ZX Spectrum

   Back Next Page