Assembler - The procedure for shifting the entire screen one space up, the loader in assembler.

Fantom #03
╔══════════════════════════════╗
║ SECTION:ASSEMBLER ║
╚══════════════════════════════╝

  So, again you are in the “Assembler” section, well
where all sorts of assembly things are for
beginners. Didn't turn out very well
last time. Judge for yourself: in the first
In the second we study the basics, and in the second we write
frame scrollers (transfers, which is the same thing)
the same). Well, okay, to hell with it...

  To begin with, I give the procedure for shifting everything
screen one space up. Plus in
it is what is parallel to the graphics
attributes are also transferred. Therefore no
such unpleasant things as lag at-
ributs from graphics. But this is not very
looks beautiful.
  This procedure can be used
when writing viewers for help or ra-
famous, there, electronic publications.

 ORG #8000
;procedure for shifting the entire screen by one
;line up.
;parallel to the graphics, the attributes also shift.

SCRL LD DE,#4000 ;where:
LD HL,#4000+32 ;from:

 LD B,#17 ;number of lines
EXH ;attributes
LD DE,#5800    ;куда
        LD HL,#5800+32 ;откуда
        ЕХХ

LOOP1   PUSH ВС
        CALL SCROLL    ;СДВИГ 8 линий
        POP ВС         ;графики
        DJNZ LOOP1
        RET            ;выход

SCROLL  LD B,#08       ;8 линий.
LOOP    PUSH ВС        ;запомнили рег.п
        PUSH HL
        PUSH DE
        LDI            ;32 LDI (32 байта
        LDI            ;в строке). Можно
        ....           ;заменить на:
        всего 32 LDI   ;LD ВС,32
        ....           ;LDIR,
        LDI            ;но это медленно
        LDI
        POP HLCALL DOWNHL    ;
        POP DE
        ЕХ DE,HL
        CALL DOWNHL
        POP ВС
        DJNZ LOOP
        ЕХХ            ;переносим атри-
        LDI            ;буты (32 байта)
        LDI            ;можно LD ВС,32
        ....           ;      LDIR
        всего 32 LDI   ;но LDI быстрее.
        ....           ;32*16=512тактов
        LDI            ;32*21=672тактов
        LDI
        ЕХХ            ;обмен
        DJNZ LOOP1
        RET            ;выход

DOWNHL  INC Н          ;экранная линия
        LD A,Н         ;вниз для HL.
        AND #07        ;(full work
    RET NZ ;with thirds of the screen
LD A,L
        ADD A,#20
        LD L,A
        RET C
        LD A,H
        SUB #08
        LD H,A
        RET

  I think you can figure it out for yourself
how it works. According to her principle, it is written and
scroller down.

 LOADER IN ASSEMBLY

  First, let's download your favorite assembly
ler and, going to BASIC, type the line:

 10 REM *********************************

  To begin with, let's put more "*" signs.
(depends on the length of your loader). Next
We return to the assembler and type:

ORG 23872
;example of a loader in assembler
          LD C,5; LOAD function
          LD B, number of loaded sectors
          LD DE,(23796) ;track/sector
          LD HL, where to ship
          D.I.
          CALL 15635
          EI
          JP address of start transition

  Having assembled this program, we go out into the wild
YSIC and type:

 2 CLEAR address:RANDOMIZE USR 23872

  Having removed all unnecessary lines, we write
file to disk. Additions to the received file:
select the code block to load, andthen them
glue it together using some command -
ra, for example PERFECT.
 That's all. We have a basic monoblock. His
can be moved around the disk.

P.S. The given loader is the most
simple, so you can perfect it
work yourself.
__________________________________________

Share your thoughts about the article