From 3bf8892f5d49e12e99b42fc8f33ebfa6a1a3428b Mon Sep 17 00:00:00 2001 From: Norayr Chilingarian Date: Thu, 10 Oct 2013 19:16:50 +0400 Subject: [PATCH] ulmEvents.Mod does not use C/asm code anymore. getaddr code procedure is replaced by more correct SYSTEM.VAL calls. added Readme and FAQ Former-commit-id: 0d9024e4aea0739d35e2a556176264a7eec90459 --- FAQ | 11 ++++++++++ README.md | 31 ++++++++++++++++++++++++++++ src/lib/ulm/{gnuc => }/ulmEvents.Mod | 25 +++++++++++----------- 3 files changed, 55 insertions(+), 12 deletions(-) create mode 100644 FAQ rename src/lib/ulm/{gnuc => }/ulmEvents.Mod (97%) diff --git a/FAQ b/FAQ new file mode 100644 index 00000000..41d43b43 --- /dev/null +++ b/FAQ @@ -0,0 +1,11 @@ + + +==compiler does show only character position, not the line number== + +Yes, by default it shows you the character position, because it's faster to go to character position in vim +:goto number + +In case you still want to use line numbers then pass -l option to voc + +voc -ls m.Mod + diff --git a/README.md b/README.md index 90427216..c2111c4f 100644 --- a/README.md +++ b/README.md @@ -2,3 +2,34 @@ voc === vishap oberon compiler + +How to install - see COMPILE file. + +How to use: + +Type voc and it'll show you help. + +voc -M will compile your module and link it statically to libVishapOberon. +voc -m will link the module dynamically. + +If you have more than one module, and you want them to be compiled into elf filethen: +Let's assume we have module M0 which imports M1; + +voc -l M1.Mod -s M0.Mod -M + +Here -l is a global option. +Module M1 will be compiled with -s option, i. e. sym file will be generated. + +Module M0 will be compiled and linked statically. + +In case you have modules in different directories, like "ui", "logic", "math", then you need to export MODULES environment variable like this: + +export MODULES=".:ui:logic:math" + +and after call voc + +voc -s ui0.Mod + +Otherwise you can use full path: + +voc -s ui/ui0.Mod diff --git a/src/lib/ulm/gnuc/ulmEvents.Mod b/src/lib/ulm/ulmEvents.Mod similarity index 97% rename from src/lib/ulm/gnuc/ulmEvents.Mod rename to src/lib/ulm/ulmEvents.Mod index 8f0c9edb..9d58c10d 100644 --- a/src/lib/ulm/gnuc/ulmEvents.Mod +++ b/src/lib/ulm/ulmEvents.Mod @@ -294,22 +294,20 @@ MODULE ulmEvents; loghandler := log; END GetLog; - (* noch *) - PROCEDURE -getaddr(handler: EventHandler): LONGINT - "(LONGINT)&handler"; - PROCEDURE NilHandler*(event: Event); (* an empty event handler *) END NilHandler; (* now QueueHandler will translate partly like - i = (long)&handler; - j = (long)&ulmEvents_NilHandler; - b = i != j; - if (!(b)) {SYSTEM_assert = 0; SYSTEM_HALT(-1);}; - -; noch + BOOLEAN b; + handler_EventHandler tmphandler; + LONGINT i, j; + i = (LONGINT)handler; + tmphandler = handler_NilHandler; + j = (LONGINT)tmphandler; + b = i != j; *) +(* changed because voc cannot compara handler and NilHandler -- noch *) PROCEDURE QueueHandler*(handler: EventHandler); (* setup an alternative handler of events @@ -317,11 +315,14 @@ MODULE ulmEvents; of their unsufficient priority *) VAR b : BOOLEAN; (* noch *) + tmphandler : EventHandler; i,j : LONGINT; BEGIN - i := getaddr(handler); - j := getaddr(NilHandler); + i := SYSTEM.VAL(LONGINT, handler); + tmphandler := NilHandler; + j := SYSTEM.VAL(LONGINT, tmphandler); b := i # j; + b := handler # tmphandler; (*ASSERT (handler # NilHandler);*) ASSERT(b); queueHandler := handler;