Giter Club home page Giter Club logo

0x10code's Introduction

0x10co.de - Makes sharing 0x10c code easy!

Uses MongoDB and Express.

Make sure you have nodejs, mongodb and npm installed on your machine.

Install Software

Ubuntu/Debian

sudo apt-get install nodejs mongodb

Other Distros.

Install or compile Node.JS (http://nodejs.org/) and MongoDB (http://www.mongodb.org/)

Install Node Package Manager

Obviously skip this if you already have npm installed

curl http://npmjs.org/install.sh | sudo sh

Install Required Node.JS Packages

npm install

Configure

Copy the example configuration and modify to suit your environment (if needed).

cp config_example.js config.js
vim config.js

Run

node app.js

Setup as Ubuntu Upstart Service

This service example uses supervisor to keep the process alive.

sudo npm install supervisor -g
sudo cp ubuntu.upstart.conf /etc/init/0x10code.conf
sudo vim /etc/init/0x10code.conf

Modify the server path and the execution user accordingly. You will now be able to start/top the server using:

start 0x10code
stop 0x10code

The default setup is to start the server automatically upon server startup. You can change these instructions in the 0x10code.conf file.

0x10code's People

Contributors

a1k0n avatar chessmaster42 avatar cubehouse avatar jazzychad avatar jsanders avatar mappum avatar twisol avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar

0x10code's Issues

keyboard gets weird after pressing tab, arrows and some other keys

If you start http://0x10co.de/htg6u it will echo every (ascii) key on the screen, and return does work, too, but if you hit tab, the program will not see it (and switch to the next screen) and instead further keyboard input will be bunched and out of order. All dead keys, arrow keys, PgUp/PgDown and Fn keys have the same effect.
I'd like to tell you which version of firefox I'm running in case the behaviour is browser dependent, but all I can say is that it is one affected by this: https://bugs.launchpad.net/ubuntu/+source/firefox/+bug/920606

Comments under code?

Could you add area under code for comments, so we can discuss with author of code, propose alternative solutions, etc.?

For start Intense debate/Disqus/Facebook comments would be enough, but in long run own solution should be baked.

Mobile Safari / iOS

It would be amazing if this worked on the iPad, then I could sit in bed and hack! Currently hitting 'Run' does nothing at all. If it helps, I'll see what I can do to debug it on mine..

Notch's emu instead of custom JS one?

Did you think about incorporating Notch's emulator here (possibly with some changes, i.e. code loader) instead of making custom one? This would make sense as Notch permits use of his code with or without modifications, unless you take money for it, so...

Of course he should still be asked if he wants it or not.

Problems with input

When you run any program that uses keyboard input, and then click somewhere, for example on the screen, input stops functioning.

Caching current code

Not an issue, But first way that came to mind to contact you. I have really been bothered by accidentally leaving the page and my code being erased. I save eventually, but I really hate when I accidentally loose code. Could you do something about it? Temporarily cache the code or something?

Branching skip additional if instruction

The branching opcodes take one cycle longer to perform if the test fails. When they skip an if instruction, they will skip an additional instruction at the cost of one extra cycle. This lets you easily chain conditionals.

The skipping of an additional if instruction seems to be not implemented yet.

"ifn 30, I" doesn't work

Example http://0x10co.de/b2nh3

if the first parameter is between -1..30 then it breaks "ifn" operation.

Most likely the reason is that b value in the opcode does not have literal range.
In this case assembler should switch a and b values or use next word for b.

Probably other if statements have the same issue

All programs

Could you add "All programs" list with all programs uploaded to 0x10co.de which we can sort by title, author or date of post? Also way to search in code or in name/description/author would be cool.

Of course "private" flag should be added to posting options that if checked make your program not visible in all listings (all/top/recent programs).

Enter/return is borked on Chrome/Mac OS.

Tested in goforth: http://0x10co.de/hiwhx

Goforth expects enter to send the keycode spec'ed in the keyboard spec. 0x10co.de does generate that keycode, but then it also generates an extra 0x13. It looks like the key is being triggered through both the keydown event and the keypress event. The keypress event doesn't check keyMap, which explains why it's not being converted. But either way, it's extra.

Changing line 413 of ui.js to:
if(e.which >= 37 && e.which <= 40 || e.which === 8 || e.which === 13) e.preventDefault();
fixes it.

not working on Chrome

not working on chrome build 18.0.1025.168
works on Internet explorer on the same computer

SET [A + 0xFFFF], 0xF030 doesn't work

Hello!

There seems to be a problem with [register + literal].
if the value of a register + the value of literal is below 0xFFFF then it is OK. But in case of overflow it doesn't work

Example

SET A, 0x8010
SET [A + 0xFFFF], 0xF030
SET [A + 0x0000], 0xF030
SET [A + 0x0001], 0xF030

It should display three zeros but it displays only two

I am using Mac OSX Lion. Tried it with Safari, Firefox and Chrome

Posting with a Password

I am posting anything that is secured by a password. The address "0x10co.de /?" asks for the password but the address "0x10co.de/fork /?" does not.

problems with DAT

the following code:

:q DAT "Hello world!", 0

:start
IFE [q+I], 0
        SET PC, end

SET A, [q+I]
BOR A, 0xC000
SET [0x8000+I], A
ADD I, 1
SET PC, start

:end

works but this:

:q DAT "Enter a number", 0

:start
IFE [q+I], 0
        SET PC, end

SET A, [q+I]
BOR A, 0xC000
SET [0x8000+I], A
ADD I, 1
SET PC, start

:end

only prints "Enter"

Extreme browser lag HWI

Whenever I call HWI repeatedly (in a loop), no matter to which virtual device, the browser window starts lagging to the point of being unusable.

Happens on Chrome, Firefox and Safari in Mac OS X 10.6.8. Also on Windows 7 64bit.

dEgle95 provided an example program:
http://0x10co.de/ymlgk

Border color format incorrect

The I/O specification on 0x10co.de/io states the following:

"The color of the border of the display may also be set by calling a hardware interrupt. The interrupt key is SET_BORDER_COLOR, which is the number 3 on the LEM1802. The interrupt value in the same HRGB color format as cells."

But according to the NE_LEM1802 specifications, the border color works as follows:

"Each color entry has the following bit format (in LSB-0):
0000rrrrggggbbbb
Where r, g, b are the red, green and blue channels. A higher value means a
lighter color."

Which is definitely not the same as with the cells.

RFI doesn't accept an argument

The 1.7 spec says that RFI takes one value (though it doesn't say what it does with it). As such, some assemblers require that a value is specified, however yours requires that none is specified. It would be nice if yours allowed an argument to be portable with other assemblers and agree with the spec.

I realize that the argument is not particularly useful, but it should be accepted nonetheless.

  • Computerizer

Entering binary numbers

Currently we can only input DEC and HEX numbers into our programs. However sometimes binary is more convenient (like when designing our own font). What I propose is to add "base sufixes" known from most x86 assemblers.

So
XXXXXXXXXXXXXXXXb - binary number
XXXXXd - decimal number
XXXXh - hex number

instead of 0xXXXX for HEX and no suffix for DEC.

Though 0xXXXX/no suffix syntax should remain for compatibility reasons, but should be marked as depracated.

[Feature] Fixed Console/Debugger location on screen.

Can we have the console + debugger scroll down to always remain in view when we are typing somewhere
deep inside a code file?

When tweaking code in a large source file, you keep having to scroll up to reach the console for testing. Then having to scroll back down and find the line you were working on.

An extension to this applies to the code running in step mode.
The code editor can jump to the current line, while always having the console/debugger in view.

Include macro?

How about .include instruction? It would automagically, before execution include content of program located at 0x10co.de/, like #include in c.

For example

set a, 5
.include abcde ;inserts program abcde which modifies a register
add 5, 10

will at second line include code of 0x10co.de/abcde.

It would be useful when developing large projects such as operating systems or games.

Key input buffer issue

Not completely sure, but i think that if users hit the keys to hard too often, 0x9010 will show the most recent key. However, if they hit 2 keys before the cycle gets back to looking for keys, it will start to snowball and eventually stop working. I think the easiest fix would be to set it to the next key pressed, not the latest, and then start adding onto the buffer and maxing it out at 16 if the user keeps spamming buttons. If im wrong, feel free to correct me as ill need to fix some of my code ^^.

Input Raw Compiled Words

I am working on creating a compiler which will produce bytecode. 0x10co.de is perfect for testing the assembly, but I have a feeling that compilers will become more prevalent the closer the game comes to completion.

Create readme with instructions on how to host own server.

Especially with the server being pounded due to Notch's tweet, it has become clear that private servers are going to be useful.

Obviously this is a node.js server, but with the javascript files named program.js or javascript.js, I honestly don't know where to start.

has no method 'createServer'

After following the install procedures, on node app.js execution I get this error:

node.js:201
        throw e; // process.nextTick error, or 'error' event on first tick
              ^
TypeError: Object function createApplication() {
  var app = connect();
  utils.merge(app, proto);
  app.request = { __proto__: req };
  app.response = { __proto__: res };
  app.init();
  return app;
} has no method 'createServer'
    at Object.<anonymous> (/root/0x10code/app.js:19:19)
    at Module._compile (module.js:441:26)
    at Object..js (module.js:459:10)
    at Module.load (module.js:348:31)
    at Function._load (module.js:308:12)
    at Array.0 (module.js:479:10)
    at EventEmitter._tickCallback (node.js:192:40)

I'm running on Ubuntu 11.04 Natty. Any help is appreciated, thanks! I'm just testing some performance optimisations.

BRK not being executed after JSR

the following code:

SET B, 0xC000
SET A, 0x30
JSR print
BRK

:print
SET PUSH, A
BOR A, B
SET [0x8000+J], A
ADD J, 1
SET A, POP
SET PC, POP

prints the character twice.

tested in firefox and chromium.

display not refreshed while stepping through code

Hello, great website.

I was working with a hello world.
When I step through the code, it doesn't seem to refresh the display.
When I click "run", it displays just fine.

If you would like more information, please let me know.
Thanks
Keenan

--- program I was running ---
set i, 0
:loop
set a, [hello_world + i]
ife a, c
set pc, end
bor a, 0x2100
set [0x8000 + i], a
add i, 1
set pc, loop

:end
set pc, end

:hello_world dat "Hello World!", 0

Doesn't detect all hardware devices.

If one has a loop like:

HWN Z

:hw
  HWQ Z
  SUB Z, 1
  SET PC, hw

Not all the hardware devices will be detected by HWQ. For the first iteration in the loop, none of the registers that HWQ sets will actually be set. And only on the second and subsequent iterations will these registers be set.

[Feature] Simple way to adjust clock frequency

Right now it's pinned to 100kHz, why not have a little menu where you can set the frequency to your own value or select from a few, like 1kHz, 10, 50, 100, 200 and so on.
Make it easy to test how programs run under-clocked or over-clocked.

Breakpoints

Can they be added?

HTML-wise, every line, beside line number would have checkbox that indicates BP and when emulator in debug mode run into line with checkbox checked, it'll stop emulation.

Apostrophe (') doesn't work

When I press apostrophe while I'm running, e.g. DCPU text editor, instead of typing it into editor, in my Firefox 9.0 "Quick search (links only)" bar appears and in result it makes it a bit useless (it's just one key, but still...)

Something going on with "dat" and strings

Example: http://0x10co.de/xbdgi

set PC, main

:used_memory 
    dat "Used memory: ", 0 
:current_stack 
    dat "Satack: ", 0

:main

    :end
    brk
        set pc, end

This code gives memory dump like that:
0000:_7f81_0012 0055 0073 0065 0064 0020 006d
0008: 0065 006d 006f 0072 0079 003a 0020 0000
0010: 0000 0000[0040]7f81 0012 0000 0000 0000

Why are first two words of the third row zeros?
There should be data for the string "Satack: "

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.