User Tools

Site Tools


sd:sd-8516_assembly_language

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
sd:sd-8516_assembly_language [2026/04/02 07:35] appledogsd:sd-8516_assembly_language [2026/04/05 09:51] (current) appledog
Line 16: Line 16:
  
 == How to Enter and Run Assembly Language Programs == How to Enter and Run Assembly Language Programs
-There are two ways. Oneyou can use the ASSEMBLE command from Stellar BASIC V1.0:+There are several ways. One is to use an external editor and load it into ''ed'' using the ''autotyper'' (or just type it using ''ed''). Then you can do something like 
 + 
 +    as filename.asm progname 
 + 
 +But for quick projects you can also use the ASSEMBLE command from Stellar BASIC V1.0:
  
     10 ASSEMBLE     10 ASSEMBLE
Line 94: Line 98:
  
 For today, let's do a deep-dive on the registers, because there's a little more to them than merely being 16 bit words. For today, let's do a deep-dive on the registers, because there's a little more to them than merely being 16 bit words.
- 
  
 === 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're general purpose, there is nothing separating one register from another except convention. You can feel free to use this guide, or use them any way you like. There are sixteen general purpose registers available for use> Here they are, with a short comment on name and purpose. Of course, since they're general purpose, there is nothing separating one register from another except convention. You can feel free to use this guide, or use them any way you like.
- 
  
 ^ 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 called with A as a variable. Often used as the high byte, or bank pointer, combind with A (see: register AB) |+| B | Assistant to the Accumulator | Secondary accumulator | This will often hold the results of functions called with A as a variable. |
 | 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 | Intended to act as a row or record indicator alongside X. | Can form the XY paired register with X. | +| Y | Row Index Register | Intended to act as a row or record indicator alongside X. | 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 most often used as high bytes for 24-bit memory access ex. GLD, FLM, etc. but can also be used for general purpose (espG -- use G for anything! And in that sense, F is the 'Free Register' -- use it as you like!) +| E, F, G | Extra registers | Most often used as high bytes for 24-bit memory access ex. GLD, FLM, etc. but can also be used for general purpose 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. ExFLZ |+| Z | Z-index pointer | Often used as a third dimensional register for graphics or data processing. | Often used as a temporary register. |
  
 === Byte Access === Byte Access
Line 847: 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!
  
-If you'd like to dive in and start by studying a real game, check out you may also be interested in: [[Part II Writing Games in Assembly Language|Part II: Writing Games in Assembly Language]]+Let'dive in write a real game! In [[Part II Writing Games in Assembly Language|Part II: Writing Games in Assembly Language]] we will walk through an Assembly Language version of ROBOTS.BAS
- [[Part II Writing Games in Assembly Language|Part II: Writing Games in Assembly Language]] where we will walk through an Assembly Language version of ROBOTS.BAS+
sd/sd-8516_assembly_language.1775115357.txt.gz · Last modified: by appledog

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki