RISC Relay CPU calculates Fibonacci
At this moment, the cpu is partially built. The data is only 8 bit wide (in stead of 16).
Only
4 8-bit registers are present, and it does not run at full speed. (This machine should be capable of executing more than 100 instructions per second) This is the program: 0000 0000 0 nop 1 ; calc fibonacci numbers 2 start: 0001 7800 3 ld cl,0x0 ; number A 0002 2001 4 st [1],cl 0003 7A01 5 ld dl,0x1 ; number B 6 loop: 0004 1001 7 ld cl,[1] 0005 2201 8 st [1],dl 0006 0461 9 segb xl,[1] ; display number B 0007 0641 10 sega yl,[1] 0008 DA08 11 dadd dl,cl ; add numbers 0009 0855 12 teq cl,0x55 ; last displayable number 000A 49F8 13 brnz loop 000B 39F4 14 br start The video needs no background music.... You might also like Envionic. RISC Relay CPU calculates Fibonacci
At this moment, the cpu is partially built. The data is only 8 bit wide (in stead of 16).
Only
4 8-bit registers are present, and it does not run at full speed. (This machine should be capable of executing more than 100 instructions per second) This is the program: 0000 0000 0 nop 1 ; calc fibonacci numbers 2 start: 0001 7800 3 ld cl,0x0 ; number A 0002 2001 4 st [1],cl 0003 7A01 5 ld dl,0x1 ; number B 6 loop: 0004 1001 7 ld cl,[1] 0005 2201 8 st [1],dl 0006 0461 9 segb xl,[1] ; display number B 0007 0641 10 sega yl,[1] 0008 DA08 11 dadd dl,cl ; add numbers 0009 0855 12 teq cl,0x55 ; last displayable number 000A 49F8 13 brnz loop 000B 39F4 14 br start The video needs no background music.... You might also like Envionic.
|