Code Monkey home page Code Monkey logo

ja-dcpu's People

Contributors

aimozg avatar markjfisher avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

markjfisher

ja-dcpu's Issues

Arguments allowed in "a" position throw error when in "b" position

I recently started using the latest ja-dcpu and upgrading to DCPU 1.7, and I ran into problems with assembling code that used to assemble correctly. I've boiled it down to issues where arguments considered valid in "a" position yield an error when in "b" position. Here are some examples:

; These work
    set A, [Y + 65535]
    set A, [Y + -1]
    set A, [65535 + Y]
    set A, [-1 + Y]
    set A, [-2]
    set A, [65535]

; These do not work
    set [Y + 65535], A
    set [Y + -1], A
    set [65535 + Y], A
    set [-1 + Y], A
    set [-2], A
    set [65535], A

Incorrect assembly output for [0 + J]

I'm getting invalid assembly output for SET [0 + J], A when compared to SET [J + 0]. The following code illustrates the problem:

SET [0 + J], A
SET B,B
SET [J + 0], A
SET B,B

Disassembling the output gives this:
SET [J+0x0411], A ; [0000] = 0171 '.' 0411 '.'
SET [J+0x0000], A ; [0002] = 0171 '.' 0000 '.'
SET B, B ; [0004] = 0411 '.'

The first instruction did not output the 2nd word for the literal 0, and it seems to have eaten the second instruction. Writing the operand in the other order (J first) seems to output the result correctly.

[SP + n] missing

I get an error when trying to assemble any of the following statements:
SET A, [SP]
SET A, [--SP]
SET A, [SP++]
SET A, [SP + 1]
These are PEEK, PUSH, POP, and PICK n, respectively, which all work correctly.

I was able to work around the issue by using the latter forms, but it seems the earlier forms should be usable as well.

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.