Close

Hello simulator !

A project log for Kobold K2 - RISC TTL Computer

A 16 bit RISC computer with video display, from just a few TTL and memory chips. Online C compiler and simulator available.

roelhroelh 11/15/2019 at 15:530 Comments

Today a minor milestone was reached.

The javascript assembler is working (for most instructions). I didn't work yet on the Javascript simulator .

But I also have a Logisim simulator. The assembler output for 'Hello World' was loaded in the Logisim simulator, and it worked ! It's the first real running program written in Kobold Assembly !

The program is this:

            0 ; Kobold K2 assembler test
            1 
            2 screen: equ 0xf000
            3 newline: equ 0x0d
            4 
00000 7C00  5  mov 0,d0
00002 7A20  6  mov text,a2
00004 631E  7  mov screen,a3
00006 7008+ 8 loop:
00008 6540  9  mov (a2),d1
0000A 7242  10  add 2,a2
0000C 9560  11  mov d1,(a3) 
0000E 4514  12  add 0xffff,d1 ;test for zero
00010 A092 b13  brc loop ; branch if non zero
00012 700C+ 14 hlt: jmp hlt
00014 6084 
            15 
00016 AAAA  16  data section
00018 0014-
0001A 0008-
0001C FFFF-
0001E F000-
            17 
            18 text:
00020 0048  19  dw 'H'
00022 0065  20  dw 'e'
00024 006C  21  dw 'l'
00026 006C  22  dw 'l'
00028 006F  23  dw 'o'
0002A 0020  24  dw ' '
0002C 0057  25  dw 'W'
0002E 006F  26  dw 'o'
00030 0072  27  dw 'r'
00032 006C  28  dw 'l'
00034 0064  29  dw 'd'
00036 000D  30  dw newline
00038 0000  31  dw 0

Some remarks:

The Logisim file and the file to be loaded in the Logisim RAM are in the file section. 

The assembler can be tried here: Kobold K2 Assembler. Just press 'Assemble' to run the assembler. Feel free to try some code changes. The assembler can load/store files from/to your own PC.

Discussions