sd-8516_assembly_language_part_ii
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| sd-8516_assembly_language_part_ii [2026/02/14 02:50] – appledog | sd-8516_assembly_language_part_ii [2026/02/21 15:31] (current) – appledog | ||
|---|---|---|---|
| Line 209: | Line 209: | ||
| - | == Lesson | + | == Lesson |
| - | There are several ways you can debug programs in SDA assembly. | + | There are several ways you can debug programs in SDA assembly. |
| + | |||
| + | === SED/CLD | ||
| + | In research or development builds, inserting SED will turn on trace debugging and you will be able to see what the CPU is executing. However, for release or community edition builds | ||
| === INT 05h IO_PUTNUM | === INT 05h IO_PUTNUM | ||
| - | One way is to use IO_PUTNUM | + | IO_PUTNUM |
| LDB #10 ; print a number in b (0-65535) | LDB #10 ; print a number in b (0-65535) | ||
| + | | ||
| LDAH $63 ; IO_PUTNUM | LDAH $63 ; IO_PUTNUM | ||
| INT $05 | INT $05 | ||
| - | |||
| === INT 05h IO_PRINT_STR | === INT 05h IO_PRINT_STR | ||
| + | Similarly, IO_PRINT_STR will print a string followed by a newline. | ||
| + | |||
| LDBLX @hello_world | LDBLX @hello_world | ||
| LDAH $66 ; IO_PRINT_STR | LDAH $66 ; IO_PRINT_STR | ||
| Line 237: | Line 241: | ||
| === INT 10h print string | === INT 10h print string | ||
| - | The interface for the above is based on the KERNAL BIOS interface | + | The interface for the above is based on the KERNAL BIOS interface |
| LDAH $26 ; | LDAH $26 ; | ||
| Line 243: | Line 247: | ||
| INT 0x10 | INT 0x10 | ||
| - | The underlying function that this calls is write_string, but outside of kernal assembly | + | Note: The assembler will place a #13 (CR, hex $0D) inside the string if you type \n. However, if you are dealing with strings on your own you must handle |
| - | LDBLX @hello_world | + | You can also just call IO_NEWLINE from INT 05h, which calls **'' |
| - | CALL @write_string | + | |
| - | + | ||
| - | CALL @carriage_return | + | |
| - | CALL @linefeed | + | |
| - | + | ||
| - | For user use, the assembler will place a #13 (CR, hex $0D) inside the string if you type \n. Therefore although there is no carriage return function, you can do that via the set cursor position | + | |
| - | + | ||
| - | If you need to issue a newline on it's own you can store the cursor position, issue a CRLF at the bottom of the screen and then restore the cursor X position. | + | |
| - | Also, under the hood, IO_NEWLINE from int 05 calls **'' | + | |
| === INT 10h print char | === INT 10h print char | ||
| Line 278: | Line 273: | ||
| + | == NEXT STEPS | ||
| + | What's next is a world of adventure waiting for you to explore. Here are some resources to help you get started: | ||
| + | |||
| + | * [[SD-8516 ISA Profile]] -- A detailed review of the opcodes available on the SD-8516. | ||
| + | * [[VC-3 System Interrupt Table]] -- A comprehensive list of KERNAL routines. | ||
| + | * [[wozmon]] -- A port of wozmon to the SD-8516, alongside instructions on how to use it to enter, load and save programs. | ||
| + | * [[SD-8516 Assembly Language]] -- Now that you know the basics, you might want to try this! | ||
| + | It's worth pointing out that most of this is intended to eventually be included or listed as part of the [[SD-8516 Programmer' | ||
sd-8516_assembly_language_part_ii.1771037441.txt.gz · Last modified: by appledog
