From 7c14e1eac7de6a20c2410a1cb47d4c3cdfb1f671 Mon Sep 17 00:00:00 2001 From: Stefan Reinauer Date: Fri, 20 Nov 2009 15:40:53 +0000 Subject: [PATCH] - hook up new 64bit words into fcode table. - dummy implementations for peek, poke, ms and get-msecs git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@617 f158a5a8-5612-0410-a976-696ce0be7e32 --- forth/device/fcode.fs | 9 +++++++++ forth/device/other.fs | 28 +++++++++++++++++++++++++++- forth/device/table.fs | 33 ++++++++++++++++++++++++++++++++- 3 files changed, 68 insertions(+), 2 deletions(-) diff --git a/forth/device/fcode.fs b/forth/device/fcode.fs index 1570171..e4f9f4e 100644 --- a/forth/device/fcode.fs +++ b/forth/device/fcode.fs @@ -368,12 +368,21 @@ defer fcode-c@ \ get byte \ b(lit) ( -- n1 ) \ Numeric literal FCode. Followed by FCode-num32. +64bit? [IF] +: b(lit) + fcode-num32 32>64 + state @ if + ['] (lit) , , + then + ; immediate +[ELSE] : b(lit) fcode-num32 state @ if ['] (lit) , , then ; immediate +[THEN] \ b(') ( -- xt ) diff --git a/forth/device/other.fs b/forth/device/other.fs index 16f2983..2d8fadb 100644 --- a/forth/device/other.fs +++ b/forth/device/other.fs @@ -21,21 +21,27 @@ hex \ 5.3.7.1 Peek/poke : cpeek ( addr -- false | byte true ) + c@ true ; : wpeek ( waddr -- false | w true ) + w@ true ; : lpeek ( qaddr -- false | quad true ) + l@ true ; : cpoke ( byte addr -- okay? ) + c! true ; : wpoke ( w waddr -- okay? ) + w! true ; : lpoke ( quad qaddr -- okay? ) + l! true ; @@ -59,13 +65,33 @@ hex : rl! ( quad qaddr -- ) ; - +: rx@ ( oaddr - o ) + state @ if + h# 22e get-token if , else execute then + else + h# 22e get-token drop execute + then + ; immediate + +: rx! ( o oaddr -- ) + state @ if + h# 22f get-token if , else execute then + else + h# 22f get-token drop execute + then + ; immediate + \ 5.3.7.3 Time +0 value dummy-msecs + : get-msecs ( -- n ) + dummy-msecs dup 1+ to dummy-msecs ; : ms ( n -- ) + get-msecs + + begin dup get-msecs < until ; : alarm ( xt n -- ) diff --git a/forth/device/table.fs b/forth/device/table.fs index 33fb28d..5c58f2d 100644 --- a/forth/device/table.fs +++ b/forth/device/table.fs @@ -380,7 +380,13 @@ create fcode-master-table ['], lbflip ['], lbflips ['], adr-mask - 6 n['], reserved-fcode \ 22a-22f + 4 n['], reserved-fcode \ 22a-22d +64bit? [IF] + ['], (rx@) + ['], (rx!) +[ELSE] + 2 n['], reserved-fcode \ 22e-22f +[THEN] ['], rb@ ['], rb! ['], rw@ @@ -398,8 +404,33 @@ create fcode-master-table ['], byte-load ['], set-args ['], left-parse-string \ 240 +64bit? [IF] + ['], bxjoin + ['],