On-Line #76
23 марта 1997 |
|
CODING - The procedure for management of upper memory on different machines.
C0DING (C) PAUL FALCON That would like you to submit files of which will help to "fight" with the upper memory. That is, run it on different machines. When launched itself determines with which computer it work. And exposes the variables in accordance with the testing machine: a computer, and how he had "brains" that is, memory. To work with the program enough treatment to three procedures, regardless of a particular computer. Basic system of 55-65% kodil my friend - Yura Kovalevsky. reworked, added more cars to determine kodil 45-35% - I. Well, now the technical information is, in fact, what and how: Data on some machines are in the variable (IY +118) (23,728) and the location of its bits following: 0 = 1 is the port # 7FFD SPECTRUM 128K 1 = 1 is the port # 1FFD SCORPION or KAY 2 = 1 is the port # DFFD PROFI 3 = 1 is the port # FFF7 TURBO 2 + 4 = 1 is the port # FDFD ATM TURBO 5 = 1 are 6 and 7 bit # 7FFD 6 7 = 1 at 8 bytes # C3 (SCORPION) Compliance by value, ie what value will be variable (IY +118) in determining whether a particular computer: 0 SPECTRUM 48K 1 SPECTRUM 128K 32 +1 SPECTRUM 256K - 512K 2 KAY 48K 2 +1 KAY 256K - 1024K 4 PROFI 48K 4 +1 PROFI 256K - 1024K 8 TURBO 2 + 48K 8 +1 TURBO 2 + 128K - 1024K 16 ATM TURBO 48K 16 +1 ATM TURBO 128K - 512K 128 SCORPION 48K 128 +1 SCORPION 128K 128 +2 SCORPION 256K - 1024K Number of actual pages is stored in a variable (IY +119) (23,729). Naturally, you can use at other addresses the storage of these variables, but it is most convenient in my opinion. Management of the program is so simple that it is necessary to know all three protsedurki: If, in determining what a car is necessary to exclude a few pages here will help the procedure DEBUG, the register C indicate the number of pages being removed from the table. This should be done immediately after the definition of the machine and then determine the memory (After CALL VIRT). Example: .... LD C, 8 CALL DEBUG .... In this example, will remove the page number 8 of the available to switch (for Scorp'a useful, not killed shadow businesses). If this procedure is not useful to you, then you can safely cut it out of the program from the mark to DEBUG ONPAGE. Also, the number of pages and their numbers can be corrected right in the table itself (at the end of the program) initially there are no 2 and 5 pages. Scrolling pages in their logical number, this procedure ONPAGE. Example: .... LD A, 8 CALL ONPAGE .... This example will include a # C000 page located but the rooms (in Reg. A) from the beginning of the table (in our case will be included 10 pages, if any at all there). Paging in their physical number - this is the procedure EX_RAM. Example: .... LD A, 8 CALL EX_RAM .... C # C000 turns page number (in Reg. A). Ie really 8 pages. That's actually a very prog ... ; @ @ @ @ @ @ @ @ @ ; @ @ @ @ @ @ @ ; @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ ; @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ ; @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ ; @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ ; @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ ; ; VERSION 5.5. IMPROVED. ; ; ; AUTOCONFIG PAGEMAKER FOR MACHINES: ; ; TURBO 2 + (48K - 1024K) V6.00 - V7.1 ; ATM TURBO (48K - 512K) V4.10 - V5.20 ; SCORPION (48K - 1024K) ; PROFI (48K - 1024K) ; SPECTRUM (128K - 512K) 6 '7 BIT # 7FFD ; ; THE SHAREWARE PRODUCT FOR FREE USING! ; (Using the procedure in ; Their programs link to the authors ; Almost obligatory (but your case)) START; the starting point ... XOR A LD (IY +118), A; type of computer INC A LD (IY +119), A; the number of pages available DI ; Check (.) 'RST 8' in the ROM 48 (if ZS-256, there # C3) LD BC, # 7FFD LD A, # 10 OUT (C), A LD A, (# 0008) CP # C3 JR NZ, ITURBO; no ZS-256 And this probably SCORPION SET 7, (IY +118) ITURBO ; Manager to check if RAM / ROM ; Take 2 bytes from the 0-th segment (there ROM48) LD HL, (1111) ; Duplicate ROM48 in 3-m segment (# C000-# FFFF) LD BC, # FFF7 LD A,% 00011111 CALL OUTC_A ; Take 2 bytes of the third segment (if TURBO 2 +, there ROM48) LD DE, (# C000 +1111) AND A SBC HL, DE; compare with bytes 0-th segment ; Restore manager LD BC, # FFF7 LD A, # FF CALL OUTC_A JR NZ, IDFFD; it's not TURBO 2 + ; Detected Manager RAM / ROM (TURBO 2 +) SET 3, (IY +118) JR I7FFD ; PROFI? IDFFD LD HL, # 80 LD DE, # 1000 LD BC, # DFFD ; Check the port # DFFD bit 4 , (Check the connection RAM instead of ROM) OUT (C), D; includes 0-th segment of RAM And instead of ROM ; Try to disable ROM NOP LD A, (HL); read bytes INC (HL); change it CP (HL); compare with the read LD (HL), A; restore bytes OUT (C), E; restore ROM JR Z, I1FFD; no port # DFFD ; A port # DFFD (PROFI) SET 2, (IY +118) JR I7FFD ; Check the port # 1FFD bit 0 ; (Check the connection RAM instead of ROM) I1FFD LD DE, # 1110 LD B, # 1F OUT (C), D; includes 8 segment RAM NOP LD A, (HL); read bytes INC (HL); change it CP (HL); compare with the read LD (HL), A; restore bytes OUT (C), E; ROM put in place JR Z, IFDFD; no port # 1FFD ; A port # 1FFD (SCORPION or KAY) XOR A OUT (C), A SET 1, (IY +118) JP I7FFD IFDFD ; Checking for port # FDFD (ATM-1) LD B, C LD HL, # FFFF OUT (C), D NOP LD B, # 7F OUT (C), D NOP LD (HL), D LD B, C OUT (C), E NOP LD B, # 7F OUT (C), D NOP LD (HL), E LD B, C OUT (C), D NOP LD B, # 7F OUT (C), D NOP LD A, (HL) CP D JR NZ, I7FFD; there is no such word , But has a port # FDFD SET 4, (IY +118) , A port (# 7FFD) ; (Test for switching ROM48 <-> ROM128) I7FFD LD HL, # 80 LD DE, # 1000 LD BC, # 7FFD OUT (C), D; ROM 1, unequivocally! NOP LD A, (HL); 48 bytes ROM OUT (C), E; ROM 0 NOP CP (HL); bytes of ROM 128 OUT (C), D; ROM 1 NOP JR Z, SIZED; no port or blocked ; Detected port # 7FFD SET 0, (IY +118) , To determine the amount of memory SIZED CALL VIRT; DE - end table (tag # FF) LD A, (IY +119); SPECTRUN 256K-512K? CP # 08 JR C, ENDING LD A, (IY +118) CP # 01 JR NZ, ENDING SET 5, (IY +118); steep SPECCY 256K - 512K ENDING LD A, # 00; page after exiting the program CALL EX_RAM; in port # 7FFD on SPECTRUM 128K. EI; for a normal exit. RET , The definition of real (!) Pages for this vehicle ; Page "phantoms" be deleted from the logical table ; Output: ; DE - end table (tag # FF) And the variable PAGE - available number of pages VIRT LD IX, # C000 ; Fill pages of their rooms with saving the contents of bytes , The points test (# C000) LD HL, DOOM +63 LD B, 64 V_R11 LD A, B DEC A; NN p. 63,62,61,60 ... 1,0 CALL EX_RAM LD C, (IX +0) LD (HL), C; save the contents of the byte LD (IX +0), A; Record back page number DEC HL DJNZ V_R11 And delete from a table not found pages PUSH AF LD A, 61 LD (IY +119), A POP AF LD DE, TABL_PG V_R20 LD A, (DE) CP # FF JR Z, V_R30; end of the table CALL EX_RAM CP (IX +0); comparison. number of pages with the content of bytes JR Z, V_R22; page actually exists ; This page on a life HET!!! PUSH DE LD HL, TABL_PG +62 AND A SBC HL, DE PUSH HL POP BC; volume shift table PUSH DE POP HL INC HL LDIR DEC (IY +119); -1 pages available POP DE DEC DE V_R22 INC DE JR V_R20 ; Restore the contents of bytes (# C000) on pages V_R30 LD B, 64 LD HL, DOOM V_R31 LD A, 64 SUB B; NN pages 0,1,2,3,4 ... 62.63 CALL EX_RAM LD A, (HL) LD (IX +0), A; save the contents of the byte INC HL DJNZ V_R31 RET , "Vydirka" from the page table given page , At the entrance: ; C - N page ; DE - end table (tag # FF) ; Output: ; DE - end of the table (probably already new) DEBUG PUSH DE POP HL NO_PG1 DEC DE LD A, (DE) CP # FF JR Z, NO_PG2; HE found delete pages! CP C JR NZ, NO_PG1 ; DE - on the number of deleted pages ; HL - to mark the end of the table (# FF) SBC HL, DE PUSH HL POP BC PUSH DE POP HL INC HL LDIR DEC (IY +119); -1 pages available DEC HL DEC HL NO_PG2 EX DE, HL RET ; Switching program pages for different types of machines ONPAGE PUSH BC; A - logical page number PUSH HL LD C, A LD B, # 00 LD HL, TABL_PG ADD HL, BC LD A, (HL); physical page number POP HL POP BC EX_RAM DI; A - physical page number PUSH HL PUSH AF PUSH BC BIT 1, (IY +118) JR NZ, ZS256; SCORPION (# 1FFD) BIT 2, (IY +118) JR NZ, PROFI; PROFI (# DFFD) BIT 3, (IY +118) JR NZ, TURBO_2; TURBO 2 + (# FFF7) BIT 4, (IY +118) JR NZ, ATM1; ATM TURBO (# FDFD) BIT 0, (IY +118) JR NZ, SPECCY; SPECTRUM 128K-512K (# 7FFD) BIT 7, (IY +118) JR NZ, SPECCY; SCORPION 128K (# 7FFD) JR TDK ; For TURBO 2 + (supports 128K-1024K) TURBO_2 PUSH AF PUSH IX AND% 00011000 CPL LD BC, # FFF7 CALL OUTC_A POP IX POP AF JP SPECCY ; ATM TURBO V4.10 - 5.20 (supports 256K - 512K) ATM1 LD BC, # FDFD PUSH AF RRCA RRCA RRCA AND% 00000011 JR HOME ; For PROFI (supports 256K-1024K) PROFI LD BC, # DFFD PUSH AF RRCA RRCA RRCA AND% 00000111 JR HOME ; For SCORPION or KAY (supports 512K-1024K unconventionally) ZS256 PUSH AF LD B, A AND% 00001000 RLCA LD C, A LD A, B AND% 00110000 RLCA RLCA ADD A, C LD BC, # 1FFD HOME OUT (C), A NOP POP AF ; For SPECTRUM 128K (256K-512K supports non-standard!) SPECCY LD B, A AND% 00011000 RLCA RLCA RLCA LD C, A LD A, B AND% 00000111 ADD A, C OR # 10; ROM 1948 LD BC, # 7FFD OUT (C), A NOP TDK POP BC POP AF POP HL RET OUTC_A LD IX, # 2A53 PUSH IX JP # 3D2F DEFB # FF TABL_PG DEFB 00,01,03,04,06,07 DEFB 08,09,10,11,12,13,14,15 DEFB 16,17,18,19,20,21,22,23 DEFB 24,25,26,27,28,29,30,31 DEFB 32,33,34,35,36,37,38,39 DEFB 40,41,42,43,44,45,46,47 DEFB 48,49,50,51,52,53,54,55 DEFB 56,57,58,59,60,61,62,63 DEFB # FF DOOM DEFS 64,0 Well, sort of the whole program, if that write on my web address in SpbZXNet (812/03.00). Good luck. Paul Falcon (CREATOR) SPbZXNet: 812/03.00
Other articles:
B.B.S. News - The work B.B.S. 'ca. |
CODING - The procedure for management of upper memory on different machines. |
Advertising - Advertisements and announcements ... |
Championship VIRUS-2 - On a revised version of the game "Virus-2." Results of the championship, which was attended by 16 viruses. |
Similar articles:
В этот день... 23 November