-
-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement enough junk for my long long test program to link
- Loading branch information
Showing
13 changed files
with
448 additions
and
5 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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
public __lcmps_fast | ||
__lcmps_fast: | ||
ld d, a | ||
ld a, e | ||
sub a, d | ||
ret nz | ||
sbc hl, bc | ||
ret z | ||
sbc a, a | ||
ret nz | ||
inc a | ||
ret |
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,8 @@ | ||
public __lcmpu_fast | ||
__lcmpu_fast: | ||
sub a, e | ||
ccf | ||
ret nz | ||
or a, a | ||
sbc hl, bc | ||
ret |
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,53 @@ | ||
public __llcmpu | ||
__llcmpu: | ||
if 0 | ||
ld iy, 0 | ||
add iy, sp | ||
ld a, b | ||
sub a, (iy + 10) | ||
ret nz | ||
ld a, c | ||
sub a, (iy + 9) | ||
ret nz | ||
ex de, hl | ||
ld bc, (iy + 6) | ||
sbc hl, bc | ||
ret nz | ||
ex de, hl | ||
ld bc, (iy + 3) | ||
sbc hl, bc | ||
ret | ||
else | ||
ld a, c | ||
ld iyh, b | ||
pop bc | ||
or a, a | ||
sbc hl, bc | ||
ex de, hl | ||
pop bc | ||
pop de | ||
jr nz, .ne24 | ||
sbc hl, bc | ||
jr nz, .ne48 | ||
sbc a, e | ||
jr nz, .ne56 | ||
ld a, iyh | ||
sbc a, d | ||
ld hl, 9 | ||
add hl, sp | ||
ld sp, hl | ||
ret | ||
.ne24: | ||
sbc hl, bc | ||
.ne48: | ||
sbc a, e | ||
.ne56: | ||
ld a, iyh | ||
sbc a, d | ||
ld hl, 9 | ||
add hl, sp | ||
ld sp, hl | ||
ret nz | ||
inc a | ||
ret | ||
end if |
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,53 @@ | ||
public __llcmpu_fast | ||
__llcmpu_fast: | ||
if 1 | ||
ld iy, 0 | ||
add iy, sp | ||
ld a, b | ||
sub a, (iy + 10) | ||
ret nz | ||
ld a, c | ||
sub a, (iy + 9) | ||
ret nz | ||
ex de, hl | ||
ld bc, (iy + 6) | ||
sbc hl, bc | ||
ret nz | ||
ex de, hl | ||
ld bc, (iy + 3) | ||
sbc hl, bc | ||
ret | ||
else | ||
ld a, c | ||
ld iyh, b | ||
pop bc | ||
or a, a | ||
sbc hl, bc | ||
ex de, hl | ||
pop bc | ||
pop de | ||
jr nz, .ne24 | ||
sbc hl, bc | ||
jr nz, .ne48 | ||
sbc a, e | ||
jr nz, .ne56 | ||
ld a, iyh | ||
sbc a, d | ||
ld hl, 9 | ||
add hl, sp | ||
ld sp, hl | ||
ret | ||
.ne24: | ||
sbc hl, bc | ||
.ne48: | ||
sbc a, e | ||
.ne56: | ||
ld a, iyh | ||
sbc a, d | ||
ld hl, 9 | ||
add hl, sp | ||
ld sp, hl | ||
ret nz | ||
inc a | ||
ret | ||
end if |
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,27 @@ | ||
public __lldivu | ||
__lldivu: | ||
public __lldivu_b_fast | ||
__lldivu_b_fast: | ||
; Not well-optimized | ||
ld iy, 0 | ||
add iy, sp | ||
ld iy, (iy + 3) | ||
ld iyh, 64 | ||
.loop: | ||
adc hl, hl | ||
ex de, hl | ||
adc hl, hl | ||
ex de, hl | ||
rl c | ||
rl b | ||
rla | ||
jr c, .1 | ||
cp a, iyl | ||
jr nc, .0 | ||
.1: | ||
sub a, iyl | ||
inc l | ||
.0: | ||
dec iyh | ||
jr nz, .loop | ||
ret |
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,63 @@ | ||
public __llmulu | ||
__llmulu: | ||
public __llmulu_b_fast | ||
__llmulu_b_fast: | ||
ld iy, 0 | ||
add iy, sp | ||
push de | ||
push hl | ||
ld a, (iy + 3) | ||
ld h, a | ||
mlt hl | ||
ld (iy - 6), l | ||
ld d, a | ||
ld e, (iy - 5) | ||
mlt de | ||
ld l, h | ||
ld h, 0 | ||
add hl, de | ||
ld (iy - 5), l | ||
ld d, a | ||
ld e, (iy - 4) | ||
mlt de | ||
ld l, h | ||
ld h, 0 | ||
add hl, de | ||
ld (iy - 4), l | ||
ld d, a | ||
ld e, (iy - 3) | ||
mlt de | ||
ld l, h | ||
ld h, 0 | ||
add hl, de | ||
ld (iy - 3), l | ||
ld d, a | ||
ld e, (iy - 2) | ||
mlt de | ||
ld l, h | ||
ld h, 0 | ||
add hl, de | ||
ld (iy - 2), l | ||
ld d, a | ||
ld e, (iy - 1) | ||
mlt de | ||
ld l, h | ||
ld h, 0 | ||
add hl, de | ||
ld (iy - 1), l | ||
ld d, a | ||
ld e, c | ||
mlt de | ||
ld l, h | ||
ld h, 0 | ||
add hl, de | ||
ld c, l | ||
ld d, a | ||
ld e, b | ||
mlt de | ||
ld a, h | ||
add a, e | ||
ld b, a | ||
pop hl | ||
pop de | ||
ret |
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,31 @@ | ||
public __llshrs | ||
__llshrs: | ||
; Not well-optimized, but it probably works | ||
push iy | ||
ld iy, 0 | ||
add iy, sp | ||
push af | ||
ld a, c | ||
ld c, b | ||
ld b, (iy + 6) | ||
inc b | ||
dec b | ||
jr z, .finish | ||
push de | ||
push hl | ||
.loop: | ||
sra c | ||
rra | ||
rr (iy - 1) | ||
rr d | ||
rr e | ||
rr (iy - 4) | ||
rr h | ||
rr l | ||
djnz .loop | ||
ld b, c | ||
ld c, a | ||
.finish: | ||
pop af | ||
pop iy | ||
ret |
Oops, something went wrong.