1st project...
ZXNet echo conference «code.zx»
From Wladimir Nikolaev → To All 16 January 2000
┌─ Forwarded by Wladimir Nikolaev ─────Not─a─niger───
│ Posted from: REAL.NEOS
│ From: Alexander Bondarenko (34:1/90.1) Sat 25 Dec 1999 16:48:24
│ To : All ()
│ Subj: [FWD] 1st project...
└────────────────────────────── ───────────────────────────────
=== So get forwarded msg, All ===
-= STUDIO STALL =-
GOOD DAY, All!
Something is starting to become clearer with the appearance of the operating system...
Let's start from level 0 (if it is in ROM, it can be called BIOS).
Immediately a persuasion - all functions are called via RST #10. Well, you can, in principle,
do this through the kernal - there will be the address of the beginning of the 0th level... Number
functions are in register C. ;))))
If any error occurs, flag C will be set at the output. Number
errors are in register A.
0 - RESET. No comments... In the best traditions of all operating systems.
1 - KEY_IN. Previously, in all CP/M's there were two procedures for polling the board - the first
checked whether any button was pressed, and the second one displayed a symbol. In this
the procedure has both - if nothing is pressed, the Z flag is set. If
pressed - the flag is reset, and in register A - the code of the pressed letter. By the way, the procedure
It can withstand all auto-repetitions and may even have a buffer.
2 - PRN_SYM. This is the printing procedure. Prints the symbol on the screen. Accordingly,
processes control characters. The character code is in register A.3 - SET_RAM. Memory driver. Clicks pages, in window #C000, numbers -
logical, however, the range does not include pages with physical ones. numbers 2 and 5, I
I think you understand why.
4 - SET_DRV - install the drive (A..D).
5,6 - guess 3 times. ;))) (For those who don’t understand, this is a complete analogue
TR-DOS functions, RD_SEC and WR_SEC. All parameters are the same, for
except that A is the memory page number).
7 - GFX_MOD. Sets the graphics mode. Parameters:
A - mode number (0 - normal, 256*192, 1 - monochrome 512*192, 2 - color
512*192, 3 - multicolor button, 4 -...)
B - screen number.
The following procedures can be classified as level 0.5 ;)))
8 - CALL_PG. Call a procedure from another page. At the entrance - A - number
pages, HL - call address...
9 - LDIR_PG. Transferring blocks of data from page to page. Uses
exchange buffer. Parameters: AHL - from, BIX - to, DE - number of bytes. By
Regarding IX - don’t be too alarmed, it’s only for passing a parameter... ;)))
10 - GET_DAT - request data from page A from the HL address to the exchange buffer, in
number of DE bytes. If there is data in it that has not been thrown out somewhere, it will blather and
won't do anything.
11 - PUT_DAT - throw out the contents of the buffer in accordance with the parameters... If
no data is loaded into it - it will blather and spit out flag C with register A.12 - SET_BUF - set the size of the exchanger in the number of A blocks. Manipulation
only possible with an empty buffer. Otherwise, nothing will work.
13 - PRG_ADJ - configure the program to the address where it is located. A-
page, HL - program vector address. The program itself must have in its
the beginning of the corresponding table.
14 - PRG_MOV - move a program from one place to another. AHL, BIX - resp.
data (same as LDIR_PG)
Here is some required minimum. Now - what will the others look like?
bells and whistles of the system.
Interrupt handler.
Deals with residents - special pieces of code that are numbered,
have a vector and their tail points to the next resident. At the very
last resident - the tail contains a transition to a special handler location
interruptions. There the handler either exits or, if a multitasking is initiated
mode, takes appropriate actions.
By the way, regarding multitasking, there will be the following types of this thing:
1. Pseudo-multitasking. You can load as many programs as you like, but there will be
Only the one you are on will be executed (ala MagOS).
2. Real multitasking. In this case, the interrupt handler when calling
remembers all registers in a special vector of the current task and, having executed the residents,
switches to the next task, takes registers from there and moves on to it.In order to avoid confusion when transferring pieces of data, and
etc. etc., it is more advisable to use the following strategy:
1. Procedures for maintaining any buffers must do HALT before transferring data
(if multitasking mode is installed), or, if really necessary, call
the function of moving to the next task (which, in principle, for this program
similarly). When control is transferred to this program, it can
continue your work. By the way, at the same time, the length of the section to be thrown is worth
coordinate with the remaining time for this procedure. It complicates
procedure, therefore, it is more expedient to do the following in the interrupt handler:
1. Each resident has a number - how many cycles it consumes to the maximum.
2. The number of clock cycles in the interrupt must be counted.
3. There should be a system variable that will show how much is left
program "live". And the program itself will already calculate how much you can throw at it
bytes In principle, knowing how quickly buffer transfer works, you can
installing the resident to calculate in advance the necessary parameters for the programs in order
then don’t suffer.
4. The task transition function will set a flag indicating that it is better not to
use these parameters, since it is not known how much time is left until the end
interruptions. Therefore, if after calling the transition function to another task, wesuddenly, before throwing the number of bytes allotted to us, we suddenly discover
some left flag in system variables, it is best to either set HALT or
jump again to another task, or do something less dangerous...
2. Where, for example, reading from a disk drive occurs, it is necessary to either prohibit
interruptions, or use terribly clever tricks. ;))))
Kernal, system variables, some code, area for special drivers.
The area they occupy is from #5b00 to #5FFF.
Well, in general, these are the things...
SEE YOU, All!
-+-----▄█▄--▄--▄▄▄▄--■-▄█▄▄---------[STUDIO STALL]-[ZX-CLUB]---
-+-(C)▐█▄█▌▐█▌▐█▐▌█▌▐█▌▐█▌-/STALL---[ASSM]-[GFX]-[GAMEMAKING]--
-+-----▀-▀--▀▀-▀--▀--▀--▀▀▀---------[BEER]-[SAMOGON]-[PC-SUXX]-
-+- Lara Croft MED 4.40 ---------------------------------------
+ Origin: Abbreviation: COURT - warehouse of criminal cases... (34:1/90.1)
=== CUT ===
Hi, All!
With Best regards, Lynx^XPL0S!VE ...
[team Plutonium] [Firestarter] [Girls] [GMD]
{ Our name is Legion. }