From fbfbc549ff34c8ae2f65324aed45bf739b3b44a2 Mon Sep 17 00:00:00 2001 From: Brad Nelson Date: Sun, 4 Sep 2022 17:45:47 -0700 Subject: [PATCH] Add non-functional code example for xtensa. --- examples/code_x64.fs | 14 ++++++++++++++ examples/code_xtensa.fs | 28 ++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 examples/code_xtensa.fs diff --git a/examples/code_x64.fs b/examples/code_x64.fs index b6a416d..269cbe5 100644 --- a/examples/code_x64.fs +++ b/examples/code_x64.fs @@ -1,5 +1,19 @@ #! /usr/bin/env ueforth +\ Copyright 2022 Bradley D. Nelson +\ +\ Licensed under the Apache License, Version 2.0 (the "License"); +\ you may not use this file except in compliance with the License. +\ You may obtain a copy of the License at +\ +\ http://www.apache.org/licenses/LICENSE-2.0 +\ +\ Unless required by applicable law or agreed to in writing, software +\ distributed under the License is distributed on an "AS IS" BASIS, +\ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +\ See the License for the specific language governing permissions and +\ limitations under the License. + asm forth code my2* diff --git a/examples/code_xtensa.fs b/examples/code_xtensa.fs new file mode 100644 index 0000000..5665c12 --- /dev/null +++ b/examples/code_xtensa.fs @@ -0,0 +1,28 @@ +#! /usr/bin/env ueforth + +\ Copyright 2022 Bradley D. Nelson +\ +\ Licensed under the Apache License, Version 2.0 (the "License"); +\ you may not use this file except in compliance with the License. +\ You may obtain a copy of the License at +\ +\ http://www.apache.org/licenses/LICENSE-2.0 +\ +\ Unless required by applicable law or agreed to in writing, software +\ distributed under the License is distributed on an "AS IS" BASIS, +\ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +\ See the License for the specific language governing permissions and +\ limitations under the License. + +asm forth + +code my2* + $02 code1, $48 code1, ( l32i.n a4, a2, 0 ) + $11 code1, $44 code1, $f0 code1, ( slli a4, a4, 1 ) + $02 code1, $49 code1, ( s32i.n a4, a2, 0 ) + $f0 code1, $0d code1, ( ret.n ) +end-code + +see my2* +123 my2* . cr +bye