Here's some sample code:
function sget(sprID,x,y)
if x<0 or x>7 or y<0 or y>7 then return 0 end
return peek4(0x8000+((sprID&511)<<6)+(y<<3)+x)
end
function sset(sprID,x,y,color)
if x<0 or x>7 or y<0 or y>7 then return end
poke4(0x8000+((sprID&511)<<6)+(y<<3)+x,color)
end