Jump to content

Category:Z80 Assembly: Difference between revisions

m
changed tags to display code correctly, corrected align 8 to 256
m (changed tags to display code correctly)
m (changed tags to display code correctly, corrected align 8 to 256)
 
Line 172:
Some programmers have taken this to its logical extreme by filling several kilobytes' worth of memory with <code>LDI</code> instructions, then pick how many they want to execute by offsetting a pointer to that section of memory. If you have plenty of bytes to burn and the need for speed, it can be a viable option.
 
<syntaxhighlight lang="Z80">
<lang z80>align 8256 ;ensures that the 0thfirst LDI begins at address &xx00
rept &7FF
LDI ;LDI takes up two bytes each, so by storing &7FF of them we fill up &0FFE bytes, nearly 4k!
endr
RET</lang>
</syntaxhighlight>
 
==References==
Cookies help us deliver our services. By using our services, you agree to our use of cookies.