This page (revision-33) was last changed on 03-Feb-2023 15:21 by Roland B. Wassenberg 

This page was created on 10-Mar-2010 09:28 by Gromit

Only authorized users are allowed to rename pages.

Only authorized users are allowed to delete pages.

Page revision history

Version Date Modified Size Author Changes ... Change note
33 03-Feb-2023 15:21 1 KB Roland B. Wassenberg to previous Assembler and Debugger ==> Assembler
32 17-Aug-2015 19:28 1 KB Roland B. Wassenberg to previous | to last Assembler ==> Assembler and Debugger
31 17-Aug-2015 19:22 1 KB Roland B. Wassenberg to previous | to last Assembler_Program ==> Assembler
30 24-Apr-2014 22:04 1 KB Roland B. Wassenberg to previous | to last
29 23-Apr-2014 22:12 1 KB Roland B. Wassenberg to previous | to last
28 05-Apr-2014 10:20 1 KB Gromit to previous | to last
27 05-Apr-2014 10:17 1 KB Gromit to previous | to last
26 05-Apr-2014 10:12 1 KB Gromit to previous | to last
25 05-Apr-2014 09:51 1014 bytes Gromit to previous | to last
24 05-Apr-2014 09:29 1000 bytes Gromit to previous | to last
23 12-May-2011 07:31 979 bytes Gromit to previous | to last
22 12-May-2011 07:30 1 KB Gromit to previous | to last
21 29-Mar-2011 13:53 968 bytes Gromit to previous | to last

Page References

Incoming links Outgoing links
Gromit...nobody

Version management

Difference between version and

At line 37 added 75 lines
-----
ACTION! TRUE/FALSE Beispiel
Halle Gromit,
ich habe Deine Beispiele aus der Documentation der FORTH Worte TRUE und FALSE herausgenommen, weil der Zusammenhang nicht stimmte. In ACTION! werden Zahlenwerte als "wahr" und "falsch" interpretiert, in FORTH gibt es extra "worte" dafür.
----
!Action
__false__ =0
Example:
%%prettify
{{{
BYTE FUNC values_match(BYTE x,y)
BYTE rval
rval=0 ;means FALSE
IF x=10 AND y=20 THEN
rval=1 ;means TRUE
FI
RETURN(rval)
PROC main()
BYTE v1,
v2
PrintE("Please give me 2 numbers.")
Print("v1 = ")
v1=InputB()
Print("v2 = ")
v2=InputB()
IF values_match(v1,v2) THEN
PrintE("Your values match!!")
FI
RETURN
}}}
/%
Dieses Beispiel ist nicht wirklich gut. Die Funktion "values_match" scheint zu prüfen ob die beiden Eingabewerte gleich sind, aber es wir getstet ob Eingabewert x = 10 und Eingabewert y = 20 ist.
Die Benahmung der Eingabewerte X/Y suggestiert einen Punkt (X-Y Koordinate im Raum). Für zwei Byte-Werte würde ich "bval1" und "bval2" vorschlagen.
Die Routine "values_match" würde ich wie so schreiben:
{{{
BYTE FUNC values_match(BYTE bval1, bval2)
RETURN(bval1 = bval2)
}}}
Das würde aber keiner so machen, da man auf Gleichheit direkt ohne Prozeduraufruf tsten kann.
Ein besseres Beispiel wäre die Prüfung on eine engegebene Zahl ungerade ist:
{{{
BYTE FUNC isOdd (Byte val)
RETURN ((val MOD 2) -1)
PROC main()
PrintE("Please give me a number.")
Print("v = ")
v = InputB()
Print("The value is ")
IF isOdd(v) THEN
PrintE("odd")
ELSE
PrintE("even")
FI
RETURN
}}}