2016-12-10 17:23:07 +00:00
|
|
|
#include "powerpc.h"
|
|
|
|
|
|
|
|
.sect .text
|
|
|
|
|
|
|
|
! Create empty set.
|
2017-01-15 21:28:14 +00:00
|
|
|
! Stack: ( size -- set )
|
2016-12-10 17:23:07 +00:00
|
|
|
|
|
|
|
.define .zer
|
|
|
|
.zer:
|
2017-01-15 21:28:14 +00:00
|
|
|
lwz r3, 0(sp)
|
|
|
|
addi sp, sp, 4
|
|
|
|
|
2016-12-10 17:23:07 +00:00
|
|
|
rlwinm r7, r3, 30, 2, 31
|
|
|
|
addi r4, r0, 0 ! r4 = zero
|
|
|
|
neg r5, r3
|
|
|
|
add sp, sp, r5 ! allocate set
|
|
|
|
mr r6, sp ! r6 = ptr to set
|
|
|
|
mtspr ctr, r7 ! ctr = r3 / 4
|
|
|
|
1:
|
|
|
|
stw r4, 0(r6) ! store zero in set
|
|
|
|
addi r6, r6, 4
|
|
|
|
bc DNZ, 0, 1b ! loop ctr times
|
|
|
|
bclr ALWAYS, 0, 0
|