Giter Site home page Giter Site logo

dcpu-16's People

Contributors

krasin avatar rmmh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

dcpu-16's Issues

Add syntax highlighting

Using <textarea> with plaintext for coding is pretty boring... I want to add some colors, but it's may cause some troubles in some browsers (I prefer to do this by myself instead of using existing libraries & frameworks).

Don't fail on .text/.size/.align/.globl

Hi there,

LLVM backend has to emit the instructions like:

:autoinit       ;;Init data stack register C
    SET I, SP
    SUB I, 256

:autostart
    JSR main
:autohalt SET PC, autohalt
    ; .file "/home/jookia/Programming/YADOS/main.c"
    .text
    .globl  main
    ; .align    2
:main
    SUB I, 2 ; The Notch order
    SET [I], 0 ; The Notch order
    SET A, 1337 ; The Notch order
    ADD I, 2 ; The Notch order
    SET PC, POP ; The Notch order

.text, .globl, .align, .size and may be a few others. It's possible to disable output of some of them (like .align), but disabling .text .globl breaks LLVM test suite and makes it impossible to develop.

In the long run, DCPU16 assemblers will likely support these directives, because they are there for a reason. Since there's no demand for proper support of these directives from the users, but there's demand to use Clang/LLVM and there's no technical possibility to avoid emitting them, I would kindly ask deNULL DCPU-16 assembler to ignore lines with these directives.

These directives always match the regex like "[\s]*[.]globl", so it should be pretty easy to ignore such lines.

The full list of directives to ignore (for now) is:

.globl
.size
.text
.data
.align

Run regression tests for the assembler

I have a collection of tests for DCPU16 assemblers (it's not that large now, but this would be improved over time) here: https://github.com/krasin/dcpu16-tests/tree/master/asm

It makes senses to run these regression tests with your assemblers to make sure that it has no known issues and (which is more important) to make sure that all the bugs you will fix in the future, will not appear later.

This issue is to write a script that will run deNULL assembler on these tests.

brk no longer stops/pauses the emulator

brk aka sub pc, 1 used to pause the emulator, but that no longer seems to be working.

It does behave as expected, otherwise. It loops forever on that instruction.

Add expressions parser

Coders should be able to write not only literals or labels (and one register), but any combination of them (support at least +, - and * operations). Will be especially useful after implementing #define and #macro syntax.

Typing is slow

Typing is pretty laggy. Profiling indicates that updating the page with the assembled results after every keystroke causes the slowdown.

Simply not updating innerhhtml if the assembler's return value hasn't changed should fix this.

Dis/assembler is misinterpreting code

From the default 'Try some basic stuff' program on DCPU.ru:

Code: SET [0x1000], 0x20
'Expected' output: 7de1 1000 0020
Actual output: 7fc1 0020 1000
Disassembling the actual output: SET [0x0020], 0x1000

StrangeProblemDCPU

7fc1
o=0b00001=SET
b=0b11110=NEXT WORD
a=0b011111=NEXT WORD (literal)

The problem appears to be that the DCPU specifications do not state which 'NEXT WORD' should be evaluated first.

Macros and label resolution

In the example below, the label end passed to the braf macro is not resolved (it becomes zero) in the assembled output. It should behave like the macro-expanded line following it.

#macro brab(label) {
   sub PC, 2+.-label
}

#macro braf(label) {
   add PC, label-(2+.)
}

:start

dat 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0

brab start
sub PC, 2+.+start
braf end
add PC, end-(2+.)

dat 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0

:end

dat 0

Newline issues with new code editor (?)

If I clear the window and type the following:

dat 4
dat 5

it either is completely unable to parse the second line, or it parses correctly and puts a blank line between the DATs in the disassembly listing on the right. I suspect \r characters are sneaking into the input somehow. It also inserts two line numbers on the left every time I hit enter, but if I paste some code in the line numbers are correct.

So I think hitting Enter is causing a \r and a \n to be inserted in the new code editor, and it's confusing the parser. This is on Chrome/OS X.

edit: whoa! if I try to paste the above in, it pastes with formatting which completely confuses everything.

Keyboard Hardware Device

The keyboard seems to be unresponsive to hardware interrupts, or at least fails to accept keypresses properly. The code I'm running is

SET A, 1
HWI 2

Even if this is run in a loop, C is never set to a nonzero value. Is my code incorrect, or is this a bug?

Improve website interface

dcpu.ru definitely requires some interface improvements (Russian version, help, a bit more neat arrangement of the panels).

Put a LICENSE file

It's very useful to have a LICENSE file on top of your repository to let others know the legal terms of using and contributing to your code.

As a suggestion, you might want to use The MIT License, the text of which can be taken from http://en.wikipedia.org/wiki/MIT_License

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.