SpectrumMachineCodeMadeEasyVolume1.pdf

(9046 KB) Pobierz
SPECTRUM
MACHINE CODE
MADE EASY
Volume One
For Beginners
James Walsh
Spectrum Machine Code Made Easy
Volume One—For Beginners
This book has been written to allow the user of the ZX
Spectrum computer, with any amount of BASIC
experience, to enter the wonderful world of machine
code programming. This text is aimed directly at those
who have no previous experience of machine code
programming at all.
Starting off with the basic concepts of machine code,
followed by the basics of binary maths, hexidecimal and
base conversion, leading as quickly and as painlessly as
possible on to the rules and types of addressing of the
very powerful Z80 microprocessor.
Whilst heavily laced with examples, it swiftly moves on to
the rudiments of more advanced instructions, namely
ADD, SUB, SBC, ADC, with intermittent breaks to allow
the reader to use the knowledge already gained.
Carefully and thoroughly the 'carry flag', jumping,
relative jumps, CALLs, RET and NOP commands are
explained.
Finally a section is dedicated to the theory of stacks, how
to build and manipulate them.
Another great book horn
INTERFACE PUBLICATIONS
791714759.002.png
SPECTRUM
MACHINE CODE
MADE EASY
Volume One
For Beginners
James Walsh
I MTERFdCE
PIIBLICATIONS
791714759.003.png
DEDICATION
Then at the balance let's be mute,
We never can adjust it;
What's done we partly may compute,
But know not what's resisted.
To Margy, with love
From
Us
Robert Burns
To Charles and Emma — THANKS for all the help
3
2
791714759.004.png
THE AUTHOR
First published in the UK by:
Interface Publications,
9-11 Kensington High Street,
London W8 5NP.
James Walsh, at the time of writing this book, is sixteen years
old and attends Davenant Foundation School in Loughton,
Essex.
© Copyright 1983, James Walsh
He has already established a reputation as a regular contributor
to several nationally distributed computer magazines, and has
previously contributed to two published books on Sinclair
computers.
All rights reserved. This book may not be reproduced in part or
in whole without the explicit prior written permission of the
publishers. The routines outlined in this book may not be used
as part of any program offered for publication nor for programs
intended to be sold as software, except as allowed by the
publisher. Permission must be sought, in advance, for all
applications of this material beyond private use by the
purchaser of this volume.
In addition to writing articles, software reviews, and books, he
finds the time to be a keen photographer, a mediocre musician
and, for the most part, a worry to his teachers.
He hopes to publish his next book in the not too far distant
future — exams permitting — although his more immediate
ambition is to travel abroad.
ISBN 0 907563 43 0
The time given to writing this book has done little for his social
life — something he now hopes to find the time to correct. In
the interim he acknowledges both the patience and support of
all his family and friends.
Cover Illustrator, Stuart Hughes
Clive C. Walsh
Typeset and Printed in England by Commercial Colour Press,
London E7.
5
791714759.005.png
CONTENTS
CHAPTER 1: Why Machine Code?
— machine code as the language of the computer
— 1 + 1 = 8!!!
— bi-stable states and binary introduced
CHAPTER 2: Words As Numbers.
— generalised view of how the computer works
— coming to terms with Hexadecimal and Binary
CHAPTER 3: Addresses and How To Get There.
— addresses
— RAMTOP
— entering machine code
CHAPTER 4: Working On The Registers.
— registers
machine versus assembly language
manipulating the registers
CHAPTER 5: Doing Your Sums On The Registers.
— add
— sub
7
791714759.001.png
Zgłoś jeśli naruszono regulamin