File tree 1 file changed +33
-37
lines changed
1 file changed +33
-37
lines changed Original file line number Diff line number Diff line change @@ -68,52 +68,25 @@ alloc_size= tmp1
68
68
.endproc ; Fall through
69
69
70
70
; Increase program memory area X by A (size in bytes)
71
- alloc_area_8:
72
- ldy # 0
73
- ; Increase program memory area X by AY (size in bytes)
74
- .proc alloc_area
75
- sty alloc_size + 1
76
- skip_y: sta alloc_size
77
-
71
+ .proc alloc_area_8
72
+ sta alloc_size
78
73
clc
79
74
adc mem_end
80
75
tay
81
- lda alloc_size + 1
76
+
77
+ lda # 0
78
+ sta alloc_size + 1
82
79
adc mem_end + 1
80
+
83
81
cpy MEMTOP
84
82
sbc MEMTOP + 1
85
83
bcs rts_1
86
84
87
- ; Move memory up by "alloc_size"
88
- stx save_x + 1
89
- jsr move_mem_up
90
- ; Adjust pointers
91
- save_x: ldx # 0
92
- .endproc ; Fall through
93
-
94
- ; Increase all pointers from "Y" to the last by AX
95
- .proc add_pointers
96
- loop : clc
97
- lda mem_start , x
98
- adc alloc_size
99
- sta mem_start , x
100
- inx
101
- lda mem_start , x
102
- adc alloc_size + 1
103
- sta mem_start , x
104
- inx
105
- cpx #mem_end - mem_start + 2
106
- bne loop
107
- clc
108
- ::rts_1:
109
- rts
110
- .endproc
111
-
112
85
; Move memory up.
113
- ; Y : index to pointer to move from
86
+ ; X : index to pointer to move from
114
87
; alloc_size : amount to move up
115
- ;
116
- .proc move_mem_up
88
+ stx save_x + 1
89
+
117
90
; Setup pointers
118
91
lda mem_start , x
119
92
sta move_dwn_src
@@ -134,9 +107,32 @@ loop: clc
134
107
sbc mem_start + 1 , x
135
108
tax
136
109
pla
137
- jmp move_dwn
110
+ jsr move_dwn
111
+
112
+ ; Adjust pointers
113
+ save_x: ldx # 0
114
+
115
+ .endproc ; Fall through
116
+
117
+ ; Increase all pointers from "Y" to the last by AX
118
+ .proc add_pointers
119
+ loop : clc
120
+ lda mem_start , x
121
+ adc alloc_size
122
+ sta mem_start , x
123
+ inx
124
+ lda mem_start , x
125
+ adc alloc_size + 1
126
+ sta mem_start , x
127
+ inx
128
+ cpx #mem_end - mem_start + 2
129
+ bne loop
130
+ clc
131
+ ::rts_1:
132
+ rts
138
133
.endproc
139
134
135
+
140
136
;----------------------------------------------------------
141
137
; Parser initialization here:
142
138
.proc parser_alloc_init
You can’t perform that action at this time.
0 commit comments