Jump to content

GB Programming: Difference between revisions

>Torchickens
No edit summary
>Torchickens
Line 598:
Because two hex digits mean one byte, $D3, as well as $61, is a byte. Since $D3 and H are leftmost in both cases, ld hl, $D361 is actually a shorter form of ld h, $D3 then ld l, $61.
 
Let's say the following instruction is ld ($2315), hl. Applying the same logic would mean H's value would be stored at ($2315), and L's would be at ($2316). However, you just lost THE GAME.; Becausebecause the z80 is a "little-endian" processor, L's value (the "little-end") is stored first, at ($2315). So ($2315) is $61, and ($2316) is $D3.
 
Stop here, and remember this until it becomes natural to you. Because this "little-endian"ness is very tricky for beginners. It is ''very'' important when working with memory.
Line 606:
Initial values :
{| class="wikitable"
|$C000||$C001||$C002||$C003||$C0004C004||$C005||$C006||$C007||$C008||$C009||$C00A||$C00B||$C00C||$C00D||$C00E||$C00F
|-
|$00||$03||$4F||$C0||$DE||$57||$2A||$00||$FF||$01||$23||$34||$56||$78||$9A||$BC
Line 630:
ld ($C00B), hl
</pre>
 
 
==Stacks==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.