mirror of
https://github.com/AppleCommander/bastools.git
synced 2025-04-06 14:39:28 +00:00
Adding a bit more documentation about the $embed directive.
This commit is contained in:
parent
9f4528bd50
commit
0a6c669907
@ -61,7 +61,7 @@ The framework allows embedding of directives.
|
||||
|
||||
### `$embed`
|
||||
|
||||
`$embed` will allow a binary to be embedded within the resulting application. Please note that once the application is loaeded on the Apple II, the program cannot be altered as the computer will crash. Usage example:
|
||||
`$embed` will allow a binary to be embedded within the resulting application *and will move it to a destination in memory*. Please note that once the application is loaded on the Apple II, the program cannot be altered as the computer will crash. Usage example:
|
||||
|
||||
```
|
||||
5 $embed "read.time.bin", "0x0260"
|
||||
@ -77,6 +77,25 @@ From the `circles-timing.bas` sample, this is the beginning of the program:
|
||||
Ptr, Line 0, CALL 3062, :, GOTO 1, Assembly code...
|
||||
```
|
||||
|
||||
The move code is based on what Beagle Bros put into their [Peeks, Pokes, and Pointers](https://beagle.applearchives.com/Posters/Poster%202.pdf) poster. (See _Memory Move_ under the *Useful Calls*; the `CALL -468` entry.)
|
||||
|
||||
```
|
||||
LDA #<embeddedStart
|
||||
STA $3C
|
||||
LDA #>embeddedStart
|
||||
STA $3D
|
||||
LDA #<embeddedEnd
|
||||
STA $3E
|
||||
LDA #>embeddedEnd
|
||||
STA $3F
|
||||
LDA #<targetAddress
|
||||
STA $42
|
||||
LDA #>targetAddress
|
||||
STA $43
|
||||
LDY #0
|
||||
JMP $FE2C
|
||||
```
|
||||
|
||||
## Optimizations
|
||||
|
||||
Optimizations are mechanisms to rewrite the `Program`, typically making the program smaller. `Optimization` itself is an enum which has a `create` method to setup the `Visitor`.
|
||||
|
Loading…
x
Reference in New Issue
Block a user