From 9a899b7221ef10d222ea321f147974889d0c1ca9 Mon Sep 17 00:00:00 2001 From: Svjatoslav Agejenko Date: Sat, 7 Jul 2012 22:40:13 +0300 Subject: [PATCH 1/1] initial commit --- .classpath | 5 + .gitignore | 3 + .project | 17 + COPYING | 341 +++++ doc/5TH_ET.txt | 269 ++++ doc/commands/cmp&misc.txt | 166 +++ doc/commands/conditio.txt | 39 + doc/commands/dsk&file.txt | 57 + doc/commands/dynmem.txt | 43 + doc/commands/graphic.txt | 68 + doc/commands/index.html | 19 + doc/commands/math&mem.txt | 61 + doc/commands/string.txt | 126 ++ doc/emulator.html | 130 ++ doc/files.txt | 24 + doc/index.html | 204 +++ doc/modules/drvkbd.txt | 34 + doc/modules/drvmouse.txt | 17 + doc/modules/gfx2.txt | 20 + doc/modules/index.html | 16 + doc/modules/trig.txt | 9 + doc/numbers.png | Bin 0 -> 929 bytes doc/shots/index.html | 27 + doc/shots/start.png | Bin 0 -> 9800 bytes doc/shots/textEditor.png | Bin 0 -> 10912 bytes doc/shots/words.png | Bin 0 -> 14567 bytes emulator/charput.inc | 66 + emulator/compile.sh | 4 + emulator/emulator.asm | 531 +++++++ emulator/emulator.com | Bin 0 -> 3306 bytes emulator/kbdrive.inc | 57 + emulator/system.inc | 137 ++ emulator/tvidput.inc | 140 ++ emulator/vidput.inc | 146 ++ floppy image/image mount.sh | 4 + floppy image/image umount.sh | 3 + floppy image/run under qemu.sh | 5 + imageFile/f/5TH_AUTORUN | 32 + imageFile/f/5TH_QUICKPATH | 6 + imageFile/f/5th_boot | 788 ++++++++++ imageFile/f/5th_demo | 23 + imageFile/f/5th_eg | 167 +++ imageFile/f/5th_et | 269 ++++ imageFile/f/5th_logo | 46 + imageFile/f/FNT_SYSTEM | Bin 0 -> 2048 bytes imageFile/f/I01_MCARROW | Bin 0 -> 108 bytes imageFile/f/lib/5TH_DRVKBD | 92 ++ imageFile/f/lib/5TH_DRVMOUSE | 53 + imageFile/f/lib/5TH_KBD_US | 97 ++ imageFile/f/lib/5TH_KBD_USDVORAK | 97 ++ imageFile/f/lib/5TH_UICMD | 77 + imageFile/f/lib/5th_gfx | 149 ++ imageFile/f/lib/5th_gfx2 | 107 ++ imageFile/f/lib/5th_trig | 24 + imageFile/f/txt_eg | 16 + imageFile/f/txt_et | 18 + imageFile/f/txt_help | 13 + kernel/core.asm | 680 +++++++++ kernel/core.raw | Bin 0 -> 3123 bytes kernel/define.inc | 79 + kernel/font.asm | 2307 ++++++++++++++++++++++++++++++ util/5th2src.bas | 53 + util/editor.bas | 395 +++++ util/font.dat | Bin 0 -> 2048 bytes util/fsimport.bas | 134 ++ util/insert.bas | 50 + util/src25th.bas | 65 + 67 files changed, 8625 insertions(+) create mode 100755 .classpath create mode 100755 .gitignore create mode 100755 .project create mode 100755 COPYING create mode 100755 doc/5TH_ET.txt create mode 100755 doc/commands/cmp&misc.txt create mode 100755 doc/commands/conditio.txt create mode 100755 doc/commands/dsk&file.txt create mode 100755 doc/commands/dynmem.txt create mode 100755 doc/commands/graphic.txt create mode 100755 doc/commands/index.html create mode 100755 doc/commands/math&mem.txt create mode 100755 doc/commands/string.txt create mode 100755 doc/emulator.html create mode 100755 doc/files.txt create mode 100755 doc/index.html create mode 100755 doc/modules/drvkbd.txt create mode 100755 doc/modules/drvmouse.txt create mode 100755 doc/modules/gfx2.txt create mode 100755 doc/modules/index.html create mode 100755 doc/modules/trig.txt create mode 100755 doc/numbers.png create mode 100755 doc/shots/index.html create mode 100755 doc/shots/start.png create mode 100755 doc/shots/textEditor.png create mode 100755 doc/shots/words.png create mode 100755 emulator/charput.inc create mode 100755 emulator/compile.sh create mode 100755 emulator/emulator.asm create mode 100755 emulator/emulator.com create mode 100755 emulator/kbdrive.inc create mode 100755 emulator/system.inc create mode 100755 emulator/tvidput.inc create mode 100755 emulator/vidput.inc create mode 100755 floppy image/image mount.sh create mode 100755 floppy image/image umount.sh create mode 100755 floppy image/run under qemu.sh create mode 100755 imageFile/f/5TH_AUTORUN create mode 100755 imageFile/f/5TH_QUICKPATH create mode 100755 imageFile/f/5th_boot create mode 100755 imageFile/f/5th_demo create mode 100755 imageFile/f/5th_eg create mode 100755 imageFile/f/5th_et create mode 100755 imageFile/f/5th_logo create mode 100755 imageFile/f/FNT_SYSTEM create mode 100755 imageFile/f/I01_MCARROW create mode 100755 imageFile/f/lib/5TH_DRVKBD create mode 100755 imageFile/f/lib/5TH_DRVMOUSE create mode 100755 imageFile/f/lib/5TH_KBD_US create mode 100755 imageFile/f/lib/5TH_KBD_USDVORAK create mode 100755 imageFile/f/lib/5TH_UICMD create mode 100755 imageFile/f/lib/5th_gfx create mode 100755 imageFile/f/lib/5th_gfx2 create mode 100755 imageFile/f/lib/5th_trig create mode 100755 imageFile/f/txt_eg create mode 100755 imageFile/f/txt_et create mode 100755 imageFile/f/txt_help create mode 100755 kernel/core.asm create mode 100755 kernel/core.raw create mode 100755 kernel/define.inc create mode 100755 kernel/font.asm create mode 100755 util/5th2src.bas create mode 100755 util/editor.bas create mode 100755 util/font.dat create mode 100755 util/fsimport.bas create mode 100755 util/insert.bas create mode 100755 util/src25th.bas diff --git a/.classpath b/.classpath new file mode 100755 index 0000000..ac37fb2 --- /dev/null +++ b/.classpath @@ -0,0 +1,5 @@ + + + + + diff --git a/.gitignore b/.gitignore new file mode 100755 index 0000000..f0216fa --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ + +bin/ + diff --git a/.project b/.project new file mode 100755 index 0000000..0ca8df8 --- /dev/null +++ b/.project @@ -0,0 +1,17 @@ + + + fifth + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/COPYING b/COPYING new file mode 100755 index 0000000..10828e0 --- /dev/null +++ b/COPYING @@ -0,0 +1,341 @@ + + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/doc/5TH_ET.txt b/doc/5TH_ET.txt new file mode 100755 index 0000000..7fde517 --- /dev/null +++ b/doc/5TH_ET.txt @@ -0,0 +1,269 @@ +.( loading editor ) update +.( done ) +.( ETh - for text editor help ) + +var handletxt +var handlebuf +Dstralloc const editfile +var shiftx var shifty +var curlocx var curlocy +Dstr \listF\TXT_ET" tmphelpfile + +: disppage ( -- ) +handletxt @ +dynp shifty @ 50 * + +0 1 at! +1270 type ; + +: fclose ( close opened file ) +handletxt @ dup if dynde handletxt off else drop then ; + +: ETnewpage fclose 27100 dynal dup handletxt ! dynp +FF swap 27100 cfill ; + +var tmp1 +: fopen ( strhand -- ) +fclose +dup editfile Dstr2Dstr fsDloadnew dup push dynp ( addrinp R: handinp ) +27100 dynal dup handletxt ! dynp ( addrinp addrout R: handinp ) +FF over 27100 cfill +tmp1 off +i dyns do ( addrinp addrout ) +over c@ ( addrinp addrout c ) +dup FE = if + drop + 50 tmp1 @ - + tmp1 off +else + dup FD = if + drop tmp1 @ tab ( addrinp addrout numspaces ) + tmp1 @ over + tmp1 ! + 0 + else + over c! 1+ 0 + tmp1 @ 1+ tmp1 ! + then + drop +then +swap 1+ swap +loop 2drop +pop dynde ; rh tmp1 + +: dispchar ( x y -- ) +2dup +swap shiftx @ - +swap shifty @ - 1+ +at! +50 * + handletxt @ dynp + c@ emit ; + +: dispcur curlocx @ curlocy @ dispchar ; + +: displine ( line ) +0 over shifty @ - 1+ at! +50 * handletxt @ dynp + shiftx @ + 50 type ; + +: dispstatbar +colneg +0 0 at! 50 do space loop +0 0 at! ." col:" curlocx @ . +7 0 at! ." line:" curlocy @ . +11 0 at! ." ascii:" curlocy @ 50 * curlocx @ + handletxt @ dynp + c@ . +1B 0 at! ." file:" editfile Dstr. +49 0 at! ." F1-help" +colnorm ; + +: charins ( char x y ) +50 * handletxt @ dynp + ( char x addr ) +over push ++ dup dup 1+ 4F pop - cmove ( char addr ) +c! ; + +: charcut ( x y -- char ) +over push +50 * handletxt @ dynp + + +dup c@ swap ( char addr ) +dup dup 1+ swap ( char addr addr+1 addr ) +4F pop - dup push cmove ( char addr ) +pop + FF swap c! ; + +: lineins ( line ) +50 * dup push handletxt @ dynp + ( addr ) +dup dup 50 + handletxt @ dyns 50 - pop - cmove ( addr ) +FF swap 50 cfill ; + +: linecut ( line ) +50 * dup push handletxt @ dynp + ( addr ) +dup 50 + swap handletxt @ dyns 50 - pop - cmove ; + +: screenaim +0 curlocy @ 1E - 794 bound shifty ! +disppage ; + +var tmp1 +: length ( line -- length ) +50 * 4F + handletxt @ dynp + ( addr ) +51 do + i tmp1 ! + dup c@ FF - if pop drop 0 push then + 1- +loop +drop +tmp1 @ ; rh tmp1 + +var tmp2 var tmp3 +: fsavechar ( char ) tmp2 @ swap over c! 1+ tmp2 ! ; +: fsave ( -- ) +27200 dynal dup dynp tmp2 ! +0 +7CF do + i length if drop pop 1+ 0 push then +loop +0 swap for ( desthand ) + tmp3 off + i 50 * handletxt @ dynp + + 0 i length for ( desthand srcaddr ) + dup c@ + i tab 8 = if tmp3 @ if FD fsavechar tmp3 off then then + dup FF = if + drop tmp3 @ 1+ tmp3 ! + else + tmp3 @ do FF fsavechar loop tmp3 off + fsavechar + then + 1+ + loop drop + FE fsavechar +loop +tmp2 @ over dynp - over dynresize +dup editfile fsDsave +dynde ; rh tmp2 rh tmp3 + +str TXT_default" tmpdefault + +: ET +handletxt @ if +disppage +until + colneg dispcur dispstatbar KBD_FW@ colnorm dispcur + + dup 415 = if ( DEL ) + curlocx @ curlocy @ charcut drop + curlocy @ displine + then + + dup FC = if ( BACKSPACE ) + curlocx @ if + curlocx @ 1- curlocy @ charcut drop + curlocy @ displine + drop 413 + else + curlocy @ if + curlocy @ 1- dup length dup curlocx ! ( y-1 strlen ) + swap 50 * handletxt @ dynp + ( strlen y1addr ) + 2dup + swap 50 + ( strlen dest src ) + swap rot 50 swap - cmove + curlocy @ linecut + drop 410 + disppage + then + then + then + + dup FD = if ( TAB ) + curlocx @ tab + dup do FF curlocx @ curlocy @ charins loop + curlocx @ + curlocx ! + curlocy @ displine + then + + dup FE = if ( ENTER ) + curlocy @ 7CF < if + curlocy @ 1+ lineins + curlocx @ 0 + 50 curlocx @ - do + over curlocy @ charcut + over curlocy @ 1+ charins + 1+ + loop 2drop + curlocx off + drop 412 + disppage + then + then + + dup 418 = if curlocy @ 3A - curlocy ! then ( PG-UP ) + dup 419 = if curlocy @ 3A + curlocy ! then ( PG-DOWN ) + dup 416 = if curlocx off then ( HOME ) + dup 417 = if curlocy @ length curlocx ! then ( END ) + dup 401 = if tmphelpfile fsdisp disppage then ( F1 ) + dup 402 = if fsave then ( F2 ) + dup 403 = if fclose drop 1B then ( F3 ) + dup 400 = if done 0 0 at! screen cls drop -1 then ( ESC ) + + 0 over F0 bound? if -1 else 0 then ( NORMAL KEY ) + over FF = if drop -1 then + if + curlocx @ curlocy @ charins + curlocy @ displine + 411 + then + + dup 411 = if curlocx @ 1+ curlocx ! then ( RIGHT ) + dup 413 = if curlocx @ 1- curlocx ! then ( LEFT ) + dup 412 = if curlocy @ 1+ curlocy ! then ( DOWN ) + dup 410 = if curlocy @ 1- curlocy ! then ( UP ) + drop + + 0 curlocx @ 4F bound curlocx ! + 0 curlocy @ 7CF bound curlocy ! + + curlocy @ shifty @ - 3B > if screenaim then + + curlocy @ shifty @ - 3B - 0 = if + 0 0 8 screen scrollf + shifty @ 1+ shifty ! + curlocy @ displine + then + + curlocy @ shifty @ - -1 < if screenaim then + + curlocy @ shifty @ - 1+ 0 = if + 0 0 -8 screen scrollf + shifty @ 1- shifty ! + curlocy @ displine + then + +loop +else + tmpdefault editfile str2Dstr + ETnewpage + ET +then ; + +: ETl +fopen +curlocx off +curlocy off +shiftx off +shifty off +ET ; + +: ETs +editfile Dstr2Dstr +fsave ." saved " ; + +: ETh tmphelpfile fs. ; + +rh handletxt +rh handlebuf +rh editfile +rh shiftx rh shifty +rh curlocx rh curlocy +rh tmphelpfile +rh disppage +rh fclose rh fopen +rh dispchar rh dispcur +rh displine rh dispstatbar +rh charins rh charcut +rh lineins rh linecut +rh screenaim rh length +rh fsavechar rh fsave +rh ETnewpage rh tmpdefault diff --git a/doc/commands/cmp&misc.txt b/doc/commands/cmp&misc.txt new file mode 100755 index 0000000..97446fb --- /dev/null +++ b/doc/commands/cmp&misc.txt @@ -0,0 +1,166 @@ + Compilation & misc + ------------------ + + +init module ( -- ) + First module, control is passed to on startup. Contains + initialization routines. Also it is the last core module. + All new modules on top of it comes as result of executing + external source files. + +head ( -- ) compiles new dictionary entry without specifying + new module type. + ex: head myentry + +: ( -- ) creates new code module +; ( -- ) ends module (immideate) + ex: : hello ." hi there" ; + +const ( n -- ) defines new constant. + ex: 2147483647 const max + +:i ( -- ) same as ":" but this module will be executed + immideately even in compile mode. + ex: :i ( 41 scan ; + +create ( -- ) same as "head" , but specify module type as data. + ex: create LotoResults 5 , 13 , 52 , 12 , 11 , 3 , + +allot ( n -- ) allocate n bytes in dictionary. + ex: create MyArray 100 allot + +" " ( -- ) compile string and its size into core. + ex: create Mystring " This is it's contects" + +str " ( -- ) just shorter way for defining strings. + ex: str Mystring This is it's contenc" + +var ( -- ) define new 32 bit variable. + ex: var result + +' ( -- n ) return memory address of given entry. + ex: ' init + +forget ( -- ) erases from RAM given entry and all entries what was + defined after it. + ex: forget myprog + +[ ( -- ) set interpret mode (immideate) +] ( n -- ) set compile mode and compile top stack element + in as literal. Together [ .... ] cobination provides good + way to compute some values only once, at compile time, + rather than every time while program is running. + ex: : calculate - [ 4 MyConst1 + MyConst2 * ] ; + +defer ( -- ) creates new module, with jump instruction. + Later address where to jump can be modified by "is" command. + This provides method of foward referencing. So you can use + modules what not jet exist. +is ( address1 address2 -- ) address1 - where to jump, address2 - + address of module created by defer command. + ex: defer dispver + : run dispver ." running ..." ; + ... whatever ... + : (dispver ." Version 9.99 " ; + ' (dispver ' dispver is + + Now if I type "run" on the screen appears: + Version 9.99 running ... + +asc ( -- ) reads char ascii code and treats it as literal. + (immideate) + ex: : BreakLine 30 do asc - emit loop ; + same as: + : BreakLine 30 do 45 emit loop ; + +dyninc ( handle -- ) execute code in dynamic memory handle. + automatically deallocates it when done. + +include ( filenumber -- ) execute code in specified file. + +words ( -- ) display existing blocks in core. + +bye ( -- ) exit from Fifth + +fkey ( -- c ) + Read one byte from input stream. + +sadd ( c addr -- ) + Add one byte "c" to string located at "addr" and updates + string length. + +scan ( c -- ) + Read input stream and store it to pad until it finds c . + It ignores all "c" bytes until it finds any non "c" byte. + in other words: + c is: " + input stream: """"This is test !"aoeu idh + result: This is test ! + + Is useful for breaking text lines into words. + +skey ( -- c ) + So called safe "fkey". Reads data from input stream + but converts characters with ASCII codes: 9 13 10 + to spaces. + +str=str? ( adr1 adr2 -- result ) + Compares string at "adr1" with string at "adr2", returns + true flag if they are equal or false if they are not. + true = -1 + false = 0 + +find ( -- addr ) + Searches whole dictionary for word in "pad". If found, + returns it address, if not, returns 0. + +execute ( -- ) + Execute word located in "pad". Depending on "mode". + +dta ( addr -- DataAddr ) + Calculates address of dictionary entry data area, from + entry point. + +2num ( -- num result ) + Attempt to convert string located in "pad" into numeric + value. If succeed returns number and true as result. + If not, returns whatever and false as result. + +dadd ( addr length -- ) + Add to dictionary data located at "addr", with specified + length. + +lit ( n -- ) + Act with number depending on "mode". When interpreting, + leaves it in stack. + + +incmod ( addr -- ) + Add to dictionary data located at "addr"+1 , length is taken + from "addr". + +here ( -- n ) + return "h" contents. + +mode var 8 bit + Holds input stream parser operation mode. + 0 = interpreting + 1 = compiling + +pad var 128 bytes + Holds temprorary strings. + +h var 32 bit + Pointer to free byte in memory, always at the end of the + dictionary. Each time when something is stored + by "c," command, pointer is incareased. + +lp var 32 bit + Pointer to last dictionary word. Each time when new word is + compiled or erased by "forget", this pointer is updated. + +modulechk ( Dstr -- ) check if module is loaded, if not + immideately load it. + +ne ( entrydata entrytype -- ) Compile new dictionary entry. + It's name must be in "pad". diff --git a/doc/commands/conditio.txt b/doc/commands/conditio.txt new file mode 100755 index 0000000..1828272 --- /dev/null +++ b/doc/commands/conditio.txt @@ -0,0 +1,39 @@ + Conditionals & loops + ------------------ + +if ( flag -- ) (immideate) + "if 1.. else 2.. then" or + "if 1.. then" construction. Conditional execution. + Performs "1.." if "flag" was true, + elseway performs "2.." if exist. Execution continues after + word "then". + ex: 1 if ." nonzero" else ." zero" then + +>= ( n1 n2 -- result ) true if (n1 = n2) or (n1 > n2) + ex: 5 3 >= if ." first number is greater or equal" then + +<= ( n1 n2 -- result ) true if (n1 = n2) or (n1 < n2) += ( n1 n2 -- result ) true if n1 = n2 + +do ( count -- ) (immideate) + "do .. loop" construction. Performs ".." "count" times. + In every step "count" is decareased until it is 0. + ex: : test 5 do i .d loop ; + result: 4 3 2 1 0 + +doexit ( -- ) exit from "do .. loop" + +for ( count top -- ) (immideate) + "for .. loop" construction. Performs ".." (top - count) times. + In every step "count" is incareased until it reaches "top" . + ex: : test 4 10 for i .d loop ; + result: 4 5 6 7 8 9 + +forexit ( -- ) exit from "for .. loop" + +until ( -- ) (immideate) + "until .. loop" construction. Performs ".." until flag become + true. False by default. Top of return stack holds flag. + +done ( -- ) exit from "until .. loop" + diff --git a/doc/commands/dsk&file.txt b/doc/commands/dsk&file.txt new file mode 100755 index 0000000..b36870f --- /dev/null +++ b/doc/commands/dsk&file.txt @@ -0,0 +1,57 @@ + Disk & file access + ------------------ + +diskload ( FromDisk ToMem amount -- ) + Load specified abount of bytes from disk into memory. + +disksave ( FromMem ToDisk amount -- ) + save specified abount of bytes from memory into disk. + +format ( -- ) Erase all files. + +fsDfilesize@ ( handle -- size ) + Return size of opened file. + +fsDcurloc@ ( handle -- location ) + Return current location in file. + +fsDupdated@ ( handle -- updated? ) + Return true if file was updated, + ie. write operations occured. + +fssave ( FromMem DestFileHandle amount -- ) + Save data to file. + +fsload ( SrcFileHandle ToMem amount -- ) + Load data from file. + +fseof ( handle -- bytesLeft ) + Return amount of bytes left till end of file. + Useful before read operation. + +fsls ( -- ) List all files and lists (directories,folders) + in current path. + +fslsr ( -- ) Same as "fsls" but recursively scans also sub lists. + +fscl ( DynStrHand -- ) + Change list (path) + +fscreate ( DynStrHand -- DescPnt ) + Create new file or list. Can create multiple lists at once. + ex: when creating: + "\listGAMES\listSTRATEGY\listSIMWORLD\5th-runme" + and only "\listGAMES\" already exist, then + "listSTRATEGY" and "listSIMWORLD" lists will be created, + and empty file "5th-runme" placed in there. + +fsDsave ( DynHand DynStrHand -- ) + Create new file and save all data from dynamic memory + block to it. + +fsDload ( DynStr DynHand -- ) + Load whole file into dynamic memory block. + +fsDloadnew ( DynStr -- DynHand ) + Load whole file into new dynamic memory block. + diff --git a/doc/commands/dynmem.txt b/doc/commands/dynmem.txt new file mode 100755 index 0000000..eb3ff6f --- /dev/null +++ b/doc/commands/dynmem.txt @@ -0,0 +1,43 @@ + Dynamic memory + -------------- + + +dynal ( size -- handle ) + Allocate dynamic memory block and return it's handle. + +dynde ( handle -- ) + Deallocate dynamic memory block. + +dynp ( handle -- addr ) + Returns pointer to memory where dynamic block + data begins. + +dyns ( handle -- size ) + Returns size of dynamic block. + +dynresize ( NewSize handle -- ) + Nondestructively resize dynamic block. + +dync@ ( addr handle ) + Read one byte from dynamic block. + +dync! ( byte addr dynhandle ) + Write one byte to dynamic block. + +dyn@ ( addr handle ) + Read 32 bit number from dynamic block. + Address will spacify, whitch number, not byte. + +dyn! ( 32BitNum addr dynhandle ) + Write 32 bit number to dynamic block. + Address will spacify, whitch number, not byte. + +dyncon ( size "name" -- ) + Allocate dynamic block with specified size, and + create constant honding its handle. + ex: 100 dyncon MyNewBlock + +dyn. ( handle -- ) + Write contenc of dynamic memory block to screen. + + diff --git a/doc/commands/graphic.txt b/doc/commands/graphic.txt new file mode 100755 index 0000000..cb8ec9d --- /dev/null +++ b/doc/commands/graphic.txt @@ -0,0 +1,68 @@ + Graphic & text + -------------- + +. ( n -- ) print number on screen + +d. ( n -- ) print number on screen in decimal + +? ( addr -- ) print 32 bit value located at addr. + +." " ( -- ) print string into screen. Immideately + compiles. + ex: : greeting ." Hello, World" ; + +tab. ( -- ) print tabulator + +calccol ( b g r -- c ) calculate color what best matches given + Blue Green & Red values. Values must be in range 0 - 255. + +imgalloc ( xsize ysize -- imgbuf ) allocate image buffer for + specified size. + +imgsize ( imgbuf -- ) print on the screen X & Y size of image + buffer. + +point ( x y imgbuf -- addr ) returns memory address for specified + pixel. + +pset ( color x y imgbuf -- ) set graphic point + +boxf ( x1 x2 y1 y2 imgbuf color -- ) draw filled box + +cls ( imgbuf -- ) clear image buffer + +setpal ( b g r color -- ) set palette value for specified color. + values bust be in size 0 - 63. + +putchar ( char color x y imgbuf -- ) put graphic character in + imagebuffer to specified (x & y) location. + +scroll ( x y imgbuf -- ) scroll in imgbuf. + +scrollf ( color x y screen -- ) scroll and fill empty space with + given color. + +at! ( x y -- ) set cursor location +curc! ( color -- ) set text color +curb! ( solor -- ) set backround color + +colnorm ( -- ) set text color to normal +colneg ( -- ) set text color to negative (selected) + +dyntype ( dynhandle -- ) display contenc of dynamic memory on screen +fsdisp ( file -- ) clear screen, display file, and wait for key + +type ( addr length -- ) + Types on the screen string, from memory at addr and + specified length. + +write ( addr -- ) + Types on the screen string, from memory at "addr"+1 + length is taken from "addr" . + +screen const 32 bit + Holds handle of screen buffer. + +copyscreen ( SrcImgHandle DestImgHandle -- ) copy contenc of source + image to destination image. Source and destination images + must have same size. diff --git a/doc/commands/index.html b/doc/commands/index.html new file mode 100755 index 0000000..5b88a3b --- /dev/null +++ b/doc/commands/index.html @@ -0,0 +1,19 @@ +FIFTH + +
+
+    

Fifth internal standard commands:

+ + +
Math & memory manipulation +
Disk & file access +
Conditionals and loops +
Graphic & text +
Dynamic memory +
Dynamic & static strings +
Compilation & miscellaneous + + +
+ + \ No newline at end of file diff --git a/doc/commands/math&mem.txt b/doc/commands/math&mem.txt new file mode 100755 index 0000000..9e68523 --- /dev/null +++ b/doc/commands/math&mem.txt @@ -0,0 +1,61 @@ + Math, memory & stack manipulation + --------------------------------- + + +off ( n -- ) writes 0 to given address, good for zeroing variable. + ex: MyVariable off +on ( n -- ) writes -1 (true flag) to given address. + ex: MyVariable on + +2dup ( n1 n2 -- n1 n2 n1 n2 ) +2drop ( n1 n2 -- ) +nip ( n1 n2 -- n2 ) +neg ( n1 -- -n1 ) negotiate +bit@ ( n bit -- result ) return specified bit from n. + ex: 38 2 bit@ (result will be 1) +to32bit ( n1 n2 n3 n4 -- n32 ) treat 4 last stack elements as bytes + and unite them into 32 bit dword. Most significant byte + on top. + ex: 12 76 23 11 to32bit result: 186076172 + +to8bit ( n32 -- n1 n2 n3 n4 ) break 32 bit number into 4 bytes. + Useful if you need to send 32 bit numbers thru 8 bit COM + port. + ex: 186076172 to8bit result: 12 76 23 11 + +mod ( n1 n2 -- reminder ) divide n1 by n2 and returns reminder. + ex: 12 5 mod result: 2 + +bound ( low n high -- n ) check if n is in given bounds, + if not then incarease/decarease it to match bounds. + ex: 5 80 15 bound result: 15 + 5 10 15 bound result: 10 + 5 -10 15 bound result: 5 + +bound? ( low n high -- result ) returns true if n is in the + given bounds. + +tab ( col -- spaces) calculate amount of spaces to add + ta reach next tabulation from given column. + +count ( addr -- addr+1 n ) + Useful for returning bytes from constantly incareasing + address. Module "type" is nice example. + +c, ( n -- ) + store one byte at memory specified by "h". And incarease + "h" by 1. + +, ( n -- ) + store 32 bit number at memory specified by "h". And + incarease "h" by 4. + +cmove ( addr1 addr2 n -- ) + copy "n" amount of bytes from memory at "addr1" to memory + at "addr2". + +rnd ( limit -- result ) + generates random number in range 0 to "limit"-1. + +abs ( n -- |n| ) + returns absolute value of "n" diff --git a/doc/commands/string.txt b/doc/commands/string.txt new file mode 100755 index 0000000..c254206 --- /dev/null +++ b/doc/commands/string.txt @@ -0,0 +1,126 @@ + Dynamic & static strings + ------------------------ + +Fifth supports both static and dynamic strings. +Static strings must have predefined space reserved, +and string mustn't exceed this length. They manipulation is +faster. But they use more memory. Static string memory address is used +to refer to the string. + +Dynamic strings can have at any time length form 0 to 0FFh, +They take up only memory they currently need. They are held +in dynamic memory blocks, so dynamic block handle is used to refer +to this string. + +Both types of strings are stored in the way, where first (0th) +byte holds current string length, following bytes are string itself. + +Dynamic: + +Dstral ( -- handle ) + Allocate new string. + +Dstrlen ( handle -- length ) + Return string length. + +c+Dstr ( chr handle -- ) + Add one byte to end of the string. + +c+lDstr ( chr handle -- ) + Add one byte to left side (beginning) of the string. + +Dstr. ( handle -- ) + Write contec of string into screen. + +Dstrsure ( size Dstr -- ) + Makes sure that at least rquested + "size" (amount of characters) is allocated for given + dynamic string. + +Dstr2str ( handle address -- ) + Copy dyamic string into static memory space. + +str2Dstr ( address handle -- ) + Copy static string into dyamic string. + +Dstr+str ( Dstr addr -- ) + Add contenc of dynamic string to static string. + +D" any string" ( -- Dstr ) + Moves specified string into dynamic string called "defDstr". + +D> any_string ( -- Dstr ) + Moves specified string into dynamic string called "defDstr". + Space marks end of string! + +D>2 any_string ( -- Dstr ) + Moves specified string into dynamic string called "defDstr2". + Space marks end of string! + +Dstr+Dstr ( Dstr1 Dstr2 -- ) + Adds "Dstr1" to "Dstr2" and places result into "Dstr2". + +Dstrclear ( Dstr -- ) + Clears contenc of dynamic string. + +Dstr2Dstr ( Dstr1 Dstr2 -- ) + Moves "Dstr1" to "Dstr2". +Dstr ( data" name -- ) + Creates new dynamic string and moves specified data into it. + Then creates new constant with given "name" holding created + dynamic string handle. + + ex: Dstr Hello, my name is Sven!" message \ creates it + message Dstr. \ tests it + +Dstrlscan ( char Dstr -- loc ) + Searches dynamic string for "char", from left to right, + returns first found "char" location in string, or 0, + if not found. + +Dstrrscan ( char Dstr -- loc ) + Searches dynamic string for "char", from right to left, + returns first found "char" location in string, or 0, + if not found. + +Dstrlscane ( char Dstr -- loc ) + Same as "Dstrlscan" buf returns string length+1 as location. +ÿ +Dstrleft ( amo Dstr -- ) + Only specified amount of characters from left remains + in dynamic string. ie. cut right part out. + +Dstrright ( amo Dstr -- ) + Only specified amount of characters from right remains + in dynamic string. ie. cut left part out. + +Dstrcutl ( amo Dstr -- ) + Cut specified amount of characters from left of dynamic + string out. + +Dstrsp ( char Dstr1 Dstr2 -- ) + Separate dynamic string in Dstr1 into two parts, + using "char" as separator. First part will be stored in + "Dstr2", second part in "Dstr1". + ex: asc \ \ ..separator + D> listF\listLIB\5TH_DRVMOUSE \ ..separate from + defDstr2 \ ..place result in + Dstrsp \ separation command + defDstr Dstr. \ will be: listLIB\5TH_DRVMOUSE + defDstr2 Dstr. \ will be: listF + +Dv ( addr -- ) + Allocates empty dynamic string, and places it's handle + into given address. + +Df ( addr -- ) + Reads dynamic string handle from given address and + deallocates (frees) it. + +ex: var mystring1 + : testmodule + mystring1 Dv \ allocates string + + + + mystring1 Df ; \ deallocates it again when no longer needed. diff --git a/doc/emulator.html b/doc/emulator.html new file mode 100755 index 0000000..d1495d4 --- /dev/null +++ b/doc/emulator.html @@ -0,0 +1,130 @@ +FIFTH + + +
+
+    

Emulator & virtual CPU

+ + + +Using CPU emulator slows it down but I shouldn't now +think too mutch about, and waste my time on batteling with problems whitch +results on complex design of PC hardware. Also it allows me to use existing DOS and +resident drivers services in real mode. So I don't need to deal with +hardware too mutch. It also allows me to use all free XMS for flat +code & data storage. + +Current emulator emulates 1 CPU. It has 2 stacks, +~50 instructions, and 4GB flat address space (theoretically). +I'm not sure that DOS 6.22 that I currently prefer can handle more than +64 MB of RAM. While I tried to keep instructionset simple, +I was forced to put in lot of complex instructions to make it's performance +acceptable on emulator. On actual silicon ~20 instructions is enaugh +(I think). + +Maybe one day similar system will run directly on custom silicon chip :) + + +CPU has following registers: + +IP - instruction pointer +DSP - data stack pointer +RSP - return stack pointer + +Virtual CPU, commands (most of them are avaiable as ordinary commands in +programming lanquage): + +code mnemonic description + +0 nop does notheing +1 halt halt CPU ( return to DOS on emulator ) + +2 kbd@ ( -- c ) read scancode of pressed or released key. + Returns 0, if no data avaiable. +3 num ( -- n ) put immidiate number into datastack + +4 jmp jump to specified code +5 call jump to specified code, save return address to + return stack. + +6 1+ ( n -- n+1 ) +7 1- ( n -- n-1 ) + +8 dup ( n -- n n ) duplicate top of data stack +9 drop ( n -- ) drop last element in data stack + +10 if ( n -- ) jump to addr if top element was 0 +11 ret jump to code, specified in return stack. + +12 c@ ( addr -- n ) read byte from memory at specified address +13 c! ( n addr -- ) store byte to specified memory + +14 push ( DSTK -> RSTK ) move top of datastack to returnstack +15 pop ( RSTK -> DSTK ) move top of returnstack to datastack + +16 +17 rot ( n1 n2 n3 -- n2 n3 n1) rotate stack elements + +18 disk@ ( FromDiskSect ToMem -- ) read 1KB from disk into RAM +19 disk! ( FromMem ToDiskSect -- ) write 1KB to disk + +20 @ ( addr -- n ) read 32 bit number from memory +21 ! ( n addr -- ) store 32 bit number to memory + +22 over ( n1 n2 -- n1 n2 n1 ) self explaining ... +23 swap ( n1 n2 -- n2 n1 ) -,,- + +24 + ( n1 n2 -- n1+n2 ) -,,- +25 - ( n1 n2 -- n1-n2 ) -,,- + +26 * ( n1 n2 -- n1*n2 ) -,,- +27 / ( n1 n2 -- n1/n2 ) -,,- + +28 > ( n1 n2 -- result ) is true when n1 > n2 +29 < ( n1 n2 -- result ) is true when n1 < n2 + +30 not ( n1 -- not_n1 ) logical not +31 i ( -- n ) copies top of return stack into datastack + +32 cprt@ ( addr -- n ) read one byte from hardware port +33 cprt! ( n addr -- ) store one byte to hardware port + +34 i2 ( -- n ) like "i" but takes socond top stack element. +35 i3 ( -- n ) like "i" but takes third top stack element. + +36 shl ( n amount -- n ) left bit shift +37 shr ( n amount -- n ) right bit shift + +38 or ( n1 n2 -- n ) logical or +39 xor ( n1 n2 -- n ) exclusive logical or + +40 vidmap ( addr -- ) copy memory from "addr" to video memory. + +41 mouse@ ( -- x y button ) read mouse coordinates & buttons + +42 vidput ( addr1 addr2 x y -- ) put image1 into image2, at + location x, y. Does clipping, so part of a big image + can be mapped into smaller one. + +43 cmove ( addr1 addr2 amount ) move memory from addr1 to addr2 + if addr1 is greater than addr2 then count address + foward while moving, elseway starts from end and + counts backwards, so no data loss will occure on + overlapping. + +44 cfill ( c addr amount -- ) fill memory starting at "addr" + with "c" bytes. + +45 tvidput ( addr1 addr2 x y -- ) same as "vidput" but treats + color 255 in source image as transparent. + +46 depth ( -- depth ) returns current depth of data stack. + +47 charput ( colorfg colorbg addrsrc addrdest x y ) + draw character to image buffer located at "addrdest" + to specified x & y location. Decodes 8 bytes from + source to bits, used to draw character. + +
+ + \ No newline at end of file diff --git a/doc/files.txt b/doc/files.txt new file mode 100755 index 0000000..f035eea --- /dev/null +++ b/doc/files.txt @@ -0,0 +1,24 @@ + Fifth distribution directory tree description + ============================================= + +After downloading and unpacking the ZIP file you shoud get +directory tree similar to this: + + +[DOC] - Fifth documentation + [commands] - documentation on Fifth built-in commands + [modules] - documentation on additional commands, realized as loadable modules + [shots] - Fifth screenshots + +[imageFile] - files contained within 'disk.raw', just an extracted form. + +[source] - source files + [emulator] - emulator source + [util] - utilites + +disk.raw - Virtual disk file, has filesystem inside. +emulator.com - main executable. + + + + diff --git a/doc/index.html b/doc/index.html new file mode 100755 index 0000000..89b27cd --- /dev/null +++ b/doc/index.html @@ -0,0 +1,204 @@ + + + + +FIFTH + + +

FIFTH - virtual machine, operating system, programming language

+ Download +    + Online homepage +    + Other applications hosted on svjatoslav.eu +
+Program author:
+    Svjatoslav Agejenko
+    Homepage: http://svjatoslav.eu
+    Email: svjatoslav@svjatoslav.eu
+
+This software is distributed under GNU GENERAL PUBLIC LICENSE Version 2.
+
+

Introdution

+ +Fifth is programming lanquage & operating system, running on +virtual CPU, with custom instructionset. It is mutch like +Charles Chunk Moore's Forth, it also uses stack architecture, +and many commands are similar. Basically I got famailiar with +concepts of Forth, and being inspired created my own system. +

+Note: + +Current implementation does not support object oriented programming. +While working on Fifth I got lots of cool new ideas that require reimplementation +of everything. + +Currently I try to implement those new ideas in the project called Sixth. + +
+Screenshots + +Read more about: +
Virtual CPU +
Built-in commands +
Additional commands, realized as loadable modules +
Example Fifth source file - text editor + + +

Installation

+ +Just unpack all files, witout altering original directory structure, +somewhere in your hard disk. For example: C:\MISC\FIFTH\.... +To run fifth you need minimally just 2 files. +emulator itself ( EMULATOR.EXE or EMULATOR.COM ), and +virtual disk file ( DISK.RAW ). +Read more about distribution directory layout. + + + +

Software/Hardware/Human requirements

+ + +Software: MS-DOS 6.22, with HIMEM.SYS loaded. + Mouse driver if you have a mouse. + Does work only when CPU is in real mode. + To recompile ASM sources I used FASM (Flat Assembler). + I ran QBasic utilites on QB 4.5 . + VESA support by BIOS, or external driver (UNIVBE). + +Hardware: Minimum CPU 386. + Recommended CPU Pentium 133. + 64 KB free RAM below 640KB, + 2 MB of free XMS. + VESA compatible video card. + +Human: Beginner level Forth knowledge is recommended. + Enthusiasm. + + + +

Numbers representation

+ + + +Fifth uses hexdecimal number representation as primary. +Numbers shape is formed by dividing a square into four parts. +And manipulating their color (black or white). + + + +

Disk file map, and it's data structures

+ + +Core & highlevel boot code is stored outside of the filesystem to allow +easy access to it, at early booting time, when filesystem is not yet +initialized. + + disk allocation: + +offset length description + +0 ~4 Kb Fifth core +4 Kb ~32Kb highlevel boot code +37 Kb ~65Kb FAT +101Kb ~16MB filesystem data area + + FAT entry format: + +-2 last sector +-1 empty sector +0 -- .. pointer to next block + + file entry format + +offset length description + +0 4 extension +4 16 name +20 4 entry point +24 4 size +28 4 last modification time + + + +

Core architecture

+ + +Fifth core is simply some amount of already compiled into machine code +and linked together modules (entries in other words). In compilation +process modules is compiled one by one and simply stored on top of +already existing and growing core. Separately from core is kept +dictionary, this is special list that contain names of compiled modules, +variables etc. and they locations in core. Constants use dictionary space +only. Random word can be removed from dictionary at any time. Currently +dictionary can contain at most 1000 entries. + + + dictionary entry format + +offset length description + +0 4 0 < previous entry + 0 = last + -1 = empty +4 15 module name string +19 1 entry type +20 4 entry data + +Core headers as linked list of module names make up something like dictionary. +When some entry address is needed compiler can quickly run through headers +backwards and find needed entry. + + Possible module types + +type description "execute" action + +0 data compile "num" instruction + with address to module +1 submodule compile "call" instruction + with address to module +2 imm. submodule immideately call to module + + + Memory map: (average) + + +0 ~4096 core +1500000 ~32000 highlevel Fifth boot code +200000h core startup messages area +5200000 end of dynamic memory space + + + +

Fifth source format

+ + +Fifth uses a different character table and codes than ASCII. +I call it FSCII (Fifth Standard Code for Information Interchange) +for example space character is not 32 but 255 instead. +I plan to use mainly HEX numbers, and create new characters +to represent numeric values. So typical nemric characters "0123..." +is treated like ordinary letters. + + FSCII: + +DEC HEX function + +0 - 15 0 - F HEX numbers +252 FC backspace +253 FD tabulator (TAB) +254 FE carriage return (CR) +255 FF space + +else ordinary characters, like in ASCII. + + + + + +
+ + \ No newline at end of file diff --git a/doc/modules/drvkbd.txt b/doc/modules/drvkbd.txt new file mode 100755 index 0000000..a8b517a --- /dev/null +++ b/doc/modules/drvkbd.txt @@ -0,0 +1,34 @@ + Keyboard driver + --------------- + +KBD_@ ( -- code ) get scancodes for pressed keys from keyboard. +KBD_down? ( key -- result ) check is key with specified scancode + currently pressed down. +KBD_SC2FSCII ( code -- FSCII ) convert key scancode into FSCII code, + or in FSK (Fifth standard keycode). +KBD_F@ ( -- FSCII ) read pressed key FSCII or FSK, returns -1 if no + keys are pressed. +KBD_FW@ ( -- FSCII ) read pressed key FSCII or FSK, if no keys is + are pressed then waits until there is. + + FSK + --- +In HEX. + +FC backspace +FD TAB +FE enter +FF space + +400 ESC +401 ... F1 ... +410 up +411 right +412 down +413 left +414 INS +415 DEL +416 home +417 end +418 PG/UP +419 PG/DN diff --git a/doc/modules/drvmouse.txt b/doc/modules/drvmouse.txt new file mode 100755 index 0000000..80bf167 --- /dev/null +++ b/doc/modules/drvmouse.txt @@ -0,0 +1,17 @@ + Mouse driver + ------------ + +mousex var Mouse x coordinate. +mousey var Mouse y coordinate. +mousekeyl var Mouse left key. +mousekeym var Mouse middle key. +mousekeyr var Mouse right key. +mousec var Display current mouse coordinates in top left part of screen, + if true. (good for debugging) +mousepointer var Image buffer, holding current mouse pointer. +mouseadd ( ModuleAddr x1 x2 y1 y2 -- ) Add specified area on screen, + into mause click buffer. If any mouse button is clicked on + that area, module at "ModuleAddr" will be executed. +mousebe var Amount of buffer elements. +mousedo ( -- ) Updates mouse coordinates and keys. Parse mouse + click buffer, and draw mouse cursor to "screen". diff --git a/doc/modules/gfx2.txt b/doc/modules/gfx2.txt new file mode 100755 index 0000000..24085f7 --- /dev/null +++ b/doc/modules/gfx2.txt @@ -0,0 +1,20 @@ + 2D graphic library + ------------------ + + +lineh ( color len x y imgbuf -- ) draws horisontal line + from X,Y coordinates to right, with specified length. +linev ( color len x y imgbuf -- ) draws vertical line + down, from coordinates X,Y, with specified length. +box ( color x2 x1 y2 y1 imgbuf -- ) draws rectangular + box. x2 bust be >= x1, y2 must be >= y1. + x1,y1-----------+ + | | + | | + +-----------x2,y2 + +flipv ( imgbuf -- ) flip image vertically. +imgcoltrans ( ImgBuf Color ToColor -- ) Translate all pixels in + specified image with "Color" into "ToColor". +imgfill ( color x y imgbuf -- ) Fill image region starting at location + X & Y with specified color. diff --git a/doc/modules/index.html b/doc/modules/index.html new file mode 100755 index 0000000..97f4011 --- /dev/null +++ b/doc/modules/index.html @@ -0,0 +1,16 @@ +FIFTH + + +
+
+    

Loadable external modules

+ + +keyboard driver +mouse driver +advanced graphic library +trigonometry module + +
+ + \ No newline at end of file diff --git a/doc/modules/trig.txt b/doc/modules/trig.txt new file mode 100755 index 0000000..7899144 --- /dev/null +++ b/doc/modules/trig.txt @@ -0,0 +1,9 @@ + Trigonometry functions + ---------------------- + +sin ( a -- result ) return sinus from given angle "a", + 360ø is 2000. So 1000 represents 180ø angle. + Result will be in range -10'000 to 10'000, instead of ñ1. + +cos ( a -- result ) return cosinus from given angle. + Parameters are like in "sin" function. diff --git a/doc/numbers.png b/doc/numbers.png new file mode 100755 index 0000000000000000000000000000000000000000..9a155937090b99b8f312fc27e6d9fce441914200 GIT binary patch literal 929 zcmeAS@N?(olHy`uVBq!ia0vp^OMuvyg9%73pA!)Sq&N#aB8wRq_>O=u<5X=vX$A)7 zU{4pvkcv5P=UklhM1jNAI{5eh{dYcJ*gP$F5#vq|p?8(HR=w>gxT-PZ=DqjdyPrHz z-^H9FD`G8(7fs5&9X9KCddM!th8^(KODdJ$T7+)Vf*Ub z#NYiF-?^}R9k9>fmF?#J?%r`KFK5R?*%=%=!rs3-(-(E8rR?G9{3}27bT}%)-)L-C zEt?y+Ws=!zOJ4ch1K0R0#j1a;O<4Ht+m+8%Vv7!`$fWC^&+S^}`!( zM%8D!T2qqxBW?4%n;MSWj%e-XPuTc4K54pe>ji^X3o^I--c$JONyYA-_w(hqaQN(5 z@#fmKxhj(DQ`U7}Ej;kLKI3=6hjZ(C*UH?D+Fd6ozHhV5n%!)F*0oMBTK-UQ|BlCE zd668E`%BFCbDr-ypQzPha+M>w{AsJe@*NzrOLYZzdeu$knYB%TN&kS)lH-4i9{cV7 z=-nY(@$cd(wlz(ArdiihPy zMb9tf?b_}by{+)Jw3NlZ|N2kF6@`}CPV#bEs`#^a@7ls0**(j?KRcFtt#tzD@&5E} zHq)1EHFwJpugl#%FK$x7;psO!+0?JeIViG7S51vgxbSrH)lA#jyC1GP6vgpzM#`c1 zV{OuXrzY-P7sai3xvhFF>!Mc<75UZItJ&t{TzE2_qd|3j@GDE+n%Wg*wu+}4HXf^} z`y$n|;DBXsZ)vfoTj`I;nX%ia{h0Lp*x~axwJR5RFJUi!+_~UJCqs>3lKO{bUOL^f z;mtvq~Q3bEslUEg&7ffhy^7#3bd*g!E>0)^sGc&9f z917t$IBjyE@7aaAEiD2u9FDOpvnx(zGKz~iJvhCCMa;=(gMiaKPKeWht|JEhVAXcX Wdg%5ob}2B=F?hQAxvXFIFTH + + +
+
+    

Screen shots

+ + + +Startup screen diplaying Fifth logo and full file list. + + + + +Sample words defined. Most of the words are commands that can be executed +interactively from command line or from file. When executed they can be +selectively compiled or interpreted. + + + + +Built in text editor. + + + +
+ \ No newline at end of file diff --git a/doc/shots/start.png b/doc/shots/start.png new file mode 100755 index 0000000000000000000000000000000000000000..0ed0b1595980c54ffa1ce49acfbdd5140b73fe63 GIT binary patch literal 9800 zcmb_?c~sKd+b?8l<wf=X0pI=bJbOR;Gwd%9FS$6W z?9kc)0030Z{eJoi0I=mY005+K+amkKJ$io@0I(l$?zH38q!RYDcTst@I^a@Um(~dq z;@RGJ$*-mMyOBmm&OWW?T~Yrf9og)D8YwRu_}{LiJ&2l!Zgh&BE;gsLt1D-A7E;y- z2ZzJIKJW6h1OObKX(|K8c4h$SS~pAqKBtrw(!>5F0HRcmY65D0QIPv@p#XsHg=H!I zqXRqb^-N+QoYp-(!;fHJw;|5~{(Vrl#fJbu^ZoxG`QPHSt8&y(ixet91nxP*SD6Zj zb4GP5*D_WAr$PT$>71qUlM|%4X{ssrMADbn;ng|y7vTAJTVb&?dYBQD&>WI~Mg{xxN;WF#7NQQxA_OK{_))k9yTl$8if$3)O zy75FyvIb7>UWExNPl#NP3BK1FTAY&a8XBwTZW8c})rMRrYhVb?Yq#{SnFJPMH*9B) zP<0{fTJ`!FvP<#kJ8w)geg%0^e-}pk`c(UKstaMmCHgBT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=htmYD^=M{;i#RjKvM9vvf< z5h#syOZe!xMjV>O%uxv1!;}R%gu%y=I#G+G^A0N$dzgV=T^|L4eE~f;yzbS1I;` z)#S4?6XSz8mAvm6@hWLO-Dc^m&i=Jx z`b=qD>*BF}Y?GefZ;|p8)us_` z$&qYA8x&I)%9VaiQeU@V{Vn-;s?TyIwa48s5fTB|Dvf~d{fUoL4Vf;M+=Va9B5}3; zjq|UVm1>#+t+k7reT+H>v?(>(v(`Ny7_g-GIeXZq_RV@(*pk6vKa@T4&oSOGWpHQ} zV^K+q*H<>3-t0Rh@2Qg!HWb(hax*?{f?s$UD2x_W(}!Afy+>^!SAAS&eWnsxfS-o< zfl5m2*quMI^b^CNVaZg|biTIikl_Dtb*FCvw~63^b-LjWKW;mB#^rR)$$&fm0dX)v AHUIzs literal 0 HcmV?d00001 diff --git a/doc/shots/textEditor.png b/doc/shots/textEditor.png new file mode 100755 index 0000000000000000000000000000000000000000..b12ee21e4d72b32354a374d506cb28902641dc85 GIT binary patch literal 10912 zcmch7WmHsO`0mgxtq8~v5`w^pbR$T&lr$>cpyU8Uw=jfsOLupTq@=WTN(so&F>nvR z|6TXXUH9wVA7<@$_8ZUhynF3AXRirYSCu2er^W|?Ktu}iGMXR|It&CtTgAlyzCkB` zIRgS=fYg<>-U22F1Ob7}Kp;2>gaCn%4;BOhf|!9Ia1aCmf*>Cj%^)B%Gmse^WQG8l zAs>9<5D?r91c!s*2oN0k5Q>0+5N03*9E3oC5J(^s2nhip%|J*v2#Ek80RzYlqy};U z!GJgNq0YlFgFxUA2m%5@K9mJ4Gc$-89Abumm?0lf0E=)l2pkT9BOq|(11P{3VFp3K zAqWHnfdnuDp%A1Q1PO;A5fCI$6+jIn13&{P0a(BqP#DM!qy};U!N>mC1W@ZR8 zGvot5pe$g);bw4z865dQ7eE0lBH(5Sgc$+}um?Z^zGg_c84_WJ1n2>J05E}QKn{RE z00LkLpazlwpaGPCD}Vzi4CDq<1G$h7$~`OtHZTxyIPyVAfFDp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w0BE3s%DV#<_yE$C-0D z^9lvSdV4OPq+5)w2E&rTa14^~jV0a#yU+j59`uwhvu?K)w3q}lw2lJ@9i={3h6RgX z?AWYXB|Jhy4HPX2fqitDF*9AmkKCw{&ASay=GL;p=y+W|VTHLJ6iftN&oTTJ^XU~< z`iu<;8vkxqt@i@}#aGmOp3`%?%?2=%W9=il^i+{|&)XES;f4gJEY^%(~IaO0bh zI^Sg{l-NCl;5I~d%6*R-FAZFO;V^xev9MfX@TBZ|UVqCWA)FcZlJTks_ zv_z4I+}j#dR&>3+i5U2Ze)lH@x#WF3cM;Vt>i2GMs_WWI`r8|1wTU(+GfKihH?81- zB(-yQoz&$!f7ODhGN8WYf@k;8fZ%9wg&F$!k?6T%fuAl(34;jR2yvE7ES2QM9v~^H z|HMIBwozM2+b%~r&Ey1|F00tB57-V4lPR74qJ24bSLlKqb)vEs%-KP-7cBnO9<$l%EudcKyqLr$@98tNI&m#f z@a>mMk|nHqKben>brlNWd2>gl(a;?ci)NRLD}D2dVC}jr)`@=GHUlF49aR~achNy4 zC^KDQb`jCFT)s=H{AK5WV1GKmWqt-w)VOG}9}9?RH&Z|jg^tO!99wa47yfwGq03|b~=en>q$ahkOJ=G(tl#0>TC>6Kn{2>T!PT^TX} literal 0 HcmV?d00001 diff --git a/emulator/charput.inc b/emulator/charput.inc new file mode 100755 index 0000000..95b395f --- /dev/null +++ b/emulator/charput.inc @@ -0,0 +1,66 @@ +; part of virtual processor, emulator for FIFTH + +xcharput: + mov eax, [es:edi] ; chary + mov [chary], eax + mov ecx, [es:edi+4] ; charx + mov eax, [es:edi+8] ; addrdest + add eax, [xms_addr] + mov ebx, [es:eax] + mov [sizex], ebx + add eax, 8 + add eax, ecx + push eax + sub edx, edx + mov eax, [chary] + mul dword [sizex] + pop ebx + add eax, ebx + mov [addrdst], eax + mov eax, [es:edi+12] + add eax, [xms_addr] + mov [addrsrc], eax + mov al, [es:edi+16] + mov [colorbg], al + mov al, [es:edi+20] + mov [colorfg], al + add edi, 24 + + mov [linenum], 8 +charl1: + mov eax, [addrsrc] + mov bx, [es:eax] + mov edx, [addrdst] + mov cx, 8 +charl2: + dec cx + bt bx, cx + jnc charl3 + mov al, [colorfg] + jmp charl4 +charl3: + mov al, [colorbg] +charl4: + mov [es:edx], al + inc edx + cmp cx, 0 + jne charl2 + + mov eax, [sizex] + add [addrdst], eax + inc [addrsrc] + dec [linenum] + mov al, [linenum] + cmp al, 0 + jne charl1 + + jmp emu + +colorfg db 0 +colorbg db 0 +charx dd 0 +chary dd 0 +addrsrc dd 0 +addrdst dd 0 +sizex dd 0 +linenum db 0 diff --git a/emulator/compile.sh b/emulator/compile.sh new file mode 100755 index 0000000..1e132a3 --- /dev/null +++ b/emulator/compile.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +fasm emulator.asm + diff --git a/emulator/emulator.asm b/emulator/emulator.asm new file mode 100755 index 0000000..751fd61 --- /dev/null +++ b/emulator/emulator.asm @@ -0,0 +1,531 @@ +; virtual processor, emulator for FIFTH + +; registers usage: + +; edi - data stack pointer +; esi - instruction pointer +; es = 0 +; cs - emulator program code segment +; ds = cs + + +org 100h + + call system_init ; init system, allocate XMS + call KB_init ; init keyoard + + push 0 ; initialize segments + pop es + push cs + pop ds + sub ebx, ebx ; initialize pointers + mov bx, cs + shl ebx, 4 + add ebx, buf + add ebx, 20000 + mov edi, ebx ; data stack + add ebx, 10000 + mov [resp], ebx ; return stack + mov esi, [xms_addr] ; instruction pointer + + mov ah, 3dh ; open diskfile + mov al, 2 + mov dx, infile + int 21h + mov word [fileh], ax + + mov ax, 4F02h ; set VESA 640*480 8 bit + mov bx, 101h + int 10h + + mov ecx, 0 ; load boot block (first 1024 bytes) + mov ebx, [xms_addr] + call diskload + jmp emu + +xmemtot dw 0 ; amount of accessible XMS + +infile db 'disk.raw', 0 ; virtual disk file name +fileh dw 0 ; it's handle + +coresiz dw 4096 ; core size +gran dw 0 ; VESA granule size + +quit: mov ax, 3 ; restore text mode + int 10h + + mov ah, 3eh ; close diskfile + mov bx, word [fileh] + int 21h + + call KB_restore + jmp system_exit ; terminate program + +resp dd 0 ; return stack pointer + +emu: ; pick instruction +movzx bx, byte [es:esi] +inc esi +shl bx, 1 +add bx, table +jmp word [cs:bx] + +table dw emu ; 0 + dw quit + dw xkbd@ + dw xnum + dw xjmp + dw xcall ; 5 + dw xinc + dw xdec + dw xdup + dw xdrop + dw xif ; 10 + dw xret + dw xc@ + dw xc! + dw xpush + dw xpop ; 15 + dw 0 + dw xrot + dw xdisk@ + dw xdisk! + dw x@ ; 20 + dw x! + dw xover + dw xswap + dw xplus + dw xminus ; 25 + dw xmul + dw xdiv + dw xgreat + dw xless + dw xnot ; 30 + dw xi + dw xcprt@ + dw xcprt! + dw xi2 + dw xi3 ; 35 + dw xshl + dw xshr + dw lor + dw lxor + dw xvidmap ; 40 + dw xmouse@ + dw xvidput + dw xcmove + dw xcfill + dw xtvidput ; 45 + dw xdep + dw xcharput + +xkbd@: call KB_read + sub edi, 4 + mov [es:edi], dl + + mov ah, 0bh ; check for key in keyboard buffer + int 21h + cmp al, 0h + je emu + mov ah, 0 ; read key + int 16h + jmp emu + +xnum: mov edx, dword [es:esi] + sub edi, 4 + mov [es:edi], edx + add esi, 4 + jmp emu + +xjmp: mov esi, dword [es:esi] + add esi, [xms_addr] + jmp emu + +xcall: mov edx, dword [es:esi] + mov eax, [resp] + sub eax, 4 + mov ebx, esi + add ebx, 4 + sub ebx, [xms_addr] + mov [es:eax], ebx + mov [resp], eax + mov esi, edx + add esi, [xms_addr] + jmp emu + +xinc: inc dword [es:edi] + jmp emu + +xdec: dec dword [es:edi] + jmp emu + +xdup: mov eax, [es:edi] + sub edi, 4 + mov [es:edi], eax + jmp emu + +xdrop: add edi, 4 + jmp emu + +xif: mov eax, [es:edi] + add edi, 4 + cmp eax, 0 + jne l2 + mov esi, [es:esi] + add esi, [xms_addr] + jmp emu +l2: + add esi, 4 + jmp emu + +xret: mov eax, [resp] + mov esi, [es:eax] + add esi, [xms_addr] + add eax, 4 + mov [resp], eax + jmp emu + +xc@: mov eax, [es:edi] + add eax, [xms_addr] + sub ecx, ecx + mov cl, [es:eax] + mov [es:edi], ecx + jmp emu + +xc!: ;( n addr -- ) + mov ebx, [es:edi] + add edi, 4 + mov ecx, [es:edi] + add edi, 4 + add ebx, [xms_addr] + mov [es:ebx], cl + jmp emu + +xpush: mov ebx, [es:edi] + add edi, 4 + mov eax, [resp] + sub eax, 4 + mov [es:eax], ebx + mov [resp], eax + jmp emu + +xpop: mov eax, [resp] + mov ebx, [es:eax] + add eax, 4 + mov [resp], eax + sub edi, 4 + mov [es:edi], ebx + jmp emu + +xrot: mov ebx, [es:edi] + mov ecx, [es:edi+4] + mov edx, [es:edi+8] + mov [es:edi+8], ecx + mov [es:edi+4], ebx + mov [es:edi], edx + jmp emu + +xdisk@: mov ebx, [es:edi] + add ebx, [xms_addr] + mov ecx, [es:edi+4] + add edi, 8 + call diskload ; ecx-fromdisk ebx-tomem + jmp emu + +xdisk!: mov ecx, [es:edi] + call file_seek + mov ecx, 1024 + mov ebx, [es:edi+4] + add edi, 8 + add ebx, [xms_addr] + sub edx, edx + mov dx, cs + shl edx, 4 + add edx, buf + call memmove ; ebx - from, edx - to, ecx - amount + mov ah, 40h + mov bx, [fileh] + mov cx, 1024 + mov dx, buf + int 21h + jmp emu + +x@: mov eax, [es:edi] + add eax, [xms_addr] + mov eax, [es:eax] + mov [es:edi], eax + jmp emu + +x!: ;( n addr -- ) + mov eax, [es:edi] + add eax, [xms_addr] + mov ecx, [es:edi+4] + add edi, 8 + mov [es:eax], ecx + jmp emu + +xover: mov ebx, [es:edi+4] + sub edi, 4 + mov [es:edi], ebx + jmp emu + +xswap: mov ebx, [es:edi] + xchg ebx, [es:edi+4] + mov [es:edi], ebx + jmp emu + +xplus: mov ebx, [es:edi] + add edi, 4 + add [es:edi], ebx + jmp emu + +xminus: mov ebx, [es:edi] + add edi, 4 + sub [es:edi], ebx + jmp emu + +xmul: mov eax, [es:edi] + add edi, 4 + sub edx, edx + imul dword [es:edi] + mov [es:edi], eax + jmp emu + +xdiv: add edi, 4 + mov eax, [es:edi] + cdq + idiv dword [es:edi-4] + mov [es:edi], eax + jmp emu + +xgreat: mov eax, [es:edi] + add edi, 4 + mov edx, 0 + cmp [es:edi], eax + jng l3 + dec edx +l3: mov [es:edi], edx + jmp emu + +xless: mov eax, [es:edi] + add edi, 4 + mov edx, 0 + cmp [es:edi], eax + jnl l4 + dec edx +l4: mov [es:edi], edx + jmp emu + +file_seek: ; ( ecx - pointer to seek ) + mov eax, 1024 + mul ecx + mov ecx, eax + mov dx, cx + shr ecx, 16 + mov ah, 42h + mov al, 0 + mov bx, [ds:fileh] + int 21h + ret + +xnot: not dword [es:edi] + jmp emu + +xi: mov ebx, [resp] + mov eax, [es:ebx] + sub edi, 4 + mov [es:edi], eax + jmp emu + +xcprt@: mov dx, [es:edi] + in al, dx + sub ecx, ecx + mov cl, al + mov [es:edi], ecx + jmp emu + +xcprt!: mov dx, [es:edi] + mov al, [es:edi+4] + add edi, 8 + out dx, al + jmp emu + +xi2: mov ebx, [resp] + mov eax, [es:ebx+4] + sub edi, 4 + mov [es:edi], eax + jmp emu + +xi3: mov ebx, [resp] + mov eax, [es:ebx+8] + sub edi, 4 + mov [es:edi], eax + jmp emu + +xshl: mov cl, [es:edi] + add edi, 4 + shl dword [es:edi], cl + jmp emu + +xshr: mov cl, [es:edi] + add edi, 4 + shr dword [es:edi], cl + jmp emu + +lor: mov eax, [es:edi] + add edi, 4 + or [es:edi], eax + jmp emu + +lxor: mov eax, [es:edi] + add edi, 4 + xor [es:edi], eax + jmp emu + +xvidmap: + mov edx, [es:edi] + add edx, [xms_addr] + add edi, 4 + push edi + push esi + push 0a000h + pop es + mov word [ds:gra], 0 + push 0 + pop ds + mov esi, edx +mapl1: mov dx, [cs:gra] + xor bx, bx + mov ax, 4f05h + int 10h + mov edi, 0 + mov cx, 4096 +; mov cx, 16384 +mapl2: mov eax, [ds:esi] + add esi, 4 + stosd + loop mapl2 + inc word [cs:gra] +; cmp word [cs:gra], 5 + cmp word [cs:gra], 19 + jne mapl1 + push 0 + pop es + push cs + pop ds + pop esi + pop edi + jmp emu +gra dw 0 + + +xmouse@: + mov ax, 0bh ; read motion counter + int 33h + push dx + sub eax, eax + mov ax, cx + cwd + shl edx, 16 + add edx, eax + mov [es:edi-4], edx + pop ax + cwd + shl edx, 16 + add edx, eax + mov [es:edi-8], edx + mov ax, 3 ; read buttons + int 33h + sub eax, eax + mov ax, bx + sub edi, 12 + mov [es:edi], eax + jmp emu + +memmove: ; ebx - from, edx - to, ecx - amount + cmp ecx, 0 + je l11 + mov al, [es:ebx] + mov [es:edx], al + inc ebx + inc edx + dec ecx + jmp memmove +l11: ret + +memmove2: ; ebx - from, edx - to, ecx - amount + add ebx, ecx + add edx, ecx +l7: cmp ecx, 0 + je l12 + dec ebx + dec edx + mov al, [es:ebx] + mov [es:edx], al + dec ecx + jmp l7 +l12: ret + +xcmove: mov ecx, [es:edi] + add edi, 12 + mov edx, [es:edi-8] + add edx, [xms_addr] + mov ebx, [es:edi-4] + add ebx, [xms_addr] + cmp ecx, 0 + je emu + cmp ebx, edx + ja l8 + call memmove2 + jmp emu +l8: call memmove + jmp emu + +xcfill: mov ecx, [es:edi] + mov edx, [es:edi+4] + add edx, [xms_addr] + mov eax, [es:edi+8] + add edi, 12 +l9: cmp ecx, 0 + je emu + mov [es:edx], al + inc edx + dec ecx + jmp l9 + +diskload: ; ecx-fromdisk ebx-tomem + push ebx + call file_seek + mov cx, 1024 + mov ah, 3fh + mov bx, [fileh] + mov dx, buf + int 21h + + sub ebx, ebx ; move it to XMS + mov bx, cs + shl ebx, 4 + add ebx, buf + pop edx + mov ecx, 1024 + call memmove ; ebx - from, edx - to, ecx - amount + ret + +xdep: sub eax, eax + mov ax, cs + shl eax, 4 + add eax, buf + add eax, 20000 + sub eax, edi + shr eax, 2 + sub edi, 4 + mov [es:edi], eax + jmp emu + +include 'vidput.inc' +include 'tvidput.inc' +include 'charput.inc' +include 'system.inc' +include 'kbdrive.inc' + +buf: ; pointer to end of the code diff --git a/emulator/emulator.com b/emulator/emulator.com new file mode 100755 index 0000000000000000000000000000000000000000..49be7260d4e54d749095b4b80ca0d7afe8dfaa7e GIT binary patch literal 3306 zcmeHJYitzP6`t4544z%jwjpavRd?5|F>zfj5ER72aVxCUkQT6FC3fmI4&XfwB*e{T zEuyqFp-Tzlv0N!qg(4-5H=_zi{3uFR&0?frvr_DUwr+7B1pf#LG~LUFAhlI&@MC+< zo%O3F{Zm!_)BUk?&v(A_y7$~OliOXAyJ74Xw9*h%PxM}Z;j0Q9&Rq8i0zSe!@nL;{ zEB|U*1-nJCH{A55?ms0BeoxF+I8iYz?K&fhSwEZ>@CSDArZ>0ElfOq0+V?&CWF)rx zAmM&NNXtUjpQ^KiQ8di`++e>cAx%|>`RgEj>vvZVXI>H`h1EY1pA`QpmP%ih)=J-( zqS67WTl%RqAPq~Gr77udSrG1(o8@QZH|6)_Kg*MHiSi}o>&gSlV@kJjM#(7eD|ux` zxy$o4&t}hqo>tFOp7WkbwN{O*ALwK1FG_Md4M^NnsydF9rHpJvtzaJcVId`C11w&s z>Hs_7YQZXl#JdV>{M@$T_=kAr+7r4gEtrD?a6gqsc+qf2p4AmEV&%^LX*n;P% z1#=xz>YLOsNFKcI%T}=8&XS1+R4}c`gQc<4{{*`cNvE?{xsIaHse=__Hb+7zyy&JJ zV$Zoyalgb6>sSU1M>z3d_ z(w8yij`|-j=&#K{nl=e0KLl&o!i{16)YemidxJ6*s*IhT!7JzXhCE-P#@@gb?6Oa= zC5{bKFq0kU2sTIq-|kP@(M7}hg}u>O=Mq?7bl8ICJ-mz1-S}#@ZJE4=ZA7`)#JE_Y zvDM3fbs7tBpbX>yo-_4&Gd%Ky(65cCqaH!nFNE;oMC`z*XWc~FvkT|RS=zGGf*<{= zbPM3*M}LnLkR3_Xje73ty68@=$DoZ3PUCnngzWllqL)fOy_j!nf(*iUd+p#k3{75u2xY zWrVfOxXp|%%_E^{*ff4n&7}%#<#g_Nft5~kJNj!@7Hk@DuSalS$mEmTJO|3)Q)tTF zn#Jxg5jLBc$oHWuy__SIIm&g z48O@JI7@{28>WL*dIIqwP9o_fm%#be=dj;e#(ulVKEv7cHc8aIrVBqZU_?Eu(;4Rt zNMah3m%urTq&lal%`9j!FVbdoPLx&jxkWvxA1Z+)E}aoQ?}H?!RimOG6d{QgvWkgp zQBQChE}aXUhPBkFs74WzNUgyvXzrSQ@mt`GBZ!I`6=QL*4Z$%4kz@zaOZ7#Vyo$cD z9GOVYpHPWWWpZN&Pb@NUdt?ga(k4iYT)Py#*?|c?XU{?s9f~S>Ks!-IPN5VtNYst% z!l5yCb&9s18WI{f zO$II8_iY0;l>6>0#}BeL{FoWS-Wi2PYRzPm0h3h-wt|Qkrj;8uc)1BU%_#OX_+Q`2 zpDSPAfyN`{@2YzZ>_Af5<=C37#%W#HZaNp9_4MyB@^U}XG3%{3oVxx3N%StNtp*g- zW@D~&uhGBPs1>^2VfTIZIh~r8VvVo9(z@wVymIh)Bef!1k@`-yA{Kq7YhNtd9^SZi z{l*R9&RBR)G#-z}DoydqfEd4L@RtkJXe`zl+Z?WMd^o)C>F^I?o$=`2I9eX)Y>!r^ zh5GE8+85%h27k{D^3N6N+qUm`U`M3s(Wdazo$>Hfox9tk?UiZYec1{tc*NVQ9`%-L zY2T{BE^oF%P5aS{6=aC#y;@2x;4-DJouH>aVVwi>?IE12C8-sJSb-bfl$TcYrm-%A zg)g;CqV9$lUm_`=jcV?og#Iyx9XR6c3m(NlEmS%*o-#fTUkeX};~KPFr)>+WX1_Ub z8`dq%@Atie5CP{8-UygtVBBklhrFWsm7%aOW@+;*B+19LGVS6y|~|3 ve|Y)@p<6zKd0B| \listF\listLIB\5TH_GFX include +D> \listF\5TH_LOGO include + +: tmpmsg 200000 100 do + dup c@ dup FC = if drop doexit else emit 1+ then +loop drop ; +.( Messages from core: ) +colhigh +tmpmsg +colnorm +forget tmpmsg + + +D> \listF\listLIB\5TH_DRVKBD include +D> \listF\listLIB\5TH_UICMD include +D> \listF\5TH_QUICKPATH include + +Dstr \listF\5TH_ET" tmpstr +: lde tmpstr include ; rh tmpstr + +Dstr \listF\TXT_HELP" tmpstr +: help tmpstr fs. ; rh tmpstr + +Dstr \listF\5TH_BOOT" tmpstr +: putboot +tmpstr fsDloadnew +dup dynp [ 400 4 * ] [ 400 20 * ] disksave +dynde ; rh tmpstr + +fslsr + +.( type 'help' to get help ) diff --git a/imageFile/f/5TH_QUICKPATH b/imageFile/f/5TH_QUICKPATH new file mode 100755 index 0000000..137bd3c --- /dev/null +++ b/imageFile/f/5TH_QUICKPATH @@ -0,0 +1,6 @@ +str \listF\" ~f +str \listGAMES\listSauron_Return\" ~game +str \listF\listLIB\" ~lib +str \" ~r + +: go fspath str2Dstr fsls ; diff --git a/imageFile/f/5th_boot b/imageFile/f/5th_boot new file mode 100755 index 0000000..8691ea6 --- /dev/null +++ b/imageFile/f/5th_boot @@ -0,0 +1,788 @@ +FE 3 + +: im 2 lp @ 13 + c! ret I +: ; B c, 1 mode c! ret I im +: gw FF scan ; +: lit mode c@ if ret else 3 c, , ret then ; +: ' gw find 14 + @ lit ; im +: abc FF scan here 2 ne 3 c, , 4 c, ' bcode , ; + + 2 abc kbd@ +10 abc kb@ 11 abc rot 1B abc / 1E abc not +1F abc i 20 abc cprt@ 21 abc cprt! 22 abc i2 +23 abc i3 24 abc shl 25 abc shr 26 abc or +27 abc xor 28 abc vidmap 29 abc mouse@ 2A abc vidput +2C abc cfill 2D abc tvidput 2E abc depth 13 abc disk! +2F abc charput + +: create gw here 0 ne ; +: vari create , ; +: var 0 vari ; +: const gw 0 ne ; +: asc skey lit ; im +: ( asc ) scan ; im +: cr FE emit ; +: .( asc ) scan pad write cr ; .( it is a test ) +: forget gw find dup 14 + @ h ! @ lp ! ; +: on -1 swap ! ; +: off 0 swap ! ; +: 2dup over over ; +: 2drop drop drop ; +: space FF emit ; +: nip swap drop ; +: >= 1- > ; +: <= 1+ < ; +: = - if 0 else -1 then ; +: neg 0 swap - ; +: forexit pop pop pop drop dup 1+ push push push ; +: done pop pop 1- push push ; +: doexit pop pop drop 0 push push ; +: bit@ shr -2 or -2 xor ; +: to32bit 100 * + 100 * + 100 * + ; +: mod 2dup / * - ; +: rh gw -1 find dup @ prev @ ! ! ; +: alloc do 0 c, loop ; +var tmp +: [ depth tmp ! 1 mode ! ; im +: ] 0 mode ! depth tmp @ - do lit loop ; rh tmp +: " asc " scan pad dup c@ c, incmod ; +: i" asc " scan pad incmod ; +: str here " const ; +: writestr i write i c@ pop + 1+ push ; +: ." 5 c, ' writestr , " ; im rh writestr +: vector ." no vector ! " ; +: defer gw here 1 ne 4 c, ' vector , ; +: is 1+ ! ; rh vector +: bound 2dup > if nip nip + else drop 2dup > if drop else + nip then then ; +: bound? over < if 2drop 0 else + > if 0 else -1 then then ; +: \ until fkey FE = if done then loop ; im +: tab. FD emit ; +: abs dup 0 < if neg then ; + +7FFFFFFF const max +80000000 const min +1 const version + +var to8bitt +: to8bit to8bitt ! to8bitt dup c@ swap 1+ dup c@ + swap 1+ dup c@ swap 1+ c@ ; rh to8bitt + +var tmp1 +: d. dup 0 < if 0 swap - 2D + emit then tmp1 off 3B9ACA00 + A do 2dup / dup dup tmp1 @ + + if 30 + emit 1 tmp1 ! + else drop then + over * swap push - pop A / + loop 2drop tmp1 @ if + else 30 emit then ; rh tmp1 + +var tmp1 +: . dup 0 < if 0 swap - 2D emit then +tmp1 off 10000000 +8 do + 2dup / dup dup tmp1 @ + + if + emit 1 tmp1 ! + else + drop + then + over * swap push - pop 10 / +loop 2drop +tmp1 @ if else 0 emit then ; +rh tmp1 + +: ? @ . ; +: depth. depth . ; + +: score 800 do i 400 * i 14 + disk! loop ; +: dump 10 do 4 do dup c@ . space 1+ loop cr loop drop ; + +var tmp1 var tmp2 +: rnd ( range -- result ) +tmp1 @ 17 * B + dup tmp1 ! +tmp2 @ over + 11 * 4 + dup tmp2 ! ++ swap mod ; rh tmp1 rh tmp2 + +100 const dynent \ dynamic memory support +create dyntab dynent 8 * alloc +create dynmem h @ 500000 + h ! +dynmem vari dynpn + +: dyntaba 8 * dyntab + ; +: dynde dyntaba off ; +: dynp dyntaba @ ; +: dynp! dyntaba ! ; +: dyns dyntaba 4 + @ ; +: dyns! dyntaba 4 + ! ; + +var dync +: dynal ( size -- handle ) +until + dync @ dup dynp 0 = if dup done then \ size dync + 1+ dup dynent = if drop 0 then + dync ! +loop \ size handle +dynpn @ over dynp! +2dup dyns! +swap dynpn @ + dynpn ! ; rh dync + +: dynresize ( nsize handle -- ) +dup push dyns \ Nsize Osiz R: handle +over < if \ Nsize R: handle + i dynp dup push over + push \ Nsize R: handle Oloc Nendloc + dyntab dynent + do + dup @ dup i3 > + if + i2 < if + pop drop i3 dynp dynpn @ dup i3 + dynp! i3 dyns cmove 0 push + then + else + drop + then + 8 + + loop + drop pop pop 2drop +then \ Nsize R: handle +i dynp over + \ Nsize Nend R: handle +dup dynpn @ > if + dynpn ! +else + drop +then \ Nsize R: handle +pop dyns! ; + +: dync@ ( addr dynhandle ) dynp + c@ ; +: dync! ( num addr dynhandle ) dynp + c! ; +: dyn@ dynp swap 4 * + @ ; +: dyn! dynp swap 4 * + ! ; +: dyncon dynal const ; + +: statdyn +cr ." " tab. ." " tab. ." " +0 dyntab dynent +do dup @ if cr swap dup . swap tab. dup @ . tab. dup 4 + @ . then 8 + +swap 1+ swap loop +2drop ; + +: dyn. ( dynhandle -- ) + dup dynp swap dyns do + dup c@ emit 1+ + loop drop ; + +rh dynent rh dyntab rh dynmem +rh dyntaba rh dynpn + +: Dstralloc ( -- strh ) \ string support +1 dynal dup dynp 0 swap c! ; + +: Dstral Dstralloc ; \ compatibility patch! + +: Dstrsure ( size strh -- ) +swap push +dup dyns 1- \ strh len +i < if + pop 20 + swap dynresize +else + pop 2drop +then ; + +: Dstrlen ( strh -- length ) +dynp c@ ; + +: c+Dstr ( chr strh -- ) +dup Dstrlen 1+ over Dstrsure +dynp dup c@ 1+ \ chr addr len +2dup swap c! ++ c! ; + +: c+lDstr ( chr strh -- ) +dup Dstrlen 1+ over Dstrsure +dynp dup c@ \ addr len +over 1+ dup 1+ rot cmove +dup dup c@ 1+ swap c! +1+ c! ; + +: Dstr. ( strh -- ) dynp write ; + +: Dstr2str ( strh mem -- ) +push dynp dup c@ 1+ \ Saddr len +pop swap cmove ; + +: str2Dstr ( mem strh -- ) +over c@ 1+ dup push over Dstrsure \ mem strh +pop do + over i + c@ + over dynp i + c! +loop 2drop ; + +: Dstr+str ( hand addr -- ) +dup c@ over + 1+ rot \ addr destaddr hand +dynp count push \ addr destaddr src R: len +swap i cmove \ addr R: len +dup c@ pop + swap c! ; + +Dstralloc const defDstr +Dstralloc const defDstr2 +: D" asc " scan pad defDstr str2Dstr defDstr ; +: D> FF scan pad defDstr str2Dstr defDstr ; +: D>2 FF scan pad defDstr2 str2Dstr defDstr2 ; + +: Dstr+Dstr ( hand1 hand2 -- ) +push push \ R: hand2 hand1 +i2 Dstrlen i Dstrlen \ len2 len1 R: hand2 hand1 +2dup + dup i2 dynp c! i2 Dstrsure +pop dynp 1+ rot pop dynp 1+ + rot cmove ; + +: Dstrclear ( handle -- ) +0 over Dstrsure +dynp 0 swap c! ; + +: Dstr2Dstr ( srchand desthand -- ) +dup Dstrclear Dstr+Dstr ; + +: Dstr asc " scan Dstralloc pad over str2Dstr const ; + +var tmploc +: Dstrlscan ( char strh -- loc ) +tmploc off +dynp 0 over c@ for \ char addr + 1+ + 2dup c@ = if i 1+ tmploc ! forexit then +loop +2drop +tmploc @ ; + +: Dstrrscan ( char strh -- loc ) +tmploc off dynp \ char addr len +dup c@ do + 2dup 1+ i + c@ = if + i 1+ tmploc ! + doexit + then +loop 2drop +tmploc @ ; rh tmploc + +: Dstrlscane ( char strh -- loc ) +dup Dstrlen push Dstrlscan +dup if pop drop else drop pop 1+ then ; + +: Dstrleft ( amo strh -- ) +dup Dstrlen rot \ strh strlen amo +0 swap rot bound \ strh ramo +swap 2dup Dstrsure +dynp c! ; + +: Dstrright ( amo strh -- ) \ unoptimized! +dup Dstrlen rot \ strh strlen amo +0 swap rot bound \ strh ramo +swap 2dup Dstrsure +push push \ R: strh ramo +i2 dynp dup c@ \ loc len R: -,,- +2dup i 1- - + \ loc len srcA R: -,,- +rot 1+ rot drop i \ srcA dstA amo R: -,,- +cmove pop pop \ ramo strh +dynp c! ; + +: Dstrcutl ( amo strh -- ) +dup Dstrlen rot - +dup 1 < if + drop Dstrclear +else + swap Dstrright +then ; + +var tmpdest var tmpsrc var tmpamo +: Dstrsp ( char strhsrc strhdest -- ) +tmpdest ! dup tmpsrc ! \ char srchand +Dstrlscane tmpamo ! +tmpsrc @ tmpdest @ Dstr2Dstr +tmpamo @ dup tmpsrc @ Dstrcutl +1- tmpdest @ Dstrleft ; +rh tmpdest rh tmpsrc rh tmpamo + +: Dv ( addr -- ) Dstral swap ! ; +: Df ( addr -- ) @ dynde ; + +24 400 * const fsroot \ filesystem support +25 const fsfatbeg +4000 const fsfatsiz +fsfatsiz 4 * 400 / 1+ fsfatbeg + const fsdata +asc f asc r asc e asc e to32bit const fsextfree +asc l asc i asc s asc t to32bit const fsextlist + +Dstr \" fspath + +create dib 400 alloc +-1 vari dibblock +: dibload dup dibblock @ = if drop + else dup dibblock ! dib disk@ then ; +: dibsave dup dibblock ! dib swap disk! ; + +var tmpfrom var tmpto var tmpamo var tmpramo +: diskload ( fromdisk tomem amount -- ) + tmpamo ! tmpto ! tmpfrom ! + until + tmpamo @ if + tmpfrom @ 400 / dibload + 0 400 tmpfrom @ 400 mod dup push - tmpamo @ bound tmpramo ! + dib pop + tmpto @ tmpramo @ 2dup + tmpto ! cmove + tmpamo @ tmpramo @ - tmpamo ! + tmpfrom @ tmpramo @ + tmpfrom ! + else + done + then + loop ; + +: disksave \ frommem todisk amount -- + tmpamo ! tmpto ! tmpfrom ! + until + tmpamo @ if + tmpto @ 400 / dibload + 0 400 tmpto @ 400 mod dup push - tmpamo @ bound tmpramo ! + tmpfrom @ dib pop + tmpramo @ cmove dibblock @ dibsave + tmpamo @ tmpramo @ - tmpamo ! + tmpfrom @ tmpramo @ + tmpfrom ! + tmpto @ tmpramo @ + tmpto ! + else + done + then + loop ; rh tmpamo rh tmpto rh tmpfrom rh tmpramo + +: fat@ 4 * dup push 400 / fsfatbeg + dibload pop 400 mod dib + @ ; +: fat! 4 * dup push 400 / fsfatbeg + dibload pop 400 mod dib + ! + dibblock @ dibsave ; + +var tmp1 +: fatfindf + until + tmp1 @ fat@ -1 = if tmp1 @ done then + tmp1 @ 1+ dup tmp1 ! + fsfatsiz = if tmp1 off then + loop ; rh tmp1 + +create formattmp i" listRootDireCtorYent" 0 , 0 , 0 , +: format ." formatting ... " fsfatsiz do + -1 i fat! + loop + -2 0 fat! + formattmp fsroot 20 disksave + ." done" cr ; rh formattmp + +20 const maxfiles +create fshandles 11 maxfiles * alloc + +\ 0 4 - FileDescription +\ 4 4 - FileSize +\ 8 4 - CurrentLocation +\ 12 4 - CurrentSector +\ 16 1 - updated + +: fsDfiledesc@ 11 * fshandles + @ ; +: fsDfiledesc! 11 * fshandles + ! ; +: fsDfilesize@ 11 * fshandles + 4 + @ ; +: fsDfilesize! 11 * fshandles + 4 + ! ; +: fsDcurloc@ 11 * fshandles + 8 + @ ; +: fsDcurloc! 11 * fshandles + 8 + ! ; +: fsDcursect@ 11 * fshandles + C + @ ; +: fsDcursect! 11 * fshandles + C + ! ; +: fsDupdated@ 11 * fshandles + 10 + c@ ; +: fsDupdated! 11 * fshandles + 10 + c! ; + +: inithandles maxfiles do + -1 i fsDfiledesc! +loop ; inithandles +forget inithandles + +: statfile +cr ." handle" tab. ." pnt" tab. ." size" tab. ." CurLoc" +tab. ." CurSect" tab. ." updated?" cr +0 maxfiles for + -1 i fsDfiledesc@ - if + i . tab. + i fsDfiledesc@ . tab. + i fsDfilesize@ . tab. + i fsDcurloc@ . tab. + i fsDcursect@ . tab. + i fsDupdated@ . cr + then +loop ; + +: fsfreenext ( firstSector -- ) + until + dup -2 = if + done + else + dup fat@ swap -1 swap fat! + then + loop drop ; + +create fsfiledesc 20 alloc +: fsopen ( FileDescPnt -- handle ) + maxfiles do + i fsDfiledesc@ -1 = if i doexit then + loop + swap dup fsfiledesc 20 diskload \ handle desc + over fsDfiledesc! \ handle + [ fsfiledesc 14 + ] @ over fsDcursect! + 0 over fsDcurloc! + 0 over fsDupdated! + [ fsfiledesc 18 + ] @ over fsDfilesize! ; + +: fspntdel ( FileDescPnt -- ) +dup fsfiledesc 20 diskload \ pnt +[ fsfiledesc 14 + ] @ fsfreenext +fsextfree fsfiledesc ! +fsfiledesc swap 20 disksave ; + +: fsclose ( handle -- ) + dup fsDupdated@ if + push + i fsDfiledesc@ fsfiledesc 20 diskload + i fsDfilesize@ [ 18 fsfiledesc + ] ! + fsfiledesc i fsDfiledesc@ 20 disksave + pop + then + -1 swap fsDfiledesc! ; rh fsfiledesc + +var tmpamo var tmpfrom var tmphand var tmploc var tmpramo var tmpsect +var tmpmax +: fssave \ fromMem toFhandle amount -- + tmpamo ! + dup fsDcurloc@ tmploc ! + dup fsDcursect@ tmpsect ! + tmphand ! tmpfrom ! + until + tmpamo @ if + 0 400 tmploc @ 400 mod dup push - dup tmpmax ! tmpamo @ + bound tmpramo ! + tmpfrom @ tmpsect @ fsdata + 400 * pop + tmpramo @ disksave + tmpramo @ tmpmax @ = if + tmpsect @ fat@ + dup -2 = if + drop + fatfindf + dup tmpsect @ fat! + -2 over fat! + then + tmpsect ! + then + tmpramo @ + tmpamo @ over - tmpamo ! + tmploc @ over + tmploc ! + tmpfrom @ + tmpfrom ! + else + done + then + loop + tmphand @ push + tmploc @ i fsDcurloc! + tmpsect @ i fsDcursect! + -1 i fsDupdated! + tmploc @ i fsDfilesize@ max bound pop fsDfilesize! ; + +var tmpto +: fsload \ fromFhandle toMem amount -- + tmpamo ! tmpto ! + dup fsDcurloc@ tmploc ! + dup fsDcursect@ tmpsect ! + tmphand ! + until + tmpamo @ if + 0 400 tmploc @ 400 mod dup push - dup tmpmax ! tmpamo @ + bound tmpramo ! + tmpsect @ fsdata + 400 * pop + tmpto @ tmpramo @ diskload + tmpsect @ fat@ + dup -2 = if + drop + else + tmpramo @ tmpmax @ = if tmpsect ! else drop then + then + tmpramo @ + tmpamo @ over - tmpamo ! + tmploc @ over + tmploc ! + tmpto @ + tmpto ! + 0 tmploc @ tmphand @ fsDfilesize@ bound tmploc ! + else + done + then + loop + tmphand @ + tmploc @ over fsDcurloc! + tmpsect @ swap fsDcursect! ; + +rh tmpamo rh tmpfrom rh tmphand rh tmploc rh tmpramo rh tmpsect rh tmpto +rh tmpmax + +: fsabsloc ( handle -- loc ) +dup fsDcursect@ fsdata + 400 * +swap fsDcurloc@ 400 mod + ; + +var tmppnt var tmphand var curhand var tmpsect +create tmpFdesc 21 alloc +: fspntcreate ( dynHand descPnt -- newFileDescPnt ) +tmppnt ! tmphand ! +tmppnt @ fsopen curhand ! +until + curhand @ fsDfilesize@ curhand @ fsDcurloc@ 20 + >= if + curhand @ fsDcursect@ tmpsect ! + curhand @ tmpFdesc 20 fsload + tmpFdesc @ fsextfree = if + curhand @ fsDcurloc@ 20 - curhand @ fsDcurloc! + tmpsect @ curhand @ fsDcursect! + done + then + else + done + then +loop +FF tmpFdesc 20 cfill +0 [ tmpFdesc 18 + ] ! +fatfindf -2 over fat! [ tmpFdesc 14 + ] ! +0 tmphand @ dync@ do + i 1+ tmphand @ dync@ + dup asc \ = if drop FF then + tmpFdesc i + c! +loop +curhand @ fsabsloc + tmpFdesc curhand @ 20 fssave + curhand @ fsclose ; +rh tmppnt rh tmphand rh curhand rh tmpsect + +: fseof ( handle -- bytesLeft ) +dup fsDfilesize@ swap fsDcurloc@ - ; + +create tmppath FF alloc +var tmppnt var tmphand var tmploc +: fsgetdesc ( dynhand -- DescPnt) +tmppath off +0 over dync@ if + 1 over dync@ asc \ = if dup tmppath Dstr2str then +then +tmppath c@ 0 = if + fspath tmppath Dstr2str + dup tmppath Dstr+str +then +drop +fsroot tmppnt ! +until + tmppath c@ if + tmppath c@ push + 1 i 2 + for + i 1- tmppath c! + tmppath i + c@ asc \ = if forexit then + loop + \ tmppath write cr + tmppath c@ if + tmppnt @ fsopen tmphand ! + until + tmphand @ fseof 20 >= if + tmphand @ fsabsloc tmploc ! + tmphand @ [ tmpFdesc 1+ ] 20 fsload + 15 do + i tmpFdesc c! + tmpFdesc i + c@ FF - + if doexit then + loop + tmpFdesc tmppath str=str? if + tmploc @ tmppnt ! + done + then + else + -1 tmppnt ! + done + then + loop + tmphand @ fsclose + else + fsroot tmppnt ! + then + tmppath c@ dup push [ tmppath 1+ ] + tmppath i2 cmove + pop pop swap - 1- + dup -1 = if drop 0 then tmppath c! + else + done + then + tmppnt @ -1 = if done then +loop +tmppnt @ ; rh tmppath rh tmppnt rh tmphand rh tmploc + +1 vari tmpdepth var tmploc +: fspntls ( recursive? descpnt -- ) +fsopen +until \ handle + dup fseof 20 >= if + dup fsabsloc tmploc ! + dup tmpFdesc 20 fsload + tmpFdesc @ fsextfree - if + [ tmpFdesc 18 + ] @ . + tmpdepth @ do tab. loop + tmpFdesc 14 type cr + then + over if + tmpFdesc @ fsextlist = if + tmpdepth @ 1+ tmpdepth ! + -1 tmploc @ fspntls + tmpdepth @ 1- tmpdepth ! + then + then + else + done + then +loop +fsclose drop ; rh tmpFdesc rh tmpdepth rh tmploc + +: tmpls ." PATH: " fspath dup Dstr. cr fsgetdesc fspntls ; +: fslsr -1 tmpls ; +: fsls 0 tmpls ; +rh tmpls + +: fscl ( dynhand -- ) +push +i Dstrlen if + 1 i dync@ asc \ = if + i fspath Dstr2Dstr + else + i fspath Dstr+Dstr + then +then pop drop ; + +var tmpstr1 var tmpstr2 var tmpstrpath var tmppnt +: fscreate ( dynhand -- descpnt ) +tmpstr1 Dv tmpstr2 Dv tmpstrpath Dv +fspath tmpstrpath @ Dstr2Dstr +tmpstr1 @ Dstr2Dstr +until + tmpstr1 @ Dstrlen if + asc \ tmpstr1 @ tmpstr2 @ Dstrsp + asc \ tmpstr2 @ c+Dstr +\ tmpstr2 @ Dstr. cr + tmpstr2 @ fsgetdesc + dup -1 = if + drop + tmpstr2 @ fspath fsgetdesc fspntcreate + then + tmppnt ! + tmpstr2 @ fscl + else + done + then +loop +tmppnt @ +tmpstrpath @ fspath Dstr2Dstr +tmpstr1 Df tmpstr2 Df tmpstrpath Df ; +rh tmpstr1 rh tmpstr2 rh tmpstrpath rh tmppnt + +: fstrunc ( Fhandle -- ) +-1 over fsDupdated! +dup fsDcurloc@ over fsDfilesize! +fsDcursect@ \ sect +dup fat@ dup 0 >= if + fsfreenext +else + drop +then +-2 swap fat! ; + +: fsDsave ( Dynhand Dstr -- ) +fscreate fsopen \ datahand filehand +dup fstrunc +dup rot \ filehand filehand datahand +dup dynp rot \ filehand datahand from filehand +rot dyns fssave \ fh +fsclose ; + +: fsDload ( Dstr Dynhand -- ) +push fsgetdesc fsopen \ Fhand R: Dhand +dup fsDfilesize@ dup i dynresize \ Fhand Fsize R: Dhand +over pop dynp rot fsload \ Fhand +fsclose ; + +: fsDloadnew ( Dstr -- Dynhand ) +1 dynal swap over fsDload ; + +1E8480 const tmpfrom +var tmplen var tmpdyn var tmpstr +: fsimport +tmpfrom tmplen 4 diskload +tmplen @ if + ." file length: " tmplen @ dup . + dynal tmpdyn ! + tmpstr Dv + F0 tmpstr @ Dstrsure + [ tmpfrom 4 + ] tmpstr @ dynp F0 over c! 1+ F0 diskload + FE tmpstr @ Dstrlscan 1- tmpstr @ Dstrleft + ." file: " tmpstr @ Dstr. + ." importing ..." + [ tmpfrom 64 + ] tmpdyn @ dynp tmplen @ diskload + tmpdyn @ tmpstr @ fsDsave + ." done" cr + tmpdyn Df tmpstr Df + tmplen off + tmplen tmpfrom 4 disksave +then ; +rh tmplen rh tmpfrom rh tmpdyn rh tmpstr + +: fsdel ( Dstr -- ) fsgetdesc dup -1 - if fspntdel else drop then ; + +: fscopy ( Dstr1 Dstr2 -- ) swap fsDloadnew dup rot fsDsave dynde ; + +: fsmove ( Dstr1 Dstr2 -- ) over swap fscopy fsdel ; + +: fsgettop ( Dstr1 Dstr2 -- ) +2dup Dstr2Dstr nip \ Dstr2 +asc \ over Dstrrscan \ Dstr2 CharLoc +swap Dstrcutl ; + +create incfiles 80 alloc \ File inclusion support +-1 vari inccur + +: dyninc ( dynhandle -- ) +inccur @ 1+ dup inccur ! \ hand cur +8 * incfiles + dup 4 + 0 swap ! ! ; + +: include ( StrHand -- ) +fsDloadnew dyninc ; + +defer cmdline + +: (fkey +inccur @ 8 * incfiles + dup @ ( adr handle ) +dup dyns rot ( handle size adr ) +4 + @ > if ( handle ) + inccur @ 8 * incfiles + 4 + dup @ ( handle adr+4 pointer ) + dup 1+ rot ! ( handle pointer ) + swap dynp + c@ +else + dynde + inccur @ 1 - dup inccur ! + 0 < if cmdline then FF +then ; + +var tmpstr +: modulechk ( Dstr -- ) +tmpstr Dv +dup tmpstr @ fsgettop +asc # tmpstr @ c+lDstr +tmpstr @ pad Dstr2str \ Dstr +find if + drop +else + tmpstr @ pad Dstr2str + here 0 ne + include +then +tmpstr Df ; rh tmpstr + +.( test test test ... ) + +\ format +\ fsimport cr + +D" listF\5TH_AUTORUN" include +' (fkey ' fkey is diff --git a/imageFile/f/5th_demo b/imageFile/f/5th_demo new file mode 100755 index 0000000..f2c2bbf --- /dev/null +++ b/imageFile/f/5th_demo @@ -0,0 +1,23 @@ +.( testgraph - simple graphic test) +: testgraph +10 40 10 40 screen FF 0 0 calccol boxf +50 80 50 80 screen 0 FF 0 calccol boxf +90 C0 10 40 screen 0 0 FF calccol boxf ; + +.( testmouse - simple mouse test) +var tmp1 var tmp2 var tmpc +: testmouse +50 tmp1 ! +50 tmp2 ! +until + kb@ if done then + mouse@ + dup 0 = if [ FF FF FF calccol ] tmpc ! then + dup 1 = if [ 00 FF FF calccol ] tmpc ! then + dup 2 = if [ FF 00 FF calccol ] tmpc ! then + 3 = if [ FF FF 00 calccol ] tmpc ! then + tmp2 @ + tmp2 ! tmp1 @ + tmp1 ! + 10 tmp1 @ 26F bound tmp1 ! + 10 tmp2 @ 1CF bound tmp2 ! + tmp1 @ dup 5 + tmp2 @ dup 5 + screen tmpc @ boxf update +loop ; rh tmp1 rh tmp2 rh tmpc diff --git a/imageFile/f/5th_eg b/imageFile/f/5th_eg new file mode 100755 index 0000000..9c73dc0 --- /dev/null +++ b/imageFile/f/5th_eg @@ -0,0 +1,167 @@ +.( loading graphic editor ) update + +D> \listF\listLIB\5TH_GFX2 modulechk +D> \listF\listLIB\5TH_DRVMOUSE modulechk + +.( gedit - load existing image ) +.( geditnew - start new image ) +.( EGh - graphic editor help ) + +var ghandle +var sizex var sizey +var zoomx var zoomy +var zoomup +var zoom +var selcol +var gbrush +1 vari geditcycdir +5 vari geditcyccur + +Dstral const EGfile +str F1 - help" msghelp +str pick the color" msgpick +str draw pixels" msgpix +str fill with color" msgfill +Dstr \listF\TXT_EG" tmphlpfile + + +: EGh tmphlpfile fs. ; + +: gclose ghandle @ dup if dynde +ghandle off else drop then ; + +: geditmsg ( addr -- ) +ghandle @ emitscreen ! +1A 3B at! 14 do space loop +1A 3B at! write +screen emitscreen ! ; + +: zoomupdate +zoom @ if + 14 do + 14 do + i 4 * 226 + dup 4 + i2 4 * 1+ dup 4 + ghandle @ + i zoomx @ + i2 zoomy @ + screen point c@ boxf + loop + loop +then ; + +: selcoldisp 226 27F 55 64 ghandle @ selcol @ boxf ; + +var tmp1 +: grinit +ghandle @ 0 = if 280 1E0 imgalloc ghandle ! then +ghandle @ cls +tmp1 off ( display palette ) +24 do + 6 do + i2 5 * dup 5 + i 5 * 1C2 + dup 5 + ghandle @ + tmp1 @ boxf + tmp1 @ 1+ tmp1 ! + loop +loop +[ FF FF FF calccol ] sizex @ 1+ 0 sizey @ 1+ 0 ghandle @ box +[ FF FF FF calccol ] 276 225 51 0 ghandle @ box +[ FF FF FF calccol ] selcol ! selcoldisp +B4 C8 1C2 1DF ghandle @ FF boxf +msghelp geditmsg ; rh tmp1 + +: geditpict ( x y -- ) +push push +1 i sizex @ bound? if +1 i2 sizey @ bound? if + gbrush @ + dup 2 = if selcol @ i i2 ghandle @ pset zoomup on then + 3 = if sizex @ sizey @ imgalloc + ghandle @ dynp over dynp -1 -1 vidput + dup push + selcol @ i2 1- i3 1- pop imgfill + dup dynp ghandle @ dynp 1 1 vidput + dynde + zoomup on then +then then +pop pop 2drop ; + +: gsavepict +sizex @ sizey @ imgalloc ( imgbuf ) +ghandle @ dynp over dynp -1 -1 vidput +dup EGfile fsDsave +dynde ; + +: ged +ghandle @ if +until + ghandle @ dynp screen dynp 4B008 cmove + zoomup @ if zoomupdate zoomup off then + + KBD_F@ dup 1+ if + dup 400 = if done then ( ESC ) + dup 401 = if tmphlpfile fsdisp then ( F1 ) + dup 402 = if gsavepict then ( F2 ) + dup 405 = if msgpick geditmsg 1 gbrush ! then ( F5 ) + dup 406 = if msgpix geditmsg 2 gbrush ! then ( F6 ) + 407 = if msgfill geditmsg 3 gbrush ! then ( F7 ) + else drop then + + mousekeyr @ if + 0 mousex @ A - sizex @ 12 - bound zoomx ! + 0 mousey @ A - sizey @ 12 - bound zoomy ! + zoom on + ghandle @ emitscreen ! + 45 1D at! + zoomx @ . space + zoomy @ . space space space space + screen emitscreen ! + zoomupdate + then + + mousekeyl @ if + gbrush @ 1 = if + mousex @ mousey @ ghandle @ point + c@ selcol ! selcoldisp + else + 225 mousex @ 276 bound? if + 0 mousey @ 51 bound? if + mousex @ 225 - 4 / zoomx @ + + mousey @ 1- 4 / zoomy @ + geditpict + then then + mousex @ mousey @ geditpict + then + then + + mousedo + update + + geditcyccur @ geditcycdir @ + dup geditcyccur ! + dup dup dup FF setpal + 1 swap 3E bound? 0 = if geditcycdir @ neg geditcycdir ! then +loop +screen cls +else +." no picture loaded" then ; + +: gedit ( file -- ) +dup EGfile str2Dstr ! fsDloadnew ( imgbuf ) +dup imgsize sizey ! sizex ! grinit +dup dynp ghandle @ dynp 1 1 vidput +dynde ged ; + +: geditnew ( xsize ysize -- ) +sizey ! sizex ! +grinit ged ; + + +rh tmphlpfile +rh ghandle +rh sizex rh sizey +rh zoomx rh zoomy +rh zoomup rh zoom +rh gclose rh geditmsg +rh zoomupdate rh selcoldisp +rh grinit rh geditpict +rh gsavepict rh ged +rh selcol +rh msghelp rh msgpix rh msgpick rh msgfill +rh gbrush +rh geditcycdir rh geditcyccur +rh EGfile diff --git a/imageFile/f/5th_et b/imageFile/f/5th_et new file mode 100755 index 0000000..7fde517 --- /dev/null +++ b/imageFile/f/5th_et @@ -0,0 +1,269 @@ +.( loading editor ) update +.( done ) +.( ETh - for text editor help ) + +var handletxt +var handlebuf +Dstralloc const editfile +var shiftx var shifty +var curlocx var curlocy +Dstr \listF\TXT_ET" tmphelpfile + +: disppage ( -- ) +handletxt @ +dynp shifty @ 50 * + +0 1 at! +1270 type ; + +: fclose ( close opened file ) +handletxt @ dup if dynde handletxt off else drop then ; + +: ETnewpage fclose 27100 dynal dup handletxt ! dynp +FF swap 27100 cfill ; + +var tmp1 +: fopen ( strhand -- ) +fclose +dup editfile Dstr2Dstr fsDloadnew dup push dynp ( addrinp R: handinp ) +27100 dynal dup handletxt ! dynp ( addrinp addrout R: handinp ) +FF over 27100 cfill +tmp1 off +i dyns do ( addrinp addrout ) +over c@ ( addrinp addrout c ) +dup FE = if + drop + 50 tmp1 @ - + tmp1 off +else + dup FD = if + drop tmp1 @ tab ( addrinp addrout numspaces ) + tmp1 @ over + tmp1 ! + 0 + else + over c! 1+ 0 + tmp1 @ 1+ tmp1 ! + then + drop +then +swap 1+ swap +loop 2drop +pop dynde ; rh tmp1 + +: dispchar ( x y -- ) +2dup +swap shiftx @ - +swap shifty @ - 1+ +at! +50 * + handletxt @ dynp + c@ emit ; + +: dispcur curlocx @ curlocy @ dispchar ; + +: displine ( line ) +0 over shifty @ - 1+ at! +50 * handletxt @ dynp + shiftx @ + 50 type ; + +: dispstatbar +colneg +0 0 at! 50 do space loop +0 0 at! ." col:" curlocx @ . +7 0 at! ." line:" curlocy @ . +11 0 at! ." ascii:" curlocy @ 50 * curlocx @ + handletxt @ dynp + c@ . +1B 0 at! ." file:" editfile Dstr. +49 0 at! ." F1-help" +colnorm ; + +: charins ( char x y ) +50 * handletxt @ dynp + ( char x addr ) +over push ++ dup dup 1+ 4F pop - cmove ( char addr ) +c! ; + +: charcut ( x y -- char ) +over push +50 * handletxt @ dynp + + +dup c@ swap ( char addr ) +dup dup 1+ swap ( char addr addr+1 addr ) +4F pop - dup push cmove ( char addr ) +pop + FF swap c! ; + +: lineins ( line ) +50 * dup push handletxt @ dynp + ( addr ) +dup dup 50 + handletxt @ dyns 50 - pop - cmove ( addr ) +FF swap 50 cfill ; + +: linecut ( line ) +50 * dup push handletxt @ dynp + ( addr ) +dup 50 + swap handletxt @ dyns 50 - pop - cmove ; + +: screenaim +0 curlocy @ 1E - 794 bound shifty ! +disppage ; + +var tmp1 +: length ( line -- length ) +50 * 4F + handletxt @ dynp + ( addr ) +51 do + i tmp1 ! + dup c@ FF - if pop drop 0 push then + 1- +loop +drop +tmp1 @ ; rh tmp1 + +var tmp2 var tmp3 +: fsavechar ( char ) tmp2 @ swap over c! 1+ tmp2 ! ; +: fsave ( -- ) +27200 dynal dup dynp tmp2 ! +0 +7CF do + i length if drop pop 1+ 0 push then +loop +0 swap for ( desthand ) + tmp3 off + i 50 * handletxt @ dynp + + 0 i length for ( desthand srcaddr ) + dup c@ + i tab 8 = if tmp3 @ if FD fsavechar tmp3 off then then + dup FF = if + drop tmp3 @ 1+ tmp3 ! + else + tmp3 @ do FF fsavechar loop tmp3 off + fsavechar + then + 1+ + loop drop + FE fsavechar +loop +tmp2 @ over dynp - over dynresize +dup editfile fsDsave +dynde ; rh tmp2 rh tmp3 + +str TXT_default" tmpdefault + +: ET +handletxt @ if +disppage +until + colneg dispcur dispstatbar KBD_FW@ colnorm dispcur + + dup 415 = if ( DEL ) + curlocx @ curlocy @ charcut drop + curlocy @ displine + then + + dup FC = if ( BACKSPACE ) + curlocx @ if + curlocx @ 1- curlocy @ charcut drop + curlocy @ displine + drop 413 + else + curlocy @ if + curlocy @ 1- dup length dup curlocx ! ( y-1 strlen ) + swap 50 * handletxt @ dynp + ( strlen y1addr ) + 2dup + swap 50 + ( strlen dest src ) + swap rot 50 swap - cmove + curlocy @ linecut + drop 410 + disppage + then + then + then + + dup FD = if ( TAB ) + curlocx @ tab + dup do FF curlocx @ curlocy @ charins loop + curlocx @ + curlocx ! + curlocy @ displine + then + + dup FE = if ( ENTER ) + curlocy @ 7CF < if + curlocy @ 1+ lineins + curlocx @ 0 + 50 curlocx @ - do + over curlocy @ charcut + over curlocy @ 1+ charins + 1+ + loop 2drop + curlocx off + drop 412 + disppage + then + then + + dup 418 = if curlocy @ 3A - curlocy ! then ( PG-UP ) + dup 419 = if curlocy @ 3A + curlocy ! then ( PG-DOWN ) + dup 416 = if curlocx off then ( HOME ) + dup 417 = if curlocy @ length curlocx ! then ( END ) + dup 401 = if tmphelpfile fsdisp disppage then ( F1 ) + dup 402 = if fsave then ( F2 ) + dup 403 = if fclose drop 1B then ( F3 ) + dup 400 = if done 0 0 at! screen cls drop -1 then ( ESC ) + + 0 over F0 bound? if -1 else 0 then ( NORMAL KEY ) + over FF = if drop -1 then + if + curlocx @ curlocy @ charins + curlocy @ displine + 411 + then + + dup 411 = if curlocx @ 1+ curlocx ! then ( RIGHT ) + dup 413 = if curlocx @ 1- curlocx ! then ( LEFT ) + dup 412 = if curlocy @ 1+ curlocy ! then ( DOWN ) + dup 410 = if curlocy @ 1- curlocy ! then ( UP ) + drop + + 0 curlocx @ 4F bound curlocx ! + 0 curlocy @ 7CF bound curlocy ! + + curlocy @ shifty @ - 3B > if screenaim then + + curlocy @ shifty @ - 3B - 0 = if + 0 0 8 screen scrollf + shifty @ 1+ shifty ! + curlocy @ displine + then + + curlocy @ shifty @ - -1 < if screenaim then + + curlocy @ shifty @ - 1+ 0 = if + 0 0 -8 screen scrollf + shifty @ 1- shifty ! + curlocy @ displine + then + +loop +else + tmpdefault editfile str2Dstr + ETnewpage + ET +then ; + +: ETl +fopen +curlocx off +curlocy off +shiftx off +shifty off +ET ; + +: ETs +editfile Dstr2Dstr +fsave ." saved " ; + +: ETh tmphelpfile fs. ; + +rh handletxt +rh handlebuf +rh editfile +rh shiftx rh shifty +rh curlocx rh curlocy +rh tmphelpfile +rh disppage +rh fclose rh fopen +rh dispchar rh dispcur +rh displine rh dispstatbar +rh charins rh charcut +rh lineins rh linecut +rh screenaim rh length +rh fsavechar rh fsave +rh ETnewpage rh tmpdefault diff --git a/imageFile/f/5th_logo b/imageFile/f/5th_logo new file mode 100755 index 0000000..7d375e1 --- /dev/null +++ b/imageFile/f/5th_logo @@ -0,0 +1,46 @@ +: tmpbox ( x y -- ) +10 * swap 10 * \ y x +dup 9 + rot dup 9 + \ x1 x2 y1 y2 +screen FF FF FF calccol boxf ; + +: tmplineh ( x y -- ) +swap 1+ swap 2dup tmpbox +swap 1+ swap tmpbox ; + +: tmplinev ( x y -- ) +1+ 2dup tmpbox +1+ tmpbox ; + +: tmpI ( x y -- ) +2dup tmplinev +3 + 2dup tmplinev +tmpbox ; + +: tmpT ( x y -- ) +2dup tmpI +tmplineh ; + +: tmpF ( x y -- ) +2dup tmpT +3 + tmplineh ; + +: tmpH ( x y -- ) +2dup tmpI +2dup 3 + tmplineh +swap 3 + swap tmpI ; + +: tmpxp +swap 5 + swap ; + +: tmplogo ( x y -- ) +2dup tmpF tmpxp +2dup tmpI tmpxp +2dup tmpF tmpxp +2dup tmpT tmpxp +tmpH ; + +7 3 tmplogo +0 18 at! +.( Fifth, Copyright 2003 Svjatoslav Agejenko. All rights reserved.) +forget tmpbox +update diff --git a/imageFile/f/FNT_SYSTEM b/imageFile/f/FNT_SYSTEM new file mode 100755 index 0000000000000000000000000000000000000000..980f716caf02d52de1a8efb37f02d3147d953c2d GIT binary patch literal 2048 zcma)7KWigL6n{9NYLQ(INZ61nRT%Dqyd;bKDFP`6-!U9yLR5)`ENjOc;fj2K`wXd5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;+^ zhP?k=)SS3}K*8V6Ji;e!}J=KucyAVxj8 literal 0 HcmV?d00001 diff --git a/imageFile/f/lib/5TH_DRVKBD b/imageFile/f/lib/5TH_DRVKBD new file mode 100755 index 0000000..15690b4 --- /dev/null +++ b/imageFile/f/lib/5TH_DRVKBD @@ -0,0 +1,92 @@ +: KBD_test +until + kbd@ + dup 1 = if done then + dup if + . tab. update + else + drop + then +loop ; + + +create KBD_downbuf 80 alloc + +: KBD_@ +until + kbd@ + dup if + dup 80 >= if + [ KBD_downbuf 80 - ] + 0 swap c! + else + dup KBD_downbuf + 1 swap c! done + then + else + done + then +loop ; + +: KBD_down? ( KeyScanCode -- result ) +KBD_downbuf + c@ ; + +rh KBD_downbuf + +str \listF\listLIB\5TH_KBD_USDVORAK" tmp1 +str \listF\listLIB\5TH_KBD_US" tmp2 + +.( Select keyboard layout, by pressing appropriate number. ) +.( 1 - US dvorak ) +.( 2 - US ) + +: tmpselect +until + KBD_@ + dup 2 = if tmp1 swap done then + dup 3 = if tmp2 swap done then + drop +loop ; + +update +tmpselect +.( selected ) +update + +defDstr str2Dstr +forget tmp1 +defDstr include + +: KBD_test2 +until + KBD_@ + dup 1 = if done then + dup if + . tab. update + else + drop + then +loop ; + +: KBD_SC2FSCII ( ScanCode -- FSCII ) +KBD_table swap until \ addr code + over @ dup if + over = if + drop 4 + @ done + else + swap 8 + swap + then + else + 2drop drop -1 done + then +loop ; + +: KBD_F@ +KBD_@ +2A KBD_down? if 100 + then +38 KBD_down? if 200 + then +KBD_SC2FSCII ; + +: KBD_FW@ update +until + KBD_F@ + dup -1 = if drop else done then +loop ; diff --git a/imageFile/f/lib/5TH_DRVMOUSE b/imageFile/f/lib/5TH_DRVMOUSE new file mode 100755 index 0000000..0f50d09 --- /dev/null +++ b/imageFile/f/lib/5TH_DRVMOUSE @@ -0,0 +1,53 @@ +var mousex +var mousey +var mousekeyl +var mousekeyr +var mousekeym +var mousec ( display coordinates flag ) +create mousebuf 100 alloc +var mousebe ( amount of buffer elements ) +var mousepointer +D> \listF\I01_MCARROW fsDloadnew mousepointer ! + +: mouseadd ( addr x1 x2 y1 y2 -- ) +mousebe @ dup 1+ mousebe ! +14 * mousebuf + ( ... addr ) +swap over ! +4 + swap over ! +4 + swap over ! +4 + swap over ! +4 + ! ; + +: mousedo ( -- ) +mouse@ +dup 0 bit@ if mousekeyl on else mousekeyl off then +dup 1 bit@ if mousekeyr on else mousekeyr off then + 2 bit@ if mousekeym on else mousekeym off then + +mousey @ + 0 swap 1DF bound mousey ! +mousex @ + 0 swap 27F bound mousex ! + +mousepointer @ dynp +screen dynp mousex @ mousey @ tvidput + +mousekeyl @ mousekeyr @ + mousekeym @ + if +mousebe @ do + i 14 * mousebuf + + dup @ swap 4 + @ mousey @ rot bound? if + i 14 * mousebuf + 8 + + dup @ swap 4 + @ mousex @ rot bound? if + i 14 * mousebuf + 10 + @ goto pop drop 0 push + then + then +loop +then + +mousec @ if + emitscreen @ + screen emitscreen ! + at@ + 0 0 at! + mousex @ . tab. mousey @ . + at! + emitscreen ! +then ; diff --git a/imageFile/f/lib/5TH_KBD_US b/imageFile/f/lib/5TH_KBD_US new file mode 100755 index 0000000..9e90ef5 --- /dev/null +++ b/imageFile/f/lib/5TH_KBD_US @@ -0,0 +1,97 @@ +create KBD_table + +2 , asc 1 , 102 , asc ! , +3 , asc 2 , 103 , asc @ , +4 , asc 3 , 104 , asc # , +5 , asc 4 , 105 , asc $ , +6 , asc 5 , 106 , asc % , +7 , asc 6 , 107 , asc ^ , +8 , asc 7 , 108 , asc & , +9 , asc 8 , 109 , asc * , +A , asc 9 , 10A , asc ( , +B , asc 0 , 10B , asc ) , +C , asc - , 10C , asc _ , +D , asc = , 10D , asc + , +E , FC , \ backspace +F , FD , \ tab +10 , asc q , 110 , asc Q , +11 , asc w , 111 , asc W , +12 , asc e , 112 , asc E , +13 , asc r , 113 , asc R , +14 , asc t , 114 , asc T , +15 , asc y , 115 , asc Y , +16 , asc u , 116 , asc U , +17 , asc i , 117 , asc I , +18 , asc o , 118 , asc O , +19 , asc p , 119 , asc P , +1A , asc [ , 11A , asc { , +1B , asc ] , 11B , asc } , +1C , FE , \ enter +1E , asc a , 11E , asc A , +1F , asc s , 11F , asc S , +20 , asc d , 120 , asc D , +21 , asc f , 121 , asc F , +22 , asc g , 122 , asc G , +23 , asc h , 123 , asc H , +24 , asc j , 124 , asc J , +25 , asc k , 125 , asc K , +26 , asc l , 126 , asc L , +27 , asc ; , 127 , asc : , +28 , asc , , 128 , asc " , +29 , asc ' , 129 , asc ~ , + +2B , asc \ , 12B , asc | , +2C , asc z , 12C , asc Z , +2D , asc x , 12D , asc X , +2E , asc c , 12E , asc C , +2F , asc v , 12F , asc V , +30 , asc b , 130 , asc B , +31 , asc n , 131 , asc N , +32 , asc m , 132 , asc M , +33 , asc , , 133 , asc < , +34 , asc . , 134 , asc > , +35 , asc / , 135 , asc ? , + +39 , FF , \ space +48 , 410 , 148 , 410 , \ up +4D , 411 , 14D , 411 , \ right +50 , 412 , 150 , 412 , \ down +4B , 413 , 14B , 413 , \ left + +1 , 400 , \ ESC +3B , 401 , \ F1 ... +3C , 402 , +3D , 403 , +3E , 404 , +3F , 405 , +40 , 406 , +41 , 407 , +42 , 408 , +43 , 409 , +44 , 40A , \ F10 + +152 , 414 , \ INS +153 , 415 , \ DEL +147 , 416 , \ HOME +14F , 417 , \ END +149 , 418 , \ PG/UP +151 , 419 , \ PG/DN + +202 , 1 , +203 , 2 , +204 , 3 , +205 , 4 , +206 , 5 , +207 , 6 , +208 , 7 , +209 , 8 , +20A , 9 , +20B , 0 , +21E , A , +231 , B , +217 , C , +223 , D , +220 , E , +215 , F , + +0 , diff --git a/imageFile/f/lib/5TH_KBD_USDVORAK b/imageFile/f/lib/5TH_KBD_USDVORAK new file mode 100755 index 0000000..b2e2301 --- /dev/null +++ b/imageFile/f/lib/5TH_KBD_USDVORAK @@ -0,0 +1,97 @@ +create KBD_table + +2 , asc 1 , 102 , asc ! , +3 , asc 2 , 103 , asc @ , +4 , asc 3 , 104 , asc # , +5 , asc 4 , 105 , asc $ , +6 , asc 5 , 106 , asc % , +7 , asc 6 , 107 , asc ^ , +8 , asc 7 , 108 , asc & , +9 , asc 8 , 109 , asc * , +A , asc 9 , 10A , asc ( , +B , asc 0 , 10B , asc ) , +C , asc [ , 10C , asc { , +D , asc ] , 10D , asc } , +E , FC , \ backspace +F , FD , \ tab +10 , asc ' , 110 , asc " , +11 , asc , , 111 , asc < , +12 , asc . , 112 , asc > , +13 , asc p , 113 , asc P , +14 , asc y , 114 , asc Y , +15 , asc f , 115 , asc F , +16 , asc g , 116 , asc G , +17 , asc c , 117 , asc C , +18 , asc r , 118 , asc R , +19 , asc l , 119 , asc L , +1A , asc / , 11A , asc ? , +1B , asc = , 11B , asc + , +1C , FE , \ enter +1E , asc a , 11E , asc A , +1F , asc o , 11F , asc O , +20 , asc e , 120 , asc E , +21 , asc u , 121 , asc U , +22 , asc i , 122 , asc I , +23 , asc d , 123 , asc D , +24 , asc h , 124 , asc H , +25 , asc t , 125 , asc T , +26 , asc n , 126 , asc N , +27 , asc s , 127 , asc S , +28 , asc - , 128 , asc _ , +29 , asc ' , 129 , asc ~ , + +2B , asc \ , 12B , asc | , +2C , asc ; , 12C , asc : , +2D , asc q , 12D , asc Q , +2E , asc j , 12E , asc J , +2F , asc k , 12F , asc K , +30 , asc x , 130 , asc X , +31 , asc b , 131 , asc B , +32 , asc m , 132 , asc M , +33 , asc w , 133 , asc W , +34 , asc v , 134 , asc V , +35 , asc z , 135 , asc Z , + +39 , FF , \ space +48 , 410 , 148 , 410 , \ up +4D , 411 , 14D , 411 , \ right +50 , 412 , 150 , 412 , \ down +4B , 413 , 14B , 413 , \ left + +1 , 400 , \ ESC +3B , 401 , \ F1 ... +3C , 402 , +3D , 403 , +3E , 404 , +3F , 405 , +40 , 406 , +41 , 407 , +42 , 408 , +43 , 409 , +44 , 40A , \ F10 + +152 , 414 , \ INS +153 , 415 , \ DEL +147 , 416 , \ HOME +14F , 417 , \ END +149 , 418 , \ PG/UP +151 , 419 , \ PG/DN + +202 , 1 , +203 , 2 , +204 , 3 , +205 , 4 , +206 , 5 , +207 , 6 , +208 , 7 , +209 , 8 , +20A , 9 , +20B , 0 , +21E , A , +231 , B , +217 , C , +223 , D , +220 , E , +215 , F , + +0 , diff --git a/imageFile/f/lib/5TH_UICMD b/imageFile/f/lib/5TH_UICMD new file mode 100755 index 0000000..5e8d371 --- /dev/null +++ b/imageFile/f/lib/5TH_UICMD @@ -0,0 +1,77 @@ +: words +cr lp @ +max do +118 do + dup 0 = if pop pop 2drop drop ret then + colnorm + dup 13 + c@ + dup 2 = if colhigh then + 0 = if colneg then + dup 4 + write colnorm + curx @ 10 mod 10 swap - do space loop + @ +loop +cr 50 do asc = emit loop KBD_FW@ drop +loop ; + +: statinc +inccur @ dup ." depth: " d. cr +." " cr +incfiles swap 1+ do + dup @ dup d. space dyns d. space 4 + dup @ d. 4 + cr +loop drop ; + +: (cmdline +\ colhigh +200 dynal +0 +cr +until + KBD_FW@ ( handle addr key ) + push + 0 swap 200 bound + over dynp over + i swap c! ( handle addr ) + 1+ + i FC = if 2 - FC emit space then + pop dup FE - if ( handle addr ) + emit + else + drop space + over dynresize ( handle ) + dyninc + done + then +loop \ colnorm +; + +' (cmdline ' cmdline is + +: ascii +until KBD_FW@ dup 1B = if done then +dup emit space d. space loop ; + +: fs. ( fname -- ) fsDloadnew dup dyn. dynde ; + +: fsdisp ( fname -- ) +screen cls 0 0 at! fs. cr +." press any key to continue ..." +KBD_FW@ drop ; + +create tmpbuf 100 alloc +: s. +depth 2 - push +." depth: " i . cr +1 i 400 bound? if + i do + i 4 * tmpbuf + ! + loop + 0 i for + i 4 * tmpbuf + @ dup . tab. + loop +then pop drop ; rh tmpbuf + +: bye 2dup push push \ R: n1 n2 +i2 3 = if + i FE = if halt then +then +." unbalanced stack: " swap . space . KBD_FW@ halt ; diff --git a/imageFile/f/lib/5th_gfx b/imageFile/f/lib/5th_gfx new file mode 100755 index 0000000..8ac8133 --- /dev/null +++ b/imageFile/f/lib/5th_gfx @@ -0,0 +1,149 @@ +: tab ( col -- spaces) 8 mod 8 swap - dup 0 = if drop 8 then ; + +: calccol ( b g r -- c ) +2B / 24 * swap 2B / 6 * + swap 2B / + ; + +: imgalloc ( x y -- handle ) +2dup * 8 + dynal ( x y handle ) +dup push dynp ( x y addr ) +rot over ! 4 + ! pop ; + +280 1E0 imgalloc const screen + +: imgsize ( screen -- x y ) +dynp dup @ swap 4 + @ ; + +: copyscreen ( srcDhand destDhand -- ) +swap dynp swap dup dynp swap dyns cmove ; + +: update ( -- ) screen dynp 8 + vidmap ; + +: point ( x y screen -- addr ) +dynp dup @ ( x y addr xs ) +rot * ( x addr y*xs) ++ + 8 + ; + +: pset ( c x y screen -- ) point c! ; + +var tmp1 var tmp2 +: boxf ( x1 x2 y1 y2 screen c -- ) +tmp1 ! +tmp2 ! +for ( x1 x2 ) + 2dup swap - push + over i2 tmp2 @ point + tmp1 @ swap pop cfill +loop 2drop ; +rh tmp1 rh tmp2 + +: cls ( screen -- ) +dynp dup @ swap 4 + dup @ ( x addr y ) +rot * swap 4 + ( len addr ) +0 rot rot swap ( c addr len) +cfill ; + +: setpal ( b g r color -- ) 3C8 cprt! 3C9 cprt! 3C9 cprt! 3C9 cprt! ; + +: setupal +D7 +6 do + 6 do + 6 do + dup i C * swap i2 C * swap i3 C * swap setpal + 1 - + loop + loop +loop +drop ; + +setupal + +D" \listF\FNT_SYSTEM" fsDloadnew const font + +: scroll ( x y screen -- ) +dynp dup @ swap 4 + dup @ swap 4 + push ( x y xsize ysize R: addr ) +over * push ( x y xsize R: addr size ) +* + i2 + pop pop swap cmove ; + +var tmp1 var tmp2 var tmp3 var tmp4 var tmp5 var tmp6 var tmp7 +: scrollf ( color x y screen -- ) +dup push tmp1 ! ( screen ) +dup push tmp2 ! ( y ) +dup tmp3 ! ( x ) +pop pop scroll +push +tmp1 @ dynp dup @ tmp4 ! ( xsize ) +4 + @ tmp5 ! ( ysize ) +tmp2 @ dup 0 - if + 0 > if + 0 dup tmp6 ! tmp4 @ tmp5 @ tmp2 @ - dup tmp7 ! + tmp5 @ tmp1 @ i boxf + + else + 0 tmp4 @ 0 tmp2 @ neg dup tmp6 ! tmp1 @ i boxf + tmp5 @ tmp7 ! + then +else + drop + 0 tmp6 ! tmp5 @ tmp7 ! +then + +tmp3 @ dup 0 - if + 0 > if + tmp4 @ dup tmp3 @ - swap tmp6 @ tmp7 @ tmp1 @ i boxf + else + 0 tmp3 @ neg tmp6 @ tmp7 @ tmp1 @ i boxf + then +else + drop +then +pop drop ; +rh tmp1 rh tmp2 rh tmp3 rh tmp4 rh tmp5 rh tmp6 rh tmp7 + +var curx +var cury +var curc +var curb +var emitscreen + +screen emitscreen ! + +: at! ( x y -- ) cury ! curx ! ; +: at@ ( -- x y ) curx @ cury @ ; +: curc! calccol curc ! ; +: curb! calccol curb ! ; + +: colnorm FF FF FF curc! 0 0 0 curb! ; +: colneg 0 0 0 curc! FF FF FF curb! ; +: colhigh 0 FF FF curc! 0 0 0 curb! ; + +colnorm + +: (emit2 +dup FE = if drop + 0 curx ! cury @ 1+ + dup 3B > if + 0 0 8 emitscreen @ scrollf + drop 3B + then + cury ! +else + dup FC - if + dup FD - if + curx @ 4F > if FE emit then + 8 * font dynp + + curc @ swap curb @ swap emitscreen @ dynp + curx @ 8 * cury @ 8 * charput + curx @ 1+ curx ! + else + drop curx @ tab do space loop + then + else + drop curx @ 1- + dup 0 < if drop 0 then curx ! + then +then ; + +screen cls +FC emit +' (emit2 ' emit is diff --git a/imageFile/f/lib/5th_gfx2 b/imageFile/f/lib/5th_gfx2 new file mode 100755 index 0000000..27f4e4e --- /dev/null +++ b/imageFile/f/lib/5th_gfx2 @@ -0,0 +1,107 @@ +: lineh ( color len x y imgbuf -- ) +point swap cfill ; + +: linev ( color len x y imgbuf -- ) +dup imgsize drop push +point swap +do 2dup c! i2 + loop +2drop pop drop ; + +var tmp1 var tmp2 var tmp3 var tmp4 +: box ( color x2 x1 y2 y1 imgbuf -- ) + push ( buf i3 ) +dup push ( y1 i2 ) +over tmp1 ! ( y2 1 ) +- tmp2 ! ( ylen 2 ) +dup push ( x1 i ) +over tmp3 ! ( x2 3 ) +- tmp4 ! ( xlen 4 ) + +dup tmp4 @ i i2 i3 lineh +dup tmp4 @ 1+ i tmp1 @ i3 lineh +dup tmp2 @ i i2 i3 linev + tmp2 @ tmp3 @ i2 i3 linev +pop pop 2drop pop drop ; +rh tmp1 rh tmp2 rh tmp3 rh tmp4 + +var flipxs var flipys var fliplb var flipib var flipsa var flipda +: flipv ( imgbuf -- ) +dup push imgsize over dynal push ( sizex sizey R: imgbuf linebuf ) +flipys ! flipxs ! pop fliplb ! pop flipib ! +flipys @ 2 / do + 0 i flipib @ point flipsa ! + 0 flipys @ i - 1- flipib @ point flipda ! + flipda @ fliplb @ dynp flipxs @ cmove + flipsa @ flipda @ flipxs @ cmove + fliplb @ dynp flipsa @ flipxs @ cmove +loop ; +rh flipxs rh flipys rh fliplb rh flipib rh flipsa rh flipda + +: imgcoltrans ( ImgBuf Color ToColor -- ) +push push +dup dynp 8 + swap dyns 8 - do + dup c@ i2 = if i3 over c! then + 1+ +loop drop pop pop 2drop ; + +var imgfillbuf var imgfilld var imgfillc +: imgfill ( color x y imgbuf -- ) +dup imgfillbuf ! point dup c@ imgfillc ! FE swap c! ( color ) +until + imgfilld off + + imgfillbuf @ imgsize + swap 1- swap + do + imgfillbuf @ imgsize drop 1- i imgfillbuf @ point + over do + dup c@ FE = if + dup 1- c@ imgfillc @ = if + dup 1- FE swap c! + imgfilld on + then + then + 1- + loop drop + + 0 i imgfillbuf @ point + over do + dup c@ FE = if + dup 1+ c@ imgfillc @ = if + dup 1+ FE swap c! + imgfilld on + then + then + 1+ + loop drop + loop drop + + imgfillbuf @ imgsize 1- swap + do + i imgfillbuf @ dup imgsize swap push 1- swap point + over do + dup c@ FE = if + dup i2 - c@ imgfillc @ = if + dup i2 - FE swap c! + imgfilld on + then + then + i2 - + loop drop + + + i2 0 imgfillbuf @ point + over do + dup c@ FE = if + dup i2 + c@ imgfillc @ = if + dup i2 + FE swap c! + imgfilld on + then + then + i2 + + loop pop 2drop + loop drop +imgfilld @ if imgfilld off else done then +loop +imgfillbuf @ FE rot imgcoltrans ; +rh imgfillbuf rh imgfilld rh imgfillc diff --git a/imageFile/f/lib/5th_trig b/imageFile/f/lib/5th_trig new file mode 100755 index 0000000..96b01e1 --- /dev/null +++ b/imageFile/f/lib/5th_trig @@ -0,0 +1,24 @@ +create sintable 8000 alloc + +: mktable +here push +sintable h ! +100000000 0 +2000 do + + over 100000 / - + swap over + swap + over 10000 / , +loop +2drop +pop h ! ; + +mktable +forget mktable + +: cos ( num -- result) +abs 2000 mod 4 * sintable + @ ; + +: sin 500 - cos ; + +rh sintable diff --git a/imageFile/f/txt_eg b/imageFile/f/txt_eg new file mode 100755 index 0000000..4b0f485 --- /dev/null +++ b/imageFile/f/txt_eg @@ -0,0 +1,16 @@ + +Graphic editor is very unfinished, some functions do not work properly yet! + + Paint quick help: + +q - exit, don't close image +F1 - this help +F2 - save to file +F3 - close & exit +F5 - pick color +F6 - draw pixels +F7 - fill with color + +Right mouse button - select zoom region. + +flashing color is transparent diff --git a/imageFile/f/txt_et b/imageFile/f/txt_et new file mode 100755 index 0000000..866010f --- /dev/null +++ b/imageFile/f/txt_et @@ -0,0 +1,18 @@ + Text editor help: + +from editor: + +F1 - help +F2 - save to current file +F3 - close text, switch to commandline +ESC - switch to commandline + +PG/UP & PG/DOWN, cursor keys, DEL, backspace, TAB, HOME & END, works as usual. + + +commandline: + + ET - switch to text editor + ETl - load file, and switch to editor + ETs - save to file + ETh - help diff --git a/imageFile/f/txt_help b/imageFile/f/txt_help new file mode 100755 index 0000000..a38b442 --- /dev/null +++ b/imageFile/f/txt_help @@ -0,0 +1,13 @@ + basic Fifth commands: + +help - get this help +lde - load editor +fsls - show list of files +fslsr - recursive file list + fsdel - delete file + fscl - goto specified path + fscopy - copy file + fs. - type file contenc to screen +bye - exit from fifth +words - list all dictionary entries. +statdyn - list info about allocated dynamic memory blocks diff --git a/kernel/core.asm b/kernel/core.asm new file mode 100755 index 0000000..2cb74c4 --- /dev/null +++ b/kernel/core.asm @@ -0,0 +1,680 @@ +; core of Fifth + +include 'define.inc' + +link = 0 +org 0 + +lpad: xnum 1 ; load rest of core into RAM + xnum 1024 + xnum 3 + xcall lload + xnum 4 ; load highlevel Fifth boot code into RAM + xnum 1500000 + xnum 32 + xcall lload + xnum -1 ; initialize dictionary space + xnum lend + xnum 30000 + xcfill + xjmp lmain + times 15 db '*PAD*' + +lload: ;( fromdisk tomem amount -- ) +l46: xdup + xif l45 + xdec + xpush + xover + xover + xdisk@ + xnum 1024 + xplus + xswap + xinc + xswap + xpop + xjmp l46 +l45: xdrop + xdrop + xdrop + xret + +ibuf: dd 0, 0, 0, 0, 0, 0, 0, 0 +lh: dd last+24000 +llp: dd lastp + +lcount: xinc + xdup + xdec + xc@ + xret + +vloc dd 200000h +llemit: ; xemit + xnum vloc + x@ + xdup + xinc + xnum vloc + x! + xc! + xret + +lhere: xnum lh + x@ + xret + +lemit: xjmp llemit + +ltype: xdup + xif l2 + xdec + xpush + xcall lcount + xcall lemit + xpop + xjmp ltype +l2: xdrop + xdrop + xret + +lwrite: xcall lcount + xcall ltype + xret + +lsadd: xdup + xc@ + xinc + xover + xover + xswap + xc! + xplus + xc! + xret + +llfkey: xnum d1 + x@ + xcall lcount + xswap + xnum d1 + x! + xret +d1 dd 1500000 + +lfkey: xjmp llfkey + +lskey: xcall lfkey + xdup + xnum 254 + xminus + xif l47 + xdup + xnum 253 + xminus + xif l47 + xret +l47: xdrop + xnum 255 + xret + +lscan: xnum 0 + xnum lpad + xc! +l4: xcall lskey + xover + xover + xminus + xif l3 + xnum lpad + xcall lsadd + xjmp l4 +l3: xdrop + xnum lpad + xc@ + xif lscan + xdrop + xret + +lstrEQstr: xdup + xc@ + xinc +l8: xdup + xif l6 + xdec + xpush + xover + xc@ + xover + xc@ + xminus + xif l7 + xpop + xdrop + xdrop + xdrop + xnum 0 + xret +l7: xinc + xswap + xinc + xpop + xjmp l8 +l6: xdrop + xdrop + xdrop + xnum -1 + xret + +lstrEQpad: + xnum lpad + xjmp lstrEQstr + +lfind: xnum llp +l9: xdup + xnum lprev + x! + x@ + xdup + xif l11 + xdup + xinc + xinc + xinc + xinc + xcall lstrEQpad + xif l9 +l11: xret + +lprev: dd 0 +lmode: db 1 ; 0 compile + ; 1 interpret + +lgoto: xnum l44+1 + x! +l44: xjmp 0 + +lexecute: + xnum lmode + xc@ + xif l19 + xcall setint +l19: xcall lfind + xdup + xif l12 ; not found ? + xnum 19 + xplus + xdup + xc@ ; ( addr+19 c ) + xdup + xif cmpnum + xdec + xdup + xif cmpmod + xdec + xif cmpimm + xdrop + xjmp clrint +setint: xnum l14 + x@ + xif l15 + xret +l14 dd 0 +l15: xnum lh + x@ + xnum l14 + x! + xnum ibuf + xnum lh + x! + xret +clrint: xnum l14 + x@ + xif l20 + xnum 11 + xcall lcsto + xnum l14 + x@ + xnum lh + x! + xnum 0 + xnum l14 + x! + xjmp ibuf +l20: xret +cmpnum: xdrop + xnum 3 + xjmp cmpn +cmpmod: xdrop + xnum 5 + xjmp cmpn +cmpimm: xcall setint + xnum 5 + xjmp cmpn +cmpn: xcall lcsto + xinc + x@ + xcall lsto + xjmp clrint +l12: xdrop + xcall l2num + xif l23 + xnum 3 + xcall lcsto + xcall lsto + xjmp clrint +l23: xdrop + xnum lpad + xcall lwrite + xnum msg1 + xcall lwrite + xjmp clrint +msg1 db 3, ' ? ' + +l2num: xnum lpad + xcall lcount ; ( addr len ) + xnum numlen + xc! + xnum 0 +l13: xnum numlen ; ( addr num ) + xc@ + xdup + xif numend + xdec + xnum numlen + xc! + xnum 16 + xmul + xswap + xcall lcount ; ( num addr c ) + + xdup + xnum 45 + xminus + xif l22 +l28: xdup + xnum 16 + xcmpg + xif l21 + xdrop + xdrop + xnum 0 + xret +l21: xrot + xplus ; ( addr num ) + xjmp l13 +numend: xdrop + xswap + xdrop + xnum numneg + xc@ + xif l16 + xnum -1 + xmul + xnum 0 + xnum numneg + xc! +l16: xnum -1 + xret +numlen db 0 +numneg db 0 + +l22: xnum numneg + xc! + xnum 0 + xjmp l28 + +lcsto: xnum lh + x@ + xover + xover ; ( n addr n addr ) + xc! + xinc + xnum lh + x! + xdrop + xret + +lsto: xnum lh + x@ + xover + xover + x! + xnum 4 + xplus + xnum lh + x! + xdrop + xret + +lhalt: xhalt + +l@: xnum 20 + xjmp bcode + +l!: xnum 21 + xjmp bcode + +lc@: xnum 12 + xjmp bcode + +lc!: xnum 13 + xjmp bcode + +linc: xnum 6 + xjmp bcode + +ldec: xnum 7 + xjmp bcode + +lcmpg: xnum 28 + xjmp bcode + +lcmpl: xnum 29 + xjmp bcode + +lret: xnum 11 + xjmp bcode + +lplus: xnum 24 + xjmp bcode + +lminus: xnum 25 + xjmp bcode + +lmul: xnum 26 + xjmp bcode + +ldrop: xnum 9 + xjmp bcode + +ldup: xnum 8 + xjmp bcode + +lswap: xnum 23 + xjmp bcode + +ldisk@: xnum 18 + xjmp bcode + +lpush: xnum 14 + xjmp bcode + +lpop: xnum 15 + xjmp bcode + +lover: xnum 22 + xjmp bcode + +lcmove: xnum 43 + xjmp bcode + +bcode: xnum lmode + xc@ + xif lcsto + xnum l25 + xc! +l25: db 0 + xret + +lne: xcall lfind + xif lne3 + xnum lpad + xcall lwrite + xnum msg2 + xcall lwrite +lne3: xnum sf ; pick next address + x@ + xdup + xnum 24 + xplus + xdup + xnum last+23999 + xcmpg + xif lne1 + xdrop + xnum last +lne1: xnum sf + x! + xdup ; is cell empty + x@ + xinc + xif lne2 + xdrop + xjmp lne3 +lne2: xnum llp ; create entry + x@ + xover + x! + xdup + xnum llp + x! + xnum lpad + xover + xinc + xinc + xinc + xinc + xnum 15 + xcmove + xnum 19 + xplus + xdup + xinc + xpush + xc! + xpop + x! + xret +sf dd lend +msg2 db 3, ' ! ' + +lcolon: xnum 255 + xcall lscan + xnum lh + x@ + xnum 1 + xcall lne + xnum 0 + xnum lmode + xc! + xret + +lI: xnum 1 + xnum lmode + xc! + xret + +ldadd: +l27: xdup + xif l26 + xdec + xpush + xcall lcount + xcall lcsto + xpop + xjmp l27 +l26: xdrop + xdrop + xret + +lincmod: xcall lcount + xjmp ldadd + +lif: xcall lhere + xinc + xnum d6 + xcall lincmod +l35: xnum 255 + xcall lscan + xnum d7 + xcall lstrEQpad + xif l36 + xcall lhere + xinc + xnum d9 + xcall lincmod + xswap + xcall lhere + xswap + x! + xjmp l35 +l36: xnum d8 + xcall lstrEQpad + xif l37 + xcall lhere + xswap + x! + xret +l37: xcall lexecute + xjmp l35 + +d6 db 5, 10, 0, 0, 0, 0 +d7 db 4, 'else' +d8 db 4, 'then' +d9 db 5, 4, 0, 0, 0, 0 + +ldo: xcall lhere + xinc + xinc + xnum d4 + xcall lincmod +l33: xnum 255 + xcall lscan + xnum d5 + xcall lstrEQpad + xif l34 + xnum 15 + xcall lsto + xnum 4 + xcall lcsto + xdup + xdec + xdec + xcall lsto + xcall lhere + xswap + x! + xnum 9 + xcall lcsto + xret +l34: xcall lexecute + xjmp l33 +d4 db 8, 8, 10, 0, 0, 0, 0, 7, 14 +d5 db 4, 'loop' + +lfor: xcall lhere + xnum d10 + xcall lincmod +l38: xnum 255 + xcall lscan + xnum d5 + xcall lstrEQpad + xif l39 + xnum d11 + xcall lincmod + xcall lhere + xover + xnum 5 + xplus + x! + xinc + xcall lhere + xdec + xdec + xdec + xdec + x! + xnum d12 + xcall lincmod + xret +l39: xcall lexecute + xjmp l38 + +d10 db 10, 14, 8, 31, 25, 10, 0,0,0,0, 14 +d11 db 7, 15, 6, 4, 0,0,0,0 +d12 db 3, 9, 15, 9 + +luntil: xnum d14 + xcall lincmod + xcall lhere +l40: xnum 255 + xcall lscan + xnum d5 + xcall lstrEQpad + xif l41 + xnum d15 + xcall lincmod + xcall lhere + xnum 6 + xminus + x! + xret +l41: xcall lexecute + xjmp l40 + +d14 db 6, 3, 0, 0, 0, 0, 14 +d15 db 8, 31, 10, 0, 0, 0, 0, 15, 9 + +lmain: +l32: xnum 255 + xcall lscan + xcall lexecute + xjmp l32 + +last: +head 2, 'lp', 0, llp +head 5, 'count', 1, lcount +head 4, 'emit', 1, lemit +head 4, 'type', 1, ltype +head 5, 'write', 1, lwrite +head 3, 'pad', 0, lpad +head 5, 'c+str', 1, lsadd +head 4, 'fkey', 1, lfkey +head 4, 'scan', 1, lscan +head 8, 'str=str?', 1, lstrEQstr +head 4, 'find', 1, lfind +head 4, 'mode', 0, lmode +head 4, 'goto', 1, lgoto +head 7, 'execute', 1, lexecute +head 4, '2num', 1, l2num +head 2, 'c,', 1, lcsto +head 1, ',', 1, lsto +head 4, 'halt', 1, lhalt +head 1, '@', 2, l@ +head 1, '!', 2, l! +head 2, 'c@', 2, lc@ +head 2, 'c!', 2, lc! +head 2, '1+', 2, linc +head 2, '1-', 2, ldec +head 1, '>', 2, lcmpg +head 1, '<', 2, lcmpl +head 3, 'ret', 2, lret +head 1, '+', 2, lplus +head 1, '-', 2, lminus +head 1, '*', 2, lmul +head 4, 'drop', 2, ldrop +head 3, 'dup', 2, ldup +head 4, 'swap', 2, lswap +head 5, 'disk@', 2, ldisk@ +head 4, 'push', 2, lpush +head 3, 'pop', 2, lpop +head 4, 'over', 2, lover +head 5, 'cmove', 2, lcmove +head 2, 'ne', 1, lne +head 1, ':', 1, lcolon +head 1, 'I', 2, lI +head 5, 'bcode', 1, bcode +head 4, 'dadd', 1, ldadd +head 6, 'incmod', 1, lincmod +head 2, 'if', 2, lif +head 4, 'here', 1, lhere +head 2, 'do', 2, ldo +head 3, 'for', 2, lfor +head 5, 'until', 2, luntil +head 4, 'prev', 0, lprev +head 4, 'skey', 1, lskey +lastp: +head 1, 'h', 0, lh +lend: diff --git a/kernel/core.raw b/kernel/core.raw new file mode 100755 index 0000000000000000000000000000000000000000..b6a66f92b68ed04c67baf52873024f1f4a97c976 GIT binary pat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zqR-6~xINcwX98RF`Pf5zvC|k1GZA#M4-$W&v)sw}{~Npqo{L|M>nmnv7G>`-vVX9> zvY4@_8~!x7tZy6AB(dm-odvf>aAMKNVU7IE&n#ru`6Bo=vVSb=CXt_mQ#M zDb7qQkrUvblKn{7MBWSjJ@JvSiQEBxo%q&K|GU8hSQun?gifrt{N*DoXDrZ zA0qqSp_xpBJOI8Q+-Wp>t>MziS@0IwcUOAz!_aa8{0RB)X2T|O75oI*cUI$JIw$fK z@H6DUzK9m%NFD{h2rk=0h*pa(?aScSZevTr+J>w1Ch;dmxO@hD9G^pHww_IBi$1nf z;C5rCkc{y$t*)6yWnTR9o#a_1rtL41inW8yG!w^!HJ;%h}VesM(+Xoo2u~F!OCn3x{31` F&%ZUNzJve( literal 0 HcmV?d00001 diff --git a/kernel/define.inc b/kernel/define.inc new file mode 100755 index 0000000..e8785af --- /dev/null +++ b/kernel/define.inc @@ -0,0 +1,79 @@ +; Virtual CPU machine code definitions +; For assembling with FASM (Flat Assembler). +; Rest is defined in highlevel code. + +macro xnop +{ db 0 } +macro xhalt +{ db 1 } +macro kbd@ +{ db 2 } +macro xnum arg1 +{ db 3 + dd arg1 } +macro head arg1, arg2, arg3, arg4 +{ dd link + link = $-4 + db arg1 + db arg2 + len = (24-5)-($-link) + times len db 177 + db arg3 + dd arg4 } +macro xjmp arg1 +{ db 4 + dd arg1 } +macro xcall arg1 +{ db 5 + dd arg1 } +macro xinc +{ db 6 } +macro xdec +{ db 7 } +macro xdup +{ db 8 } +macro xdrop +{ db 9 } +macro xif arg1 +{ db 10 + dd arg1 } +macro xret +{ db 11 } +macro xc@ +{ db 12 } +macro xc! +{ db 13 } +macro xpush +{ db 14 } +macro xpop +{ db 15 } +macro xrot +{ db 17 } +macro xdisk@ +{ db 18 } +macro xdisk! +{ db 19 } +macro x@ +{ db 20 } +macro x! +{ db 21 } +macro xover +{ db 22 } +macro xswap +{ db 23 } +macro xplus +{ db 24 } +macro xminus +{ db 25 } +macro xmul +{ db 26 } +macro xcmpg +{ db 28 } +macro xcmpl +{ db 29 } +macro xcprt! +{ db 33 } +macro xcmove +{ db 43 } +macro xcfill +{ db 44 } diff --git a/kernel/font.asm b/kernel/font.asm new file mode 100755 index 0000000..b1f5030 --- /dev/null +++ b/kernel/font.asm @@ -0,0 +1,2307 @@ +; Font for Fifth + + +; 0 +db 00000000b +db 00000000b +db 00111000b +db 00101000b +db 00111000b +db 00000000b +db 00000000b +db 00000000b +; 1 +db 11111110b +db 01111100b +db 00111000b +db 00101000b +db 00111000b +db 00000000b +db 00000000b +db 00000000b +; 2 +db 00000010b +db 00000110b +db 00111110b +db 00101110b +db 00111110b +db 00000110b +db 00000010b +db 00000000b +; 3 +db 11111110b +db 01111110b +db 00111110b +db 00101110b +db 00111110b +db 00000110b +db 00000010b +db 00000000b +; 4 +db 00000000b +db 00000000b +db 00111000b +db 00101000b +db 00111000b +db 01111100b +db 11111110b +db 00000000b +; 5 +db 11111110b +db 01111100b +db 00111000b +db 00101000b +db 00111000b +db 01111100b +db 11111110b +db 00000000b +; 6 +db 00000010b +db 00000110b +db 00111110b +db 00101110b +db 00111110b +db 01111110b +db 11111110b +db 00000000b +; 7 +db 11111110b +db 01111110b +db 00111110b +db 00101110b +db 00111110b +db 01111110b +db 11111110b +db 00000000b +; 8 +db 10000000b +db 11000000b +db 11111000b +db 11101000b +db 11111000b +db 11000000b +db 10000000b +db 00000000b +; 9 +db 11111110b +db 11111100b +db 11111000b +db 11101000b +db 11111000b +db 11000000b +db 10000000b +db 00000000b +; 10 +db 10000010b +db 11000110b +db 11111110b +db 11101110b +db 11111110b +db 11000110b +db 10000010b +db 00000000b +; 11 +db 11111110b +db 11111110b +db 11111110b +db 11101110b +db 11111110b +db 11000110b +db 10000010b +db 00000000b +; 12 +db 10000000b +db 11000000b +db 11111000b +db 11101000b +db 11111000b +db 11111100b +db 11111110b +db 00000000b +; 13 +db 11111110b +db 11111100b +db 11111000b +db 11101000b +db 11111000b +db 11111100b +db 11111110b +db 00000000b +; 14 +db 10000010b +db 11000110b +db 11111110b +db 11101110b +db 11111110b +db 11111110b +db 11111110b +db 00000000b +; 15 +db 11111110b +db 11111110b +db 11111110b +db 11101110b +db 11111110b +db 11111110b +db 11111110b +db 00000000b +; 16 +db 10000000b +db 11100000b +db 11111000b +db 11111110b +db 11111000b +db 11100000b +db 10000000b +db 00000000b +; 17 +db 00000010b +db 00001110b +db 00111110b +db 11111110b +db 00111110b +db 00001110b +db 00000010b +db 00000000b +; 18 +db 00011000b +db 00111100b +db 01111110b +db 00011000b +db 00011000b +db 01111110b +db 00111100b +db 00011000b +; 19 +db 01100110b +db 01100110b +db 01100110b +db 01100110b +db 01100110b +db 00000000b +db 01100110b +db 00000000b +; 20 +db 01111111b +db 11011011b +db 11011011b +db 01111011b +db 00011011b +db 00011011b +db 00011011b +db 00000000b +; 21 +db 00111110b +db 01100011b +db 00111000b +db 01101100b +db 01101100b +db 00111000b +db 10000110b +db 11111100b +; 22 +db 00000000b +db 00000000b +db 00000000b +db 00000000b +db 01111110b +db 01111110b +db 01111110b +db 00000000b +; 23 +db 00011000b +db 00111100b +db 01111110b +db 00011000b +db 01111110b +db 00111100b +db 00011000b +db 11111111b +; 24 +db 00011000b +db 00111100b +db 01111110b +db 00011000b +db 00011000b +db 00011000b +db 00011000b +db 00000000b +; 25 +db 00011000b +db 00011000b +db 00011000b +db 00011000b +db 01111110b +db 00111100b +db 00011000b +db 00000000b +; 26 +db 00000000b +db 00011000b +db 00001100b +db 11111110b +db 00001100b +db 00011000b +db 00000000b +db 00000000b +; 27 +db 00000000b +db 00110000b +db 01100000b +db 11111110b +db 01100000b +db 00110000b +db 00000000b +db 00000000b +; 28 +db 00000000b +db 00110000b +db 01100000b +db 11111110b +db 01100000b +db 00110000b +db 00000000b +db 00000000b +; 29 +db 00000000b +db 00110000b +db 01100000b +db 11111110b +db 01100000b +db 00110000b +db 00000000b +db 00000000b +; 30 +db 00000000b +db 00110000b +db 01100000b +db 11111110b +db 01100000b +db 00110000b +db 00000000b +db 00000000b +; 31 +db 00000000b +db 00110000b +db 01100000b +db 11111110b +db 01100000b +db 00110000b +db 00000000b +db 00000000b +; 32 +db 00000000b +db 00000000b +db 00000000b +db 00000000b +db 00000000b +db 00000000b +db 00000000b +db 00000000b +; ! 33 +db 00011000b +db 00111100b +db 00111100b +db 00011000b +db 00011000b +db 00000000b +db 00011000b +db 00000000b +; " 34 +db 01101100b +db 01101100b +db 01101100b +db 00000000b +db 00000000b +db 00000000b +db 00000000b +db 00000000b +; # 35 +db 01101100b +db 01101100b +db 11111110b +db 01101100b +db 11111110b +db 01101100b +db 01101100b +db 00000000b +; $ 36 +db 00011000b +db 01111110b +db 11000000b +db 01111100b +db 00000110b +db 11111100b +db 00011000b +db 00000000b +; % 37 +db 00000000b +db 11000110b +db 11001100b +db 00011000b +db 00110000b +db 01100110b +db 11000110b +db 00000000b +; & 38 +db 00111000b +db 01101100b +db 00111000b +db 01110110b +db 11011100b +db 11001100b +db 01110110b +db 00000000b +; ' 39 +db 00110000b +db 00110000b +db 01100000b +db 00000000b +db 00000000b +db 00000000b +db 00000000b +db 00000000b +; ( 40 +db 00011000b +db 00110000b +db 01100000b +db 01100000b +db 01100000b +db 00110000b +db 00011000b +db 00000000b +; ) 41 +db 01100000b +db 00110000b +db 00011000b +db 00011000b +db 00011000b +db 00110000b +db 01100000b +db 00000000b +; * 42 +db 00000000b +db 01100110b +db 00111100b +db 11111111b +db 00111100b +db 01100110b +db 00000000b +db 00000000b +; + 43 +db 00000000b +db 00011000b +db 00011000b +db 01111110b +db 00011000b +db 00011000b +db 00000000b +db 00000000b +; , 44 +db 00000000b +db 00000000b +db 00000000b +db 00000000b +db 00000000b +db 00011000b +db 00011000b +db 00110000b +; - 45 +db 00000000b +db 00000000b +db 00000000b +db 01111110b +db 00000000b +db 00000000b +db 00000000b +db 00000000b +; . 46 +db 00000000b +db 00000000b +db 00000000b +db 00000000b +db 00000000b +db 00011000b +db 00011000b +db 00000000b +; / 47 +db 00000110b +db 00001100b +db 00011000b +db 00110000b +db 01100000b +db 11000000b +db 10000000b +db 00000000b +; 0 48 +db 01111100b +db 11001110b +db 11011110b +db 11110110b +db 11100110b +db 11000110b +db 01111100b +db 00000000b +; 1 49 +db 00110000b +db 01110000b +db 00110000b +db 00110000b +db 00110000b +db 00110000b +db 11111100b +db 00000000b +; 2 50 +db 01111000b +db 11001100b +db 00001100b +db 00111000b +db 01100000b +db 11001100b +db 11111100b +db 00000000b +; 3 51 +db 01111000b +db 11001100b +db 00001100b +db 00111000b +db 00001100b +db 11001100b +db 01111000b +db 00000000b +; 4 52 +db 00011100b +db 00111100b +db 01101100b +db 11001100b +db 11111110b +db 00001100b +db 00011110b +db 00000000b +; 5 53 +db 11111100b +db 11000000b +db 11111000b +db 00001100b +db 00001100b +db 11001100b +db 01111000b +db 00000000b +; 6 54 +db 00111000b +db 01100000b +db 11000000b +db 11111000b +db 11001100b +db 11001100b +db 01111000b +db 00000000b +; 7 55 +db 11111100b +db 11001100b +db 00001100b +db 00011000b +db 00110000b +db 00110000b +db 00110000b +db 00000000b +; 8 56 +db 01111000b +db 11001100b +db 11001100b +db 01111000b +db 11001100b +db 11001100b +db 01111000b +db 00000000b +; 9 57 +db 01111000b +db 11001100b +db 11001100b +db 01111100b +db 00001100b +db 00011000b +db 01110000b +db 00000000b +; : 58 +db 00000000b +db 00011000b +db 00011000b +db 00000000b +db 00000000b +db 00011000b +db 00011000b +db 00000000b +; ; 59 +db 00000000b +db 00011000b +db 00011000b +db 00000000b +db 00000000b +db 00011000b +db 00011000b +db 00110000b +; < 60 +db 00011000b +db 00110000b +db 01100000b +db 11000000b +db 01100000b +db 00110000b +db 00011000b +db 00000000b +; = 61 +db 00000000b +db 00000000b +db 01111110b +db 00000000b +db 01111110b +db 00000000b +db 00000000b +db 00000000b +; > 62 +db 01100000b +db 00110000b +db 00011000b +db 00001100b +db 00011000b +db 00110000b +db 01100000b +db 00000000b +; ? 63 +db 00111100b +db 01100110b +db 00001100b +db 00011000b +db 00011000b +db 00000000b +db 00011000b +db 00000000b +; @ 64 +db 01111100b +db 11000110b +db 11011110b +db 11011110b +db 11011100b +db 11000000b +db 01111100b +db 00000000b +; A 65 +db 00110000b +db 01111000b +db 11001100b +db 11001100b +db 11111100b +db 11001100b +db 11001100b +db 00000000b +; B 66 +db 11111100b +db 01100110b +db 01100110b +db 01111100b +db 01100110b +db 01100110b +db 11111100b +db 00000000b +; C 67 +db 00111100b +db 01100110b +db 11000000b +db 11000000b +db 11000000b +db 01100110b +db 00111100b +db 00000000b +; D 68 +db 11111000b +db 01101100b +db 01100110b +db 01100110b +db 01100110b +db 01101100b +db 11111000b +db 00000000b +; E 69 +db 11111110b +db 01100010b +db 01101000b +db 01111000b +db 01101000b +db 01100010b +db 11111110b +db 00000000b +; F 70 +db 11111110b +db 01100010b +db 01101000b +db 01111000b +db 01101000b +db 01100000b +db 11110000b +db 00000000b +; G 71 +db 00111100b +db 01100110b +db 11000000b +db 11000000b +db 11001110b +db 01100110b +db 00111010b +db 00000000b +; H 72 +db 11001100b +db 11001100b +db 11001100b +db 11111100b +db 11001100b +db 11001100b +db 11001100b +db 00000000b +; I 73 +db 01111000b +db 00110000b +db 00110000b +db 00110000b +db 00110000b +db 00110000b +db 01111000b +db 00000000b +; J 74 +db 00011110b +db 00001100b +db 00001100b +db 00001100b +db 11001100b +db 11001100b +db 01111000b +db 00000000b +; K 75 +db 11100110b +db 01100110b +db 01101100b +db 01111000b +db 01101100b +db 01100110b +db 11100110b +db 00000000b +; L 76 +db 11110000b +db 01100000b +db 01100000b +db 01100000b +db 01100010b +db 01100110b +db 11111110b +db 00000000b +; M 77 +db 11000110b +db 11101110b +db 11111110b +db 11111110b +db 11010110b +db 11000110b +db 11000110b +db 00000000b +; N 78 +db 11000110b +db 11100110b +db 11110110b +db 11011110b +db 11001110b +db 11000110b +db 11000110b +db 00000000b +; O 79 +db 00111000b +db 01101100b +db 11000110b +db 11000110b +db 11000110b +db 01101100b +db 00111000b +db 00000000b +; P 80 +db 11111100b +db 01100110b +db 01100110b +db 01111100b +db 01100000b +db 01100000b +db 11110000b +db 00000000b +; Q 81 +db 01111100b +db 11000110b +db 11000110b +db 11000110b +db 11010110b +db 01111100b +db 00001110b +db 00000000b +; R 82 +db 11111100b +db 01100110b +db 01100110b +db 01111100b +db 01101100b +db 01100110b +db 11100110b +db 00000000b +; S 83 +db 01111100b +db 11000110b +db 11100000b +db 01111000b +db 00001110b +db 11000110b +db 01111100b +db 00000000b +; T 84 +db 11111100b +db 10110100b +db 00110000b +db 00110000b +db 00110000b +db 00110000b +db 01111000b +db 00000000b +; U 85 +db 11001100b +db 11001100b +db 11001100b +db 11001100b +db 11001100b +db 11001100b +db 11111100b +db 00000000b +; V 86 +db 11001100b +db 11001100b +db 11001100b +db 11001100b +db 11001100b +db 01111000b +db 00110000b +db 00000000b +; W 87 +db 11000110b +db 11000110b +db 11000110b +db 11000110b +db 11010110b +db 11111110b +db 01101100b +db 00000000b +; X 88 +db 11000110b +db 11000110b +db 01101100b +db 00111000b +db 01101100b +db 11000110b +db 11000110b +db 00000000b +; Y 89 +db 11001100b +db 11001100b +db 11001100b +db 01111000b +db 00110000b +db 00110000b +db 01111000b +db 00000000b +; Z 90 +db 11111110b +db 11000110b +db 10001100b +db 00011000b +db 00110010b +db 01100110b +db 11111110b +db 00000000b +; [ 91 +db 01111000b +db 01100000b +db 01100000b +db 01100000b +db 01100000b +db 01100000b +db 01111000b +db 00000000b +; \ 92 +db 11000000b +db 01100000b +db 00110000b +db 00011000b +db 00001100b +db 00000110b +db 00000010b +db 00000000b +; ] 93 +db 01111000b +db 00011000b +db 00011000b +db 00011000b +db 00011000b +db 00011000b +db 01111000b +db 00000000b +; ^ 94 +db 00010000b +db 00111000b +db 01101100b +db 11000110b +db 00000000b +db 00000000b +db 00000000b +db 00000000b +; _ 95 +db 00000000b +db 00000000b +db 00000000b +db 00000000b +db 00000000b +db 00000000b +db 00000000b +db 11111111b +; ` 96 +db 00110000b +db 00110000b +db 00011000b +db 00000000b +db 00000000b +db 00000000b +db 00000000b +db 00000000b +; a 97 +db 00000000b +db 00000000b +db 01111000b +db 00001100b +db 01111100b +db 11001100b +db 01110110b +db 00000000b +; b 98 +db 11100000b +db 01100000b +db 01100000b +db 01111100b +db 01100110b +db 01100110b +db 11011100b +db 00000000b +; c 99 +db 00000000b +db 00000000b +db 01111000b +db 11001100b +db 11000000b +db 11001100b +db 01111000b +db 00000000b +; d 100 +db 00011100b +db 00001100b +db 00001100b +db 01111100b +db 11001100b +db 11001100b +db 01110110b +db 00000000b +; e 101 +db 00000000b +db 00000000b +db 01111000b +db 11001100b +db 11111100b +db 11000000b +db 01111000b +db 00000000b +; f 102 +db 00111000b +db 01101100b +db 01100100b +db 11110000b +db 01100000b +db 01100000b +db 11110000b +db 00000000b +; g 103 +db 00000000b +db 00000000b +db 01110110b +db 11001100b +db 11001100b +db 01111100b +db 00001100b +db 11111000b +; h 104 +db 11100000b +db 01100000b +db 01101100b +db 01110110b +db 01100110b +db 01100110b +db 11100110b +db 00000000b +; i 105 +db 00110000b +db 00000000b +db 01110000b +db 00110000b +db 00110000b +db 00110000b +db 01111000b +db 00000000b +; j 106 +db 00001100b +db 00000000b +db 00011100b +db 00001100b +db 00001100b +db 11001100b +db 11001100b +db 01111000b +; k 107 +db 11100000b +db 01100000b +db 01100110b +db 01101100b +db 01111000b +db 01101100b +db 11100110b +db 00000000b +; l 108 +db 01110000b +db 00110000b +db 00110000b +db 00110000b +db 00110000b +db 00110000b +db 01111000b +db 00000000b +; m 109 +db 00000000b +db 00000000b +db 11001100b +db 11111110b +db 11111110b +db 11010110b +db 11010110b +db 00000000b +; n 110 +db 00000000b +db 00000000b +db 10111000b +db 11001100b +db 11001100b +db 11001100b +db 11001100b +db 00000000b +; o 111 +db 00000000b +db 00000000b +db 01111000b +db 11001100b +db 11001100b +db 11001100b +db 01111000b +db 00000000b +; p 112 +db 00000000b +db 00000000b +db 11011100b +db 01100110b +db 01100110b +db 01111100b +db 01100000b +db 11110000b +; q 113 +db 00000000b +db 00000000b +db 01110110b +db 11001100b +db 11001100b +db 01111100b +db 00001100b +db 00011110b +; r 114 +db 00000000b +db 00000000b +db 11011100b +db 01110110b +db 01100010b +db 01100000b +db 11110000b +db 00000000b +; s 115 +db 00000000b +db 00000000b +db 01111100b +db 11000000b +db 01110000b +db 00011100b +db 11111000b +db 00000000b +; t 116 +db 00010000b +db 00110000b +db 11111100b +db 00110000b +db 00110000b +db 00110100b +db 00011000b +db 00000000b +; u 117 +db 00000000b +db 00000000b +db 11001100b +db 11001100b +db 11001100b +db 11001100b +db 01110110b +db 00000000b +; v 118 +db 00000000b +db 00000000b +db 11001100b +db 11001100b +db 11001100b +db 01111000b +db 00110000b +db 00000000b +; w 119 +db 00000000b +db 00000000b +db 11000110b +db 11000110b +db 11010110b +db 11111110b +db 01101100b +db 00000000b +; x 120 +db 00000000b +db 00000000b +db 11000110b +db 01101100b +db 00111000b +db 01101100b +db 11000110b +db 00000000b +; y 121 +db 00000000b +db 00000000b +db 11001100b +db 11001100b +db 11001100b +db 01111100b +db 00001100b +db 11111000b +; z 122 +db 00000000b +db 00000000b +db 11111100b +db 10011000b +db 00110000b +db 01100100b +db 11111100b +db 00000000b +; { 123 +db 00011100b +db 00110000b +db 00110000b +db 11100000b +db 00110000b +db 00110000b +db 00011100b +db 00000000b +; | 124 +db 00011000b +db 00011000b +db 00011000b +db 00000000b +db 00011000b +db 00011000b +db 00011000b +db 00000000b +; } 125 +db 11100000b +db 00110000b +db 00110000b +db 00011100b +db 00110000b +db 00110000b +db 11100000b +db 00000000b +; ~ 126 +db 01110110b +db 11011100b +db 00000000b +db 00000000b +db 00000000b +db 00000000b +db 00000000b +db 00000000b +;  127 +db 00000000b +db 00010000b +db 00111000b +db 01101100b +db 11000110b +db 11000110b +db 11111110b +db 00000000b +; � 128 +db 01111100b +db 11000110b +db 11000000b +db 11000110b +db 01111100b +db 00001100b +db 00000110b +db 01111100b +; � 129 +db 00000000b +db 11001100b +db 00000000b +db 11001100b +db 11001100b +db 11001100b +db 01110110b +db 00000000b +; � 130 +db 00011100b +db 00000000b +db 01111000b +db 11001100b +db 11111100b +db 11000000b +db 01111000b +db 00000000b +; � 131 +db 01111110b +db 10000001b +db 00111100b +db 00000110b +db 00111110b +db 01100110b +db 00111011b +db 00000000b +; � 132 +db 11001100b +db 00000000b +db 01111000b +db 00001100b +db 01111100b +db 11001100b +db 01110110b +db 00000000b +; � 133 +db 11100000b +db 00000000b +db 01111000b +db 00001100b +db 01111100b +db 11001100b +db 01110110b +db 00000000b +; � 134 +db 00110000b +db 00110000b +db 01111000b +db 00001100b +db 01111100b +db 11001100b +db 01110110b +db 00000000b +; � 135 +db 00000000b +db 00000000b +db 01111100b +db 11000110b +db 11000000b +db 01111000b +db 00001100b +db 00111000b +; � 136 +db 01111110b +db 10000001b +db 00111100b +db 01100110b +db 01111110b +db 01100000b +db 00111100b +db 00000000b +; � 137 +db 11001100b +db 00000000b +db 01111000b +db 11001100b +db 11111100b +db 11000000b +db 01111000b +db 00000000b +; � 138 +db 11100000b +db 00000000b +db 01111000b +db 11001100b +db 11111100b +db 11000000b +db 01111000b +db 00000000b +; � 139 +db 11001100b +db 00000000b +db 01110000b +db 00110000b +db 00110000b +db 00110000b +db 01111000b +db 00000000b +; � 140 +db 01111100b +db 10000010b +db 00111000b +db 00011000b +db 00011000b +db 00011000b +db 00111100b +db 00000000b +; � 141 +db 11100000b +db 00000000b +db 01110000b +db 00110000b +db 00110000b +db 00110000b +db 01111000b +db 00000000b +; � 142 +db 11000110b +db 00010000b +db 01111100b +db 11000110b +db 11111110b +db 11000110b +db 11000110b +db 00000000b +; � 143 +db 00110000b +db 00110000b +db 00000000b +db 01111000b +db 11001100b +db 11111100b +db 11001100b +db 00000000b +; � 144 +db 00011100b +db 00000000b +db 11111100b +db 01100000b +db 01111000b +db 01100000b +db 11111100b +db 00000000b +; � 145 +db 00000000b +db 00000000b +db 01111111b +db 00001100b +db 01111111b +db 11001100b +db 01111111b +db 00000000b +; � 146 +db 00111110b +db 01101100b +db 11001100b +db 11111110b +db 11001100b +db 11001100b +db 11001110b +db 00000000b +; � 147 +db 01111000b +db 10000100b +db 00000000b +db 01111000b +db 11001100b +db 11001100b +db 01111000b +db 00000000b +; � 148 +db 00000000b +db 11001100b +db 00000000b +db 01111000b +db 11001100b +db 11001100b +db 01111000b +db 00000000b +; � 149 +db 00000000b +db 11100000b +db 00000000b +db 01111000b +db 11001100b +db 11001100b +db 01111000b +db 00000000b +; � 150 +db 01111000b +db 10000100b +db 00000000b +db 11001100b +db 11001100b +db 11001100b +db 01110110b +db 00000000b +; � 151 +db 00000000b +db 11100000b +db 00000000b +db 11001100b +db 11001100b +db 11001100b +db 01110110b +db 00000000b +; � 152 +db 00000000b +db 11001100b +db 00000000b +db 11001100b +db 11001100b +db 01111100b +db 00001100b +db 11111000b +; � 153 +db 11000011b +db 00011000b +db 00111100b +db 01100110b +db 01100110b +db 00111100b +db 00011000b +db 00000000b +; � 154 +db 11001100b +db 00000000b +db 11001100b +db 11001100b +db 11001100b +db 11001100b +db 01111000b +db 00000000b +; � 155 +db 00011000b +db 00011000b +db 01111110b +db 11000000b +db 11000000b +db 01111110b +db 00011000b +db 00011000b +; � 156 +db 00111000b +db 01101100b +db 01100100b +db 11110000b +db 01100000b +db 11100110b +db 11111100b +db 00000000b +; � 157 +db 11001100b +db 11001100b +db 01111000b +db 00110000b +db 11111100b +db 00110000b +db 11111100b +db 00110000b +; � 158 +db 11111000b +db 11001100b +db 11001100b +db 11111010b +db 11000110b +db 11001111b +db 11000110b +db 11000011b +; � 159 +db 00001110b +db 00011011b +db 00011000b +db 00111100b +db 00011000b +db 00011000b +db 11011000b +db 01110000b +; � 160 +db 00011100b +db 00000000b +db 01111000b +db 00001100b +db 01111100b +db 11001100b +db 01110110b +db 00000000b +; � 161 +db 00111000b +db 00000000b +db 01110000b +db 00110000b +db 00110000b +db 00110000b +db 01111000b +db 00000000b +; � 162 +db 00000000b +db 00011100b +db 00000000b +db 01111000b +db 11001100b +db 11001100b +db 01111000b +db 00000000b +; � 163 +db 00000000b +db 00011100b +db 00000000b +db 11001100b +db 11001100b +db 11001100b +db 01110110b +db 00000000b +; � 164 +db 00000000b +db 11111000b +db 00000000b +db 10111000b +db 11001100b +db 11001100b +db 11001100b +db 00000000b +; � 165 +db 11111100b +db 00000000b +db 11001100b +db 11101100b +db 11111100b +db 11011100b +db 11001100b +db 00000000b +; � 166 +db 00111100b +db 01101100b +db 01101100b +db 00111110b +db 00000000b +db 01111110b +db 00000000b +db 00000000b +; � 167 +db 00111000b +db 01101100b +db 01101100b +db 00111000b +db 00000000b +db 01111100b +db 00000000b +db 00000000b +; � 168 +db 00011000b +db 00000000b +db 00011000b +db 00011000b +db 00110000b +db 01100110b +db 00111100b +db 00000000b +; � 169 +db 00000000b +db 00000000b +db 00000000b +db 11111100b +db 11000000b +db 11000000b +db 00000000b +db 00000000b +; � 170 +db 00000000b +db 00000000b +db 00000000b +db 11111100b +db 00001100b +db 00001100b +db 00000000b +db 00000000b +; � 171 +db 11000110b +db 11001100b +db 11011000b +db 00110110b +db 01101011b +db 11000010b +db 10000100b +db 00001111b +; � 172 +db 11000011b +db 11000110b +db 11001100b +db 11011011b +db 00110111b +db 01101101b +db 11001111b +db 00000011b +; � 173 +db 00011000b +db 00000000b +db 00011000b +db 00011000b +db 00111100b +db 00111100b +db 00011000b +db 00000000b +; � 174 +db 00000000b +db 00110011b +db 01100110b +db 11001100b +db 01100110b +db 00110011b +db 00000000b +db 00000000b +; � 175 +db 00000000b +db 11001100b +db 01100110b +db 00110011b +db 01100110b +db 11001100b +db 00000000b +db 00000000b +; � 176 +db 00100010b +db 10001000b +db 00100010b +db 10001000b +db 00100010b +db 10001000b +db 00100010b +db 10001000b +; � 177 +db 01010101b +db 10101010b +db 01010101b +db 10101010b +db 01010101b +db 10101010b +db 01010101b +db 10101010b +; � 178 +db 11011011b +db 11110110b +db 11011011b +db 01101111b +db 11011011b +db 01111110b +db 11010111b +db 11101101b +; � 179 +db 00011000b +db 00011000b +db 00011000b +db 00011000b +db 00011000b +db 00011000b +db 00011000b +db 00011000b +; � 180 +db 00011000b +db 00011000b +db 00011000b +db 00011000b +db 11111000b +db 00011000b +db 00011000b +db 00011000b +; � 181 +db 00011000b +db 00011000b +db 11111000b +db 00011000b +db 11111000b +db 00011000b +db 00011000b +db 00011000b +; � 182 +db 00110110b +db 00110110b +db 00110110b +db 00110110b +db 11110110b +db 00110110b +db 00110110b +db 00110110b +; � 183 +db 00000000b +db 00000000b +db 00000000b +db 00000000b +db 11111110b +db 00110110b +db 00110110b +db 00110110b +; � 184 +db 00000000b +db 00000000b +db 11111000b +db 00011000b +db 11111000b +db 00011000b +db 00011000b +db 00011000b +; � 185 +db 00110110b +db 00110110b +db 11110110b +db 00000110b +db 11110110b +db 00110110b +db 00110110b +db 00110110b +; � 186 +db 00110110b +db 00110110b +db 00110110b +db 00110110b +db 00110110b +db 00110110b +db 00110110b +db 00110110b +; � 187 +db 00000000b +db 00000000b +db 11111110b +db 00000110b +db 11110110b +db 00110110b +db 00110110b +db 00110110b +; � 188 +db 00110110b +db 00110110b +db 11110110b +db 00000110b +db 11111110b +db 00000000b +db 00000000b +db 00000000b +; � 189 +db 00110110b +db 00110110b +db 00110110b +db 00110110b +db 11111110b +db 00000000b +db 00000000b +db 00000000b +; � 190 +db 00011000b +db 00011000b +db 11111000b +db 00011000b +db 11111000b +db 00000000b +db 00000000b +db 00000000b +; � 191 +db 00000000b +db 00000000b +db 00000000b +db 00000000b +db 11111000b +db 00011000b +db 00011000b +db 00011000b +; � 192 +db 00011000b +db 00011000b +db 00011000b +db 00011000b +db 00011111b +db 00000000b +db 00000000b +db 00000000b +; � 193 +db 00011000b +db 00011000b +db 00011000b +db 00011000b +db 11111111b +db 00000000b +db 00000000b +db 00000000b +; � 194 +db 00000000b +db 00000000b +db 00000000b +db 00000000b +db 11111111b +db 00011000b +db 00011000b +db 00011000b +; � 195 +db 00011000b +db 00011000b +db 00011000b +db 00011000b +db 00011111b +db 00011000b +db 00011000b +db 00011000b +; � 196 +db 00000000b +db 00000000b +db 00000000b +db 00000000b +db 11111111b +db 00000000b +db 00000000b +db 00000000b +; � 197 +db 00011000b +db 00011000b +db 00011000b +db 00011000b +db 11111111b +db 00011000b +db 00011000b +db 00011000b +; � 198 +db 00011000b +db 00011000b +db 00011111b +db 00011000b +db 00011111b +db 00011000b +db 00011000b +db 00011000b +; � 199 +db 00110110b +db 00110110b +db 00110110b +db 00110110b +db 00110111b +db 00110110b +db 00110110b +db 00110110b +; � 200 +db 00110110b +db 00110110b +db 00110111b +db 00110000b +db 00111111b +db 00000000b +db 00000000b +db 00000000b +; � 201 +db 00000000b +db 00000000b +db 00111111b +db 00110000b +db 00110111b +db 00110110b +db 00110110b +db 00110110b +; � 202 +db 00110110b +db 00110110b +db 11110111b +db 00000000b +db 11111111b +db 00000000b +db 00000000b +db 00000000b +; � 203 +db 00000000b +db 00000000b +db 11111111b +db 00000000b +db 11110111b +db 00110110b +db 00110110b +db 00110110b +; � 204 +db 00110110b +db 00110110b +db 00110111b +db 00110000b +db 00110111b +db 00110110b +db 00110110b +db 00110110b +; � 205 +db 00000000b +db 00000000b +db 11111111b +db 00000000b +db 11111111b +db 00000000b +db 00000000b +db 00000000b +; � 206 +db 00110110b +db 00110110b +db 11110111b +db 00000000b +db 11110111b +db 00110110b +db 00110110b +db 00110110b +; � 207 +db 00011000b +db 00011000b +db 11111111b +db 00000000b +db 11111111b +db 00000000b +db 00000000b +db 00000000b +; � 208 +db 00110110b +db 00110110b +db 00110110b +db 00110110b +db 11111111b +db 00000000b +db 00000000b +db 00000000b +; � 209 +db 00000000b +db 00000000b +db 11111111b +db 00000000b +db 11111111b +db 00011000b +db 00011000b +db 00011000b +; � 210 +db 00000000b +db 00000000b +db 00000000b +db 00000000b +db 11111111b +db 00110110b +db 00110110b +db 00110110b +; � 211 +db 00110110b +db 00110110b +db 00110110b +db 00110110b +db 00111111b +db 00000000b +db 00000000b +db 00000000b +; � 212 +db 00011000b +db 00011000b +db 00011111b +db 00011000b +db 00011111b +db 00000000b +db 00000000b +db 00000000b +; � 213 +db 00000000b +db 00000000b +db 00011111b +db 00011000b +db 00011111b +db 00011000b +db 00011000b +db 00011000b +; � 214 +db 00000000b +db 00000000b +db 00000000b +db 00000000b +db 00111111b +db 00110110b +db 00110110b +db 00110110b +; � 215 +db 00110110b +db 00110110b +db 00110110b +db 00110110b +db 11111111b +db 00110110b +db 00110110b +db 00110110b +; � 216 +db 00011000b +db 00011000b +db 11111111b +db 00011000b +db 11111111b +db 00011000b +db 00011000b +db 00011000b +; � 217 +db 00011000b +db 00011000b +db 00011000b +db 00011000b +db 11111000b +db 00000000b +db 00000000b +db 00000000b +; � 218 +db 00000000b +db 00000000b +db 00000000b +db 00000000b +db 00011111b +db 00011000b +db 00011000b +db 00011000b +; � 219 +db 11111111b +db 11111111b +db 11111111b +db 11111111b +db 11111111b +db 11111111b +db 11111111b +db 11111111b +; � 220 +db 00000000b +db 00000000b +db 00000000b +db 00000000b +db 11111111b +db 11111111b +db 11111111b +db 11111111b +; � 221 +db 11110000b +db 11110000b +db 11110000b +db 11110000b +db 11110000b +db 11110000b +db 11110000b +db 11110000b +; � 222 +db 00001111b +db 00001111b +db 00001111b +db 00001111b +db 00001111b +db 00001111b +db 00001111b +db 00001111b +; � 223 +db 11111111b +db 11111111b +db 11111111b +db 11111111b +db 00000000b +db 00000000b +db 00000000b +db 00000000b +; � 224 +db 00000000b +db 00000000b +db 01110110b +db 11011100b +db 11001000b +db 11011100b +db 01110110b +db 00000000b +; � 225 +db 00000000b +db 01111000b +db 11001100b +db 11111000b +db 11001100b +db 11111000b +db 11000000b +db 11000000b +; � 226 +db 00000000b +db 11111100b +db 11001100b +db 11000000b +db 11000000b +db 11000000b +db 11000000b +db 00000000b +; � 227 +db 00000000b +db 00000000b +db 11111110b +db 01101100b +db 01101100b +db 01101100b +db 01101100b +db 00000000b +; � 228 +db 11111100b +db 11001100b +db 01100000b +db 00110000b +db 01100000b +db 11001100b +db 11111100b +db 00000000b +; � 229 +db 00000000b +db 00000000b +db 01111110b +db 11011000b +db 11011000b +db 11011000b +db 01110000b +db 00000000b +; � 230 +db 00000000b +db 01100110b +db 01100110b +db 01100110b +db 01100110b +db 01111100b +db 01100000b +db 11000000b +; � 231 +db 00000000b +db 01110110b +db 11011100b +db 00011000b +db 00011000b +db 00011000b +db 00011000b +db 00000000b +; � 232 +db 11111100b +db 00110000b +db 01111000b +db 11001100b +db 11001100b +db 01111000b +db 00110000b +db 11111100b +; � 233 +db 00111000b +db 01101100b +db 11000110b +db 11111110b +db 11000110b +db 01101100b +db 00111000b +db 00000000b +; � 234 +db 00111000b +db 01101100b +db 11000110b +db 11000110b +db 01101100b +db 01101100b +db 11101110b +db 00000000b +; � 235 +db 00011100b +db 00110000b +db 00011000b +db 01111100b +db 11001100b +db 11001100b +db 01111000b +db 00000000b +; � 236 +db 00000000b +db 00000000b +db 01111110b +db 11011011b +db 11011011b +db 01111110b +db 00000000b +db 00000000b +; � 237 +db 00000110b +db 00001100b +db 01111110b +db 11011011b +db 11011011b +db 01111110b +db 01100000b +db 11000000b +; � 238 +db 00111000b +db 01100000b +db 11000000b +db 11111000b +db 11000000b +db 01100000b +db 00111000b +db 00000000b +; � 239 +db 01111000b +db 11001100b +db 11001100b +db 11001100b +db 11001100b +db 11001100b +db 11001100b +db 00000000b +; � 240 +db 00000000b +db 01111110b +db 00000000b +db 01111110b +db 00000000b +db 01111110b +db 00000000b +db 00000000b +; � 241 +db 00011000b +db 00011000b +db 01111110b +db 00011000b +db 00011000b +db 00000000b +db 01111110b +db 00000000b +; � 242 +db 01100000b +db 00110000b +db 00011000b +db 00110000b +db 01100000b +db 00000000b +db 11111100b +db 00000000b +; � 243 +db 00011000b +db 00110000b +db 01100000b +db 00110000b +db 00011000b +db 00000000b +db 11111100b +db 00000000b +; � 244 +db 00001110b +db 00011011b +db 00011011b +db 00011000b +db 00011000b +db 00011000b +db 00011000b +db 00011000b +; � 245 +db 00011000b +db 00011000b +db 00011000b +db 00011000b +db 00011000b +db 11011000b +db 11011000b +db 01110000b +; � 246 +db 00011000b +db 00011000b +db 00000000b +db 01111110b +db 00000000b +db 00011000b +db 00011000b +db 00000000b +; � 247 +db 00000000b +db 01110110b +db 11011100b +db 00000000b +db 01110110b +db 11011100b +db 00000000b +db 00000000b +; � 248 +db 00111000b +db 01101100b +db 01101100b +db 00111000b +db 00000000b +db 00000000b +db 00000000b +db 00000000b +; � 249 +db 00000000b +db 00000000b +db 00000000b +db 00011000b +db 00011000b +db 00000000b +db 00000000b +db 00000000b +; � 250 +db 00000000b +db 00000000b +db 00000000b +db 00000000b +db 00011000b +db 00000000b +db 00000000b +db 00000000b +; � 251 +db 00001111b +db 00001100b +db 00001100b +db 00001100b +db 11101100b +db 01101100b +db 00111100b +db 00011100b +; � 252 +db 01011000b +db 01101100b +db 01101100b +db 01101100b +db 01101100b +db 00000000b +db 00000000b +db 00000000b +; � 253 +db 01110000b +db 10011000b +db 00110000b +db 01100000b +db 11111000b +db 00000000b +db 00000000b +db 00000000b +; � 254 +db 00000000b +db 00000000b +db 00111100b +db 00111100b +db 00111100b +db 00111100b +db 00000000b +db 00000000b +; � 255 +db 10001000b +db 00000000b +db 00000000b +db 00000000b +db 10000000b +db 00000000b +db 00000000b +db 00000000b diff --git a/util/5th2src.bas b/util/5th2src.bas new file mode 100755 index 0000000..b147cc1 --- /dev/null +++ b/util/5th2src.bas @@ -0,0 +1,53 @@ +DECLARE SUB getline (a$) +DECLARE SUB start () +DIM SHARED byte AS STRING * 1 +DIM SHARED endf + +start + +OPEN COMMAND$ + ".5th" FOR BINARY AS #1 +OPEN COMMAND$ + ".src" FOR OUTPUT AS #2 + +1 +getline a$ +IF endf = 1 THEN GOTO 2 +PRINT #2, a$ +GOTO 1 +2 + +CLOSE #2 +CLOSE #1 + +SYSTEM + +SUB getline (a$) + +a$ = "" +3 +IF EOF(1) <> 0 THEN endf = 1: GOTO 4 +GET #1, , byte +IF ASC(byte) <= 9 THEN + byte = CHR$(48 + ASC(byte)) +END IF +IF ASC(byte) <= 15 THEN + byte = CHR$(65 + ASC(byte) - 10) +END IF +IF ASC(byte) = 255 THEN + byte = " " +END IF +IF ASC(byte) = 253 THEN + byte = CHR$(9) +END IF + +IF byte = CHR$(254) THEN GOTO 4 +a$ = a$ + byte +GOTO 3 +4 + +END SUB + +SUB start +endf = 0 +IF COMMAND$ = "" THEN END +END SUB + diff --git a/util/editor.bas b/util/editor.bas new file mode 100755 index 0000000..313b6e8 --- /dev/null +++ b/util/editor.bas @@ -0,0 +1,395 @@ +' Disk file editor for FIFTH +' Svjatoslav Agejenko: n0@hot.ee + +DECLARE SUB fdisp () +DECLARE SUB fopen (a$) +DECLARE SUB ask (a$, b$) +DECLARE SUB addk (a$) +DECLARE SUB llen (a%, l%) +DECLARE SUB save (a%) +DECLARE SUB disp () +DEFINT A-Z + +DECLARE SUB load (a) +DECLARE SUB start () +DECLARE SUB edit () +DIM SHARED buf(0 TO 31, 0 TO 31) +DIM SHARED obuf(0 TO 31, 0 TO 31) +DIM SHARED byte AS STRING * 1 +DIM SHARED font(0 TO 20, 0 TO 255) +DIM SHARED eb +DIM SHARED keys(0 TO 10000) +DIM SHARED keyl, keyc +DIM SHARED curx, cury +DIM SHARED fil$(0 TO 1000) +DIM SHARED fline, froll +DIM SHARED filename$ + +start + +OPEN "..\..\disk.raw" FOR BINARY AS #1 + +edit + +CLOSE #1 +SYSTEM + +SUB addk (a$) +keys(keyl) = ASC(a$) +keyl = keyl + 1 +IF keyl > 10000 THEN keyl = 0 +END SUB + +SUB ask (a$, b$) +LOCATE 16, 34 +PRINT SPACE$(46) +LOCATE 16, 34 +COLOR 15 +PRINT a$ +COLOR 10 +LOCATE 16, 34 + LEN(a$) +INPUT "", b$ +LOCATE 16, 34 +PRINT SPACE$(46) +COLOR 15 +END SUB + +SUB disp + +FOR y = 0 TO 31 +FOR x = 0 TO 31 +c = buf(x, y) +IF c <> obuf(x, y) THEN + PUT (x * 8, y * 8), font(0, c), PSET + obuf(x, y) = c +END IF +NEXT x +NEXT y + +x1 = curx * 8 +y1 = cury * 8 +FOR y = y1 TO y1 + 7 +FOR x = x1 TO x1 + 7 +c = POINT(x, y) +IF c = 15 THEN c = 0 ELSE c = 10 +PSET (x, y), c +NEXT x +NEXT y +obuf(curx, cury) = -1 + +LOCATE 1, 77 +PRINT " " +LOCATE 1, 76 +PRINT buf(curx, cury) +END SUB + +SUB edit +fdisp +leb = -1 +m = 0 +1 +IF eb <> leb THEN + IF m = 1 THEN + save leb + m = 0 + END IF + load eb + leb = eb + LOCATE 1, 60 + PRINT "page:"; eb; " " +END IF +disp +2 +a$ = INKEY$ +bk = 0 +IF a$ = "" THEN + IF keyl = keyc THEN GOTO 2 + a$ = CHR$(keys(keyc)) + keyc = keyc + 1 + IF keyc > 10000 THEN keyc = 0 + bk = 1 +END IF + +IF a$ = CHR$(0) + CHR$(73) THEN eb = eb - 1 +IF a$ = CHR$(0) + CHR$(81) THEN eb = eb + 1 +IF a$ = CHR$(27) THEN GOTO 4 +IF a$ = CHR$(0) + "M" THEN curx = curx + 1 +IF a$ = CHR$(0) + "K" THEN curx = curx - 1 +IF a$ = CHR$(0) + "P" THEN cury = cury + 1 +IF a$ = CHR$(0) + "H" THEN cury = cury - 1 +IF a$ = CHR$(0) + "=" THEN ask "page: ", b$: eb = VAL(b$) +IF a$ = CHR$(0) + "?" THEN ask "file: ", b$: fopen b$ +IF a$ = CHR$(0) + CHR$(132) THEN fline = fline - 1: fdisp +IF a$ = CHR$(0) + CHR$(118) THEN fline = fline + 1: fdisp +IF a$ = CHR$(0) + CHR$(64) THEN ' F6 + d = 0 + FOR b = 1 TO LEN(fil$(fline)) + c$ = RIGHT$(LEFT$(fil$(fline), b), 1) + IF c$ = CHR$(9) THEN c$ = " " + IF c$ = " " OR c$ = CHR$(255) THEN d = d + 1 ELSE d = 0 + IF d < 2 THEN addk c$ + NEXT b +END IF + +IF a$ = CHR$(0) + ";" THEN + FOR y = 0 TO 31 + FOR x = 0 TO 31 + buf(x, y) = 255 + NEXT x + NEXT y + m = 1 +END IF + +IF a$ = CHR$(0) + CHR$(83) THEN + FOR b = curx TO 30 + buf(b, cury) = buf(b + 1, cury) + NEXT b + buf(31, cury) = 255 + m = 1 +END IF + +IF (a$ = CHR$(13)) AND (bk = 0) THEN +a$ = "" +IF cury < 31 THEN + FOR a = 31 TO cury + 2 STEP -1 + FOR b = 0 TO 31 + buf(b, a) = buf(b, a - 1) + NEXT b + NEXT a + FOR a = 0 TO 31 + buf(a, cury + 1) = 255 + NEXT a + FOR a = curx TO 31 + SWAP buf(a, cury), buf(a - curx, cury + 1) + NEXT a + m = 1 + cury = cury + 1 + curx = 0 +END IF +END IF + +IF LEN(a$) = 1 THEN + IF ASC(a$) = 32 THEN a$ = CHR$(255) + IF (a$ = CHR$(8)) AND (bk = 0) THEN + a$ = "" + IF curx > 0 THEN + FOR b = curx - 1 TO 30 + buf(b, cury) = buf(b + 1, cury) + NEXT b + buf(31, cury) = 255 + curx = curx - 1 + m = 1 + ELSE + IF cury > 0 THEN + llen cury - 1, a + curx = a + FOR b = a TO 31 + buf(b, cury - 1) = buf(b - a, cury) + NEXT b + FOR a = cury TO 30 + FOR b = 0 TO 31 + buf(b, a) = buf(b, a + 1) + NEXT b + NEXT a + FOR b = 0 TO 31 + buf(b, 31) = 255 + NEXT b + m = 1 + cury = cury - 1 + END IF + END IF + END IF +END IF + +IF a$ = CHR$(0) + "<" THEN +ask "decimal number:", b$ +b$ = HEX$(VAL(b$)) +FOR a = 1 TO LEN(b$) + c = ASC(RIGHT$(LEFT$(b$, a), 1)) + IF (c <= 57) AND (c >= 48) THEN d$ = CHR$(c - 48): addk d$ + IF (c <= 70) AND (c >= 65) THEN d$ = CHR$(c - 55): addk d$ +NEXT a +END IF + +IF a$ = CHR$(0) + CHR$(65) THEN +FOR a = 999 TO fline STEP -1 + fil$(a + 1) = fil$(a) +NEXT a +fil$(fline) = "" +FOR a = curx TO 31 + fil$(fline) = fil$(fline) + CHR$(buf(a, cury)) +NEXT a +fdisp +END IF + +IF a$ = CHR$(0) + ">" THEN +ask "ascii code:", b$ +a$ = CHR$(VAL(b$)) +END IF + +IF LEN(a$) = 1 THEN + FOR b = 31 TO curx + 1 STEP -1 + buf(b, cury) = buf(b - 1, cury) + NEXT b + buf(curx, cury) = ASC(a$) + curx = curx + 1 + m = 1 +END IF + +IF eb < 0 THEN eb = 0 +IF curx < 0 THEN curx = 0 +IF cury < 0 THEN cury = 0 +IF curx > 31 THEN curx = 31 +IF cury > 31 THEN cury = 31 +GOTO 1 +4 + +END SUB + +SUB fdisp +IF fline < 0 THEN fline = 0 +IF fline > 1000 THEN fline = 1000 +IF fline - froll > 10 THEN froll = fline - 10 +IF fline - froll < 0 THEN froll = fline +IF froll < 0 THEN froll = 0 + +LOCATE 17, 1 +PRINT SPACE$(80) +LOCATE 17, 1 +PRINT "file: " + filename$ + +LOCATE 17, 20 +PRINT "line:"; fline + +FOR a = 0 TO 10 + LOCATE a + 18, 1 + IF a + froll = fline THEN + COLOR 10 + IF fil$(a + froll) = SPACE$(LEN(fil$(a + froll))) THEN + FOR b = 1 TO 80 + PRINT CHR$(219); + NEXT b + GOTO 7 + END IF + ELSE + COLOR 12 + END IF + PRINT fil$(a + froll) + SPACE$(80 - LEN(fil$(a + froll))); +7 +NEXT a + +COLOR 15 +END SUB + +SUB fopen (a$) +filename$ = a$ +FOR b = 0 TO 1000 + fil$(b) = "" +NEXT b + +b = 0 +OPEN filename$ FOR INPUT AS #2 +5 +IF EOF(2) <> 0 THEN GOTO 6 +LINE INPUT #2, c$ +fil$(b) = c$ +b = b + 1 +IF b > 1000 THEN GOTO 6 +GOTO 5 +6 +CLOSE #2 + +fline = 0 +froll = 0 +fdisp +END SUB + +SUB llen (a, l) +FOR b = 31 TO 0 STEP -1 +IF buf(b, a) <> 255 THEN l = b + 1: GOTO 3 +NEXT b +l = 0 +3 +END SUB + +SUB load (a) +DIM c AS LONG +DIM a1 AS LONG +a1 = a +c = a1 * 1024 +SEEK #1, c + 1 +FOR y = 0 TO 31 + FOR x = 0 TO 31 + GET #1, , byte + buf(x, y) = ASC(byte) + NEXT x +NEXT y +END SUB + +SUB save (a) +DIM c AS LONG +DIM a1 AS LONG +a1 = a +c = a1 * 1024 +SEEK #1, c + 1 +FOR y = 0 TO 31 + FOR x = 0 TO 31 + byte = CHR$(buf(x, y)) + PUT #1, , byte + NEXT x +NEXT y +SOUND 5000, .1 +END SUB + +SUB start +SCREEN 12 +COLOR 15 +eb = 7 + +filename$ = "" +fline = 0 +froll = 0 +keyl = 0 +keyc = 0 + +OPEN "font.dat" FOR BINARY AS #1 +FOR f = 0 TO 255 +FOR y = 0 TO 7 +GET #1, , byte +n = ASC(byte) +b = 128 +FOR a = 0 TO 7 +IF n >= b THEN n = n - b: c = 15 ELSE c = 0 +b = b / 2 +PSET (a, y), c +NEXT a +NEXT y +GET (0, 0)-(7, 7), font(0, f) +NEXT f +CLOSE #1 + +FOR y = 0 TO 31 +FOR x = 0 TO 31 +obuf(x, y) = -1 +NEXT x +NEXT y + +LOCATE 1, 34 +PRINT "F1 - clear page" +LOCATE 2, 34 +PRINT "F2 - enter decimal number" +LOCATE 3, 34 +PRINT "F3 - goto page" +LOCATE 4, 34 +PRINT "F4 - enter character code" +LOCATE 5, 34 +PRINT "F5 - load source file" +LOCATE 6, 34 +PRINT "F6 - insert line from source file" +LOCATE 7, 34 +PRINT "F7 - copy line to source file" + +LOCATE 1, 71 +PRINT "code:" +END SUB + diff --git a/util/font.dat b/util/font.dat new file mode 100755 index 0000000000000000000000000000000000000000..980f716caf02d52de1a8efb37f02d3147d953c2d GIT binary patch literal 2048 zcma)7KWigL6n{9NYLQ(INZ61nRT%Dqyd;bKDFP`6-!U9yLR5)`ENjOc;fj2K`wXd5 zq+DWHQVhP%F-RCyBE{X|N?yV+%I`P3zB*6Zee?dz`#1C6isWD9A`+_}AB^T-&PN9l z>mCc`RqW-!NnV4d9Qd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 2000000 +CLOSE #1 + +SYSTEM + +SUB byter (fi, addr, d) +SEEK #1, addr + 1 +GET fi, , byte +d = ASC(byte) +END SUB + +SUB bytew (fi, d, addr) +SEEK #1, addr + 1 +byte = CHR$(d) +PUT #1, , byte +END SUB + +SUB dwordr (fi, a, f) +byter fi, a, b +byter fi, a + 1, c +byter fi, a + 2, d +byter fi, a + 3, e +f = e * 16777216 +f = f + d * 65536 + c * 256 + b +END SUB + +SUB dwordw (fi, b, a) +c = b +d = c \ 16777216 +c = c - (d * 16777216) + +e = c \ 65536 +c = c - (e * 65536) + +f = c \ 256 +c = c - (f * 256) + +bytew fi, c, a +bytew fi, f, a + 1 +bytew fi, e, a + 2 +bytew fi, d, a + 3 +END SUB + +DEFSNG A-Z +SUB getson (a$) +mitus = 0 + +d = 1 +FOR b = 1 TO LEN(a$) +c$ = RIGHT$(LEFT$(a$, b), 1) +IF c$ = " " THEN +d = 1 +ELSE +IF d = 1 THEN +mitus = mitus + 1 +sona$(mitus) = "" +d = 0 +END IF +sona$(mitus) = sona$(mitus) + c$ +END IF +NEXT b +END SUB + +SUB savepath +a$ = COMMAND$ + "\" +f$ = "" +ext$ = "" +t$ = "" +m = 0 +FOR b = 1 TO LEN(a$) + c$ = RIGHT$(LEFT$(a$, b), 1) + IF c$ = "." THEN m = 1: GOTO 3 + IF c$ = "\" THEN + IF ext$ = "" THEN ext$ = "list" +4 IF LEN(ext$) < 4 THEN ext$ = ext$ + "_": GOTO 4 + t$ = t$ + ext$ + f$ + "\" + f$ = "" + ext$ = "" + GOTO 3 + END IF + IF m = 0 THEN f$ = f$ + c$ ELSE ext$ = ext$ + c$ +3 +NEXT b +t$ = LEFT$(t$, LEN(t$) - 1) + +' PRINT a$ +' PRINT t$ + +t$ = t$ + CHR$(254) +SEEK #1, 2000005 +PUT #1, , t$ + + + + +END SUB + +SUB start + +IF COMMAND$ = "" THEN END + +srcfile$ = COMMAND$ + + +END SUB + diff --git a/util/insert.bas b/util/insert.bas new file mode 100755 index 0000000..d40265f --- /dev/null +++ b/util/insert.bas @@ -0,0 +1,50 @@ +DECLARE SUB getson (a$) +DECLARE SUB start () +DIM SHARED mitus, sona$(1 TO 50) +DIM SHARED byte AS STRING * 1 + +start + +OPEN sona$(1) FOR BINARY AS #1 +PRINT "Seeking to:" + sona$(3) +SEEK #1, VAL(sona$(3)) + 1 +OPEN sona$(2) FOR BINARY AS #2 +2 +IF EOF(2) <> 0 THEN GOTO 1 +GET #2, , byte +PUT #1, , byte +GOTO 2 +1 +CLOSE #2 +CLOSE #1 + +SYSTEM + +SUB getson (a$) +mitus = 0 + +d = 1 +FOR b = 1 TO LEN(a$) +c$ = RIGHT$(LEFT$(a$, b), 1) +IF c$ = " " THEN +d = 1 +ELSE +IF d = 1 THEN +mitus = mitus + 1 +sona$(mitus) = "" +d = 0 +END IF +sona$(mitus) = sona$(mitus) + c$ +END IF +NEXT b +END SUB + +SUB start + +IF COMMAND$ = "" THEN END + +getson COMMAND$ + + +END SUB + diff --git a/util/src25th.bas b/util/src25th.bas new file mode 100755 index 0000000..af0a924 --- /dev/null +++ b/util/src25th.bas @@ -0,0 +1,65 @@ +DECLARE SUB chl (a$, b$) +DECLARE SUB getline (a$) +DECLARE SUB start () +DIM SHARED byte AS STRING * 1 +DIM SHARED er + + +start + +OPEN COMMAND$ + ".src" FOR INPUT AS #1 +IF er = 0 THEN KILL COMMAND$ + ".5th" +OPEN COMMAND$ + ".5th" FOR BINARY AS #2 + +1 +IF EOF(1) <> 0 THEN GOTO 2 +LINE INPUT #1, a$ + +c$ = "" +e$ = "" +FOR b = 1 TO LEN(a$) +d$ = RIGHT$(LEFT$(a$, b), 1) +IF d$ = " " THEN chl e$, c$: c$ = c$ + CHR$(255): GOTO 3 +IF d$ = CHR$(9) THEN chl e$, c$: c$ = c$ + CHR$(253): GOTO 3 +e$ = e$ + d$ +3 +NEXT b +chl e$, c$ +c$ = c$ + CHR$(254) +FOR b = 1 TO LEN(c$) + byte = RIGHT$(LEFT$(c$, b), 1) + PUT #2, , byte +NEXT b +GOTO 1 +2 + +CLOSE #2 +CLOSE #1 + +SYSTEM + + +SUB chl (a$, b$) + +e$ = "" +FOR c = 1 TO LEN(a$) +d = ASC(RIGHT$(LEFT$(a$, c), 1)) +IF (d >= 48) AND (d <= 57) THEN d = d - 48: GOTO 4 +IF (d >= 65) AND (d <= 70) THEN d = d - 55: GOTO 4 +IF (d = 45) AND (c = 1) THEN GOTO 4 +GOTO 5 +4 +e$ = e$ + CHR$(d) +NEXT c +a$ = e$ +5 + +b$ = b$ + a$ +a$ = "" +END SUB + +SUB start +IF COMMAND$ = "" THEN END +er = 0 +END SUB + -- 2.20.1