Last modified by Max on 2025/03/02 15:18

From version 2.52
edited by Max
on 2025/02/25 15:27
Change comment: (Autosaved)
To version 2.1
edited by Max
on 2025/02/25 11:51
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -15,6 +15,7 @@
15 15  * 177224 - Primary Boot Register (BOOT1)
16 16  * 177226 - Alternate Boot Register (BOOT2)
17 17  
18 +
18 18  The CSR register accepts commands in bits D0-D5 and the interrupt enable bit in bit D6, all write only, always zero is read. In bit D7, the readiness bit is read. One in it means that the previous command has been executed and the controller is ready for exchange. Zero means that the controller is busy executing the previous operation, the other registers are disabled, access to any of them will cause Trap to 4. If the execution of the previous command caused an error, bit D15 is set simultaneously with bit D7.
19 19  \\Writing to registers is done only in words; byte writing is not allowed.
20 20  \\All data exchange is conducted via DR. For commands with a single-word argument, this argument should be sent to DR, and then the command should be sent to CSR. For commands exchanging with the controller buffer, on the contrary, the command should be issued and only after it a data block of a certain length should be received or transmitted.
... ... @@ -299,133 +299,126 @@
299 299  {{/code}}
300 300  
301 301  
302 -== 007: Get disk size ==
303 +== **007: Получить размер псевдодиска** ==
303 303  
304 -There are two commands for obtaining the size of a pseudo-disk, i.e. the AZn file-image mounted on the selected pseudo-drive.
305 -\\If the OS being used (or a program working with disks without an OS) can work with large (more than 32M) disks, you should use the command with the code 017. The sequence of actions: reset the controller (command 000), select the drive (p. 3.2) and send the code 017 to the CSR, and then, without any waiting, read from DR first the lower word, and then the higher word of the size of the selected drive (image file).
306 -\\If the OS you are using cannot work with disks larger than 32M (RT-11), you should use the 007 command - get the pseudo-disk size with a limit of up to 32M. The steps are similar: reset the controller, select the disk, send the 007 code to the CSR and read one word of the pseudo-disk size from DR. If the size of the image file mounted on the selected pseudo-drive is larger than 65534 blocks, the controller returns the number 65534 instead of this "large" size. We remind you that the number 65535 is used in some places for special purposes and cannot be the disk size.
307 -\\We also remind you that if the image file is not mounted on this drive, the sequence of actions will not work (command 001 select device) and the program execution will simply not reach this point. Therefore, these commands do not provide for errors.
305 +Есть две команды получения размера псевдодиска, т.е. смонтированного на выбранный псевдопривод AZn файл-образа.
306 +\\Если используемая ОС (или программа, работающая с дисками без ОС) умеет работать с большими (больше 32М) дисками, следует пользоваться [[командой с кодом 017>>doc:||anchor="H017:A041F43E43B44344743844244C44043043743C43544043F44143543243443E43443844143A4302C43143E43B44C44843E439"]]. Последовательность действий: сбросить контроллер (команда 000), выбрать накопитель (п. 3.2) и переслать в CSR код 017, а затем, без каких-либо ожиданий, считать из DR сначала младшее, и следом за ним старшее слово размера выбранного накопителя (файл-образа).
307 +\\Если используемая ОС не умеет работать с дисками бОльшими, чем 32М (RT-11), следует пользоваться командой 007 - получить размер псевдодиска с ограничением до 32М. Действия похожие: сбрасываем контроллер, выбираем диск, посылаем в CSR код 007 и считываем из DR одно слово размера псевдодиска. Если размер файл-образа, смонтированного на выбранный псевдопривод, больше 65534 блоков, вместо этого "большого" размера, контроллер возвращает число 65534. Напоминаем, что число 65535 кое-где используется в специальных целях и не может быть размером диска.
308 +\\Также напоминаем, что если на этот накопитель не смонтирован файл-образ, последовательность действий не пройдет (команда 001 выбор устройства) и исполнение программы до этого места просто не дойдет. Поэтому ошибок у этих команд не предусмотрено.
308 308  
309 -Example of a program with "small" disks
310 +Пример программы с "малыми" дисками
310 310  
311 311  {{code language="assembler"}}
312 312  ;......................................
313 313  
314 -GetSiz=007; Get the "small" disk size
315 +GetSiz=007; Получить "малый" размер диска
315 315  
316 -; From fragment 3.2 (disk selection) we have in R3
317 -; DR address (177222)
317 +; От фрагмента 3.2 (выбор диска) у нас в R3 остался
318 +; адрес DR (177222)
318 318  
319 - MOV #GetSiz,-(R3); send the command
320 - TST (R3)+; return the address in R3 back to DR
320 + MOV #GetSiz,-(R3); пошлем команду
321 + TST (R3)+; вернем адрес в R3 назад, на DR
321 321   MOV @R3,DskSiz
322 322  ;......................................
323 323  {{/code}}
324 324  
325 -== 010: Allow network operation ==
326 +== **010: Разрешить работу сети** ==
326 326  
327 -Command code 010. Having completed the sequence of actions for transferring the next portion of data, and expecting that the next request will not follow immediately, you can "utilize" the processor time of the STM32 microcontroller, which is the basis of AZ - occupy it with servicing the network. In the same RT-11, this can be done before exiting the AZ driver, before the .DRFIN macro command, which completes the execution of the input-output request.
328 -\\Indeed, the I/O operation is completed, the CPU program in the system will prepare a new portion of data for output, or figure out (based on the previously read data) where it should read something else, or generally think about something of its own. smile.gif In other words, after the I/O request is completed, there is a fairly high probability that there will be a pause in working with the AZ disks. So, the time of this pause can be given to servicing the network. To do this, before executing the .DRFIN macro in RT-11 or its analogue in other OS, you should send code 110 (enable network plus enable interrupts) to the CSR.
328 +Код команды 010. Закончив последовательность действий по передаче очередной порции данных, и ожидая, что следующий запрос последует не сразу же, можно "утилизировать" процессорное время микроконтроллера STM32, составляющего основу AZ - занять его обслуживанием сети. В той же RT-11 это можно сделать перед выходом из драйвера AZ, перед макрокомандой .DRFIN, завершающей исполнение запроса ввода-вывода.
329 +\\Действительно, операция ввода-вывода завершена, программа ЦП в системе будет готовить новую порцию данных для вывода, или соображать (на основании предыдущих прочитанных данных), где ей еще что-то прочитать, или вообще размышлять о чем-то своём. [[image:https://forum.maxiol.com/style_emoticons/default/smile.gif||alt="smile.gif"]] Другими словами, после окончания запроса ввода-вывода, довольно высока вероятность того, что последует пауза в работе с дисками AZ. Вот, время этой паузы и можно отдать на обслуживание сети. Для этого, перед исполнением макрокоманды .DRFIN в RT-11 или ее аналога в других ОС следует отправить в CSR код 110 (разрешить сеть плюс разрешить прерывания).
330 +\\Прерывание в этом случае не произойдет, оно активируется только по завершении "длительных" операций, которые переводят контроллер в состояние "Думаю, прошу не мешать", а установленный в "1" триггер разрешения прерываний, кроме этого, разрешает еще и работу сети, если она активирована. При запуске следующей операции ввода-вывода действия в п. 3.1 (сброс контроллера) сбросят и этот триггер, после чего программа обслуживания сети, обнаружив сброс этого триггера, прекратит (приостановит) свою работу и вернет управление основной программе обслуживания дисков AZ. Максимум, что можно заметить со стороны ЦП - это небольшая (10-20 мкс) задержка исполнения команды сброса, но это вполне умеренная плата за сетевые возможности.
331 +
329 329  
333 +== **011: Получить таблицу назначений приводов AZn** ==
330 330  
331 -In this case, the interrupt will not occur, it is activated only upon completion of "long" operations that transfer the controller to the "Thinking, please do not interfere" state, and the interrupt enable trigger set to "1" also enables network operation if it is activated. When the next input-output operation is started, the actions in paragraph 3.1 (controller reset) will also reset this trigger, after which the network service program, having detected the reset of this trigger, will stop (suspend) its work and return control to the main disk service program AZ. The maximum that can be noticed from the CPU side is a small (10-20 µs) delay in executing the reset command, but this is a very reasonable price for network capabilities.
335 +Код команды 011. Получив эту команду, контроллер переключается с буфера для блока на свою внутреннюю таблицу назначений (32 строки по 140 байт каждая)* . Перед выдачей этой команды следует сбросить контроллер. После выдачи этой команды следует выдать команду 015 (чтение буфера), но в этом случае будет читаться не буфер, а та самая таблица, последовательно, слово за словом.
336 +\\* начиная с версии v17, длина имени файла уже не 130 байт, а 386 байт (последнее слово - нулевое, для окончания строки)
332 332  
333 -== 011: Get AZn drive assignment table ==
338 +[[**//пример утилиты AZSMNT//**>>url:https://forum.maxiol.com/index.php?s=&showtopic=5605&view=findpost&p=59420]]
334 334  
335 -Command code 011. Upon receiving this command, the controller switches from the block buffer to its internal assignment table (32 lines of 140 bytes each)*. Before issuing this command, the controller should be reset. After issuing this command, command 015 (read buffer) should be issued, but in this case it will not be the buffer that is read, but the same table, sequentially, word by word.
336 -\\* starting with v17, the file name length is no longer 130 bytes, but 386 bytes (the last word is zero, to end the line)
337 337  
338 -[[AZSMNT utility example>>url:https://forum.maxiol.com/index.php?s=&showtopic=5605&view=findpost&p=59420]]
341 +Пример программы:
339 339  
340 -
341 -Example program:
342 -
343 343  {{code language="assembler"}}
344 344  ;...................................
345 -AZ$CSR = 177220; Controller CSR
346 -RdBuf = 012; Command "Read from controller memory"
347 -RdTbl = 011; Command "Read assignment table"
348 -TblSiz = 1120.; Table length in bytes (decimal)
345 +AZ$CSR = 177220; CSR контроллера
346 +RdBuf = 012; Команда "Читать из памяти контроллера"
347 +RdTbl = 011; Команда "Читать таблицу назначений"
348 +TblSiz = 1120.; Длина таблицы в байтах (десятичная)
349 349  
350 -; We assume that R2 contains the address of the first word of the
351 -; memory area for the assignment table. We do not show the procedure for obtaining this address.
350 +; Считаем, что в R2 находится адрес первого слова
351 +; области памяти для таблицы назначений. Процедуру
352 +; получения этого адреса не показываем.
352 352  
353 - MOV #AZ$CSR,R3; Preparing the controller CSR
354 + MOV #AZ$CSR,R3; Готовим CSR контроллера
354 354  10$: CLR @R3;
355 - TSTB @R3; Reset the controller
356 + TSTB @R3; Сбросим контроллер
356 356   BPL 10$;
357 357  
358 - MOV #RdTbl,@R3;Command "Transfer
359 - ; table"
359 + MOV #RdTbl,@R3; Команда "Передать
360 + ; таблицу"
360 360  
361 - MOV #RdBuf,(R3+); Command "Read from
362 -; controller memory. At the same time, move the address in R3
363 -; to the DR of the controller (177222).
362 + MOV #RdBuf,(R3+); Команда "Читать из
363 +; памяти контроллера. Одновременно передвинем адрес в R3
364 +; на DR контроллера (177222).
364 364  
365 - MOV #TblSiz/2,R1; Prepare the word counter
366 + MOV #TblSiz/2,R1; Готовим счетчик слов
366 366  
367 -11$: MOV @R3,(R2)+; Send the current word
368 -SOB R1,11$; and repeat 560 times
368 +11$: MOV @R3,(R2)+; Перешлем текущее слово
369 + SOB R1,11$; и повторим 560 раз
369 369  ;...................................
370 370  {{/code}}
371 371  
372 -== 012: Setting the block number, block number high bits ==
373 +== **012: Установка номера блока, старшие биты номера блока** ==
373 373  
374 -The controller provides the machine with MPI as disks AZ0 - AZ7 file-images of the DSK type on the micro-SD card. The size of these file-images and, accordingly, pseudo-disks, can be any, up to 4G each. Addressing on these pseudo-disks is direct - the block number obtained by QBUS, after shifting, is used as an offset from the beginning of the corresponding file-image. In fact, this is something like LBA on a PC.
375 +Контроллер предоставляет машинке с МПИ в качестве дисков AZ0 - AZ7 файл-образы типа DSK на карточке микро-SD. Размер этих файл-образов и, соответственно, псевдодисков, может быть любым, вплоть до 4Г каждый. Адресация на этих псевдодисках прямая - полученный по МПИ номер блока, после сдвига, используется в качестве смещения от начала соответствующего файл-образа. Фактически, это нечто, вроде LBA на PC.
376 +\\Существуют операционные системы PDP-11, поддерживающие такие диски - RSX-11, ДИАМС, еще что-то. Однако, самая распространенная ОС - RT-11 - использует для номера блока СЛОВО (16 бит), причем код 0177777 кое-где используется в специальных целях и как размер диска не годится, поэтому для RT-11 могут быть использованы диски с максимальным числом блоков 0177776, т.е. 65534 блока (33553408 байт или 32767 К байт). Поэтому команды установки номера блока две: установить младшие биты номера блока - код 002 и установить старшие биты номера блока - код 012. Если номер блока помещается в 16 разрядов (для RT-11 - всегда), достаточно использовать команду установки младших битов номера блока, старшие биты при этом очищаются. Если номер не помещается в 16 разрядов, то сначала надо выдавать младшие биты, а потом старшие. Если попытаться сразу передать старшие биты без предварительной передачи младших, выдается ошибка. Если переданный адрес выходит за границу файл-образа, также выдается ошибка, не важно, на каком этапе - хоть при передаче младших 16 битов номера блока, хоть при передаче старших.
377 +\\Для выполнения этих действий следует переслать требуемую часть битов номера блока в DR и затем переслать в CSR код команды, после чего следует проверить на ошибку. Команды мгновенные, т.е. выполняются за один цикл обращения по МПИ.
378 +
375 375  
380 +== **013: Прочитать запись оглавления HFS** ==
376 376  
377 -There are PDP-11 operating systems that support such disks - RSX-11, DIAMS, and some others. However, the most common OS - RT-11 - uses a WORD (16 bits) for the block number, and the code 0177777 is used in some places for special purposes and is not suitable as a disk size, so disks with a maximum number of blocks of 0177776, i.e. 65534 blocks (33553408 bytes or 32767 K bytes), can be used for RT-11. Therefore, there are two commands for setting the block number: to set the low-order bits of the block number - code 002 and to set the high-order bits of the block number - code 012. If the block number fits into 16 bits (for RT-11 - always), it is enough to use the command to set the low-order bits of the block number, the high-order bits are cleared. If the number does not fit into 16 digits, then first the lower bits must be output, and then the higher ones. If you try to immediately transmit the higher bits without first transmitting the lower ones, an error is returned. If the transmitted address goes beyond the file-image boundary, an error is also returned, no matter at what stage - either when transmitting the lower 16 bits of the block number, or when transmitting the higher ones.
378 -\\To perform these actions, you should send the required part of the block number bits to DR and then send the command code to CSR, after which you should check for an error. The commands are instantaneous, i.e. they are executed in one cycle of access via MPI.
379 -
380 -== 013: Read HFS TOC entry ==
381 -
382 -Command code 013, the command reads the TOC record into the internal memory area and switches the pointer to it for data transfer via DR. The TOC must be open before this.
383 -
384 -The procedure is as follows:
385 -• Reset the controller.
386 -• Issue the command "Read the table of contents entry" to the CSR and wait for it to finish.
387 -• Issue the command "Read from controller memory" to the CSR
388 -• Read 11 words of the table of contents entry from DR
389 -\\The table of contents entry has the format:
390 -
391 -(% style="width:686px" %)
392 -|=(% style="width: 136px;" %)Offset (octal)|=(% style="width: 305px;" %)Name|=(% style="width: 242px;" %)Value
393 -|(% style="width:136px" %)0|(% style="width:305px" %)fSize|(% style="width:242px" %)File size in bytes, low word
394 -|(% style="width:136px" %)2|(% style="width:305px" %)fSize|(% style="width:242px" %)File size in bytes, high word
395 -|(% style="width:136px" %)4|(% style="width:305px" %)fDate|(% style="width:242px" %)Date in MS-DOS format
396 -|(% style="width:136px" %)6|(% style="width:305px" %)fTime|(% style="width:242px" %)Time in MS-DOS format
397 -|(% style="width:136px" %)10|(% style="width:305px" %)fAttr|(% style="width:242px" %)Attributes 1 byte
398 -|(% style="width:136px" %)10|(% style="width:305px" %)fName|(% style="width:242px" %)NAME.FILE TYPE, 8+1+3+1 = 13 bytes
399 -
400 -
401 -The offsets are specified in octal. The formula in the fName line means that there must first be a name, maximum of eight characters, then a period, then a type, up to three characters, and a terminating zero byte 0x00. If the type is not specified, the period is also not needed.
402 -\\File attributes in fAttr byte (octal):
382 +Код команды 013, команда читает запись оглавления во внутреннюю область памяти и переключает на нее указатель для передачи данных через DR. Оглавление перед этим должно быть открыто. Порядок действий следующий:
383 +• Сбросить контроллер.
384 +• Выдать в CSR команду "Прочитать запись оглавления" и дождаться ее окончания.
385 +• Выдать в CSR команду "Прочитать из памяти контроллера"
386 +• Прочитать из DR 11 слов записи оглавления
387 +\\Запись оглавления имеет формат:
388 +\\См. Имя Значение
389 +0 fSize Размер файла в байтах, младшее слово
390 +2 старшее слово
391 +4 fDate Дата в формате MS-DOS
392 +6 fTime Время в формате MS-DOS
393 +10 fAttr Атрибуты 1 байт
394 +11 fName ИМЯ.ТИП файла, 8+1+3+1 = 13 байт
395 +\\Смещения указаны восьмеричные. Формула в строке fName означает, что там сначала должно быть имя, максимально из восьми символов, далее должна быть точка, далее тип, до трёх символов, и завершающий нулевой байт 0х00. Если тип не указан, точка тоже не нужна.
396 +\\Атрибуты файлов в байте fAttr (восьмеричные):
403 403  \\001 - Read Only
404 404  002 - Hidden
405 405  004 - System
406 406  020 - Directory
407 407  040 - Archive
408 -\\Example program
402 +\\Пример программы.
409 409  
410 410  {{code language="assembler"}}
411 411  ;......................................
412 -RdDir = 013; command code "Read table of contents entry"
406 +RdDir = 013; код команды "Читать запись оглавления"
413 413  RdBuf = 015
414 414  
415 415   MOV #AZ$CSR,R3
416 416  
417 417  15$: CLR @R3;
418 - TSTB @R3; Reset the controller
412 + TSTB @R3; Сбросим контроллер
419 419   BPL 15$;
420 420  
421 - MOV #RdDir,@R3; Ask the controller
422 -16$: TSTB @R3; to read into its memory
423 - BPL 16$; table of contents entry
415 + MOV #RdDir,@R3; Попросим контроллер
416 +16$: TSTB @R3; прочитать в свою память
417 + BPL 16$; запись оглавления
424 424  
425 425   MOV @RdBuf,(R3)+;
426 - MOV DIRREC,R2; And transfer it to itself in
427 - MOV #11.,R1; memory area, pointer
428 -17$: MOV @R3,(R2)+; to which lies in cell
420 + MOV DIRREC,R2; И перенесем ее к себе в
421 + MOV #11.,R1; область памяти, указатель
422 +17$: MOV @R3,(R2)+; на которую лежит в ячейке
429 429   SOB R1,17$; DIRREC.
430 430  
431 431  ;......................................
... ... @@ -432,97 +432,96 @@
432 432  {{/code}}
433 433  
434 434  
435 -== 014: Unmount disk ==
429 +== **014: Размонтировать диск** ==
436 436  
437 -Command code 014, to unmount the disk, you should reset the controller, send the AZ drive number to the controller DR, which should be unmounted, and send the 014 code to the controller CSR, then wait for the operation to complete (it takes a long time) and check for an error. An error is issued if the drive has not been mounted.
438 -[[AZUMNT utility example>>url:https://forum.maxiol.com/index.php?showtopic=5605&st=0&p=59418&#entry59418]]
431 +Код команды 014, чтобы размонтировать диск, следует сбросить контроллер, переслать в DR контроллера номер привода AZ, который следует размонтировать, и послать в CSR контроллера код 014, после чего дождаться окончания операции (она длительная) и проверить на ошибку. Ошибка выдается, если привод не был смонтирован.
432 +[[**//пример утилиты AZUMNT//**>>url:https://forum.maxiol.com/index.php?showtopic=5605&st=0&p=59418&#entry59418]]
439 439  
440 440  
441 -== 015: Start transferring the read block ==
435 +== **015: Начать передачу считанного блока** ==
442 442  
443 -The command code is 015. Having received this command, the controller is configured to output word by word the contents of the same built-in buffer for 256 words, which will be output sequentially through the DR register. No waiting is required, we simply send a word from DR to sequential memory cells 256 times, and that's it. If less than 256 words are needed (the last shortened block of the file), then the remainder can simply be discarded without reading, resetting the controller at the beginning of the next operation will also reset this remainder.
444 -\\Example program:
437 +Код команды - 015. Получив эту команду, контроллер настраивается на пословную выдачу содержимого того самого встроенного буфера на 256 слов, которые будут выданы последовательно через регистр DR. Никаких ожиданий не требуется, просто пересылаем 256 раз слово из DR в последовательные ячейки памяти, и все. Если нужно меньше, чем 256 слов (последний укороченный блок файла), то остаток можно просто бросить, не считывая, сброс контроллера в начале следующей операции сбросит и этот остаток.
438 +\\Пример программы:
445 445  
446 446  {{code language="assembler"}}
447 447  ;..................................
448 -RdBuf=015; symbolic name of the command
442 +RdBuf=015; символическое наименование команды
449 449  
450 -; In R3 from the previous fragment there is the address of the CSR
444 +; В R3 от предыдущего фрагмента остался адрес CSR
451 451  ; (177220)
452 452  
453 -; We assume that in R2 we have the address of the first word
454 -; of memory, where the read block should be placed.
455 -; The program for obtaining this address is not given.
447 +; Считаем, что у нас в R2 находится адрес первого слова
448 +; памяти, куда следует разместить прочитанный блок.
449 +; Программа получения этого адреса не приводится.
456 456  
457 - MOV #400,R1; Prepare the word counter
451 + MOV #400,R1; Готовим счетчик слов
458 458   ; 0400 oct = 256 dec
459 459  
460 - MOV #RdBuf,(R3)+; and send the command
461 -; RdBuf to the CSR. The address in R3 will point to DR (177222).
454 + MOV #RdBuf,(R3)+; и пересылаем команду
455 +; RdBuf в CSR. Адрес в R3 укажет на DR (177222).
462 462  
463 -3$: MOV @R3,(R2)+we will send the next word to
464 -; memory
465 - SOB R1,3$; and repeat this 256 (0400)
466 - ; times
457 +3$: MOV @R3,(R2)+;перешлем очередное слово в
458 + ; память
459 + SOB R1,3$; и повторим это 256 (0400)
460 + ; раз
467 467  ;..................................
468 468  {{/code}}
469 469  
470 -That's it, reading is complete.
464 +Всё, чтение закончено.
465 +\\Для записи наоборот, требуется сначала перенести весь блок данных из памяти ЦП в контроллер и потом выдать команду "Записать содержимое буфера на диск"
471 471  
472 -To write the opposite way, you first need to transfer the entire data block from the CPU memory to the controller and then issue the command "Write the contents of the buffer to disk"
473 473  
468 +== **016: Принять блок данных в буфер** ==
474 474  
475 -== 016: Receive data block into buffer ==
470 +Код команды 016. Команда настраивает контроллер на прием блока данных и помещении его в буфер. Следующие 256 циклов записи в DR поместят данные, переданные через МПИ, в буфер.
471 +\\Пример программы.
476 476  
477 -Command code 016. The command sets the controller to receive a block of data and place it in the buffer. The next 256 write cycles to DR will place the data transferred via the QBUS in the buffer.
478 -\\Example program:
479 -
480 480  {{code language="assembler"}}
481 481  ;..................................
482 482  
483 -WrBuf=016; Symbolic name of the command
476 +WrBuf=016; Символическое наименование команды
484 484  
485 -; Before writing, you need to perform the same actions as in
486 -; pp. 3.1.-3.3. Usually, this is the same program,
487 -; just after point 3.3. a check is performed "What
488 -; is required: reading or writing?" and a branch is made to the
489 -; reading or writing program.
478 +; Перед записью нужно выполнить те же действия, что и в
479 +; пп. 3.1.-3.3. Обычно, это одна и та же программа,
480 +; просто после пункта 3.3. выполняется проверка "Что
481 +; требуется: чтение или запись?" и разветвление на
482 +; программу чтения или записи.
490 490  
491 -; After the fragment in point 3.3., the CSR address
492 -; (177220) remains in R3. We will assume that R2 contains the address in the CPU
493 -; memory where the block to be written is located.
494 -; The program for obtaining this address is not shown.
484 +; После фрагмента в п. 3.3. в R3 остался адрес CSR
485 +; (177220). Будем считать, что в R2 находится адрес в
486 +; памяти ЦП, где находится блок, подлежащий записи.
487 +; Программа получения этого адреса не показана.
495 495  
496 - MOV #400,R1; Preparing the counter
489 + MOV #400,R1; Готовим счетчик
497 497  
498 - MOV #WrBuf,(R3)+; Let's forward the command to the CSR and
499 -; switch the address in R3 to
500 -; DR
491 + MOV #WrBuf,(R3)+; Перешлем команду в CSR и
492 + ; переключим адрес в R3 на
493 + ; DR
501 501  
502 -4$: MOV (R2)+,@R3; Let's forward the next word
503 -; data
504 - SOB R1,4$; and repeat this 256 times
495 +4$: MOV (R2)+,@R3; Перешлем очередное слово
496 + ; данных
497 + SOB R1,4$; и повторим это 256 раз
505 505  ;..................................
506 506  {{/code}}
507 507  
508 -== 017: Get ramdisk size, large ==
501 +== **017: Получить размер псевдодиска, большой** ==
509 509  
510 -There are two commands to get the size of a pseudo-disk, i.e. the AZn file-image mounted on the selected pseudo-drive.
511 -\\If the OS being used (or a program working with disks without an OS) can work with large (more than 32M) disks, you should use the command with the code 017. The sequence of actions: reset the controller (p. 3.1), select the drive (p. 3.2) and send the code 017 to the CSR, and then, without any waiting, read from DR first the lower word, and then the higher word of the size of the selected drive (image file).
512 -\\If the OS you are using cannot work with disks larger than 32M (RT-11), you should use the 007 command - get the pseudo-disk size with a limit of up to 32M. The steps are similar: reset the controller, select the disk, send the 007 code to the CSR and read one word of the pseudo-disk size from DR. If the size of the image file mounted on the selected pseudo-drive is larger than 65534 blocks, the controller returns the number 65534 instead of this "large" size. We remind you that the number 65535 is used in some places for special purposes and cannot be the disk size.
513 -\\We also remind you that if the image file is not mounted on this drive, the sequence of actions will not work (command 001 select device) and the program execution will simply not reach this point. Therefore, these commands do not provide for errors.
514 -\\Example of a program with large disks
503 +Есть две команды получения размера псевдодиска, т.е. смонтированного на выбранный псевдопривод AZn файл-образа.
504 +\\Если используемая ОС (или программа, работающая с дисками без ОС) умеет работать с большими (больше 32М) дисками, следует пользоваться командой с кодом 017. Последовательность действий: сбросить контроллер (п. 3.1), выбрать накопитель (п. 3.2) и переслать в CSR код 017, а затем, без каких-либо ожиданий, считать из DR сначала младшее, и следом за ним старшее слово размера выбранного накопителя (файл-образа).
505 +\\Если используемая ОС не умеет работать с дисками бОльшими, чем 32М (RT-11), следует пользоваться командой 007 - получить размер псевдодиска с ограничением до 32М. Действия похожие: сбрасываем контроллер, выбираем диск, посылаем в CSR код [[007>>doc:||anchor="H007:41F43E43B44344743844244C44043043743C43544043F44143543243443E43443844143A430"]] и считываем из DR одно слово размера псевдодиска. Если размер файл-образа, смонтированного на выбранный псевдопривод, больше 65534 блоков, вместо этого "большого" размера, контроллер возвращает число 65534. Напоминаем, что число 65535 кое-где используется в специальных целях и не может быть размером диска.
506 +\\Также напоминаем, что если на этот накопитель не смонтирован файл-образ, последовательность действий не пройдет (команда 001 выбор устройства) и исполнение программы до этого места просто не дойдет. Поэтому ошибок у этих команд не предусмотрено.
507 +\\Пример программы с большими дисками
515 515  
516 516  {{code language="assembler"}}
517 517  ;......................................
518 518  
519 -GetBig=017; Get the "big" disk size
512 +GetBig=017; Получить "большой" размер диска
520 520  
521 -; From fragment 3.2 (disk selection) we have in R3
522 -; DR address (177222)
514 +; От фрагмента 3.2 (выбор диска) у нас в R3 остался
515 +; адрес DR (177222)
523 523  
524 - MOV #GetBig,-(R3); send the command
525 - TST (R3)+; return the address in R3 back to DR
517 + MOV #GetBig,-(R3); пошлем команду
518 + TST (R3)+; вернем адрес в R3 назад, на DR
526 526   MOV @R3,BigSiz
527 527   MOV @R3,BigSiz+2
528 528  ;......................................
... ... @@ -529,26 +529,27 @@
529 529  {{/code}}
530 530  
531 531  
532 -== 020: Get extended diagnostic code ==
525 +== **020: Получить расширенный код диагностики** ==
533 533  
534 -Command code 020, after resetting the controller, you should issue this command in the CSR and then read two words of extended diagnostics from DR. The command is instant, no waiting is required.
527 +Код команды 020, после сброса контроллера следует выдать эту команду в CSR и затем прочитать два слова расширенной диагностики из DR. Команда мгновенная, ожидание не требуется.
535 535  
536 536  
537 -== 027: Get firmware version AZ STM32 ==
530 +== **027: Получить версию firmware AZ STM32** ==
538 538  
539 -Command code 027, returns 2 words
540 -\\first word - 06404 = high byte 13. this is the firmware version, low byte 4. this is the hardware version - i.e. AZБК in this case second word - 037 = this is the maximum mountable disk - 31.
532 +Код команды 027, возвращает 2 слова
533 +\\первое слово - 06404 = старший байт 13. это версия прошивки, младший байт 4. это версия железа - те AZБК в данном случае
534 +второе слово - 037 = это максимальный монтируемый диск - 31.
541 541  
542 542  
543 543  {{code language="assembler"}}
544 544  ;-------------------------------------------------------------
545 -; getting STM32 firmware version - result in R1 R1=0 error
539 +; получение версии прошивки STM32 - результат в R1 R1=0 ошибка
546 546  GTSTMV: MOV #AZ$CSR,R1
547 -1$: CLR (R1) ; Send "Reset" command
548 - TSTB (R1) ;Check controller readinessконтроллера
549 - BPL 1$ ; If not ready, reset again
541 +1$: CLR (R1) ; Пошлем команду "Сброс"
542 + TSTB (R1) ; Проверим готовность контроллера
543 + BPL 1$ ; Если не готов, сбрасываем еще
550 550   mov #27,(R1)
551 - TST (R1)+ ; Check for error
545 + TST (R1)+ ; Проверяем на ошибку
552 552   BMI 2$
553 553   mov (R1),R1
554 554   return
... ... @@ -558,45 +558,45 @@
558 558  {{/code}}
559 559  
560 560  
561 -== 030: No operation ==
555 +== **030:  Нет операции** ==
562 562  
563 -The main purpose of this command is to set the interrupt enable bit from the controller. The command transfers the interrupt enable bit, which is in the same word with it, but is not part of it (remember, the command is located in bits D0 - D5, and the interrupt enable bit is D6), to the corresponding trigger of the controller and does not affect the processes in the controller in any other way. Control of this trigger works even in the "Thinking, please do not interfere" state, and this is the main feature of the "no operation" command.
564 -\\The command has the code 0030. Sending the code 0130 to the CSR will enable interrupts from the controller, sending the code 0030 will disable them. An example is not given due to its triviality.
557 +Основное назначение этой команды - устанавливать бит разрешения прерываний от контроллера. Команда передает бит разрешения прерывания, который находится с ней в одном слове, но не входит в ее состав (напоминаем, команда располагается в битах D0 - D5, а бит разрешения прерываний - D6), в соответствующий триггер контроллера и больше никак не влияет на процессы в контроллере. Управление этим триггером работает даже в состоянии "Думаю, прошу не мешать", и это главная особенность команды "нет операции".
558 +\\Команда имеет код 0030. Посылка в CSR кода 0130 разрешит прерывания от контроллера, посылка кода 0030 запретит их. Пример не приводится вследствие тривиальности его.
565 565  
566 566  
567 -= Command block for working with non-volatile memory =
561 += **Блок команд работы с энергонезависимой памятью** =
568 568  
569 -The interface provides any AZ controller with access to 255 words of non-volatile memory, all commands set the ready bit upon completion. This allows you to save user settings in non-volatile memory, for example, this is used in AZBK ??- there are saved settings for more comfortable operation of the controller.
563 +Интерфейс предоставляет любому AZ-контроллеру доступ к 255 словам энергонезависимой памяти, все команды устанавливают бит готовности по завершению. Это позволяет сохранять пользовательские настройки в энергонезависимой памяти, к примеру это используется в AZБК - там сохраняются настройки для более комфортной работы контроллера.
570 570  
571 -All commands in this block use a non-volatile memory buffer for their operation.
565 +Все команды этого блока используют буфер энергонезависимой памяти для своей работы.
572 572  
573 -== 021: Read non-volatile memory block into buffer ==
567 +== **021: Cчитать блок энергонезависимой памяти в буфер** ==
574 574  
575 575  (% class="wikigeneratedid" %)
576 -Command code 021, this command causes a block of non-volatile memory to be read into the non-volatile memory buffer.
570 +Код команды 021, данная команда вызывает чтение блока энергонезависимой памяти в буфер энергонезависимой памяти.
577 577  
578 578  
579 -== 022: Transfer the read block of non-volatile memory from the buffer to the bus ==
573 +== **022: Отдать на шину считанный блок энергонезависимой памяти из буфера** ==
580 580  
581 581  (% class="wikigeneratedid" %)
582 -Command code 022, this command ensures that the non-volatile memory buffer is transferred to the DR register for reading.
576 +Код команды 022, данная команда обеспечивает передачу буфера энергонезависимой памяти в регистр DR для считывания.
583 583  
584 584  (% class="wikigeneratedid" %)
585 -Example program
579 +Пример программы
586 586  
587 587  {{code language="assembler"}}
588 -AZ$CSR = 177220; command and status register (CSR)
589 -AZ$DR = 177222; data register (DR)
582 +AZ$CSR = 177220; регистр команд и состояния (CSR)
583 +AZ$DR = 177222; регистр данных (DR)
590 590  
591 591  
592 -; trap 50 - reset AZ
586 +; trap 50 - cброс AZ
593 593  ; результат в R1 =0 ok
594 594  AZreset: MOV #AZ$CSR,R1
595 -1$: CLR (R1); Send the "Reset" command
596 - TSTB (R1); Check the controller readiness
597 - BPL 1$; If not ready, reset again
598 -; once and check again
599 - TST (R1); Check for an error,
589 +1$: CLR (R1); Пошлем команду "Сброс"
590 + TSTB (R1); Проверим готовность контроллера
591 + BPL 1$; Если не готов, сбрасываем еще
592 + ; раз и проверяем снова
593 + TST (R1); Проверим на ошибку,
600 600   BMI 0ERR$
601 601   CLR R1
602 602   return
... ... @@ -605,30 +605,30 @@
605 605   return
606 606  
607 607  
608 -; trap 54 - reading non-volatile memory of block 1 EEPROM to the buffer from the address ADREEPROMMEM
609 -; result R3 - address, if R3=0 error
610 -; read status in R1 0 - ok
611 -; 1 - size does not match saved
612 -; 2 - version error
613 -; 3 - checksum error
602 +; trap 54 - чтение энергонезависимой памяти блока 1 EEPROM в буфер с адреса ADREEPROMMEM
603 +; результат R3 - адрес, если R3=0 ошибка
604 +; статус чтения в R1 0 - ok
605 +; 1 - размер не соответствует сохраненному
606 +; 2 - oшибка версии
607 +; 3 - oшибка контрольной суммы
614 614  ReadEEPROM: push R2
615 - call AZreset; reset
609 + call AZreset; сбросим
616 616   tst R1
617 617   bne 0ERR$
618 618  ; теперь читаем
619 619   MOV #AZ$CSR,R1
620 - mov #21,(R1); read block 1 of non-volatile memory into buffer
621 -0$: TSTB (R1); check execution result
622 - BPL 0$; wait
623 - mov #22,(R1); send read block of non-volatile memory from buffer to bus
624 -1$: TSTB (R1); check execution result
625 - BPL 1$; wait
626 - TST (R1)+; increment
614 + mov #21,(R1); считать блок 1 энергонезависимой памяти в буфер
615 +0$: TSTB (R1); проверяем результат выполнения
616 + BPL 0$; ждем
617 + mov #22,(R1); отдать на шину считанный блок энергонезависимой памяти из буфера
618 +1$: TSTB (R1); проверяем результат выполнения
619 + BPL 1$; ждем
620 + TST (R1)+; инкрементируем
627 627   mov #ADREEPROMMEM,R3
628 - mov #256.,R2; read 256. words; first word is reading result
629 -2$: mov (R1),(R3)+; read block of words into memory
622 + mov #256.,R2; читаем 256. слов; первое слово - результат чтения
623 +2$: mov (R1),(R3)+; читаем блок слов в память
630 630   sob R2,2$
631 - mov #ADREEPROMMEM,R3; successful
625 + mov #ADREEPROMMEM,R3; успешно
632 632   mov (R3),R1
633 633   br 0END$
634 634  0ERR$: CLR R3
... ... @@ -636,39 +636,41 @@
636 636   return
637 637  {{/code}}
638 638  
639 -obviously, after reading the memory, it is necessary to check the result code in the first word - see the decoding of error codes
640 -\\Examples of returned data for commands
641 -\\sequentially issuing the command 021 and then 022 will allow reading 256 words from non-volatile memory
642 -Attention! The first word will be the reading success status
633 +очевидно, после считывания памяти необходимо проверить код результата в первом слове - см расшифровку кодов ошибок
634 +\\Примеры возвращаемых данных по командам
635 +\\последовательная подача команды 021 и затем 022 позволит считать 256. слов
636 +из энергонезависимой памяти
637 +**Внимание! **первое слово это будет статус успешности чтения
638 +
643 643  
644 644  * 0 - ok
645 -* 1 - size does not match saved
646 -* 2 - version error
647 -* 3 - checksum error
641 +* 1 - размер не соответствует сохраненному
642 +* 2 - oшибка версии
643 +* 3 - oшибка контрольной суммы
648 648  
649 -== 023: Receive data from the bus into the buffer for subsequent writing into the buffer ==
645 +== **023: Принять с шины в буфер данные для последующей записи в буфер** ==
650 650  
651 -Command code 023, this command allows you to fill the non-volatile memory buffer
647 +Код команды 023, данная команда позволяет наполнить буфер энергонезависимой памяти
652 652  
653 -== 024: Write from buffer to non-volatile memory block ==
649 +== **024: Записать из буфера в блок энергонезависимой памяти** ==
654 654  
655 -Command code 024, this command causes a non-volatile memory block to be written from the non-volatile memory buffer.
651 +Код команды 024, данная команда вызывает запись блока энергонезависимой памяти из буфера энергонезависимой памяти.
656 656  
657 -Example program
653 +Пример программы
658 658  
659 659  {{code language="assembler"}}
660 -AZ$CSR = 177220; Command and Status Register (CSR)
661 -AZ$DR = 177222; Data Register (DR)
656 +AZ$CSR = 177220; регистр команд и состояния (CSR)
657 +AZ$DR = 177222; регистр данных (DR)
662 662  
663 663  
664 -; trap 50 - reset AZ
660 +; trap 50 - cброс AZ
665 665  ; результат в R1 =0 ok
666 666  AZreset: MOV #AZ$CSR,R1
667 -1$: CLR (R1); Send the "Reset" command
668 - TSTB (R1); Check the controller readiness
669 - BPL 1$; If not ready, reset again
670 -; once and check again
671 - TST (R1); Check for an error,
663 +1$: CLR (R1); Пошлем команду "Сброс"
664 + TSTB (R1); Проверим готовность контроллера
665 + BPL 1$; Если не готов, сбрасываем еще
666 + ; раз и проверяем снова
667 + TST (R1); Проверим на ошибку,
672 672   BMI 0ERR$
673 673   CLR R1
674 674   return
... ... @@ -676,27 +676,27 @@
676 676   COM R1
677 677   return
678 678  
679 -; trap 55 - write non-volatile memory from the buffer at address ADREEPROMMEM в блок 1 EEPROM
675 +; trap 55 - запись энергонезависимой памяти из буфера с адреса ADREEPROMMEM в блок 1 EEPROM
680 680  WriteEEPROM: push R1
681 681   push R2
682 682   push R3
683 - call AZreset; reset
679 + call AZreset; сбросим
684 684   tst R1
685 685   bne 0ERR$
686 686  
687 687   MOV #AZ$CSR,R1
688 - mov #23,(R1);command that we will write data to the buffer
689 -0$: TSTB (R1); check the result of executio
690 - BPL 0$; wait
691 - TST (R1)+; increment
684 + mov #23,(R1); командуем что будем писать данные в буфер
685 +0$: TSTB (R1); проверяем результат выполнения
686 + BPL 0$; ждем
687 + TST (R1)+; инкрементируем
692 692   mov #ADREEPROMMEM+2,R3
693 - mov #255.,R2; write 255. words; skip the first word - the result of reading
694 -1$: mov (R3)+,(R1); send to the controller
689 + mov #255.,R2; пишем 255. слов; первое слово пропускаем - результат чтения
690 +1$: mov (R3)+,(R1); отдаем в контроллер
695 695   sob R2,1$
696 - tst -(R1); decrement
697 - mov #24,(R1); write from the buffer to block 1 of non-volatile memory
698 -2$: TSTB (R1); check the result of execution
699 - BPL 2$; we are waiting
692 + tst -(R1); декрементируем
693 + mov #24,(R1); записать из буфера в блок 1 энергонезависимой памяти
694 +2$: TSTB (R1); проверяем результат выполнения
695 + BPL 2$; ждем
700 700   br 0END$
701 701  0ERR$: CLR R3
702 702  0END$: pop R3
... ... @@ -705,21 +705,23 @@
705 705   return
706 706  {{/code}}
707 707  
708 -**Please note** that when recording, the buffer immediately comes with the data, i.e. there is no first word with the statu
704 +**Обращаю внимание**, при записи, буфер идет сразу с данными, те нет первого слова со статусом.
709 709  
710 710  
711 711  
712 -= Block of commands for working with RTC and NTP =
708 += Блок команд для работы с RTC и NTP =
713 713  
714 -The AZ® controller has 2 sources of date-time, the first is the RTC built into the STM32, the second is the clock in the TCP/IP stack. The RTC clock works autonomously with a 2032 battery installed. The clock in the TCP/IP stack is set based on data from the NTP server.
710 +В контроллере AZ®  есть 2 источника получения даты-времени, первый это RTC встроенный в STM32, второй это часы в стеке TCP/IP.  Часы RTC работают автономно при наличии установленной батарейки 2032. Часы в стеке TCP/IP устанавливаются на основании данных с NTP-сервера.
715 715  
716 716  
717 -== Buffer format timestamp (readable) ==
713 +== Формат буфера timestamp (доступен по чтению) ==
718 718  
719 -The controller API immediately prepares time in several formats, so that it can be conveniently used on the PDP-11 side
715 +API контроллера сразу готовит время в нескольких форматах, дабы его было удобно применить на стороне PDP-11
720 720  
721 721  {{info}}
722 -datetime buffer format octal offset - those words datetime buffer format
718 +формат буфера даты-времени
719 +offset в восьмеричной системе - те слова
720 +формат буфера даты-времени
723 723  \\[0]=rtc_rt11date();
724 724  [2]=rt11 time 50Hz big word;
725 725  [4]=rt11 time 50Hz little word;
... ... @@ -737,72 +737,72 @@
737 737  {{/info}}
738 738  
739 739  
740 -== SimpleIN buffer format (when writing) ==
738 +== Формат буфера SimpleIN (при записи) ==
741 741  
742 -the format is simplified as much as possible, for work with PDP-11
740 +формат максимально упрощен, для работы со стороны PDP-11
743 743  
744 744  {{info}}
745 -offset in octal - those words
743 +offset в восьмеричной системе - те слова
746 746  
747 -[0]=year, the lower two digits are 22 and not 2022(!)
748 -[2]=month; month
749 -[4]=day; day
750 -[6]=wday; day of the week =0 not set, 1 - Monday 2 - Tuesday etc.
751 -[10]=hour; hour
752 -[12]=min; minute
753 -[14]=sec; second
745 +[0]=year       год, младшие две цифры - те 22 а не 2022(!)
746 +[2]=month;     месяц
747 +[4]=day;       день
748 +[6]=wday;      день недели =0 не установлен, 1- понедельник 2 - вторник итд
749 +[10]=hour;     час
750 +[12]=min;      минута
751 +[14]=sec;      секунда
754 754  {{/info}}
755 755  
756 756  
757 -== 031: Get time from RTC to timestamp buffer ==
755 +== **031:  Получить время из RTC в буфер timestamp** ==
758 758  
759 -Command code 031, this command uses RTC clock as a source of filling the timestamp buffer
757 +Код команды 031, данная команда использует RTC часы как источник заполнения буфера timestamp
760 760  
761 -Example program:
759 +Пример программы:
762 762  
763 763  {{code language="assembler"}}
764 -; trap 61 - reading clock data from autonomous RTC clock
765 -; R3 - buffer address where to read
766 -; result in R3 address if successful. R3=0 if error
762 +; trap 61 - чтение данных часов из автономных часов RTC
763 +; R3 - адрес буфера куда надо считать
764 +; результат в R3 адрес, если успешно. R3=0 если ошибка
767 767  GetDateFromRTC: push R0
768 768   push R1
769 769   push R2
770 - call AZreset; reset
768 + call AZreset; сбросим
771 771   tst R1
772 772   bne G60ERR
773 773   MOV #AZ$CSR,R1
774 774   mov #31,(R1)
775 - br G60; let's go there because further code is the same
773 + br G60; идем туда тк дальше код одинаковый
776 776  {{/code}}
777 777  
778 -== 032: Get time from timestamp buffer ==
776 +== **032:  Получить время из буфера timestamp** ==
779 779  
780 -Command code 032, this command sends the contents of the timestamp buffer to the bus
778 +Код команды 032, данная команда отдает на шину содержимое буфера timestamp
781 781  
782 782  {{code language="assembler"}}
783 -; working with clock
784 -; trap 60 - reading clock data from TCP/IP stack
785 -; R3 - buffer address where to read
786 -; result in R3 address if successful. R3=0 if error
781 +; работа с часами
782 +; trap 60 - чтение данных часов из TCP/IP стека
783 +; R3 - адрес буфера куда надо считать
784 +; результат в R3 адрес, если успешно. R3=0 если ошибка
787 787  GetDateFromLAN: push R0
788 788   push R1
789 789   push R2
790 - call AZreset; reset
788 + call AZreset; сбросим
791 791   tst R1
792 792   bne G60ERR
793 793   MOV #AZ$CSR,R1
794 794   mov #42,(R1)
795 -G60: TSTB (R1); check execution result
796 - BPL G60; wait
793 +G60: TSTB (R1); проверяем результат выполнения
794 + BPL G60; ждем
797 797   mov #32,(R1)
798 -1$: TSTB (R1); check execution result
796 +1$: TSTB (R1); проверяем результат выполнения
799 799   BPL 1$; ждем
800 - TST (R1)+; increment
801 - mov R3,R0; remember R3 address
802 - mov #10.,R2; read 10 words
803 -2$: mov (R1),(R3)+; read block of words into memory
798 + TST (R1)+; инкрементируем
799 + mov R3,R0; запомним R3 - адрес
800 + mov #10.,R2; читаем 10 слов
801 +2$: mov (R1),(R3)+; читаем блок слов в память
804 804   sob R2,2$
805 - mov R0,R3; successful, return address to R3
803 + mov R0,R3; успешно, вернем адрес в R3
806 806   br 0END$
807 807  G60ERR: CLR R3
808 808  0END$: pop R2
... ... @@ -811,11 +811,11 @@
811 811   return
812 812  {{/code}}
813 813  
814 -It is worth checking the correctness of the received time:
812 +Стоит проверить корректность полученного времени:
815 815  
816 816  {{code language="assembler"}}
817 -; trap 63 - check time correctness
818 -; R3 - buffer address, result in R3, if buffer address then OK, =0 error
815 +; trap 63 - проверка корректности времени
816 +; R3 - адрес буфера, результат в R3, если адрес буфера то OK, =0 ошибка
819 819  CheckDateTime: Cmp 6(r3),#2021.
820 820   Blos 1err
821 821   Cmp 6(r3),#2100.
... ... @@ -825,94 +825,94 @@
825 825   return
826 826  {{/code}}
827 827  
828 -== 033: Write time-date to SimpleIN buffer ==
826 +== **033:  Запись времени-даты в буфер SimpleIN** ==
829 829  
830 -Command code 033, this command receives data from the bus into the SimpleIN buffer
828 +Код команды 033, данная команда  принимает с шины данные в буфер SimpleIN
831 831  
832 -The operation of this command is similar to the operation of commands 023 and 016.
830 +Работа данной команды аналогична работе команд [[023>>doc:||anchor="H023:41F44043843D44F44244C44144843843D44B43243144344443544043443043D43D44B43543443B44F43F43E44143B43543444344E44943543943743043F438441438432431443444435440"]] и [[016>>doc:||anchor="H016:A041F44043843D44F44244C43143B43E43A43443043D43D44B445432431443444435440"]].
833 833  
834 -== 034: Set RTC based on buffer data ==
832 +== **034:  Установка RTC на основании данных из буфера** ==
835 835  
836 -Command code 034, this command sets the RTC based on the data in the SimpleIN buffer
834 +Код команды 034, данная команда  устанавливает RTC на основании данных в буфере SimpleIN
837 837  
838 -This command executes quickly, but to avoid problems, a wait loop is recommended.
836 +Данная команда выполняется быстро, но для исключения проблем цикл ожидания выполнения рекомендуется.
839 839  
840 -== 035: Stimulate time request from NTP server, set based on response ==
838 +== **035:  Стимуляция запроса времени с NTP сервера, установка на основании ответа** ==
841 841  
842 -Command code 035, this command sends a request to the NTP server (set in the AZ.INI file or received from DHCP) and sets the clock in the TCP/IP stack.
840 +Код команды 035, данная команда отправляет запрос на NTP cервер (установленный в AZ.INI файле или полученный от DHCP) и устанавливает часы в стеке TCP/IP.
843 843  
844 -Example program: sending a request to set the time from an NTP server
842 +Пример программы: отсылка запроса на установку времени с NTP сервера
845 845  
846 846  {{code language="assembler"}}
847 -; trap 62 - sending a request to set the time from the NTP server
845 +; trap 62 - отсылка запроса на установку времени с NTP сервера
848 848  GetDateNTPtoNET:push R1
849 - call AZreset; reset
847 + call AZreset; сбросим
850 850   tst R1
851 851   bne 0ERR$
852 852   MOV #AZ$CSR,R1
853 853   mov #35,(R1)
854 -0$: TSTB (R1); check the result of execution
855 - BPL 0$; wait
852 +0$: TSTB (R1); проверяем результат выполнения
853 + BPL 0$; ждем
856 856  0ERR$: pop R1
857 857   return
858 858  {{/code}}
859 859  
860 -The command execution takes 1-2 seconds on average. This command requires the TCP/IP stack to work, so waiting cycles are needed when the stack is enabled.
858 +Выполнение команды занимает 1-2 секунды в среднем. Данная команда требует работы стека TCP/IP, соответственно нужны циклы ожидания при включенном стеке.
861 861  
862 -An example of a polling cycle to get time from the network
860 +Пример цикла опроса с целью получить время с сети
863 863  
864 864  {{code language="assembler"}}
865 -; date-time
863 +; дата-время
866 866   mov #S_DateTime_0,R3; "Lan Date:"
867 867   trap 10
868 - mov #20,R4; number of wait cycles
869 -$datry: trap 62; sent a request to the NTP server
870 - mov #110,@#AZ$CSR; enable the network
871 - trap 47; waiting
872 - trap 47; waiting
866 + mov #20,R4; количество циклов ожидания
867 +$datry: trap 62; отослали запрос к NTP серверу
868 + mov #110,@#AZ$CSR; включим сеть
869 + trap 47; ожидание
870 + trap 47; ожидание
873 873   mov #ADRTMPSTR,R3
874 - trap 60; read the date-time into the buffer
875 - trap 63; checked the date-time
872 + trap 60; считали в буфер дату-время
873 + trap 63; проверили дату-время
876 876   tst R3
877 877   bne $ok
878 878  $sob: sob R4,$datry
879 - mov #S_DateTime_2,R3; print error
877 + mov #S_DateTime_2,R3; печать ошибки
880 880   trap 7
881 881   br $go
882 882  
883 883  $ok: mov #ADRTMPSTR,R3
884 - trap 24; print date
885 - trap 25; time
886 -$go: mov #110,@#AZ$CSR; let's turn on the network
882 + trap 24; печать даты
883 + trap 25; времени
884 +$go: mov #110,@#AZ$CSR; включим сеть
887 887  {{/code}}
888 888  
889 -Here we explicitly send a request to the NTP server, then turn on the network and wait for the result, periodically polling and checking the correctness of the result.
887 +Тут мы явно отсылаем запрос к NTP серверу, затем включаем работу сети и ждем результата, периодически опрашивая и проверяя корректность результата.
890 890  
891 -== 036: Setting RTC based on TCP/IP stack clock ==
889 +== **036:  Установка RTC на основании часов TCP/IP стека** ==
892 892  
893 -Command code 036, this command sets the RTC based on the clock in the TCP/IP stack. You must first set the clock in TCP/IP - command 036.
891 +Код команды 036,  данная команда устанавливает RTC на основании часов в TCP/IP стека. Предварительно надо установить часы в TCP/IP - команда 036.
894 894  
895 -Example program:
893 +Пример программы:
896 896  
897 897  {{code language="assembler"}}
898 -; trap 64 - set RTC time based on stack time
899 -; R1 - result R1=0 - OK
900 -SetDateNETtoRTC:call AZreset; reset
896 +; trap 64 - установка времени RTC на основании времени стека
897 +; R1 - результат R1=0 - OK
898 +SetDateNETtoRTC:call AZreset; сбросим
901 901   tst R1
902 902   bne 0ERR$
903 903   MOV #AZ$CSR,R1
904 904   mov #36,(R1)
905 -0$: TSTB (R1); check execution result
906 - BPL 0$; wait
903 +0$: TSTB (R1); проверяем результат выполнения
904 + BPL 0$; ждем
907 907   clr R1
908 908  0ERR$: return
909 909  {{/code}}
910 910  
911 -== 042: Get time from TCP/IP stack clock into timestamp buffer ==
909 +== **042:  Получить время из часов TCP/IP стека в буфер timestamp** ==
912 912  
913 -Command code 042, this command uses the TCP/IP stack clock as a source for filling the timestamp buffer.
911 +Код команды 042,   данная команда использует часы TCP/IP стека как источник заполнения буфера timestamp.
914 914  
915 -Example program:
913 +Пример программы:
916 916  
917 917  {{code language="assembler"}}
918 918  ; работа с часами