X-Git-Url: https://git.rrq.au/?a=blobdiff_plain;f=example.f;h=499f468773c06f4163b393900b4a70b1f6143662;hb=e528551bc019017d3a1313b9d8299d15cc5e3c82;hp=41993d73ba877de3f7c7c72491ecee6318a43d80;hpb=95f71309628ccb9339cf43fb2326ab506bd5ae04;p=rrq%2Fjonasforth.git diff --git a/example.f b/example.f index 41993d7..499f468 100644 --- a/example.f +++ b/example.f @@ -1,6 +1,3 @@ -( vim: syntax=forth -) - : FIB ( n -- Fn ) 0 1 ( n a b ) 0 ( n a b i ) @@ -13,16 +10,24 @@ DUP 4 PICK = UNTIL DROP SWAP DROP SWAP DROP ; ( a+b ) -S" HELLO-ADDR" CREATE -S" Hello!" DUP ROT -STORE-STRING -: HELLO - ' HELLO-ADDR LIT, TELL NEWLINE ; +: HELLO S" Hello!" TELL NEWLINE ; -HELLO +: TEST-FIB + S" 10 FIB = " TELL + 10 FIB .U + SPACE S" (Expected: 59)" TELL NEWLINE ; -S" 10 FIB = " TELL -10 FIB .U -SPACE S" (Expected: 59)" TELL NEWLINE +\ This example calls the Blt() function on UEFI's Graphics Output Protocol. See +\ the UEFI specification and uefi.f for more information. +: BLUE-SQUARE + GraphicsOutputProtocol + HERE @ 255 C, 0 C, 0 C, 0 C, \ Buffer with single blue pixel + EfiBltVideoFill + 0 0 \ Source + 100 100 20 20 \ Destination + 0 + GOP.Blt() ; -TERMINATE +HELLO +TEST-FIB +BLUE-SQUARE