papierkorb:sample11.blk
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| papierkorb:sample11.blk [2025-08-16 17:50] – ↷ Seite von projects:sample11.blk nach papierkorb:sample11.blk verschoben mka | papierkorb:sample11.blk [Unbekanntes Datum] (aktuell) – gelöscht - Externe Bearbeitung (Unbekanntes Datum) 127.0.0.1 | ||
|---|---|---|---|
| Zeile 1: | Zeile 1: | ||
| - | === Examples for Lecture Number 11 === | ||
| - | < | ||
| - | Screen 0 not modified | ||
| - | 0 \ Examples for Lecture Number 11 | ||
| - | 1 \ Last change: | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | 10 | ||
| - | 11 | ||
| - | 12 | ||
| - | 13 | ||
| - | 14 | ||
| - | 15 | ||
| - | |||
| - | Screen 2 not modified | ||
| - | 0 \ BLOCK 16: | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | 10 | ||
| - | 11 | ||
| - | 12 | ||
| - | 13 | ||
| - | 14 | ||
| - | 15 | ||
| - | |||
| - | |||
| - | Screen 3 not modified | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | 10 | ||
| - | 11 SAVE-BUFFERS | ||
| - | 12 updated to mass storage and then mark them as unmodified | ||
| - | 13 | ||
| - | 14 FLUSH ( -- -- ) Same effect as SAVE-BUFFERS followed | ||
| - | 15 by EMPTY-BUFFERS . | ||
| - | |||
| - | |||
| - | Screen 4 not modified | ||
| - | 0 \ Virtual vector arrays-1 | ||
| - | 1 BLK @ 2+ ( 6 ) CONSTANT FIRST-BLOCK | ||
| - | 2 BLK @ 4 + ( 8 ) CONSTANT LAST-BLOCK | ||
| - | | ||
| - | | ||
| - | 5 : => STORE? ON ; \ Assignment operator. | ||
| - | 6 \ Allot some virtual memory cells. | ||
| - | 7 : B-ALLOT | ||
| - | | ||
| - | | ||
| - | 10 | ||
| - | 11 | ||
| - | 12 \ Compile time routine. | ||
| - | 13 : COMPILE-VVECTOR ( n -- ) | ||
| - | 14 | ||
| - | 15 , | ||
| - | |||
| - | |||
| - | Screen 5 not modified | ||
| - | 0 \ Virtual vector arrays-2 | ||
| - | 1 \ Runtime for virtual vector. | ||
| - | 2 : RUN-VVECTOR | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | 10 | ||
| - | 11 : VVECTOR | ||
| - | 12 | ||
| - | 13 | ||
| - | 14 | ||
| - | 15 | ||
| - | |||
| - | |||
| - | |||
| - | Screen 9 not modified | ||
| - | 0 \ Multitasking. | ||
| - | 1 Multitasking allows one computer to appear to do several things | ||
| - | 2 at the same time. Most of the time a single user computer sits | ||
| - | 3 in an idle loop waiting for the operator to press the keyboard. | ||
| - | | ||
| - | 5 The idea is to utilize this waiting time to perform other useful | ||
| - | 6 tasks. | ||
| - | 7 instruments in a lab, printing a long file, updating a clock etc | ||
| - | | ||
| - | 9 F83 uses a very simple yet effective round-robin scheduling | ||
| - | 10 technique. | ||
| - | 11 maintains its own parameter and return stacks and its own set | ||
| - | 12 of critical variables ( called USER variables ). | ||
| - | 13 | ||
| - | 14 The task switcher just changes the pointer to the correct list | ||
| - | 15 of USER variables. | ||
| - | |||
| - | |||
| - | Screen 10 not modified | ||
| - | 0 \ Task dependent user variables. | ||
| - | 1 \ The following USER variables are needed in every task. | ||
| - | 2 TOS Saved during Task switching. | ||
| - | 3 ENTRY Jumped to during multitasking. | ||
| - | 4 LINK | ||
| - | 5 SP0 Empty parameter stack for this task. | ||
| - | 6 RP0 Empty return stack for this task. | ||
| - | 7 DP Size of dictionary. | ||
| - | 8 #OUT | ||
| - | 9 #LINE Number of CR's sent since last page. | ||
| - | 10 OFFSET | ||
| - | 11 BASE The current numeric base for number input output. | ||
| - | 12 HLD Points to a converted character during numeric output. | ||
| - | 13 FILE | ||
| - | 14 IN-FILE | ||
| - | 15 PRINTING | ||
| - | |||
| - | |||
| - | Screen 11 not modified | ||
| - | 0 \ PAUSE RESTART | ||
| - | | ||
| - | 2 PAUSE When multitasking PAUSE stops the current task and | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | 7 RESTART When multitasking RESTART does the reverse of PAUSE. | ||
| - | | ||
| - | | ||
| - | 10 | ||
| - | 11 | ||
| - | 12 | ||
| - | 13 | ||
| - | 14 | ||
| - | 15 | ||
| - | |||
| - | |||
| - | Screen 12 not modified | ||
| - | 0 \ SLEEP WAKE | ||
| - | 1 SLEEP ( adr -- ) Used in the form: {taskname} | ||
| - | | ||
| - | | ||
| - | 4 WAKE ( adr -- ) Used in the form: {taskname} | ||
| - | | ||
| - | | ||
| - | 7 STOP ( -- -- ) Make the current task pause indefinitely. | ||
| - | | ||
| - | 9 MULTI ( -- -- ) Start the multitasker. | ||
| - | 10 | ||
| - | 11 | ||
| - | 12 | ||
| - | 13 SINGLE | ||
| - | 14 | ||
| - | 15 PAUSE to its NOOP function. | ||
| - | |||
| - | |||
| - | Screen 13 not modified | ||
| - | 0 \ Task Definition. | ||
| - | | ||
| - | 2 TASK: {taskname} | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | 10 | ||
| - | 11 In addition to alloting space the new task must be | ||
| - | 12 | ||
| - | 13 Example: | ||
| - | 14 400 TASK: MYTASK | ||
| - | 15 \ bytes of dictionary space. | ||
| - | |||
| - | |||
| - | Screen 14 not modified | ||
| - | 0 \ SET-TASK | ||
| - | | ||
| - | 2 SET-TASK | ||
| - | | ||
| - | | ||
| - | | ||
| - | 6 ACTIVATE ( task.adr | ||
| - | | ||
| - | | ||
| - | | ||
| - | 10 BACKGROUND: {taskname} ( -- -- ) Create a new task with 400 | ||
| - | 11 bytes of dictionary space and initialize it to execute | ||
| - | 12 the code which follows up to the semi-colon . | ||
| - | 13 | ||
| - | 14 | ||
| - | 15 | ||
| - | |||
| - | |||
| - | Screen 15 not modified | ||
| - | 0 \ Multitasking Examples. | ||
| - | 1 ONLY EDITOR ALSO FORTH DEFINITIONS ALSO | ||
| - | 2 2VARIABLE | ||
| - | 3 : TT | ||
| - | | ||
| - | 5 : COUNTER | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | 10 UNTIL | ||
| - | 11 CR " COUNTER IS DONE" | ||
| - | 12 | ||
| - | 13 | ||
| - | 14 BACKGROUND: | ||
| - | 15 | ||
| - | |||
| - | |||
| - | Screen 16 not modified | ||
| - | 0 \ TASK-COUNT | ||
| - | | ||
| - | 2 : TASK-COUNT | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | 10 | ||
| - | 11 | ||
| - | 12 \ | ||
| - | 13 \ ' COUNTER > | ||
| - | 14 \ | ||
| - | 15 | ||
| - | |||
| - | |||
| - | Screen 17 not modified | ||
| - | 0 \ S.ON S.OFF TONE | ||
| - | 1 HEX | ||
| - | 2 : | ||
| - | | ||
| - | 4 : S.OFF ( -- -- ) \ Turn speaker off. | ||
| - | | ||
| - | | ||
| - | 7 : TONE ( freq -- ) \ Make tone of specified frequency. | ||
| - | | ||
| - | | ||
| - | 10 | ||
| - | 11 DROP NIP [ HEX ] \ Keep 16-bit quotient only. | ||
| - | 12 | ||
| - | 13 | ||
| - | 14 42 PC! 42 PC! \ Store low and high byte in timer. | ||
| - | 15 | ||
| - | |||
| - | |||
| - | Screen 18 not modified | ||
| - | 0 \ PIPPING | ||
| - | | ||
| - | 2 : PIPPING | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | 8 BACKGROUND: | ||
| - | | ||
| - | 10 | ||
| - | 11 | ||
| - | 12 | ||
| - | 13 | ||
| - | 14 | ||
| - | 15 | ||
| - | |||
| - | |||
| - | Screen 19 not modified | ||
| - | 0 \ VIEW-REG | ||
| - | 1 ONLY EDITOR ALSO FORTH DEFINITIONS ALSO | ||
| - | | ||
| - | | ||
| - | 4 : #' | ||
| - | 5 TCOUNT 2+ VADR ! | ||
| - | 6 : VIEWREG | ||
| - | | ||
| - | | ||
| - | | ||
| - | 10 8 #'S BL HOLD ASCII [ HOLD #> | ||
| - | 11 CUR@ >R 40 2 AT | ||
| - | 12 VTYPE R> CUR! DECIMAL THEN | ||
| - | 13 AGAIN ; | ||
| - | 14 BACKGROUND: | ||
| - | 15 | ||
| - | |||
| - | |||
| - | Screen 20 not modified | ||
| - | 0 \ CLOCK task | ||
| - | | ||
| - | 2 : CLOCK | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | 10 BACKGROUND: | ||
| - | 11 | ||
| - | 12 | ||
| - | 13 | ||
| - | 14 | ||
| - | 15 | ||
| - | |||
| - | |||
| - | Screen 21 not modified | ||
| - | 0 \ MARQUEE | ||
| - | | ||
| - | 2 CREATE | ||
| - | 3 : PAWS SPEED @ -1 ?DO PAUSE LOOP ; | ||
| - | | ||
| - | 5 CREATE TEXTB 24 , \ Beginning block for display | ||
| - | 6 CREATE # | ||
| - | 7 CREATE #T 0 , \ Offset in bytes, from TEXTB | ||
| - | | ||
| - | | ||
| - | 10 : VTEXT ( -- adr ) \ Leave virtual address relative to TEXTB | ||
| - | 11 #T @ 1024 /MOD TEXTB @ + BLOCK + ; | ||
| - | 12 | ||
| - | 13 CREATE MQ? -1 , \ Flag read by MARQUEE | ||
| - | 14 : HO MQ? OFF ; \ Halt the MARQUEE | ||
| - | 15 : HUM MQ? ON ; \ Resume the MARQUEE | ||
| - | |||
| - | |||
| - | Screen 22 not modified | ||
| - | 0 \ HUH BUMP MARQ 16: | ||
| - | 1 CREATE RD? 0 , \ Flag read by MARQUEE | ||
| - | 2 : HUH -1 RD? +! ; \ Back up the MARQUEE and redisplay | ||
| - | | ||
| - | | ||
| - | 5 \ only use powers of 2. | ||
| - | | ||
| - | 7 : BUMP ( -- -- ) | ||
| - | | ||
| - | | ||
| - | 10 \ Display PAD and then bump characters to the left. | ||
| - | 11 : MARQ ( -- -- ) | ||
| - | 12 PAWS CUR@ 0 0 AT PAD 80 VTYPE CUR! | ||
| - | 13 MQ? @ IF BUMP THEN ; | ||
| - | 14 : TAIL ( -- adr count ) | ||
| - | 15 80 #BUMP - PAD + #BUMP ; | ||
| - | |||
| - | |||
| - | Screen 23 not modified | ||
| - | 0 \ MARQUEE | ||
| - | | ||
| - | 2 : MARQUEE | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | 10 ELSE 0 THEN | ||
| - | 11 MQ? @ IF #BUMP ELSE 0 THEN + | ||
| - | 12 | ||
| - | 13 DO MARQ LOOP | ||
| - | 14 | ||
| - | 15 BACKGROUND: TASK5 MARQUEE ; | ||
| - | |||
| - | |||
| - | Screen 24 not modified | ||
| - | | ||
| - | 1 Multitasking allows one computer to appear to do several things | ||
| - | 2 at the same time. Most of the time a single user computer sits | ||
| - | 3 in an idle loop waiting for the operator to press the keyboard. | ||
| - | | ||
| - | 5 The idea is to utilize this waiting time to perform other useful | ||
| - | 6 tasks. | ||
| - | 7 instruments in a lab, printing a long file, updating a clock etc | ||
| - | | ||
| - | 9 F83 uses a very simple yet effective round-robin scheduling | ||
| - | 10 technique. | ||
| - | 11 maintains its own parameter and return stacks and its own set | ||
| - | 12 of critical variables ( called USER variables ). | ||
| - | 13 | ||
| - | 14 The task switcher just changes the pointer to the correct list | ||
| - | 15 of USER variables. | ||
| - | |||
| - | |||
| - | Screen 25 not modified | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | 7 d task to sleep. | ||
| - | | ||
| - | | ||
| - | 10 | ||
| - | 11 do something wrong!! | ||
| - | 12 | ||
| - | 13 then if your brave. | ||
| - | 14 | ||
| - | 15 | ||
| - | |||
| - | |||
| - | Screen 26 not modified | ||
| - | 0 \ How to use ACTIVATE reassign a taskname | ||
| - | | ||
| - | | ||
| - | 3 : COUNTDOWN | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | 10 | ||
| - | 11 UNTIL | ||
| - | 12 CR " COUNTER IS DONE" | ||
| - | 13 STOP ; | ||
| - | 14 | ||
| - | 15 | ||
| - | |||
| - | </ | ||
papierkorb/sample11.blk.1755359401.txt.gz · Zuletzt geändert: 2025-08-16 17:50 von mka