Commit graph

41 commits

Author SHA1 Message Date
7d12f1f994 comment 2019-12-02 09:18:09 -08:00
8013b8796c remove trailing whitespace 2019-12-02 09:18:09 -08:00
Sami Samhuri
e77ac481d8 ruby 1.9 compatible case statements 2013-01-20 22:50:51 -08:00
Sami Samhuri
88a7ca99e9 trying to fix github saying compiler.rb is not found 2010-09-25 11:35:29 -07:00
Sami Samhuri
9b5c3b795e implement lazy boolean OR and AND operators, || and && respectively 2010-02-14 23:15:38 -08:00
Sami Samhuri
f7e44b7472 finished bitwise AND, OR, and XOR 2010-02-14 23:15:03 -08:00
Sami Samhuri
10c4576569 rearranged a few things 2010-02-14 19:02:15 -08:00
Sami Samhuri
18d3bab844 add bit manipulation ops | (OR) & (AND) and ^ (XOR) 2010-02-14 19:01:57 -08:00
Sami Samhuri
d2e7c987d8 # comments till the end of the current line 2010-02-14 18:59:05 -08:00
Sami Samhuri
5940ac99c0 remove some crufty comments 2010-02-14 12:00:51 -08:00
Sami Samhuri
3422f201d1 clean up block by moving keywords into a lookup table. 2010-02-08 23:37:27 -08:00
Sami Samhuri
90bcdbf659 declare variable sizes in bytes, and stop trampling other vars in memory. 2010-01-20 23:20:33 -08:00
Sami Samhuri
0c21d1abc6 [big commit] use variable proxies to defer address calculation 2010-01-19 23:23:54 -08:00
sjs
63cf421501 fixed a syntax error and argument error -- always test before commiting 2009-10-20 18:25:38 -07:00
sjs
de366ea542 Removed duplication thanks to caliper @ http://devver.net 2009-10-20 18:04:10 -07:00
Sami Samhuri
ed1a3444c7 [CHANGED] Removed use of the LOOP instruction. 2009-06-26 11:37:45 -07:00
Sami Samhuri
0fbb366e9c [NEW] Encode [esp] and [ebp] as [esp+0] and [ebp+0] using SIB and disp8 respectively. 2009-06-26 10:13:49 -07:00
Sami Samhuri
bc6a3d4d3b [NEW] Binary assembler outputs working machine code and Mach-O object files that can be linked into working executables. 2009-06-25 09:42:56 -07:00
Sami Samhuri
47ce9043e4 [FIXED] print on Darwin ... probably still violates calling convention. 2009-05-25 17:18:58 -07:00
Sami Samhuri
a4506bab10 [NEW] First hints of cross-platform support. Compiles to Mach-O on Darwin with nasm and gcc.
There is no binary assembler support for Darwin yet! I'm not sure when I will dive into the details
of generating a Mach-O binary from Ruby or C.

[MERGED] Binary assembler support.  It *should* work on ELF but it needs testing on Linux.
2009-05-25 16:26:21 -07:00
sjs
76d4d2be3a [BUNK] moving to macbook, broken commit. 2009-05-24 20:29:17 -07:00
sjs
83accb5bba [NEW] x86_inc instruction with some binary encoding. 2009-05-24 14:05:40 -07:00
sjs
5e317aaacc [NEW] broke assembler code into its own module before merging machinecode branch. 2009-05-24 13:45:06 -07:00
sjs
b8581b8b24 [FIXED] relations and the do loop. abstracted simple loops. 2009-05-24 12:57:56 -07:00
sjs
41eb590d44 [NEW] real tokens and boolean operators (logic withstanding) 2009-05-24 08:24:43 -07:00
sjs
dc23e23b92 [NEW] Boolean expressions. Print statement. 2009-05-21 13:39:20 -07:00
sjs
55c047d0ef [FIXED] handle unary plus and minary properly 2009-05-20 13:48:30 -07:00
sjs
f7e63cbe21 [NEW] do statement, d 10 a = a * a e 2009-05-20 13:32:17 -07:00
sjs
dd6d342dd4 [NEW] simple VB style for loop, f x = 1 >> 5 s = s + x e 2009-05-20 11:47:28 -07:00
sjs
3f070cd0db [NEW] Emit x86 code for the mov instruction. Barely works 1/2 the time.
The supporting infrastructure includes a C program for reading a
binary blob of x86 code and wrapping it in an ELF executable for Linux
x86.  Unsure about getting the data for other sections of the binary
besides .text.
2009-05-19 17:01:14 -07:00
sjs
221efca282 [NEW] while, until, repeat, and break keywords.
While and until loops work as in C and Ruby.  Repeat loops infinitely
(or until a break is encountered).  Break is used to break out of the
innermost loop construct.
2009-05-17 08:13:43 -07:00
sjs
e547804711 [CHANGED] only generate required labels in if-else 2009-05-16 15:40:43 -07:00
sjs
0431cd60f3 [CHANGED] if statement supports else clause 2009-05-16 15:34:14 -07:00
sjs
f5678a312e [NEW] Rudimentary if statement. No else yet. 2009-05-16 14:49:26 -07:00
sjs
785f229eec [CHANGED] subtraction is now implemented it terms of ADD. 2009-05-15 09:37:44 -07:00
sjs
bd0408fa2f [NEW] ignore most whitespace. Fixed division (use cdq before idiv). 2009-05-14 01:12:48 -07:00
sjs
c008ed007a [NEW] Parse numbers of any length, instead of only one digit. 2009-05-13 23:29:52 -07:00
sjs
42ca4451a8 [NEW] Parse identifiers of any length, instead of only one char. 2009-05-13 23:27:47 -07:00
sjs
268c6f6c29 [NEW] Parse assignment statements. Added template and test code. 2009-05-13 23:20:51 -07:00
sjs
ff2b68a8f2 [NEW] Expression grouping with parens. (end of part 2) 2009-05-13 21:16:51 -07:00
sjs
af95bd9dec Initial commit of a compiler in Ruby. 2009-05-13 20:56:46 -07:00