Jump to content

Generic swap: Difference between revisions

m
Line 3,600:
 
===Game Boy===
The Game Boy is missing all the exchange commands that the Z80 and 8080 both have. There are no shadow registers, <code>EX</code>, or <code>EXX</code>, asand wellyou ascannot loadingload/storingstore 16-bit register pairs directly from/to/from immediate memory addresses. The only register that can store directly to memory is the stack pointer (<code>SP</code>), and it can only store, not load! But not all is lost. <code>EX DE,HL</code> can be mimicked with the following sequence; although it's much slower than the Zilog's <code>EX DE,HL</code>, it's as quick as it possibly can be.
 
<lang z80>push hl
1,489

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.