Work in Progress

Official 8-BIT COMPUTER

1

was8bit 2019-02-05 01:35 (Edited)

V1.2..... layout
V1.3.... formatting colors
V1.4.... created viable output, use PAUSE to toggle mode
V1.5.... improved mode select.. use PAUSE, (B) chooses, (A) to confirm

8BIT COMPUTER 1.4.nx | Open in app
2019-02-08 11:54
8BIT COMPUTER 1.3.nx | Open in app
2019-02-05 10:10
8BIT COMPUTER 1.2.nx | Open in app
2019-02-05 02:12

moechofe 2019-02-05 20:44

Explain! please?


Timo 2019-02-05 21:12

For me, too :) What's the plan?


moechofe 2019-02-05 21:54

A virtual 8bit computer inside a virtual 8bit fantasy console inside a 64bit modern computer.


was8bit 2019-02-06 04:56 (Edited)

This of course will NOT be a reproduction simulation of the real apple2e machine language programming language... instead these things simply inspired this...

What THIS is, is a visual representation and simulation of an EXTREMELY simplified computer... what you SEE is the actual memory banks, each bank holds a value 0-15 (or 0123456789ABCDEF)

The MAIN memory bank of 16x16 big, starting at the top left corner the memory address is 00... the next memory address is the next one to its right is 10... etc. to the top right most block of memory whose address is F0 .. the bottom right block of memory address is FF... it used x coordinates left to right and y coordinates top to bottom, so an adrress is then its XY coordinate... for reference, I've added these numbers to help figure out what the adress for any one block of memory..

Next, you have register memory... these have special use... there is an A register (derived from the ACCUMULATOR), the X register, and the Y register... there is also the STACK which is a special stack of 16 memory blocks... data is PUSHED to the top (with all data bumping down one, the last one gets lost) and POPPED from the top (with all the data bumping up, the bottom one getting copied up) and the top of this stack is labeled with and S

When this computer is in "RUN" mode, it will begin processing data starting at address 00, proceeds to the right towards address F0... it will continue to address 01 seamlessly as if they are together and continue this left to right, top to bottom, until it reaches address FF where it stops running (much like LowRes can run top to bottom if there were no GOTO or other branching commands)



was8bit 2019-02-06 05:06 (Edited)

It processes in this manner... when it READS a block of memory, it will interpret it as a command based on the following chart... if the command is SINGLE, it will process only that one block of memory, and the next block of memory is again READ. If the command is a DOUBLE, then the very next block is taken as data for that command, and the NEXT block beyond the data block will be READ... so READ steps at one block at a time with SINGLE commands, and two blocks at a time with DOUBLE commands..

Here is the list of all 16 commands...

REM SINGLE BIT COMMANDS
REM
REM 0 READ X,Y TO A
REM 1 PUSH A TO STACK
REM 2 POP STACK TO A
REM 3 GOTO X,Y
REM 4 GOSUB X,Y
REM 5 RETURN TO GOSUB
REM 6 INC A
REM 7 DEC A

REM DOUBLE BIT COMMANDS
REM 1STBIT=COMMAND
REM 2NDBIT = N
REM
REM 8 WRITE N TO X,Y
REM 9 WRITE N TO X
REM A WRITE N TO Y
REM B WRITE N TO A
REM C BRANCH TO X,Y IF A>N
REM D BRANCH TO X,Y IF A<N
REM E BRANCH TO X,Y IF A=N
REM F BRANCH TO X,Y IF A<>N


was8bit 2019-02-06 05:09

So, for example, if the computer is READING a block of memory, and reads a "0", it will execute command 0, which is READ X,Y TO A, so it takes the data from memory address XY (based on whatever is in the X register and what is in the Y register) and put that data into register A


was8bit 2019-02-06 05:15

Another example, if the computer READS 8, this is a double command, so it will also use the next block of data as "N" in its command (when its time to READ another block of memory it will skip the block used as "N" and read the next block after the one used as "N") so the command is WRITE N TO X,Y, so the next block of data after the READ 8 is copied into the memory block address X,Y (based in the values of the X register and Y register at the time this command is executed)


was8bit 2019-02-06 05:19

In the REAL apple2e, you had different blocks of memory designated for different things... some to display page 1 graphics, some page 2 graphics (so you could create one page .... slowly... while the person was looking at a another page) this one for now has no output, you're just looking at the inner workings right now...


was8bit 2019-02-06 05:24

The idea here is to recreate the system where ANY on piece of memory could be interpreted by the computer processor as 1) a command or 2) as data for a command...

... not sure what to do with this after I get it working... I just wanted to enjoy the challenge of creating the simulation ....

... I feel it would need SOME sort of output.... somehow....


was8bit 2019-02-06 05:31

I will be using the PAUSE button to toggle between EDIT mode and RUN mode..

In EDIT mode, you can "program" the memory with data... the registers cannot be edited as they all start out as empty 0 each time you RUN the program

In RUN mode, it will always begin READING at block 0,0 and progress as the commands dictate.. it will only stop running when it reaches block FF


was8bit 2019-02-06 05:33

Theoretically, you can program in blocks of data... that your program could "read" but you have to be sure you organize your code and data so the processor doesn't accidentally process your data as commands, or use your commands as data..


was8bit 2019-02-06 06:01 (Edited)

So, how would the above randomly made "program" actually run!

Block 00: command C5: does not branch as register A (0) is not bigger than 5
Block 20: command 1: push A(0) to top of stack (stack is all 0, no change)
Block 30: command B0: puts value of 0 into register A (wow, regA goes from 0 to 0)
Block 50: command 8B: puts value B into memory block 0,0 (we just rewrote our code)
Block 70: command 93: puts value 3 into register X (oh no!)
Block 90: command 6: INC(rement) register A (it's now 1)
Block A0: command FB: branches to memory 30 as register A (1) <> value B
Block 30: ...um.. we have just encountered an eternal loop... our code will cause the computer to "hang", "freeze", and become unresponsive at this point...

Let's say your code avoided the eternal loop, but you have your code go back to memory 00... But since your code rewrote itself, now if looping back to the start the program will now run differently as your code rewrote itself with different code....


was8bit 2019-02-06 06:06 (Edited)

MY commands are a small list, 0-F.. with small data values 0-F... in the REAL apple2e computer, all commands could range from 00-FF and values from 00-FF, with more complicate registers, stacks, and memories... also, their commands were not as simple.. some commands required more than one bit of data, they might need 4 or more bits of data following the command.. like maybe CF 03EA for one command CF .. most folk wouldn't write their code this raw, they would use assembly language which is one level of interpretation higher then the raw code, letting you use english words like BEQ for Branch if EQual instead of the actual code,CF


was8bit 2019-02-06 06:34

@moechofe..

Actually my "computer" single commands are 4bit, the double ones are 8-bit.

A 64bit command could look like this... F38E1A73B6E82DC5... now THATS power !!!


moechofe 2019-02-06 11:15

Are you using a 64bit computer to develop your 4bit virtual machine inside a 8bit fantasy console? :D


was8bit 2019-02-06 12:34

https://www.thesoundarchive.com/austinpowers/yababy.mp3


moechofe 2019-02-06 20:50

https://youtu.be/sXrOoODYPNE


was8bit 2019-02-07 04:54

Cool link :D


was8bit 2019-02-08 11:58 (Edited)

PLAY mode lets you see the "output" of the code's results... it deviates from the simulation I wanted but the fact is I used up all my available commands and didn't want to change what I had...

How PLAY works is it uses the STACK to create a little melody.. it reads the stack 2bits of data at a time.. data1 is the frequency, data2 is the duration...

EDIT mode is the next thing I'll work on...

RUN mode will be the last thing to work on...


was8bit 2019-02-08 12:09

I "COULD" redo the BRANCH commands, replace > and = with >= freeing up a command slot, and make F command to do a PLAY output of the stack... I believe I'll do that :) this will act like queuing up data into a buffer before "playing" the data :)


was8bit 2019-02-08 12:31

Here are the commands in a new lineup..

REM SINGLE BIT COMMANDS
REM
REM 0 READ X,Y TO A
REM 1 WRITE A TO X,Y
REM 2 PUSH A TO STACK
REM 3 POP STACK TO A
REM 4 INC A
REM 5 DEC A
REM 6 GOTO X,Y
REM 7 GOSUB X,Y
REM 8 RETURN TO GOSUB
REM 9 OUTPUT: PLAY STACK


REM DOUBLE BIT COMMANDS
REM 1STBIT=COMMAND
REM 2NDBIT = N
REM
REM A WRITE N TO A
REM B WRITE N TO X
REM C WRITE N TO Y
REM D BRANCH TO X,Y IF A>=N
REM E BRANCH TO X,Y IF A<N
REM F BRANCH TO X,Y IF A<>N


Timo 2019-02-10 12:37

This looks really interesting, but it seems that my brain energy is already spent and I'm not really able to try it :/


was8bit 2019-02-10 17:24 (Edited)

Thanks :) ... technically it isn't functional yet... will be adding "EDIT" ability to edit in your code, then will add the "RUN" ability which will actually process the code... at that point it should be ready to play with :)


was8bit 2019-02-10 17:29

... and I'll probably tweak the commands to make programming the sound output easier, I already see a couple needed changes... it's challenging limiting my commands to only 16 :)


was8bit 2019-02-10 17:32

In a tiny sort of way I'm doing what you are doing on a HUGE level... using using one type of code to create NX programming code .... which, I'm using to create this tiny programming code ....


Log in to reply.