IzhNews #06
29 августа 2000
  Софт  

Nonsense - about the features of the assembler Alasm 4.2 (macro, commands, conditional events, etc.)

<b>Nonsense</b> - about the features of the assembler Alasm 4.2 (macro, commands, conditional events, etc.)
■

          NONSENSE



      ALASM 4.2 RULEZ_ ..

(C) PIXel
__________________________________________


  In this article I will try to explain
why do we need all the features
offers mentioned in the title
assembler, namely, macro and
Team conditional compilation. The reason for
writing was the complete absence
interest in the above ficham from local
encoders. In general, the usefulness of macros a lot
written in SCENERGY # 1. Flying / DR rather
well explained to everyone why they are needed, but
He did it on the example assembler TASM
4.12 by XLD, and I use ALASM_4.2.

  I'll start with some definitions:

  Macro [macro, macro instruction]
Team assembly language, canned in
several machine instructions.

  If the vaschey program is the same
isndtruktsy sequence assembly
ispozuetsya several times, there is no
the need to rewrite it every time.
Much easier to decorate it as
macro and refer to it
appropriate macro. For example
often use Taku
sequence of commands:

  ld hl, sourse

  ld de, destenation

  ld bc size-1

  ldir
Oformim macro:
 MACRO COPY; SOURSE, DEST, SIZE

  LD HL,: 0

  LD DE,: 1

  LD BC, :2-1

  LDIR
 ENDM

  For instance, we need to copy the screen
Address # S000:

  ...

  COPY # 4000, # C000, # 1B00

  ...

  Needless to use a macro is not
necessary if no parameters and
does not consist of directives, the assembler
For example:
 MACRO CLS

  LD HL, # 4000

  LD DE, # C000

  LD BC, # 1B00

  LD (HL), L

  LDIR
 ENDM

  Profitable to do routine, but they
below. This macro will be ineffective
since your code will be "bold", but a little
faster than with procedures.

  Using macros makes the text
program graphically, for example:

  ...

  PAUSE 10

  BORDER 5

  ...
looks much nicer than:

  ...

  LD B, 10

  HALT

  DJNZ $ -1

  LD A, 5

  OUT (# FE), A

  ...
Of course you can make ordinary
routines, but it will not be more economical:

  LD A, 5

  CALL BORDER
BORDER

  OUT (# FE), A

  RET
is distorted, since the call Procedure 3 and Bait
she is 2 bytes. When using
Macro have only 2 bytes.


  Give an elementary macros:


       MACRO BORDER; COLOR

       LD A,: 0'7

       OUT (# FE), A

       ENDM


       MACRO PAUSE

       LD B,: 0

       HALT

       DJNZ $ -1

       ENDM


       MACRO SETIM2; LABEL

       DI

       LD A, # 5F

       LD I, A

       LD HL,: 0

       LD (# 5FFF), HL

       IM 2

       EI

       ENDM


       MACRO TOALASM

       LD BC, # 7FFD

       LD A,% 00010100

       OUT (C), A

       JP # C000

       ENDM


  The next is more difficult:


       MACRO GETMEM; LABEL, SIZE
; Label - the beginning of the target area
; Size - the size of the

       IFN? SLOWMEM
And if the label does not opedelena then define its

       SLOWMEM EQU # 6000
, Assigning a value to it # 6000

       ENDIF

       : 0 = SLOWMEM
; Label - the beginning of the free area

       SLOWMWM = SLOWMEM +: 1
; For the trail. Treatment (: 1 = size)

       IFN (('(# 8000-SLOWMEM)) '% 10000000)
And if slowmem> # 8000

       BORDER 2
; Tipo error

       TOALASM
; Return home.

       ENDIF

       ENDM


  This macro generates code only
event abroad # 8000. The idea
creation arose after reading an article
Flying'a in SCENERGY # 1 and placed it on
image macro for TASM_4.12.

  Well, I think makrosostroenie tepr boils at
our town (and maybe not only in
our). We strongly recommend that you read
article to which I have repeatedly referred.


  As I have said to use macros
not always effective and should be used
standard procedure, ie ispozovat
procedure. On creation of libraries of procedures
spoke Flying, but there has to
beginning of the source code to indicate that I need, but
no. In ALASM'e can avoid this
rudiment. Suppose the library contains 50
procedures and loaded at the end of the source.
I'm in my program using 2 procedures:
clrscr and clratr, then I must
otassemblirovat only them. Êàî
library must register as follows:


       IF? PROC1-1
PROC1 ....

       ENDIF


       IF? PROC2-1
PROC2 ....

       ENDIF

so on. procedure PROCh will otassemblirovana only if requested 
to do it from your source.


  That is perhaps all, what if someone does not
understood, I think he should read the Help to
ALASM'y 4. 2 and all will be RULEZz_. and if
it does not help then we can as something with
contact me and I will try to explain more
once more.

  Yes, to get there in the annex is
the source of my macros and an example
library procedures, as well as the source of their
All yuzayuschy.
__________________________________________






Other articles:

Entry - a new newspaper.

News - Day of the city, establishing Izhevskgo magazine, the new composition of the editorial board.

pent - samoedstvo authors otsutvii newspaper about the reaction of readers.

Warez - Gaming and system innovations: Imperia 2000, the 8 th Division, The Last Courier, Burial GFX Editor, Perspective Comander.

Nonsense - about the features of the assembler Alasm 4.2 (macro, commands, conditional events, etc.)

Solution - a detailed walkthrough Dizzy A.

Cheating - Thoughts aloud, or to deceive as additional missions to the game, Black Crow.

Password - the method of decrypting passwords for the games.

Adventure - Guide Adventyurnym games! (Part 1)

FEATURES - Corrected wiring diagram click to ZX Spectrum.

Proposal - philosophy: "Eat anything smaller than me, avoiding all that is bigger than me."

Advertising - advertising and announcements.


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

Similar articles:
Information - an explanation of the status MAGIC SOFT.
Advertising - advertising and announcements from spektrumistov.
Worlds 128 - Cheats "TERMINATOR - 2.
Gingerbread - a fairy tale.

В этот день...   29 April