-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[NFC] Use .zeropage directive throughout SDK.
- Loading branch information
1 parent
c851b3f
commit f795a2f
Showing
41 changed files
with
634 additions
and
548 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
.include "imag.inc" | ||
|
||
.global __do_init_stack | ||
|
||
; Initialize soft stack pointer to MEMTOP | ||
.section .init.100,"axR",@progbits | ||
__do_init_stack: | ||
lda $2e5 | ||
sta mos8(__rc0) | ||
sta __rc0 | ||
lda $2e6 | ||
sta mos8(__rc1) | ||
sta __rc1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
.text | ||
|
||
; | ||
; unsigned cbm_k_iobase (void); | ||
; | ||
.global cbm_k_iobase | ||
jsr __IOBASE | ||
txa | ||
sty __rc2 | ||
ldx __rc2 | ||
rts | ||
.include "imag.inc" | ||
|
||
.text | ||
|
||
; | ||
; unsigned cbm_k_iobase (void); | ||
; | ||
.global cbm_k_iobase | ||
jsr __IOBASE | ||
txa | ||
sty __rc2 | ||
ldx __rc2 | ||
rts | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
.text | ||
|
||
; | ||
; unsigned int cbm_k_load(unsigned char flag, unsigned addr); | ||
; | ||
.global cbm_k_load | ||
cbm_k_load: | ||
ldy __rc2 | ||
jmp __LOAD | ||
.include "imag.inc" | ||
|
||
.text | ||
|
||
; | ||
; unsigned int cbm_k_load(unsigned char flag, unsigned addr); | ||
; | ||
.global cbm_k_load | ||
cbm_k_load: | ||
ldy __rc2 | ||
jmp __LOAD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,14 @@ | ||
.text | ||
|
||
__rs1 = __rc2 | ||
__rs2 = __rc4 | ||
|
||
; | ||
; unsigned char cbm_k_save(unsigned int start, unsigned int end); | ||
; | ||
.global cbm_k_save | ||
cbm_k_save: | ||
sta __rs2 | ||
stx __rs2 + 1 | ||
ldx __rc2 | ||
ldy __rc2 + 1 | ||
lda #__rs2 | ||
jmp __SAVE | ||
|
||
.include "imag.inc" | ||
.text | ||
|
||
; | ||
; unsigned char cbm_k_save(unsigned int start, unsigned int end); | ||
; | ||
.global cbm_k_save | ||
cbm_k_save: | ||
sta __rc4 | ||
stx __rc5 | ||
ldx __rc2 | ||
ldy __rc3 | ||
lda #__rc4 | ||
jmp __SAVE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
.text | ||
|
||
; | ||
; void cbm_k_setlfs (unsigned char LFN, unsigned char DEV, unsigned char SA); | ||
; | ||
.global cbm_k_setlfs | ||
cbm_k_setlfs: | ||
ldy __rc2 | ||
jmp __SETLFS | ||
.include "imag.inc" | ||
|
||
.text | ||
|
||
; | ||
; void cbm_k_setlfs (unsigned char LFN, unsigned char DEV, unsigned char SA); | ||
; | ||
.global cbm_k_setlfs | ||
cbm_k_setlfs: | ||
ldy __rc2 | ||
jmp __SETLFS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
.text | ||
|
||
__rs1 = __rc2 | ||
|
||
; | ||
; void cbm_k_setnam (const char* Name); | ||
; | ||
.global cbm_k_setnam | ||
cbm_k_setnam: | ||
lda __rs1 | ||
pha | ||
lda __rs1 + 1 | ||
pha | ||
jsr strlen | ||
sta __rc2 | ||
pla | ||
tay | ||
pla | ||
tax | ||
lda __rc2 | ||
jmp __SETNAM | ||
.include "imag.inc" | ||
|
||
.text | ||
|
||
; | ||
; void cbm_k_setnam (const char* Name); | ||
; | ||
.global cbm_k_setnam | ||
cbm_k_setnam: | ||
lda __rc2 | ||
pha | ||
lda __rc3 | ||
pha | ||
jsr strlen | ||
sta __rc2 | ||
pla | ||
tay | ||
pla | ||
tax | ||
lda __rc2 | ||
jmp __SETNAM |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
add_library(common-asminc INTERFACE) | ||
target_include_directories(common-asminc BEFORE INTERFACE .) | ||
install(FILES imag.inc DESTINATION ${ASMINCDIR}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.zeropage __rc0, __rc1, __rc2, __rc3, __rc4, __rc5, __rc6, __rc7, __rc8, __rc9 | ||
.zeropage __rc10, __rc11, __rc12, __rc13, __rc14, __rc15, __rc16, __rc17, __rc18 | ||
.zeropage __rc19, __rc20, __rc21, __rc22, __rc23, __rc24, __rc25, __rc26, __rc27 | ||
.zeropage __rc28, __rc29, __rc30, __rc31 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
.include "imag.inc" | ||
|
||
.global __do_init_stack | ||
|
||
; Initialze soft stack pointer from __stack symbol. | ||
.section .init.100,"axR",@progbits | ||
__do_init_stack: | ||
lda #mos16lo(__stack) | ||
sta mos8(__rc0) | ||
sta __rc0 | ||
lda #mos16hi(__stack) | ||
sta mos8(__rc1) | ||
sta __rc1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.