Note that there are some explanatory texts on larger screens.

plurals
  1. POHow does a machine determine what is displayed on a screen (6502 specifically)?
    primarykey
    data
    text
    <p>I know this is an incredibly vague question, and it might not be a good question for programmers, since this is really a hardware related thing, but I guess some assembly/machinecode comes into play which would be appropriate for this site. </p> <p>So what I'm wondering is; imagine the 6502 processor. It has some registers, an instruction set, and access to a certain amount of memory. Then imagine that you have some LCD screen with an arbitrary resolution. How is it determined what is shown on this screen? How is it determined which pixels at which position is given what color? Does the screen always display, for instance, a pixel with the value in the accumulator of the 6502, and with x position stored in register x, and y position stored in y? Or is it interpreted differently by every machine? </p> <p>Someone wrote a JavaScript 6502 emulator, and the device displays a pixel with its value at some memory position starting with $200. So for instance: </p> <pre><code>LDA #$08 STA $200 </code></pre> <p>would display a pinkish pixel at position x:0, y:0. </p> <pre><code>LDA #$01 STA $205 </code></pre> <p>would display a white pixel at position x:5, y:0. </p> <p>If you look at the NES, however, it has a dedicated PPU which displays certain pixels with a certain value at a certain area on the screen. </p> <p>So how does it work? Is it interpreted differently by every machine (i.e. Apple II, C64, NES), or is there some kind of consistency of how it is interpreted? </p> <p>As a matter of fact, what would happen if a program compiled for an Apple II was somehow executed on a C64? The machine should be able to read the instructions, right? </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload