aimozg / ja-dcpu Goto Github PK
View Code? Open in Web Editor NEW0x10c DCPU implementation in Java (assembler, disassembler, CPU and peripherals emulator)
0x10c DCPU implementation in Java (assembler, disassembler, CPU and peripherals emulator)
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
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.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.