git @ Cat's Eye Technologies Funge-98 / 89899e6
Begin massaging Markdown version of specification. catseye 12 years ago
1 changed file(s) with 37 addition(s) and 102 deletion(s). Raw diff Collapse all Expand all
88
99 ### Table of Contents
1010
11 - #### [Introduction](#Introduction)
11 - [Introduction](#Introduction)
1212
1313 - [What is a Funge?](#Whatis)
1414 - [About this Document](#About)
1515
16 - #### [The Funge Virtual Machine](#Machine)
16 - [The Funge Virtual Machine](#Machine)
1717
1818 - [Code and Data](#Code_Data)
1919 - [Funge-Space](#Space)
2020 - [Stack Stack](#Stack_Stack)
2121 - [Funge Source File Format](#Format)
2222
23 - #### [Code: Program Flow](#Code)
23 - [Code: Program Flow](#Code)
2424
2525 - [Instruction Pointer](#IP)
2626 - [Instructions](#Instructions)
2929 - [Flow Control](#Flow)
3030 - [Decision Making](#Decision)
3131
32 - #### [Data: Cell Crunching](#Data)
32 - [Data: Cell Crunching](#Data)
3333
3434 - [Integers](#Integers)
3535 - [Strings](#Strings)
3636 - [Stack Manipulation](#Stack_Manipulation)
3737 - [Stack Stack Manipulation](#Stack_Stack_Manipulation)
3838
39 - #### [Media: Communications and Storage](#Media)
39 - [Media: Communications and Storage](#Media)
4040
4141 - [Funge-Space Storage](#Storage)
4242 - [Standard Input/Output](#Stdio)
4444 - [System Execution](#System)
4545 - [System Information Retrieval](#Sysinfo)
4646
47 - #### [Scale: Extension and Customization](#Scale)
47 - [Scale: Extension and Customization](#Scale)
4848
4949 - [Handprints](#Handprints)
5050 - [Fingerprints](#Fingerprints)
5151 - [Funge Central Registry](#Registry)
5252
53 - #### [Appendix](#Appendix)
53 - [Appendix](#Appendix)
5454
5555 - [Instruction Quick Reference](#Quickref)
5656 - [Concurrent Funge-98](#Concurrent)
373373 To remember which is which, visualize yourself on the seat of a bicycle,
374374 looking down at the handlebars:
375375
376 ------------- -------------- --------------
377 `+-| +-` `+-+| |` `-+ |-+`
378 `[` ` ` `]`
379 `Turn Left` `Go Forward` `Turn Right`
380 ------------- -------------- --------------
376 +- +-+ -+
377 | | | |
378 +- -+
379
380 [ ]
381
382 Turn Go Turn
383 Left  Forward Right
381384
382385 The `r` "Reverse" instruction multiplies the IP's delta by -1. In two
383386 dimensions, this is the equivalent of reflecting the delta of the IP
610613 spaces and/or wrap while in stringmode will have to be changed to work
611614 the same under Funge-98.
612615
613 Befunge-93 Befunge-98
614
616 Befunge-93 Befunge-98
617
615618 "hello world" "hello world"
616619 "hello world" "hello "::"world"
617620
621624 skipping over the character (in no ticks). For example, the following
622625 two snippets perform the same function, printing a Q:
623626
624 `"Q",`
625
626 `'Q,`
627 "Q",
628
629 'Q,
627630
628631 `s` "Store Character" is the mirror image of the `'` instruction: this
629632 instead pops a value off the stack and writes it into (position +
10791082
10801083 ### Funge Central Registry
10811084
1085 _Nota bene: information in this section is obsolete_
1086
10821087 The Funge Central Registry is an online database located at
10831088 `http://www.catseye.mb.ca/esoteric/befunge/`. Before developing and
10841089 releasing your own Funge-98 implementation or extension, please register
11121117 - `f` Filesystem Funge. Check `y` to see if these instructions are
11131118 implemented.
11141119
1115 Decimal
1116
1117 ASCII
1118
1119 Instruction
1120
1121 Stack Before
1122
1123 Stack After
1124
1125 Other Effects
1126
1127 *(bottom ... top)*
1128
1129 32
1130
1131 space
1132
1133 Space
1134
1135  
1136
1137  
1138
1139 not normally executed
1140
1141 33
1142
1143 `!`
1144
1145 Logical Not
1146
1147 b
1148
1149 NOT b
1150
1151  
1152
1153 34
1154
1155 `"`
1156
1157 Toggle Stringmode
1158
1159  
1160
1161  
1162
1163 stringmode \<- NOT stringmode
1164
1165 35
1166
1167 `#`
1168
1169 Trampoline
1170
1171  
1172
1173  
1174
1175 pos \<- pos + delta
1176
1177 36
1178
1179 `$`
1180
1181 Pop
1182
1183 n
1184
1185  
1186
1187  
1188
1189 37
1190
1191 `%`
1192
1193 Remainder
1194
1195 a b
1196
1197 a REM b
1198
1199  
1120 "Before" column is the state of the TOSS before the instruction is
1121 executed. "After" column is the state of the TOSS after the instruction
1122 is executed. Both are notated from bottom (on the left) to top (on the
1123 right).
1124
1125 ASCII Instruction Before After Other Effects
1126 ----- ----------- ------ ----- -------------
1127 space Space not normally executed
1128 ! Logical Not b NOT b
1129 " Toggle Stringmode stringmode <- NOT stringmode
1130 # Trampoline pos <- pos + delta
1131 $ Pop n
1132 % Remainder a b a REM b
1133
1134 * * * * *
12001135
12011136 38
12021137