Skip to content

Commit

Permalink
mecrisp-stellaris-ra-0.8
Browse files Browse the repository at this point in the history
  • Loading branch information
Jean Jonethal committed Oct 19, 2015
1 parent f94fbeb commit dc7d295
Show file tree
Hide file tree
Showing 40 changed files with 3,211 additions and 1,287 deletions.
58 changes: 29 additions & 29 deletions README-RA
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,29 @@ This time, it contains an analytical compiler which keeps track
of the top three stack elements and maps them to registers
whenever possible.

Four targets are available:
ARM Linux, KL25Z128 (Cortex M0) and LM4F120 & TM4C1294 (Cortex M4).
Five targets are available:
KL25Z128 & LPC1114FN28 (Cortex M0), ARM Linux and LM4F120 & TM4C1294 (Cortex M4).

For M4, you can flash your Stellaris or Tiva Launchpad with the included binary.

For M0, you have two possibilities:
For M0, you have three possibilities:

You can either flash the srec file to your Freedom board
or make the thumbulator and type
"thumbulator mecrisp-stellaris-kl25z128.bin".

You can also use a LPC1114FN28 chip and flash its hex file.

To dive in, you should load the disassembler and see
definitions you have just compiled.

Two examples, on M0:

: >gray ( u -- x ) dup 1 rshift xor ; \ For any cell size ok.
ok.
: >gray ( u -- x ) dup 1 rshift xor ; ok.
see >gray
00007C48: B500 push { lr }
00007C4A: 0873 lsrs r3 r6 #1
00007C4C: 405E eors r6 r3
00007C4E: BD00 pop { pc }
00006B38: 0873 lsrs r3 r6 #1
00006B3A: 405E eors r6 r3
00006B3C: 4770 bx lr
ok.


Expand Down Expand Up @@ -64,26 +64,26 @@ see >gray
1-foldable ; ok.
ok.
see bitexp
00007B8E: B500 push { lr }
00007B90: 2EF7 cmp r6 #F7
00007B92: D902 bls 00007B9A
00007B94: 26F0 movs r6 #F0
00007B96: 0636 lsls r6 r6 #18
00007B98: E00C b 00007BB4
00007B9A: 2E10 cmp r6 #10
00007B9C: D801 bhi 00007BA2
00007B9E: 0876 lsrs r6 r6 #1
00007BA0: E008 b 00007BB4
00007BA2: 0033 lsls r3 r6 #0
00007BA4: 2007 movs r0 #7
00007BA6: 4003 ands r3 r0
00007BA8: 2008 movs r0 #8
00007BAA: 4303 orrs r3 r0
00007BAC: 08F6 lsrs r6 r6 #3
00007BAE: 3E02 subs r6 #2
00007BB0: 40B3 lsls r3 r6
00007BB2: 461E mov r6 r3
00007BB4: BD00 pop { pc }
00006BA2: 2EF7 cmp r6 #F7
00006BA4: B500 push { lr }
00006BA6: D902 bls 00006BAE
00006BA8: 26F0 movs r6 #F0
00006BAA: 0636 lsls r6 r6 #18
00006BAC: E00C b 00006BC8
00006BAE: 2E10 cmp r6 #10
00006BB0: D801 bhi 00006BB6
00006BB2: 0876 lsrs r6 r6 #1
00006BB4: E008 b 00006BC8
00006BB6: 0033 lsls r3 r6 #0
00006BB8: 2007 movs r0 #7
00006BBA: 4003 ands r3 r0
00006BBC: 2008 movs r0 #8
00006BBE: 4303 orrs r3 r0
00006BC0: 08F6 lsrs r6 r6 #3
00006BC2: 3E02 subs r6 #2
00006BC4: 40B3 lsls r3 r6
00006BC6: 461E mov r6 r3
00006BC8: BD00 pop { pc }

Note that it compiles bitexp without any stack movements at all.

Expand Down
Binary file modified kl25z128-ra/mecrisp-stellaris-kl25z128.bin
Binary file not shown.
Loading

0 comments on commit dc7d295

Please sign in to comment.