You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(On Z80, GB, but could maybe pertain to other hardware) It would be nice if Wiz could automatically decompose load instructions on register pairs into load instructions on the individual parts, when a more suitable instruction doesn't exist.
As a simple example, this instruction isn't possible, because there is no load instruction that moves from one 16-bit register to another.
hl = bc;
This annoyingly produces an error. To a newcomer, they may think they need push and pop to load hl with bc, like so:
push(bc);
hl = pop();
But this isn't the most efficient way, and requiring temporary stack memory like this moves this particular step into something Wiz will never do implicitly.
Specifically for hl, there's this possibility, but this is also not the most size or cycle-efficient way:
hl = 0;
hl += bc;
There's a much more straightforward method. 16-bit registers (excepting SP and AF) can be split into their 8-bit parts. Load instructions exist between the general 8-bit registers, so hl = bc can be accomplished like this:
l = c;
h = b;
Wiz could automatically decompose the missing 16-bit load instruction into two 8-bit load instructions. Since this is the most efficient way to synthesize this, and since no registers other than those named in the assignment are accessed, there shouldn't be problems to do this.
The text was updated successfully, but these errors were encountered:
(On Z80, GB, but could maybe pertain to other hardware) It would be nice if Wiz could automatically decompose load instructions on register pairs into load instructions on the individual parts, when a more suitable instruction doesn't exist.
As a simple example, this instruction isn't possible, because there is no load instruction that moves from one 16-bit register to another.
This annoyingly produces an error. To a newcomer, they may think they need
push
andpop
to load hl with bc, like so:But this isn't the most efficient way, and requiring temporary stack memory like this moves this particular step into something Wiz will never do implicitly.
Specifically for hl, there's this possibility, but this is also not the most size or cycle-efficient way:
There's a much more straightforward method. 16-bit registers (excepting SP and AF) can be split into their 8-bit parts. Load instructions exist between the general 8-bit registers, so
hl = bc
can be accomplished like this:Wiz could automatically decompose the missing 16-bit load instruction into two 8-bit load instructions. Since this is the most efficient way to synthesize this, and since no registers other than those named in the assignment are accessed, there shouldn't be problems to do this.
The text was updated successfully, but these errors were encountered: