SMALL PROCEDURES IN ASSEMBLY
FOR ALL OCCASIONS OF LIFE.
------------------------------------------
This section is dedicated to programming tricks
topics and methods of obtaining the desired result
result in bypassing standard entry points and
subroutines A similar practice has already happened
application in other electronic publications.
I decided to support this direction in my
magazine. I hope there are many here
useful and interesting information for both
novice coders, as well as for experienced and
seasoned programming aces.
The nature and method of presentation of articles is based
comes from personal experience of communicating with my
friends who often ask for help
power and advice. Based on their in-
resources and needs, as well as your ac-
active participation, now and in the future there will be
methods and methods for solving the program are described.
framework problems when creating various software
Ask - we will answer. Would you like to share?
your secrets - you are welcome to ours
pages. A magazine for everyone!To begin with, I propose to consider a method
control of disk ejection from the drive. But
I warn you right away that in nature there is
There are drive models that
do not “react” to such requests from
them. I've met people like that, so...
I believe with full responsibility. True,
it was of imported origin and name
I don't remember now...
So, many programs control
this process. No one will be surprised by this now
you see, but nevertheless it is very convenient to work
melt when you are not distracted by operations on
re-reading the disk directory. Tssobenno
cool and convenient when copying discs to
one drive. Oh well, let's xorim
further. And then - assembly procedures -
ka. Many people sculpt it into an interruption if
tacts allow. You can also post separately
include, for example, key polling. Values
does not have. So:
;Control ejecting a disk from the drive.
ЦRG #6000
M1 HALT ;cycle stabilizationCALL INDIKAT
ЦR A
JR NZ,М1
RET
INDIKAT LD A,195 ;код JP
LD (#SCC2),A;перехват захода
LD HL,LL5FBA;в бейсик
LD (#5ССЗ),HL
LD IX,#2FC1
CALL DЦS
LD A,#08
LD ВС,#001F
LD IX,#2A53;out (c),а
CALL DЦS LD (LL5FBB),SP
LD DE,#0000
LD IX,#2740
CALL DЦS
LL5FBA LD SP,#0000
LL5FBB EQU $-#02
LD IX,#1FFЗ
CALL DЦS
LD IX,#1FEB
CALL DЦS
LD IX,#2FC1
CALL DЦS
LD A,#С9 ;для норм. раб.
LD (#SCC2),A
LDA,(#5CCD)
AND #40 ;BIT 6,(#FF)
RET
DCS PUSH IX
JP 15663
The output in the ZF flag will be the result
polling the drive for ejection
disk. You are asked for an indicator that responds
behind the write protection slot. Procedures from
TR-DCS we check this sensor. His reaction
The value is displayed in the system logger
VG93. If the sixth bit is reset (flag Z is
le polling is installed in the procedure), which means
the disk left the drive. Or vice versa -
setil. Further actions depend on the progress
program execution. In conclusion I will say,
that this procedure is extracted from JEMMINI
SCMMANDER`av4.0productionJemminisoft.
----- Let's consider another procedure. This is what-
transferring a group of sectors from the disk. Procedure
extracted from"Black Raven". Introductory for
its functions are similar to #05 v TR-DCS,a
exactly: HL, download address; D,track; E,sec-
torus; B,number of bootable sectors. On
output in flag CF download quality - us-
turned on, it means the sector has not been read. In re-
the hysteral pair DE will be located as follows:
current track and sector on the disk on which
Reading information has stopped. In HL, I follow-
current address. The procedure does not have details
analysis of the cause of failed reading, i.e. no
handling error conditions. But this is
not a school, but a “stash”, so write it yourself
yourself a procedure that will deal with
mistakes.
The example shows non-standard according to
referring to TR-DCS sector numbers and their differences
measures. Parameter MIN indicates the first fi-
sic sector number located on
track. MAX indicates to the procedure that when
reaching this sector number should not
try to count it, because him there and in
no, but do itpositioning on
next track and starting sector. Process
fool reading is now presented for kilo-
byte sectors.
ЦRG #6000
MIN EQU #С0 ;initial sector
MAX EQU #C5 ;at what position.
LCAD LD DE,#01С0;Track & sect.
DALEE1 EQU $-2
LD HL,#С000
LD B,16 ;size in sect.
CALL LCADER
LD (DALEE1),DE;where I ended
EI
RET
;in:B,number of sectors; DE, track and sector
;out:next track & sect. + new address
LCADER DI
CALL РЦZIC
LD A,(#5CD6);will be here
EX AF,AF` ;reading quality
LCAD_0 LD LX,#03 ;repeat counter
LCAD_1 PUSH HL ;in case of errors
PUSH BC
PUSH IX
LD С,#5F
LD A,E ;sector
CALL ЦUT_С
CALL LL2090 ;readDI ;#2090 allows
LD HL,#5CD6;interrupts
EX AF,AF`
SR (HL) ; when changing
RTsR IX ;there was an error!
JR Z,LCAD_2
LD (HL),A
CALL РЦZIC ;for promotion
DEC LX ;motor yes
RCR VS
RCR HL
JR Z,LCAD_4;egg
EX AF,AF`
JR LCAD_1
LCAD_2РЦР ВС
РЦР HL
ЕХ AF,AF`
INC Е
LD A,Е
СР МАХ ;предел
JR С,LЦAD_3
LD Е,MIN ;начальный номер
INC D ;next track
CALL РЦZIС
LЦAD_3 INC Н ;1024 байта
INC Н ;размер сектора
INC Н
INC Н
DJNZ LЦAD_0 ХЦR A
RET
LЦAD_4 SCF ;load еггог
RET ;DI оп
LL2090 LD ВС,LL2090
PUSH ВС
LD ВС,#017F
LD IX,#2090
JR DЦS
LL5CF6 NЦР ;номер дисковода
РЦZIС DI
PUSH IX
LD A,(LL5CF6) ADD A,#3С
BIT 0,D
JR Z,РЦZ_1
RES 4,A
РЦZ_1 LD С,#FF
CALL ЦUT_С
LD A,D
SRL A
LD С,#7F
CALL ЦUT_С
LD A,#18
LD С,#1F
CALL ЦUT_С
CALL РЦZ_2
РЦР IX
DI
RET
РЦZ_2 LD IX,#3EF5
DЦS PUSH IX
JP 15663
ЦUT_С LD IX,#2A53
JR DЦS
------
Хотя данная рубрика и не является пи-
ратским разделом, но заначка для того де-
лается, чтобы было на все случаи жизни. К
чему я клоню? Да все те же пиратские штуч-
ки. На сей раз предлагаю способ просмотра
финального мультика в игре "Черный Ворон".
Для его созерцания не обязательно прохож-
дение всей игры. Достаточно иметь под ру-
кой программу "STS" any version and 128Kb.
memory in the computer. Since you're reading mine
text, it means you have at least 128K. Te-
first load"STS"and do what I say-
zhu. Namely: insert into any of"A"and "B"
disk drives, the first disk of the "Raven" program,
then load the ninth physical sector from
this disk. To load "STS" enter
command SS+L and in the resulting window set the
Sector parameters: track-0 sector-8 length-1
address-#5D25.As soon as the boot process
ends, cross the strip-like course
rom on the values of processor registers and from
I have the following:
RS, #5D27
SP,#8000
ВС,#0000 ;register В=0 - people; 1 - kung
AF,#0000 ;register A=0 - drive A
A=1 - drive B.
The values of other registers are not significant.
values. After entering the parameters you need
run the commandSS+J (minus or plus) on
execution and contemplate the pleasant final cut.
------
For the first time, assembler is enough. But
This section will be around for quite some time.
vat, because There’s a lot more I’d like to tell you -
tell you all. And readers, I hope
they'll throw something in. So see you soon
chi on the pages of "Black Crow"!
Share your thoughts about the article