Assembly Language Primer
Joel Matthew Rees
Amagasaki, Japan, 2024
Copyright 2024 Joel Matthew Rees
All rights reserved, except as explicitly specified:
******
This work, including all expository text, graphics, and code,
may be used
for personal, individual study.
It may also be used for individual,
private hobby purposes.
All other uses, including classroom, require
permission.
Certain example code will specify additional permissions, for those examples only.
******
An introduction to assembly language programming under the split stack discipline, or the paradigm of maintaining dynamic parameters on a separate stack, accompanied by a record of my research on a certain project requiring assembly language.
Initially presenting the 6800, 6801, 6809, and 68000 in parallel.
Preface
Basics (01)
- Accumulating Integer Results in the M6809, 6800, 6801, and M68000
- Getting a simulator for the 6800 and 6809
- Running code on the 6800 and 6809
- Getting a Simulator for the 6801 and Running Code on It
- Getting a Simulator for the 68000 and Running Code on It (Hatari)
- Global Constants on the 6800, 6801, 6809, and 68000
- Working in Binary, Hexadecimal, Etc.: bc, gforth, and Other Options
- Simple Lists on the 6800, 6801, 6809, and 68000 (array of bytes)
- Sequentially Accessing a Simple List on the 6800, 6801, 6809, and 68000
- Hello, World! (Not Yet on the Beach) -- 6800, 6801, 6809 (strings and getting output)
- Hello, World! (Not Yet on the Beach) -- 68000
- Hello, World! (Not Yet on the Beach) -- 6801 (EXORsim6801)
- Hello, Bugs! Debugging Example, 6800 and 6809
-
Doing This with Other Processors
Beachhead (02)
- Foothold! (Split Stacks ... barely on the Beach) -- 6800 (strings and output, split stack)
- Foothold! (Split Stacks ... barely on the Beach) -- 6801
- Foothold! (Split Stacks ... barely on the Beach) -- 6809
- Foothold! (Split Stacks ... barely on the Beach) -- 68000
- Introduction to Byte Arithmetic on the 6800, 6801, and 6809
- Introduction to Byte Arithmetic on the 68000
- A Note on Byte Widening and Scratch Registers on the 6800, 6801, and 6809
- On the Beach with Parameters -- 16-bit Arithmetic on the 6800 (more split stack)
- On the Beach with Parameters -- 16-bit Arithmetic on the 6801
- On the Beach with Parameters -- 16-bit Arithmetic on the 6809
- On the Beach with Parameters -- 16-bit Arithmetic on the 6809 with Direct Page Moved
- On the Beach with Parameters -- 16/32-bit Arithmetic on the 68000
- Balancing on the Beach -- Comparing Pointers, Checking the Stack
-
One Foot on the Beach, One in the Surf -- Frame Pointer for Split
Stack
(incomplete)
-
Switching Feet on the Beach -- Ephemeral Frame Pointer for Split Stack
(incomplete)
- One Foot on One Beach, One Foot on Another -- Stack Frame for Single Stack: 68000 and 6809
-
Unsteady Footing -- Stack Frame for Single Stack: 6801
(not recommended for code)
-
Ascending the Wrong Island -- Single-stack Stack Frame Example: 68000
(and
split stack frames)
-
Ascending the Wrong Island -- Single-stack Stack Frame Example: 6809
(and
split stack frames)
-
Some Address Math for the 6800
(no discipline)
- Some Address Math for the 6801
- Some Address Math for the 6809
- Synthesizing Multibyte NEG on 6809 (Applies to 6800 and 6801)
- Some Address Math for the 68000
- Ascending the Wrong Island -- Single-stack Stack Frame Example: 6801
- Walking the Pontoons -- Split-stack Stack Frame Example: 6801
- Ascending the Wrong Island -- Single-stack Stack Frame Example: 6800
- Walking the Pontoons -- Split-stack Stack Frame Example: 6800
- Putting the Wrong Island in the Rear-view Mirror -- Single-stack No Frame Example: 6800
- Ascending the Right Island -- Split-stack No Frame Example: 6800
- More Looking in the Rear-view Mirror -- Single-stack No Frame Example: 6801
- More Ascending the Right Island -- Split-stack No Frame Example: 6801
- Ascending the Right Island -- Frameless Examples (Single- & Split-stack): 6809
- Ascending the Right Island -- Frameless Examples (Single- & Split-stack): 68000
-
Tentative Op-code Map of RK0801 CPU (Extension of M6801)
Framework Rigging (03)
-
Binary Output on the 6800, Left-to-right; Framework-by-include
(asm68c)
(split stack)
- Binary Output on the 6801, Left-to-right; Framework-by-include
-
Binary Output on the 6809, Left-to-right; Framework-by-include (LWTools)
-
Binary Output on the 68000, Left-to-right; Framework-by-include
(error in code!)
- Hexadecimal Output on the 6800, without General Divide
- Hexadecimal Output on the 6801, without General Divide
- Hexadecimal Output on the 6809, without General Divide (Register Parameters)
- Hexadecimal Output on the 68000, without General Divide (Register Allocation) (error in code!)
- Keyboard Input on the 6800, 6801, and 6809 (EXORsim)
- Keyboard Input Routines and Character Code Output on the 6800
- Keyboard Input Routines and Character Code Output on the 6801
- Keyboard Input Routines and Character Code Output on the 6809
-
Keyboard Input Routines and Character Code Output on the 68000 (Debug
Session -- Init Error)
(fixing the errors in chapters 4 and 8, part 1)
- Keyboard Input Routines and Character Code Output on the 68000 (Debug Session -- Dealloc Error) (fixing the errors in chapters 4 and 8, part 2)
-
Converting Numbers for Output and Input with Multiplication and Division
(Theory)
Framework Rigging Notes (03-XX)
-
Numeric Output Conversion and Multiplying by Constants (Theory)(to be replaced/moved/rewritten)
-
Multiplying by Powers of Two (Shift Left)(to be replaced/moved/rewritten) Demonstrating Left Shift -- 6800(to be replaced/moved/rewritten)Multiplying by Small Constants (Shift Left and Add)(to be replaced/moved/rewritten)
No comments:
Post a Comment