Inferno #07
31 мая 2005

For Coderz - Small programmers' tricks.

<b>For Coderz</b> - Small programmers' tricks.
           1. (A <> 0) AND (B <> 0)


   Short way to determine that both the number
la (A and B) are not equal nulyu.Esli at least one
of them is zero, it will be flagged
 Z.

         ADD A, -1

         SBC A, A

        AND B

   Applied in ACEdit to hit test
Extend.


          2. How to make CLEAR?


   Sub-CLEAR (the address of 7863, PA
parameter RAMTOP in BC - sm.ee call, for example,
in the source mrip) is designed for at
variation of the BASIC interpreter, and therefore
does not fully form a stack of codes of
You can call only if nevozv
tus in BASIC. If you want to go back
 in BASIC, you will need:

   1. SP = RAMTOP-23.

  2. Copy 24 bytes of stack BASIC
at SP. They are always the same, quote
 them:

        # 2d2b

        # 3365

        # 2758

        # 10ed

       # D (or # 3e, if you are not
 recent statement in a row)

        # 9

        # 1c85

        # 1c10

        # 1b52

        # 1b76

        # 1303

        # 3e00

  3. Record the value in cell RAMTOP'a
 23730/31 (they just called RAMTOP).

  4. Record the value RAMTOP-3 in cell
23613/14 (called ERRSP).

   That's it! Can not even clean the equivalent
wounds, although the subroutine clears.
More beysikovskaya routine cleaning variables
variables, and something else does, but it is us
not necessary ...


      3. How to change the length of BASIC?


   Addresses that must be filled, I
resulted in IG # 5 - in the article about autobuild.
 Now I will explain what this address:

   (23,635) PROG - start BASIC.

  (23,627) VARS - end beysika.Dlya empty
BASIC is PROG. For empty variables
 on this index is # 80.

  (23,641) E_LINE - buffer address editing
emoy line. For an empty domain of the variables
equal VARS +1. For editing an empty buffer
Fix the line on the pointer is # d,
# 80. This content is not important when you exit
RST through 8 and is not important to save Bay
Sica on the disc. (Previous # 80 is also not important
 to be saved.)

  (23,649) WORKSP - address the working stack
(That is, I do not know). For an empty region
STI current line is E_LINE +2. C
this address TR-DOS allocates memory for
 their needs.

  (23,651) STKBOT - address stack kalkulyato
 pa. According to my observations, is WORKSP +12.

  (23,653) STKEND - the end of the stack kalkulyato
pa. For the empty is STKBOT.


  4. Autodetect enabled page


   Used in my TR-DOS v6b09e instead
the old test of 16-bit key (in which
Torah is often erroneous determination
line). I have a key 32-bit.



         LD DE, (# C000)

         LD HL, (# FFFD)

         PUSH HL

         LD BC, # 7FFD

         LD (# C000), BC

         LD (# FFFD), BC

        XOR A
 nxtpg

         AND # C7

         DEC A

         AND # C7

         OR 16

         OUT (C), A

         LD HL, (# C000)

         SBC HL, BC

         JR NZ, nxtpg

         LD HL, (# FFFD)

         SBC HL, BC

         JR NZ, nxtpg

         LD (# C000), de

         POP HL

        LD (# FFFD), HL
; A = page


   5. Arrow in strategic games

Alex Xor>

   As you deduced the cursor in their original
framework of "Allods"? And as the output of the cursor Copper
nogov in CV? I need to just own principles
group. I know that your principle and the principle of Copper
nogova vary, but generally speaking I do not know the 
subtleties of simpler. The work must go with the shadow shield.


 Vyacheslav Mednonogov>

   When updating the screen output goes to
vniz.Pri rows above it in the special
variable to remember the number stroki.Strel
ka "hangs" on the ward pre preryvaniyah.Pri
closing the check, update a screen
 present or not.

   If not - no problem. If yes - WHO
three different variants are possible: the current line
above the arrow, below the arrow crosses tends
 lku.

   In the first case - to recover every
map below the arrow in the second case -
not restored in the third case - in
zvraschaesh pointer output line is not
how many positions back to keep third
case to one.

 Alone Coder>

   My way: the arrow is hanging on termination,
but you can print it on
 shadow screen.

   If at the entrance to interrupt detected
that displays the screen, then draw the exact
same arrow on the shadow screen (CALL ARMAP).
before this blot on its old arrow
drawn through ARMAP (CALL REMAP). For
than the last - I can now formulate
vat, but it's important (I think, because
shadow is displayed for more than one Frey
 ma).

   This source, I do not myself
feel about that comment. Here
fragment of the hook on which
Therefore, all should be clear:
 PRSHADF = $ +1

         LD A, 0

         DEC A

         PUSH AF

         CALL Z, REMAP

         CALL PRAR

         POP AF

        CALL Z, ARMAP
Alex Xor>

   A screen print is where? It is not
within interrupt?
 Alone Coder>

   Of course, outside, is absolutely not connected
with preemption.
Alex Xor>

   And how you counted interruption to
then withdraw?
 Alone Coder>

   Not counted, the source worked as
CV - a turbo accelerates all:)


            6. Nested DISP


   Nested in the DISP ... ENT ALASM'e made
as follows:



        DISP smesch1

        ... (On the main shift)
 ad0

        DISP smesch2
 ad1

         ... (Internal displacement)

         DISP ad0 + $-ad1

         ... (Continued osn.smescheniyu)

       ENT


   Used in the development of portal
ROM or other software with complex distribution
division of memory (which can not compile
vat back to where they are executed).

A. Coder




Other articles:

Classics - Almanashnik. Alexander Pushkin.

For Coderz - Recognition and computation of arithmetic expressions on their character record.

Inferno - The authors of the magazine.

For Coderz - the discipline to create large projects.

Interview - Questions Konstantin Sviridov (Conan) on the site zxnext.narod.ru.

Likbez - The principles of converting graphics PC-ZX.

For Coderz - Programming disc changer / drive in Scorpio.

Softinka - DNA_OS v0.431 - package of utilities for working with hard drives, RAM-drives and floppy disks.

For Coderz - Programming under DNA_OS ZET-9, a package of tools to work with storage devices.

Softinka - The problems and shortcomings package of tools to work with storage devices DNA_OS.

Likbez - details about disk formats that are FAT.

Inferno - Entered from the editor.

Inferno - Errors in the previous numbers.

For Coderz - Small programmers' tricks.

Gameland - On the new games: Oneyroid, Dizzy forever, Dridlock.

For Coderz - Writing archive. Practical principles LZ packaging.

Gameland - Passage of new shipments for the game "Black Crow".

For Coderz - Programming for the video mode 384x304.

Inferno - Letters to the Editor.

Sound - Eden Megus'a about the tracker for the AY / YM.

Inferno - On the shell.

For Coderz - Fundamentals of optimization for the processor Z80.

Likbez - The location of partitions on your hard drive.

Gamedev - 3D projection of the floor / road in the games.

Sound - Wild ideas for AY trackers.

Advertising - Ads by Roman Chuunin.

Advertising - Ads by V. Bogdanovich

For Coderz - How a large Flexible Program.

Repair - Faults Pentagon 128 + and their repair.

Inferno - Content.

Miscellaneous - Thoughts on the contest for the best software.

Others - Transfer software on ZX Spectrum with a PC.

Video - On packaging for a video ZX Spectrum.


Темы: Игры, Программное обеспечение, Пресса, Аппаратное обеспечение, Сеть, Демосцена, Люди, Программирование

Similar articles:

В этот день...   21 November