Added example code
This commit is contained in:
29
src/example/char_out.md
Normal file
29
src/example/char_out.md
Normal file
@@ -0,0 +1,29 @@
|
||||
# ```char_out```
|
||||
|
||||
> Version: 1.0.20092.1 \
|
||||
> Created by: Jali <jali@orca-central.de> \
|
||||
> Last modified by: Jali <jali@orca-central.de>
|
||||
|
||||
## About
|
||||
|
||||
The ```char_out``` function is one of the built-in functions from the ROM.
|
||||
It takes a character, and writes it onto the screen, at a specific location.
|
||||
|
||||
## Parameters
|
||||
|
||||
```char_out``` is called through address 0x8468. It takes three parameters:
|
||||
- Register A holds the ASCII code of the character to print
|
||||
- Register DE holds the position on the screen. D is a value between 0 and 3, representing
|
||||
the row, while E has a value between 0-23, representing the column to print in.
|
||||
|
||||
## Example
|
||||
|
||||
```ASM
|
||||
10;Outputs an "A" in the second column of the last row
|
||||
20 ORG 100H ;Tell the assembler to start at addr. 0x100
|
||||
30START: LD A,41H ;Load the letter "A" to register A
|
||||
40 LD DE,301H ;Sets the row to 3 and the column to 1
|
||||
50 CALL 8468H ;Calls the ```char_out``` function
|
||||
60 RET ;Return
|
||||
70 END ;Marks the end of the code for the assembler
|
||||
```
|
||||
Reference in New Issue
Block a user