Last active
March 9, 2017 21:57
-
-
Save gnacu/952a8acbe67e46ec8cd91ea66ec88816 to your computer and use it in GitHub Desktop.
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
salloc ;Struct Allocate | |
.block | |
lda offset | |
sta ptr ;Set lo addr byte | |
bne incoff | |
pha | |
lda #1 ;Alloc one page | |
jsr pgalloc | |
tay ;Page addr -> .Y | |
lda #0 | |
jsr memset ;Zero the page | |
sty page | |
lda rootpg | |
bne skip | |
sty rootpg ;Assign root ptr | |
skip pla | |
incoff clc | |
adc #entrysize | |
sta offset | |
lda page | |
sta ptr+1 ;Set hi addr byte | |
rts | |
page .byte 0 ;Current struct page. | |
offset .byte 0 ;Current page offset. | |
.bend |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment