-
-
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 optimized
lbswap
and llbswap
- Loading branch information
Showing
4 changed files
with
50 additions
and
0 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
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,15 @@ | ||
assume adl=1 | ||
|
||
section .text | ||
public __lbswap | ||
__lbswap: | ||
push hl ; ...[hlu]hl <- (sp) | ||
inc sp ; ...[hlu]h <- (sp) | ||
ld h, e ; uhl = [hlu]el | ||
push hl ; ...[hlu]h[hlu]el <- (sp) | ||
inc sp ; ...[hlu]h[hlu]e <- (sp) | ||
ld e, l | ||
pop hl ; euhl = lh[hlu]e | ||
; ...[hlu] <- (sp) | ||
inc sp ; ... <- (sp) | ||
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,16 @@ | ||
assume adl=1 | ||
|
||
section .text | ||
public __llbswap | ||
__llbswap: | ||
push af | ||
ld a, b ; a = b | ||
ld b, l ; bcudeuhl = lc[deu]de[hlu]hl | ||
ld l, d ; bcudeuhl = lc[deu]de[hlu]hd | ||
ld d, c ; bcudeuhl = lc[deu]ce[hlu]hd | ||
ld c, h ; bcudeuhl = lh[deu]ce[hlu]hd | ||
ld h, e ; bcudeuhl = lh[deu]ce[hlu]ed | ||
ld e, a ; bcudeuhl = lh[deu]cb[hlu]ed | ||
ex de, hl ; bcudeuhl = lh[hlu]ed[deu]cb | ||
pop af | ||
ret |