Skip to content

Instantly share code, notes, and snippets.

@Jarvix
Jarvix / gist:2328917
Created April 7, 2012 13:30
jxAssembler preprocessor and parser
.include "Test2.s"
; Comment lines
; another one
:lala
SET A, 0x30 ; should be
SET [ A+0x1000 ], 0x20; removed
SUB A, [ 0x1000]
IFN A, 0x10
0x00-0x08: register (A, B, C, X, Y, Z, I, J or SP, in that order)
0x09-0x11: [register]
0x12-0x1a: [next word + register]
0x1b: SP ; FREE! :D
0x1c: PC
0x1d: O
0x1e: [next word]
0x1f: next word (literal)
0x20-0x3f: literal value 0x00-0x1f (literal)
Dear Notch,
I'm writing to you on behalf of #0x10c-std community at Freenode IRC. We have been discussing various ideas for DCPU-16
for a couple of days now and in the process devised much improved DCPU-16 specification. Our rationale for changes is to
keep emulation complexity minimal, yet enable DCPU to be as flexible as possible for people to be able to do really cool
stuff with it.
As you see we also propose very simple interrupts mechanisim. We believe that it is vital for DCPU to become really
general-purpose processor since interrupts allow among many things: flexible timers or preemptive task-switching to
happen. However we kept the complexity minimal so DCPU is capable of only one interrupt handler and no interrupt
;There was an interrupt by the timer!
;;;VM
PUSH PC ; is current PC
PUSH 0 ; timer has no second argument
PUSH 1 ; timer interrupt is 1
; vm does the lookup job
; jumps to the handler
DCPU-16 Specification
Copyright 2012 Mojang
Version 1.2
Edited by: 0x10c Standards Committee (rmmh, Jarvix, tpw_rules, et al)
* 16 bit words
* 0x10000 words of ram
* 8 registers (A, B, C, X, Y, Z, I, J)
* program counter (PC)
* stack pointer (SP)
<label>, <name>, <param> must all match: /[A-Za-z_][A-Za-z0-9_]*/
labels, names and parameters can not have names equal to registers and mnemonics.
LABELS
<label>:
!!! NOT :<label> !!!!
FILE INCLUSION
; Try some basic stuff
SET A, 0x30 ; 7c01 0030
SET [0x1000], 0x20 ; 7de1 1000 0020
SUB A, [0x1000] ; 7803 1000
IFN A, 0x10 ; c00d
SET PC, crash ; 7dc1 001a [*]
; Do a loopy thing
SET I, 10 ; a861
SET A, 0x2000 ; 7c01 2000
<kk`>Ok, just let them get a word in.
<kk`>Blecki: https://github.com/0x10cStandardsCommittee/0x10c-Standards/issues/39
<Jarvix>https://github.com/0x10cStandardsCommittee/0x10c-Standards/issues/39
<scybot>Jarvix: kk` linked that 0 minutes ago.
<kk`>Ha!
<Jarvix>scybot:: i KNOW
<scybot>Jarvix: How Do You Know (2010) (Comedy, Drama, Romance): After being cut from the USA softball team and feeling a bit past her prime, Lisa finds herself evaluating her life and in the middle of a love triangle, as a corporate guy in crisis competes with her current, baseball-playing beau. 2 hrs 1 min. 5.3/10 with 15611 votes. http://www.imdb.com/title/tt1341188
I lives....
RFC X____ J. Kuijpers, Ed.
Jarvix
M. Beermann, Ed.
April 17, 2012
0xSCA: Standards Committee Assembly
; 0xSCA syntax
.macro myMacro(var1)
SET PC, 10
.end
foo:
set a, 10
.loop:
sub a, 1