Skip to content

piotr-wiszowaty/elf2fth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

elf2fth

A tool for generating Forth inline words from compiled object code (ELF files). Generated words are to be used with Mecrisp Forth.

Example

Input assembly source file - test.S:


  .syntax unified
  .cpu    cortex-m0
  .thumb
  .text

  nop          @ placeholder for "push {lr}"

  ldr  r0, =0x12345678
loop:
  subs r0, #1
  bne  loop

  .end

Compilation :

$ arm-none-eabi-as -o test.o test.S

Forth code generation :

$ elf2fth -s -w test-1 test.o > test.forth

Generated word - test.forth :


: test-1 [
  $4801 h, $3801 h, $D1FD h, $5678 h,
  $1234 h, ] ;

About

No description or website provided.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages