Difference between revisions of "Motorola 68000"

From SizeCoding
Jump to: navigation, search
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
== Introduction ==
 
== Introduction ==
Wanting to start sizecoding on a Motorola 68k platform in this day and age can be tough.  
+
Wanting to start sizecoding on a Motorola 68000 platforms in this day and age can be tough.
 +
So lets start with a list of well known Motorola 68000 systems you could target for sizecoding.
  
So here is a bit of help to get you started:
+
== Motorola 68000 Platforms ==
 +
Here is a list of well known Motorola 68000 platforms you could target for sizecoding:
 +
*'''[[Atari ST]]''' - Atari ST Sizecoding information
 +
*'''[[Commodore Amiga]]''' - Commodore Amiga Sizecoding information
 +
*'''[[Atari Jaguar]]''' - Atari Jaguar Sizecoding information
 +
*'''[[Spectrum QL]]''' - Spectrum QL information
 +
*'''[[X68000]]''' - Sharp X68000 information
  
=== The Motorola 68k processor ===
+
== The Motorola 68000 processor ==
The Motorola 68k processor is a 16-bit Big-Endian format processor, using 32-bit register and addresses.
+
The Motorola 68000/68k processor is a 16-bit Big-Endian format processor, using 32-bit register and addresses.
  
 
This means that instruction sizes on average are either 2 or 4 bytes each, and 6 bytes for longword / 32-bit instructions.
 
This means that instruction sizes on average are either 2 or 4 bytes each, and 6 bytes for longword / 32-bit instructions.
Line 34: Line 41:
 
* addq #value, reg : 2 bytes - Adds a values 0..8 to a register
 
* addq #value, reg : 2 bytes - Adds a values 0..8 to a register
 
* subq #value, reg : 2 bytes - Subtracts a values 0..8 from a register
 
* subq #value, reg : 2 bytes - Subtracts a values 0..8 from a register
 +
 +
 +
== Generic 68K sinus table generator ==
 +
Here is a fairly generic 68k sinus table generator (14 bytes on Atari ST/Amiga) as well as a 10-byte zigzag generator.
 +
* [https://demozoo.org/productions/310191/ Singen68k]
  
 
== Resources ==
 
== Resources ==
Line 39: Line 51:
 
* [http://www.easy68k.com/ EASy68K Editor/Assembler/Simulator for the 68000]
 
* [http://www.easy68k.com/ EASy68K Editor/Assembler/Simulator for the 68000]
 
* [http://www.easy68k.com/paulrsm/index.html Various Motorola 68k resources]
 
* [http://www.easy68k.com/paulrsm/index.html Various Motorola 68k resources]
 
== Motorola M68K Platforms ==
 
*'''[[Atari ST]]''' - Atari ST Sizecoding information
 
*'''[[Atari Jaguar]]''' - Atari Jaguar Sizecoding information
 
*'''[[Commodore Amiga]]''' - Commodore Amiga Sizecoding information
 
*'''[[Spectrum QL]]''' - Spectrum QL information
 

Latest revision as of 04:24, 2 June 2025

Introduction

Wanting to start sizecoding on a Motorola 68000 platforms in this day and age can be tough. So lets start with a list of well known Motorola 68000 systems you could target for sizecoding.

Motorola 68000 Platforms

Here is a list of well known Motorola 68000 platforms you could target for sizecoding:

The Motorola 68000 processor

The Motorola 68000/68k processor is a 16-bit Big-Endian format processor, using 32-bit register and addresses.

This means that instruction sizes on average are either 2 or 4 bytes each, and 6 bytes for longword / 32-bit instructions.

Note: The assigment direction is source,dest instead of dest,source !!!

Registers

  • D0..D7 - 8 x 32 bit General Purpose Registers
  • A0..A6 - 7 x 32 bit Address Registers
  • A7 - 32-bit Stack-Address Register

Instructions timing

The number of cycles for each instruction is different depending of processor model in M68K family.

http://oldwww.nvg.ntnu.no/amiga/MC680x0_Sections/mc68000timing.HTML

Size considerations

Here are some general rule of thumbs when it comes to size consideration when programming the M68000

  • Moving/Calculating Register from/to registers - 2 bytes
  • Moving/Calculating with byte or word values - 4 bytes
  • Moving/Calculating with long values - 6 bytes

Shorter variants:

  • moveq #value, reg : 2 bytes - Moves a values -128...127 to a register
  • addq #value, reg : 2 bytes - Adds a values 0..8 to a register
  • subq #value, reg : 2 bytes - Subtracts a values 0..8 from a register


Generic 68K sinus table generator

Here is a fairly generic 68k sinus table generator (14 bytes on Atari ST/Amiga) as well as a 10-byte zigzag generator.

Resources