sd:sd-8516_assembly_language
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| sd:sd-8516_assembly_language [2026/04/02 07:17] – appledog | sd:sd-8516_assembly_language [2026/04/05 09:51] (current) – appledog | ||
|---|---|---|---|
| Line 2: | Line 2: | ||
| Here you can learn all about writing Assembly Language programs for the SD-8516. | Here you can learn all about writing Assembly Language programs for the SD-8516. | ||
| - | This is the basic tutorial. But if you would prefer to skip ahead, | + | You may also be interested in: [[Part II Writing Games in Assembly Language|Part II: Writing |
| - | + | ||
| - | * [[Part II: Writing Games in Assembly Language]] | + | |
| - | * [[Part III: Writing | + | |
| == Introduction | == Introduction | ||
| Line 20: | Line 16: | ||
| == How to Enter and Run Assembly Language Programs | == How to Enter and Run Assembly Language Programs | ||
| - | There are two ways. One, you can use the ASSEMBLE command from Stellar BASIC V1.0: | + | There are several |
| + | |||
| + | as filename.asm progname | ||
| + | |||
| + | But for quick projects | ||
| 10 ASSEMBLE | 10 ASSEMBLE | ||
| Line 98: | Line 98: | ||
| For today, let's do a deep-dive on the registers, because there' | For today, let's do a deep-dive on the registers, because there' | ||
| - | |||
| === All About Registers | === All About Registers | ||
| There are sixteen general purpose registers available for use> Here they are, with a short comment on name and purpose. Of course, since they' | There are sixteen general purpose registers available for use> Here they are, with a short comment on name and purpose. Of course, since they' | ||
| - | |||
| ^ REG ^ Name ^ Convention ^ Notes | | ^ REG ^ Name ^ Convention ^ Notes | | ||
| | A | Accumulator | Scratchpad for math operations, function calls, etc. | The accumulator -- used in much the same way as A or AX on 6502/8086 style systems. | | | A | Accumulator | Scratchpad for math operations, function calls, etc. | The accumulator -- used in much the same way as A or AX on 6502/8086 style systems. | | ||
| - | | B | Assistant to the Accumulator | Secondary accumulator | This will often hold the results of functins | + | | B | Assistant to the Accumulator | Secondary accumulator | This will often hold the results of functions |
| | X | Column Index Register | Intended to help map 2d memory and arrays, loops, etc. | Often used for example in cursor or pixel array helper functions | | | X | Column Index Register | Intended to help map 2d memory and arrays, loops, etc. | Often used for example in cursor or pixel array helper functions | | ||
| - | | Y | Row Index Regisrer | + | | Y | Row Index Register |
| - | | C, I, J, K | Iterator Registers | C is often used for counting, but I, J, K are also used. Also see: CD, IJ and KT. Some people treat these (especially K, alongside T and TK) as temporary registers | | + | | C, I, J, K | Iterator Registers | C is often used for counting, but I, J, K are also used. Also see: CD, IJ and KT. Some people treat these (especially K, alongside T and KT) as temporary registers | |
| | T | Temporary Register | There is a saying, if you are preserving T you're doing it wrong. Don't PUSH and POP T to protect it-- use it locally and then ignore it. T is our favorite temporary register! | | | T | Temporary Register | There is a saying, if you are preserving T you're doing it wrong. Don't PUSH and POP T to protect it-- use it locally and then ignore it. T is our favorite temporary register! | | ||
| | M, D | Memory pointer and memory pointer Destination. | These are often used in pairings like ELM, ELD, etc, to point to memory locations. As such they are generally for immediate use only and could be used on their own as temporary registers. | ELM is EL as high-byte | | | M, D | Memory pointer and memory pointer Destination. | These are often used in pairings like ELM, ELD, etc, to point to memory locations. As such they are generally for immediate use only and could be used on their own as temporary registers. | ELM is EL as high-byte | | ||
| - | | E, F, G | Extra registers | + | | E, F, G | Extra registers |
| - | | L | The Last True Register | If you really need another register, use this one. For emergency use only. | | + | | L | The Last True Register | If you really need another register, use this one. For emergency use only. | Rarely used. | |
| - | | Z | Z-index pointer | Often used as a third dimensional register for graphics or data processing. | + | | Z | Z-index pointer | Often used as a third dimensional register for graphics or data processing. |
| === Byte Access | === Byte Access | ||
| Line 851: | Line 849: | ||
| - | == NEXT STEPS | + | == Part II Writing Games in Assembly Language |
| What's next is a world of adventure waiting for you to explore! | What's next is a world of adventure waiting for you to explore! | ||
| - | You can continue at: | + | Let's dive in write a real game! In [[Part II Writing Games in Assembly Language|Part II: Writing |
| - | + | ||
| - | * [[Part II: Writing Games in Assembly Language]] | + | |
| - | * [[Part III: Writing | + | |
sd/sd-8516_assembly_language.1775114248.txt.gz · Last modified: by appledog
