\section[title={NedoOS -- Multitasking operating system for ZX Spectrum},reference={nedoos-multitasking-operating-system-for-zx-spectrum}] \subsection[title={Features},reference={features}] \startitemize[packed] \item Works with TR-DOS floppies, SD-card, IDE HDD (FAT12/16 or FAT32 with long filenames support). Device letters: \startitemize[packed] \item \quotation{E}..\quotation{H}~-- IDE HDD (Master), \item \quotation{I}..\quotation{L}~-- IDE HDD (Slave), \item \quotation{M}~-- SD-card (Z-controller), \item \quotation{N}~-- SD-card (NeoGS), \item \quotation{O}~-- USB flash, \item \quotation{A}..\quotation{D}~-- TR-DOS floppies. IDE controller (ATM or Nemo IDE) depends on the batch file you run. Includes support for segmented TR-DOS files of any size (according to TR-DOS sequential access files standard). \stopitemize \item Up to 16 tasks running at the same time. Tasks may be active (one of them has the focus, so it can read input devices and print on visible terminal screen) or frozen. Tasks may give away their time slot to the system using \type{YIELD}, but don't have to. \item NedoOS can open up to 8 files on FAT, up to 8 files on TR-DOS, and up to 8 pipes between tasks at the same time. \item User program can access the whole memory between 0x0100..0xffff, any 16K window can be switched via OS calls (see below). File operations and BDOS data transfer can be done at any address in the userspace. \item User programs can modify the interrupt handler (for example, to restore stack data) and move the stack pointer. \item Gfx editor Scratch, music players NedoPlayer and modplay, text editor texted, disk image mounter dmm, snapshot runner/switcher nmisvc, compiler NedoLang, assembler NedoAsm, basic interpreter NedoBasic, picture viewer NedoView, decompressors for \type{*.zip}, \type{*.gz}, \type{*.rar}, \type{*.tar} and archivers for \type{*.rar} and \type{*.tar}, network utilities (NedoBrowser, dmirc, dmftp, netterm etc.), games\ldots{} \stopitemize \subsection[title={System requirements},reference={system-requirements}] \startitemize[packed] \item ATM Turbo 2 or ATM3 compatible computer (depends on the main executable) \item Kempston mouse with a wheel recommended \item SD-card recommended (Z-Controller with shadow ports or NeoGS) or harddrive (NemoIDE or ATM IDE) \item DDp's palette scheme (4+4+4) recommended \item Real-time clock (Mr.Gluk's schematics) recommended \item ZXNETUSB network interface card recommended \item General Sound or NeoGS sound card recommended \item TurboSound FM sound card recommended \stopitemize \subsection[title={Keyboard shortcuts},reference={keyboard-shortcuts}] NedoOS handles keys and mouse events and forwards them to the task that is in focus. The key combinations Ext+letter (Tab+letter) correspond to ASCII control codes 1..26. The Ext+Number key combinations (Tab+Number, CapsShift+SymbolShift+Number) are equivalent to function keys F1..F10 on a PS/2 keyboard. Keyboard shortcuts used by the kernel (PS/2 shortcuts are shown in brackets): \startitemize[packed] \item Caps Shift (Left Shift)~-- hold down to stop scrolling on the screen \item Symbol Shift + Enter (Right Shift + Enter)~-- switches visual tasks (that is, those that called \type{CMD_SETGFX}), while the task to which they were switched receives the \type{key_redraw} key code (upon learning this, it can redraw the screen) \item C+M+D (press simultaneously)~-- execute \type{cmd.com} if there are no active tasks. (polled in the idle task, so it works only when there are no active tasks). To spawn a new terminal, use the command \type{term}. \item Caps Shift + 2 (Caps Lock)~-- switch case \item Caps Shift + 1 (Alt + Shift)~-- switch between keyboard layouts (Russian/English). In the Russian mode (it also supports the Ukrainian language), the ШВЕРТЫ layout is enabled. In this case, you can type some letters by two presses (ja=я, jo=ё, ju=ю, je=є, ji=ї, jy=i, cg=_, cc=ц, hh=э, jj=ъ). Because letters \quotation{й}, \quotation{ц}, \quotation{ш}, \quotation{э} are used as a prefix of combinations, you can input them separately by pressing any other key after them that is not included in their combination. The key pressed afterward is not ignored, but also processed. In the literary text, the combinations \quotation{йа}, \quotation{йо}, \quotation{йу}, \quotation{йe}, \quotation{чч}, \quotation{хх}, \quotation{йи}, \quotation{йы}, \quotation{йй}, \quotation{цг} are practically excluded (sometimes in foreign words). To enter such combinations use cursor movement. All punctuation marks available in Latin mode are also available in Russian. The Russian encoding is CP866 and CP1125 is used as Ukrainian encoding. \item Ext+Enter (Tab+Enter, Caps Shift+Symbol Shift+Enter, use Tab+Right Shift+Enter on incompatible keyboards)~-- switch on/off the pseudo-graphic input mode \item In case of TR-DOS errors (the red border is shown), the R (Retry), I (Ignore sector), A (Abort) keys work. \stopitemize \subsection[title={cmd -- Command interpreter},reference={cmd-command-interpreter}] It is an interactive prompt (command line) with scrolling to the left and right. Cursor key Up will recall the previous command. Following file types are executed (the first character of the extension is checked): \startitemize \item .com (the extension can be omitted)~-- an executable program, a new parallel process is created. Command-line parameters are passed to the process to the \type{COMMANDLINE} address (see the \quotation{Programming} section). \item .bat is a sequence of commands that \type{cmd} understands, including starting .com programs (commands are executed sequentially and not concurrently, except when the \type{start} command is used). Each command is shown on the screen before it is executed. \stopitemize Programs located in the \type{bin/} directory of the system disk can be executed in the command line from any directory of any disk (the current directory has priority for calling programs before the \type{bin/} directory). The current directory does not change when programs are executed. The following commands (and their aliases) are supported: \startitemize[packed] \item \type{exit}~-- quit cmd \item \type{a:} \ldots{} \type{o:}~-- change the current disk \item \type{dir (ls)}~-- list the content of the current directory. You can redirect output to a file: \type{dir> filename} \item \type{cd }~-- change the current directory to . can contain a drive name. \item \type{cd ..}~-- change directory to the parent directory. \item \type{md (mkdir) }~-- create a new directory with the specified name in the current or the specified path \item \type{del (rm) }~-- delete a file or an empty directory in the current directory \item \type{copy (cp) }~-- copy file \item \type{ren }~-- rename or move file \item \type{mem (free)}~-- print the number of free memory pages \item \type{proc (ps)}~-- list current processes and their state (\quotation{+} or \quotation{-}~-- activity, \quotation{g} for graphical tasks) \item \type{drop (kill) }~-- terminate the process with the given ID \item \type{date}~-- print current date and time \item \type{rem}~-- do nothing (needed for comments in .bat files) \item \type{start }~-- execute the program in the background (by default, the executed program blocks \type{cmd}) \item \type{copydir }~-- recursive copy of the {\em dir1} directory with all files to the {\em dir2} directory. Full paths must be specified, not relative! \item \type{pause}~-- wait for a keypress (used in \type{.bat} files) \item \type{echo }~-- print a message (needed for \type{.bat} files) \item \type{type }~-- print file content \stopitemize You can also use the complex syntax: \starttyping dir > filename.txt dir | more.com more < filename.txt \stoptyping The command-line parameters of the .bat file are available through macros \type{%0} to \type{%9} (\type{%0} contains the filename of the script). The {\em idle} system task launches the \type{term.com} terminal, which creates stdin and stdout pipes and launches the shell to execute \type{autoexec.bat}. When there is no running process, the {\em idle} enters into an infinite loop and it is waiting for C+M+D key combination (see above). When launched, the shell looks at its command line and executes it. If the command line is \type{cmd.com autoexec.bat}, the shell enters interactive mode after \type{autoexec.bat} is executed, otherwise exits. You can start another independent terminal with \type{term} command or a network terminal (\type{netterm}) accessible via Telnet (TCP/IP port 2323). \subsection[title={nv, nvfast -- Nedovigator, dual-pane file manager},reference={nv-nvfast-nedovigator-dual-pane-file-manager}] Keyboard short cuts: \startitemize \item cursor keys (up, down)~-- navigate through files \item Home (Symbol Shift+Q)~-- jump to the first file \item End (Symbol Shift+E)~-- jump to the last file \item Tab (Caps Shift+Symbol Shift)~-- change the current panel \item Space~-- tag file \item \type{*}~-- invert tagging \item BackSpace (Caps Shift+0)~-- switch to the parent directory \item Enter~-- launch the file under cursor in the blocking mode (\type{.com} and \type{.$c} are launched directly, other types may use the external launchers, see below) \item Enter~-- execute command line in the blocking mode, then \type{nv} will release the focus and will wait till the end of the called program or till \type{OS_HIDEFROMPARENT}in that program. Text output of the finished program can be displayed with the mouse wheel (in \type{nv}) or Esc (in \type{nvfast}). \item Caps Shift+Enter or F9~-- insert the file name on the command line \item 3~-- text files viewer \startitemize[packed] \item use cursor keys, PageUp (Caps Shift+3), PageDown (Caps Shift+4), \item s~-- switch encoding, \item w~-- switch line breaks, \item Break (Esc, Caps Shift + Space)~-- exit, \item Tab (Caps Shift + Symbol Shift)~-- switch to hex viewer/editor: \startitemize[packed] \item use cursor for moving control, PgUp, PgDn, \item input numbers and A-F \item Caps Shift+Enter or F2~-- save, \item Break (Esc, Caps Shift + Space)~-- exit, \item Tab (Caps Shift + Symbol Shift)~-- go to the normal text viewer \stopitemize \stopitemize \item 4~-- open the text editor {\em texted} to modify the file under the cursor \item 5~-- copy marked files or the file under the cursor to the opposite panel \item 6~-- rename the file/directory (do not use \quotation{/} and "" in the name) \item 7~-- create a directory in the current panel (Esc {[}CS+Space{]} - cancel) \item 8~-- delete tagged files (only empty directories are deleted) \item 1, 2~-- select a drive in the left or right panel (cursor, Esc {[}CS+Space{]} to cancel, Enter~-- confirm selection) {\bf Note:} Instead of numbers, you can press F1..F10 on the PS/2 keyboard. \item Symbol Shift+1..5~-- select sorting mode (by name, extension, size, date, and no sorting). The sorting order is reversed if the same mode is invoked a second time. The change to a different mode will use the ascending order. \item Break (Esc, Caps Shift + Space)~-- exit (Esc~-- cancel, Enter~-- confirm) \stopitemize The remaining keys are used to edit the command line (numbers are not entered when the command line is empty). The text output of the launched program from the command line is saved (but not a program launched in another terminal). See above, how to display it. The configuration file \type{nv.ext} describes the association which launcher is used for the given file extension, for example: \starttyping bmp, scr: scratch.com bat: cmd.com \stoptyping \subsection[title={texted -- Text editor},reference={texted-text-editor}] Provide \type{texted} with the name of the file for editing as the command line parameter. The file size is only limited by the amount of available free memory. Shortcuts: \startitemize[packed] \item cursor keys, PageUp (Caps Shift+3), PageDown (Caps Shift+4)~-- cursor movement \item Home (Symbol Shift+Q)~-- jump to the beginning of the line \item End (Symbol Shift+E)~-- jump to the end of the line \item BackSpace (Caps Shift+0)~-- delete a character before the cursor \item Del (Caps Shift + 9)~-- delete a character to the right of the cursor \item Caps Shift+Enter or F2~-- save \item Break (Esc, Caps Shift + Space)~-- exit \stopitemize Other keys are used to input the text. \subsection[title={basic -- NedoBasic, BASIC interpreter},reference={basic-nedobasic-basic-interpreter}] Files with \type{*.bas} extension can be called as command line parameter. Data types: \startitemize[packed] \item integers (32bit signed), can be used for boolean values (0=false, -1=true). If used as an index for a cycle, they consume more memory, \item strings (up to 255 bytes + zero terminator), also used as an array of unsigned bytes, \item one-dimensional arrays of integers (32bit signed). \stopitemize Variable names must consist of only one alphabetical character, for example: \startitemize[packed] \item \type{i} (number), \item \type{a$} (string), \item \type{a(10)} (10th element of the array, counting from 0), \item \type{a$(10)} (10th character of the string, counting from zero). \stopitemize The following operations are used in expressions: \startitemize[packed] \item lowest priority: =, <, >, <=, >=, <> \item medium priority: +, - \item high priority: * and / \item highest priority: unary -, expression brackets () \stopitemize The function \type{$rnd} generates random numbers in the range 0..65535, at least one space must be used after the function name! Commands (it is possible to join several commands on one line separated by a colon): \startitemize[packed] \item \type{run}~-- start the program \item \type{list}~-- view the listing of the program \item \type{quit}~-- exit NedoBasic \item \type{edit }~-- call to edit the line with the specified number \item \type{clear}~-- clear variables \item \type{new}~-- erase the program \item \type{let =} \item \type{print ; }~-- if the last character is a semicolon, then no line feed is printed at the end) \item \type{cls}~-- clear the screen in black \item \type{goto }~-- jump to the specified line number. When the number does not exist the program will continue from the next line after the used one. \item \type{if then }~-- if expression is not false, execute commands to the end of the line \item \type{dim ()}~-- create an array of specified size \item \type{for = to step } ~-- the beginning of the cycle. Step can be positive or negative, but not 0. \item \type{rem }~-- use for text comments \item \type{next }~-- the end of for-cycle \item \type{gfx 0}~-- enable graphic mode 320x200x16 colors \item \type{gfx 6}~-- enable text mode (when the program exits, it will automatically enable text mode back) \item \type{pause}~-- waiting for the keypress \item \type{plot , , }~-- draw a point in the graphic mode \item \type{line , , }~-- draw a line in the graphic mode (from the previous point or the end of the previous line) \item \type{save }~-- save the program. The filename can contain the path, for example, \quotation{m:/path/file.bas}. The filename can be also a string variable. \item \type{load }~-- load a program. The filename can contain the path, for example, \quotation{m:/path/file.bas}. The filename can be also a string variable. \item \type{system }~-- launch a command via \type{cmd}, it is waiting for completion. Also, a string variable can be used. \stopitemize Press Esc (Break, CS+Space) to break the execution of the program or code scrolling. \subsection[title={tp -- Turbo Pascal 3.0 by Borland},reference={tp-turbo-pascal-3.0-by-borland}] Short cuts are displayed on the screen. Source code can be compiled to the memory or file. English documentation is located in: \starttyping http://www.retroarchive.org/docs/software/turbodoc.html \stoptyping See examples~-- \type{t.pas} (\quotation{Hello} in a cycle), \type{mc.pas} (spreadsheet). \subsection[title={cc, cc2, clink, c.ccc, deff.crl, deff2.crl -- BDS C compiler},reference={cc-cc2-clink-c.ccc-deff.crl-deff2.crl-bds-c-compiler}] BDS C compiler was developed by Brain Damage Software. Example: \type{cc.bat ex} (compile \type{ex.c}, link and run the code). \starttyping #include main(argc, argv) char **argv; { int i; printf("Hello world!\n"); for (i = 1; i < argc; i++) printf("Arg #%d = %s\n",i,argv[i]); getchar(); } \stoptyping Compiler collection examples and usage: \startitemize[packed] \item \type{cc filename.c} \item \type{cc2}~-- second compilation is invoked automatically \item Object files and libraries have the \type{.crl} extension (deff2.crl is automatically connected by the linker). Examples of libraries are \type{deff2a.csm}, \type{deffgfx.csm}. \item Link object file to executable: \startitemize[packed] \item \type{clink filename} \item \type{clink filename deffgfx} (see \type{cc.bat} and example \type{ex.c}) \stopitemize \item How to build the concatenation tool (\type{concat outfile infile1 infile2}): \startitemize[packed] \item \type{cc concat.c} \item \type{clink concat} \stopitemize \stopitemize \subsection[title={player -- NedoPlayer},reference={player-nedoplayer}] The simple music player for \type{*.pt2}, \type{*.pt3} (with TurboSound support) and \type{*.tfc} formats. Use the command-line parameter to specify the filename for playing. Prints the filename when the screen is refreshed. To exit use Break (Esc, Caps Shift+Space). \subsection[title={modplay},reference={modplay}] The simplest MOD music player for General Sound compatible sound cards. Use the command-line parameter to specify the filename for playing. Launching without parameters is going to stop playback. \subsection[title={pkunzip},reference={pkunzip}] Unpacker for \type{*.zip} and \type{*.gz} archives. It unpacks the entire archive to the current directory. \subsection[title={tar},reference={tar}] Unpacker for \type{*.tar} archives. It unpacks the entire archive to the current directory. If the parameter is not a \type{.tar} archive, then this is a file from which the archive will be created (if a directory is specified, then it will all be packed into an archive with all content, files, and directories). The archive name corresponds to the file name, with the extension replaced by \type{.tar}. \subsection[title={unrar -- Unpack \type{*.rar} (2.x) archives},reference={unrar-unpack-.rar-2.x-archives}] It reads the name of the archive via the command line, then it works in the interactive mode. \startitemize[packed] \item v~-- view the contents of the archive \item e~-- unpack necessary files from the archive \item m~-- enter a mask for files (the first characters of the file name in the archive, including the internal path) \stopitemize \subsection[title={zxrar -- Packer of (2.x) \type{*.rar} archives},reference={zxrar-packer-of-2.x-.rar-archives}] It reads the name of file via the command line and creates archive \type{mynewrar.rar} or adds to it. \subsection[title={browser -- NedoBrowser, web browser},reference={browser-nedobrowser-web-browser}] NedoBrowser is a text-based web browser. Invoke from the command line: \startitemize[packed] \item \type{browser file://m:/girl.jpg} (\type{file://} is optional) \item \type{browser http://alonecoder.nedopc.com/} (\type{http://} and the trailing slash is optional in the URL) \item HTTPS protocol (https://) is supported with a proxy. \stopitemize The status bar is displayed at the bottom of the screen, it contains: \startitemize[packed] \item full path to the current file \item number of busy pages \item rendering time \item errors (conn.err~-- connection error, load err~-- loading error) \stopitemize Following formats are supported: \startitemize[packed] \item html (does not support all tags yet and displays only windows-1251 and UTF-8 encodings {[}by default{]}), \item jpeg (so far only plain scan), \item gif (so far only normal scan, animations are supported), \item png (only normal scan for now), \item bmp (so far only normal line order, 24bit), \item svg (no fill, coordinates in a limited range). \item For large pictures use cursor keys, Z~-- changes the scale. \stopitemize Short cuts: \startitemize[packed] \item cursor keys, PageUp (Caps Shift+3), PageDown (Caps Shift+4)~-- movement \item Enter~-- follow the link \item S~-- save the current file (it will be saved as \type{download.fil}, the first letter is increased with each file) \item L~-- download the file from the hyperlink (calls the \type{wget} program) \item 5~-- reload the file \item E~-- edit url (arrows left, right, Enter, BackSpace {[}Caps Shift+0{]}) \item U~-- change encoding UTF-8 / windows-1251 \item BackSpace (Caps Shift + 0)~-- back in the browsing history \item Break (Esc, Caps Shift + Space)~-- exit browser \stopitemize \subsection[title={wget},reference={wget}] The non-interactive HTTP downloader. It with play music files and display \type{*.src} images automatically. \subsection[title={dmm},reference={dmm}] The tool for mounting of TRD, SCL, FDI, TAP images via Evo Service. Can also mount TRD images using xBIOS ROM at ATM2. \subsection[title={time},reference={time}] The tool for network time protocol (NTP). Command-line options: \startitemize[packed] \item \type{-H} help \item \type{-T} set time(-T17:59:38) \item \type{-D} set date(-D21-06-2019) \item \type{-N} ntp-server default: -N2.ru.pool.ntp.org \item \type{-Z} time-zone default: -Z3 \item \type{-i} get date time from the internet \stopitemize \subsection[title={dmirc -- IRC client},reference={dmirc-irc-client}] \subsection[title={dmftp -- FTP client},reference={dmftp-ftp-client}] \subsection[title={ping},reference={ping}] Send ICMP \type{ECHO_REQUEST} to network hosts. Example: \type{ping 1.2.3.4}. \subsection[title={telnet -- Telnet client},reference={telnet-telnet-client}] The user interface to the TELNET protocol. The TCP port can be specified with: \type{telnet url:1234}, the default port is 23. \subsection[title={3ws -- Web server},reference={ws-web-server}] The web server supports the sharing of the system disk. See \type{3ws.txt} for more details. You can use your own page design (files in the subdirectory of the same name). \subsection[title={wizcfg},reference={wizcfg}] Provides basic network setup of ZXNETUSB. It uses configuration saved in \type{net.ini}. \subsection[title={nmisvc},reference={nmisvc}] Launches and translates snapshot. Runs a \type{.SNA} snapshots (48K or 128K) specified on the command line. Exit the snapshot to OS by pressing the NMI button. You can save the memory state to a new snapshot or continue the execution. At the same time, you can manually switch to another task in the OS. OS allows you to between snapshots and the system. It can also run BASICs from TR-DOS disc. \subsection[title={view -- NedoView, image viewer},reference={view-nedoview-image-viewer}] NedoView supports the following graphics formats: \startitemize[packed] \item scr (6144 and 6912) \item fnt (linear and screen format, 768 and 2048) \item img (dual screens with interlace) \item 3 (AGA editors, 8col) \item 888 (8col editor) \item \type{+} or \type{-} (MultiStudio editor) \item Y (packed 8-color picture for the ManyColor+/XColor) \item plc (Laser Compact 5, BGE) \item mc (multicolor) \item mlt (multicolor from ZX Paintbrush editor) \item mcx (multicolor with interlace) \item grf (hardware multicolor ATM/Profi) \item ch\$ (large pictures with attributes, with or without interlace) \item mg1, mg2, mg4, mg8 (MultiArtist editor) \item rm (R-Mode) \item 16c (32K memory image + 32 bytes palette) \stopitemize \subsection[title={hddfdisk},reference={hddfdisk}] Utility for partitioning and formatting IDE partitions. \subsection[title={term},reference={term}] Terminal emulator for programs that use \type{stdio.asm}. \startitemize[packed] \item Transmits ANSI codes (VT-100+) with mouse events. \item Scrolling with the mouse wheel. \item Mouse click in the top left corner will save terminal text to \type{pasta.txt} \item Mouse click in the bottom left corner will insert 80 characters from \type{pasta.txt}. \stopitemize \subsection[title={netterm -- TELNET server},reference={netterm-telnet-server}] The network terminal server listens on port 2323. Supports programs that use \type{stdio.asm}. Set the following configuration in your telnet client (for example PuTTY): \startitemize[packed] \item VT-100 \item Local echo off \item Local line editing off \item Backspace = Control-H \stopitemize \subsection[title={pt -- Pro Tracker 3.x},reference={pt-pro-tracker-3.x}] Pro Tracker 3.x provides a larger window and supports hard disk and General Sound (see the manual in a separate file). \subsection[title={playtap -- Player for \type{.tap} files.},reference={playtap-player-for-.tap-files.}] TAP files are played on your physical tape output. The file to play must be named \type{tilt.tap}. \subsection[title={Programming (for details see \type{api_base.txt})},reference={programming-for-details-see-api_base.txt}] User programs are compiled with the header file \type{../_sdk/sys_h.asm}, which includes the file \type{sysdefs.asm} with constants. Programs are loaded and run with \type{PROGSTART} (0x0100), with the command line in \type{COMMANDLINE} (0x0080) and with its length stored at \type{COMMANDLINE_sz} (0x0080). It is highly recommended to use these constants rather than numeric values (the same goes for key codes, call numbers, etc.). The stack initially grows from the top of 0x0000, it can be manually rearranged to any place above 0x3b00. File operations and data transfers in BDOS can be done at any address in the userspace. It is not recommended to read keyboard ports manually, use \type{OS_GETKEYMATRIX}~-- it returns the pressed keys only to the task that is currently in focus. It is not recommended to use the \type{syssets.asm} dependency in user programs. Application developers use the symbolic key names defined in \type{sysdefs.asm} under \quotation{Usable key codes}. The system is currently unable to assemble itself. To reach this goal, we will follow a number of guidelines for programming in assembly language: \startitemize[packed] \item it is not recommended to use external utilities (\type{*.exe}) for building programs, except for the assembler and the NedoLang package. \item it is recommended to format hexadecimal numbers in the 0xffff format, it is not recommended to use binary numbers (in extreme cases, write in the 0b0101 format). \item it is recommended to write arithmetic expressions so that they are executed correctly even in the absence of priority of operations. If this requires starting an expression with a parenthesis, write a + sign before the parenthesis. \item it is recommended to write arithmetic expressions so that they are executed correctly in unsigned multiplication and division. \item it is not recommended to use \type{ifn a == b}, use \type{if a != b}. \item it is not recommended to use \type{ORG} other than the initial one. Use \type{ds addr-$}. \item it is not recommended to use \type{DUP..EDUP}, you can use \type{include} for large blocks, and expand small ones. \item it is not recommended to use \type{EQU} and \type{STRUCT}, use the \quotation{=} sign. \item it is not recommended to use digital labels and transitions of type 1b (especially transitions of type 1f!). \item it is not recommended to write several commands in a line and several sets of parameters for one command. \item it is not recommended to use UTF-8 encoding, use Windows-1251 or CP866 instead. \stopitemize As the native build system will be improved, these restrictions will be relaxed. Restarts in the kernel (it is highly recommended to use them through macros since it is planned to free 0x0000 for the user, make \type{CALLBDOS} a restart, and \type{SETPG...} calls for speed): \startitemize[packed] \item \type{QUIT (0x0000)}~-- close the current task and free its memory \item \type{CALLBDOS (0x0005)}~-- calling BDOS (see functions in \type{sys_h.asm}, function number in C). You should not call this macro directly, for each command there is a separate macro \type{OS_...}. Registers are not saved! \item \type{GET_KEY (0x0008)}~-- read a key (HA=code with language, BC=code without language, key codes are specified in \type{sys_h.asm}) and read the mouse at the same time (de=mouse position (y, x), l=mouse buttons (bits 0, 1, 2: 0=pressed)), nz=the program is not in focus, the buttons are not displayed, the mouse position must be ignored (=0) \item \type{PRCHAR (0x0010)}~-- print character A (registers are not saved!) \item \type{SETPG16K (0x0018)}~-- enable page A at 0x4000 (corrupts the BC register). The page number is stored in (CURPG16K) \item \type{SETPG32KLOW (0x0020)}~-- enable page A at 0x8000 (corrupts the BC register). The page number is stored in (CURPG32KLOW) \item \type{SETPG32KHIGH (0x0028)}~-- enable page A at 0xc000 (corrupts the BC register). The page number is stored in (CURPG32KHIGH) (switch the page at 0x0000 via \type{OS_SETMAINPAGE}, while the page must have a kernel!) \item 0x0030~-- far call is planned \item 0x0038~-- interrupt handler \stopitemize BDOS functions: see \type{sys_h.asm}. The entry to the standard interrupt handler looks like this: \starttyping push af push bc push de \stoptyping How to capture an interrupt handler in your program: \startitemize[packed] \item replace 3 bytes at 0x0038 with \type{jp
}, and take the \type{intjp} address from 0x0038+3 and copy to yourself. \stopitemize For example: \starttyping swapimer ;the first call will turn on your handler, ;the second call will return the standard handler di ld hl, (0x0038 + 3) ;address intjp ld (intjpaddr), hl ld de, 0x0038 ld hl, oldimer ld bc, 3 swapimer0 ld a, (de) ldi ;[oldimer] -> [0x0038] dec hl ld (hl), a ;[0x0038] -> [oldimer] inc hl jp pe, swapimer0 ei ret oldimer jp on_int ;will be replaced with the code from 0x0038 jp 0x0038 + 3 \stoptyping \startitemize[packed] \item your interrupt handler should call \type{oldimer}. For example: \stopitemize \starttyping on_int ex de, hl ;de = "hl", hl = "de" ex (sp), hl ;hl = exit address, de = "hl", on the stack "de" ld (on_int_jp), hl ld ( on_int_sp), SP ld sp, INTSTACK ;in order not to mess up the stack push af push bc push de ;"hl" ... call oldimer ;ei ... pop de ;"hl" pop bc pop af on_int_sp = $ + 1 ld sp , 0 ; de = "hl", on the stack "de" pop de ; \stoptyping \startitemize[packed] \item do not use \type{YIELD}, use \type{HALT} instead. Otherwise, the interrupt will go to another task, and there is another interrupt handler. \item Call NedoOS functions (except for page switching) either in the interrupt handler or immediately after HALT. \item if you just install your music player, use \type{OS_SETMUSIC}, while you can ignore the previous two points (music will work anyway). \stopitemize \subsection[title={Developers},reference={developers}] \startitemize[packed] \item Project manager, code, documentation~-- Dmitry Mikhailovich Bystrov (Alone Coder/Conscience). \item Networking, patches to the disk subsystem, utilities, testing - DimkaM. \item A bit of code and documentation~-- Nikolay Aleksandrovich Grivin. \item NedoBasic was written with the participation of Kirill Lovyagin as part of the assembly language training. \item Further development of NedoBasic and Nedovigator, build scripts for Linux, utilities~-- demige. \item Sorting files, fixing build scripts for Linux, \type{aynet_psg} utility, sjasm and UnrealSpeccy fixes~-- Lord Vader. \item rdtrd, wrtrd~-- Konstantin Kosarev. \item ZX Battle City game~-- Slip, music~-- nq, testing~-- Videogames Sematary, porting~-- Alone Coder. \item Porting the game Eric and the Floaters~-- Rasmer, coloring~-- Alone Coder, Sashapont. \item Porting the game Black Raven~-- Alone Coder, coloring~-- Alone Coder, Sashapont, Kitty, Louisa. \item Logos~-- Louisa, Sashapont, Wizard. \stopitemize The disk subsystem is based on the FatFS library with drivers from Savelij13 and DimkaM and the iofast library from the NedoLang suite. The operating system idea was brought in 2007 when the first version of the kernel was written (but never tested). The main portion of the kernel code, \type{cmd} and \type{nv}, and part of Scratch graphic editor was written in 2018. \subsection[title={License},reference={license}] Free distribution of the program and its source code is allowed. Please ask for the approval from project manager if you want to port the code or its parts to a different platform. \subsection[title={System setup},reference={system-setup}] Clock usage according to Mr.~Gluk's schematics for ATM2 is tested in UnrealSpeccy 0.37.1. Disk images (the HDD image can be mounted through WinImage, and the SD-card image can be mounted in Windows). Do not forget to unmount it once done: \starttyping http://alonecoder.nedopc.com/sd.zip http://alonecoder.nedopc.com/hdd.zip \stoptyping Installing the system on a real HDD: \startitemize[n,packed][stopper=.] \item Run \type{mkatm2.bat} (or \type{mkatm3.bat} for ATM3). \item Using \type{nv}, copy all the files from the \type{*.trd} received to \type{e:/bin/}. \item Run \type{mkatm2hd.bat} (or \type{mkatm3hd.bat} for ATM3), copy the resulting \type{*.$c} to drive 1. \stopitemize Then you can start the system (\type{*.$c}) from the HDD. Installation of the system on a real SD-card: copy the \type{bin/} directory and the required \type{$c} to the root of a SD-card. Settings for the UnrealSpeccy emulator: \starttyping [ZC] ; Z-Controller settings ; sdcard image SDCARD="sd.vhd" [HDD] Scheme = NEMO-DIVIDE (for ATM3 version) or ATM (for ATM2 version) Image0 = hdd.ima CHS0=609/16/63 ; max size, accessible through CHS. not used for real drive LBA0=614400 ; max size, accessible through LBA. not used for real drive HD0RO=0 ; read only flag CD0=0 ; 1 if image is cdrom \stoptyping \type{eVHDattach.bat} (you can mount also by clicking on \type{*.vhd}): \starttyping d: cd zx\us035\ @echo off if exist VHDattach.txt ( @echo on echo VHDattach.txt exist @echo off ) else ( @echo on echo create VHDattach.txt @echo off echo select vdisk file="%cd%\sd.vhd" > VHDattach.txt echo attach vdisk >> VHDattach.txt rem echo select vdisk file="%cd%\sd.vhd" >> VHDattach.txt rem echo select part 1 >> VHDattach.txt rem echo assign letter=K >> VHDattach.txt ) if exist sd.vhd ( @echo on echo sd.vhd attach diskpart /s VHDattach.txt @echo off ) else ( @echo on echo create VHDcreate.txt @echo off echo create vdisk file="%cd%\sd.vhd" MAXIMUM=300 TYPE=FIXED > VHDcreate.txt echo select vdisk file="%cd%\sd.vhd" >> VHDcreate.txt echo attach vdisk >> VHDcreate.txt echo create part primary >> VHDcreate.txt echo select part 1 >> VHDcreate.txt echo format label="ZX" quick fs=FAT32 >> VHDcreate.txt echo assign >> VHDcreate.txt @echo on diskpart /s VHDcreate.txt del VHDcreate.txt @echo off ) @echo on pause \stoptyping \type{eVHDdetach.bat:} \starttyping d: cd zx\us035\ @echo off if exist VHDdetach.txt ( @echo on echo VHDdetach.txt exist @echo off ) else ( @echo on echo create VHDdetach.txt @echo off echo select vdisk file="%cd%\sd.vhd" > VHDdetach.txt echo detach vdisk >> VHDdetach.txt ) @echo on diskpart /s VHDdetach.txt pause \stoptyping On Windows 10, you can use right-click to mount and unmount.