[A83] Re: Official H**s Replacement Commands (OT)
[Prev][Next][Index][Thread]
[A83] Re: Official H**s Replacement Commands (OT)
To clarify a bit, what he's saying is that >> 8 and & 255 are used to get the 8-bit pieces of a 16-bit address. For example, when you do:
ld hl,plotsscreen
What you're doing is equivalent to
ld h,plotsscreen >> 8 ;upper byte
ld l,plotsscreen & 255 ;lower byte
Thus you can use >> 8 and & 255 to just get one piece of the address if you don't want to do an entire 16-bit load.
In a message dated Tue, 3 Jul 2001 3:35:01 PM Eastern Daylight Time, "Kirk Meyer" <kirk.meyer@colorado.edu> writes:
<<
>> 8 shifts right 8 (get upper byte)
& 255 ands with 255 (get lower byte)
In this code it's obviously a joke, but >> 8 is often used for optimizing
tables by splitting them across 256 bytes.
-----Original Message-----
From: assembly-83-bounce@lists.ticalc.org
[mailto:assembly-83-bounce@lists.ticalc.org]On Behalf Of Jeff Ruud
Sent: Tuesday, July 03, 2001 1:24 PM
To: assembly-83@lists.ticalc.org
Subject: [A83] Re: Official H**s Replacement Commands (OT)
What are the >> and & in those lines for?
ld a,plotsscreen >> 8
ld a,plotsscreen & 255
__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/
>>