Home

Awesome

code-examples

Code examples for ForwardCom

Prerequisites:

Assemble:

forw -ass hello.as

Link:

forw -link hello.ex hello.ob libc_light.li libc.li math.li

Emulate:

forw -emu hello.ex

A script doing all this in Windows:

make_example.bat hello

Or in Linux:

./make_example.sh hello

Run:

Some of these examples can run in a softcore when linked with libc-light.li. See the manual for the softcore

You can find more code examples under test-suite and libraries.

Files includedDescription
hello.asSimple Hello world example. Works on emulator and softcore
calculator.asInputs two integers and calculates +-*/% operations. Works on emulator and softcore
guess_number.asGuessing game. Works on emulator and softcore
event.asDemonstrates the event handling system. Works on emulator
sumarray.asCalculate sum of array elements using vector loop
trigonometric-f.asCalculates trigonometric functions with single precision. Works on emulator
trigonometric.asCalculates trigonometric functions with double precision. Works on emulator
integrate.asIntegration of sin function. Works on emulator
make_example.batWindows bat file for compiling and linking example
make_example.shLinux shell script for compiling and linking example