I/O Handling

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

I/O Handling

Greemngreek
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: I/O Handling

ivant
Actually c % 16 means the remainder of the integer division of c by 16, not the quotient. This comes from the language C (or it could be even older, since C is successor to B, which was a simplified version of BCPL) and is used in C++, Java, C# and others.
Reply | Threaded
Open this post in threaded view
|

Re: I/O Handling

Greemngreek
This post was updated on .
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: I/O Handling

Greemngreek
In reply to this post by ivant
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: I/O Handling

ivant
Greemngreek wrote
Forgot to ask, what about doubt 2?
Yes, basically each bit in the video RAM corresponds to 1 pixel in the display.

Most machines use more bits per pixel so that can support colors or at least shades of gray (or green, or orange, depending on the monitor). The original Macintosh also used black & white display with 1 bit per pixel, so we're in a good company there.
Reply | Threaded
Open this post in threaded view
|

Re: I/O Handling

Greemngreek
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: I/O Handling

ivant
Greemngreek wrote
So to blacken the first 16 pixels,
@SCREEN
M=65536
Doesn't seem right..
It's not! But not because of that. 65536 = 1 0000 0000 0000 0000 in binary. You want to put 1111 1111 1111 1111 instead, which is -1.

So M=-1 would work fine. But if you want to put another value, for example 123, you'll have to first store it in D and then do that
@123
D=A
@SCREEN
M=D

Also, remember that you can put only positive values with @val. So you'll need additional commands to put negative ones.
Reply | Threaded
Open this post in threaded view
|

Re: I/O Handling

Greemngreek
CONTENTS DELETED
The author has deleted this message.