From 1a02aefa55ecbf1f84277415bfb806db72901be1 Mon Sep 17 00:00:00 2001 From: Alyona Kovalyova Date: Sun, 30 Sep 2018 19:10:05 +0300 Subject: [PATCH 1/4] Document words that read digits --- documentation.frt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/documentation.frt b/documentation.frt index c8ea719..596b0b5 100644 --- a/documentation.frt +++ b/documentation.frt @@ -12,3 +12,18 @@ Drop the topmost element of the stack ( a b -- b a ) Swap two topmost elements of the stack " doc-word + +' read-oct-digit g" +( -- digit ) +Read one octal digit +" doc-word + +' read-hex-digit g" +( -- digit ) +Read one hexadecimal digit +" doc-word + +' read-digit g" +( -- digit ) +Read one decimal digit +" doc-word From b62b9a2102be48e87a9e3620dfcb8859a2ef167d Mon Sep 17 00:00:00 2001 From: Alyona Kovalyova Date: Sun, 30 Sep 2018 19:10:48 +0300 Subject: [PATCH 2/4] Document words that read string literals --- documentation.frt | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/documentation.frt b/documentation.frt index 596b0b5..ddc3bca 100644 --- a/documentation.frt +++ b/documentation.frt @@ -27,3 +27,35 @@ Read one hexadecimal digit ( -- digit ) Read one decimal digit " doc-word + +' ." g" +( -- ) +Print string literal + +This word reads the string until it meets a double quote, stores it in +the word being defined and prints it. +" doc-word + +' g" g" +( -- string ) +Store string literal in global data segment + +This word reads the string until it meets a double quote, stores it in +the global data segment and pushes the pointer to it onto the stack. +" doc-word + +' " g" +( -- string ) +Read string literal with escape sequences + +This word reads the string until it meets a double quote, stores it in +the word being defined and pushes the pointer to it onto the stack. +" doc-word + +' _" g" +( -- string ) +Read string literal without expanding escape sequences + +This word reads the string until it meets a double quote, stores it in +the word being defined and pushes the pointer to it onto the stack. +" doc-word From dd074b71feb0c19fbb5aaeb5de8ebd53d4d1a6cb Mon Sep 17 00:00:00 2001 From: Alyona Kovalyova Date: Sun, 30 Sep 2018 19:11:29 +0300 Subject: [PATCH 3/4] Document words that read numeric literals --- documentation.frt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/documentation.frt b/documentation.frt index ddc3bca..7ee6e8f 100644 --- a/documentation.frt +++ b/documentation.frt @@ -59,3 +59,13 @@ Read string literal without expanding escape sequences This word reads the string until it meets a double quote, stores it in the word being defined and pushes the pointer to it onto the stack. " doc-word + +' 0x g" +( -- number ) +Read hexadecimal literal +" doc-word + +' 08x g" +( -- number ) +Read octal literal +" doc-word From 86a5cfda4b04d1a413d2d19e8727644d317ac8e2 Mon Sep 17 00:00:00 2001 From: Alyona Kovalyova Date: Sun, 30 Sep 2018 19:11:51 +0300 Subject: [PATCH 4/4] Document words that define flags for sys-open --- documentation.frt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/documentation.frt b/documentation.frt index 7ee6e8f..c422feb 100644 --- a/documentation.frt +++ b/documentation.frt @@ -69,3 +69,13 @@ Read hexadecimal literal ( -- number ) Read octal literal " doc-word + +' O_CREAT g" +( -- 0x40 ) +Push a flag O_CREAT (create new file if pathname does not exist) onto stack +" doc-word + +' O_APPEND g" +( -- 0x400 ) +Push a flag O_APPEND (seek to the end of file) onto stack +" doc-word