3d28e95707
add bitrange function to make code a little clearer
2015-12-02 09:09:44 -08:00
08472cdc1a
remove obsolete comments; move a function
2015-12-02 08:30:52 -08:00
5544c5226b
add a warning about integer precision in Lua
2015-11-28 15:11:51 -08:00
63851234f9
allow signed constants for some instructions
2015-11-26 21:38:08 -08:00
975ff3f942
make only the assemble function visible
2015-11-26 19:45:13 -08:00
c978d4914f
set all lexer states at EOF
2015-11-26 19:28:14 -08:00
3ea0184fb6
implement HEX directives; a couple misc fixes
2015-11-26 19:15:15 -08:00
76fe45adee
lex newlines in block comments
2015-11-26 18:51:07 -08:00
dc7f457b95
simplify buffer handling in lexer
2015-11-26 18:49:01 -08:00
fa12154420
use coroutines to lex
...
this will be relevant due time.
2015-11-26 18:45:45 -08:00
82af3d531e
unallow labels as immediates; allow labels in DEREF instructions
2015-11-25 21:55:45 -08:00
c7f0d15910
fix LA
2015-11-25 21:27:46 -08:00
774b04795d
update readme
2015-11-25 21:23:22 -08:00
cc5e673d0c
implement and fix many pseudo-instructions
...
up until this commit, there was a bug
that caused LI/LA to load wrong values
for 0x8000 <= immediate <= 0xFFFF.
2015-11-25 21:21:39 -08:00
6e97d134e4
implicit RA argument for JR
2015-11-25 10:47:37 -08:00
14f44f8206
add remaining instructions
2015-11-25 10:28:55 -08:00
b89c92087f
update readme
2015-11-25 09:37:05 -08:00
03cb168ad0
add more instructions
2015-11-25 03:04:55 -08:00
9ccf2fd883
don't error when no options are given
...
d'oh!
2015-11-24 17:15:12 -08:00
5aa0b5abe1
added 'unsafe' option to not wrap execution in pcall
2015-11-24 17:06:38 -08:00
d1edcf4fab
add line numbers to Dumper errors
2015-11-24 17:00:44 -08:00
32368f3998
optimize LI/LA
2015-11-24 16:34:18 -08:00
89fcdd825d
be more strict with immediate sizes
...
this will be made up for by pseudo-instructions in due time.
2015-11-24 16:25:05 -08:00
338685d5bc
fix a couple coprocessor instructions
2015-11-24 13:34:24 -08:00
bd0c5f4b34
implement align and skip directives
2015-11-24 13:23:22 -08:00
9a2335fab1
a little more info
2015-11-23 20:42:19 -08:00
2694035873
cleanup and documenting; alias S8 register to FP
2015-11-23 14:16:31 -08:00
3590093470
fix line number in 'undefined define' error
2015-11-23 13:13:54 -08:00
bead0e5576
brain fart
2015-11-22 14:00:17 -08:00
bc72559091
rename; readme
2015-11-22 13:58:29 -08:00
c508c6efd9
move assembler to its own repo
2015-11-22 13:50:44 -08:00
e15d699ac3
ignore highest bit of .org directive
...
are you *really* gonna be assembling files over 2GiB?
2015-11-22 13:49:12 -08:00
e31b73d34e
handle immediates in place of most offsets
2015-11-22 13:49:10 -08:00
25b0ade37a
reimplement parsing; resolve defines after lexing
2015-11-22 13:49:09 -08:00
92c5819e3f
tokenize all at once (WIP)
2015-11-22 13:49:08 -08:00
d560f47be9
unfudge LI/LA a little
2015-11-22 13:49:06 -08:00
009d7080a4
use proper instruction type names
2015-11-22 13:49:05 -08:00
6fc3b8f2b5
add reg# register aliases
2015-11-22 13:49:03 -08:00
4a6c7c4d09
pseudo-instruction crap
2015-11-22 13:49:01 -08:00
57ca41d414
various
...
fix jump and branch destinations.
note: branching is no longer compatible with CajeASM.
make LUI dumb: only use 'UPPER' with LI/LA.
note: this is very incompatible with CajeASM.
add LUUI pseudo-instruction to use 'UPPER' instead of 'LOWER'.
fix SUBI/SUBIU parsing.
fix LI for values under 0x10000.
pass filename through main().
tell Lexer our filename.
don't print filename in Dumper since it's irrelevant.
2015-11-22 13:48:59 -08:00
327f38cbbc
implement LI and LA
2015-11-22 13:48:58 -08:00
b3e481301e
various
...
alias ZERO register to R0.
lex decimal numbers properly.
lex octal and negative numbers.
lex directives properly.
fix byte dumping.
fix UPPER behavior...?
2015-11-22 13:48:56 -08:00
d5dd709cb0
new dumper to support directives
...
the old one could still have a place,
with its simplicity and speed.
also, screw versioning.
2015-11-22 13:48:55 -08:00
e3f882f986
simplify size handling
2015-11-22 13:48:54 -08:00
724e044288
define formats in the instruction table
...
this greatly reduces code bloat,
and made it easier to implement a few instructions.
everything is still very untested, however.
2015-11-22 13:48:52 -08:00
e6d34bdb0b
only specify one instruction list
2015-11-22 13:48:51 -08:00
2d8aabc311
add remaining fp instructions
2015-11-22 13:48:49 -08:00
e07d3f04e8
add fp compare instructions
2015-11-22 13:48:48 -08:00
5da1b19fd5
use filename in errors; fix JALR
2015-11-22 13:48:46 -08:00
4646d467d2
set up as a proper module
2015-11-22 13:48:45 -08:00