It works
I worked on the backend of the emulator a lot. I coded the remaining parts of all of the components, then I made a clock and finally put everything together to make the working emulator.
The processor can now execute all three DTA instructions properly: COPY, SET, and PULSE
The instruction decoder reads the instruction words, figures out what operation needs to happen, and the processor performs it through the appropriate registers and pins.
There were also a bunch of weird bugs like components not being able to update their own read-only registers and memory size limits 
A processor isn’t very useful without any output devices
so I made a GPU device to output pictures.
It has a 64x64 pixel screen to which the processor can write pixels to. It has only black and white pixels because… i was lazy ig 
I then tried running some programs on it!
Like one that continuously tries to write to read-only registers and throws infinite errors!
ok that one was for testing
I tried making a program that actually uses the screen, and I thought of just drawing a checkerboard pattern on the screen.
Unfortunately I was too ambitious and it didn’t work. at all. 
So i tried just drawing one pixel to the screen and WOW IT WORKED! no it didnt it still did nothing
I did a bunch of backend debugging stuff which is really boring and complicated and I had to move the device register update code in the DSC to its own pin and trigger method and akcgcrwqajhxte tldr a bunch of confusing stuff 
Finally i got the pixels to work! There was now one white pixel on the screen! exciting!
I had to do a lot more debugging for the checkerboard thing to work. I didn’t make an assembler as of now, so I had to write all the machine code myself
(Literally writing with numbers)
And catching bugs was impossible because again, you’re looking at a bunch of numbers. Anything as simple as adding a line of code was a pain because it shifts the memory addresses of all the lines of code after that, which messes with jump conditions and stuff.
Despite all that IT WORKED
it does run quite slow because its more than 30 instructions for each iteration of the loop, it takes a few seconds for it to finish the image at a clock speed of 10 kilohertz.
This is basically how the program works:
- Initialize the DSC and GPU on device 0
- Set up the variables in memory for X and Y coordinates
And then start running an infinite loop in which all this happens:
- Increment X by 2
- Then check if X is 64, if it is, increment Y by 1 and set X to 1
- Check if X is 63, if it is, increment Y by 1 and set X to 0.
- Write the
PIXELinstruction, X coordinate, Y coordinate and pixel colour to the GPU via the DSC. - Repeat until heat death of the universe
All that generates this cool checkerboard pattern on the screen.
(This is 44 lines of assembly
)
Anyway look at this picture:
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.