Changes for page API контроллеров AZ®
Last modified by Max on 2025/03/02 15:18
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -382,46 +382,50 @@ 382 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 383 384 384 The procedure is as follows: 385 -• Сбросить контроллер. 386 -• Выдать в CSR команду "Прочитать запись оглавления" и дождаться ее окончания. 387 -• Выдать в CSR команду "Прочитать из памяти контроллера" 388 -• Прочитать из DR 11 слов записи оглавления 389 -\\Запись оглавления имеет формат: 390 -\\См. Имя Значение 391 -0 fSize Размер файла в байтах, младшее слово 392 -2 старшее слово 393 -4 fDate Дата в формате MS-DOS 394 -6 fTime Время в формате MS-DOS 395 -10 fAttr Атрибуты 1 байт 396 -11 fName ИМЯ.ТИП файла, 8+1+3+1 = 13 байт 397 -\\Смещения указаны восьмеричные. Формула в строке fName означает, что там сначала должно быть имя, максимально из восьми символов, далее должна быть точка, далее тип, до трёх символов, и завершающий нулевой байт 0х00. Если тип не указан, точка тоже не нужна. 398 -\\Атрибуты файлов в байте fAttr (восьмеричные): 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): 399 399 \\001 - Read Only 400 400 002 - Hidden 401 401 004 - System 402 402 020 - Directory 403 403 040 - Archive 404 -\\ Примерпрограммы.408 +\\Example program 405 405 406 406 {{code language="assembler"}} 407 407 ;...................................... 408 -RdDir = 013; кодкоманды"Читатьзаписьоглавления"412 +RdDir = 013; command code "Read table of contents entry" 409 409 RdBuf = 015 410 410 411 411 MOV #AZ$CSR,R3 412 412 413 413 15$: CLR @R3; 414 - TSTB @R3; Сбросимконтроллер418 + TSTB @R3; Reset the controller 415 415 BPL 15$; 416 416 417 - MOV #RdDir,@R3; Попросимконтроллер418 -16$: TSTB @R3; прочитатьвсвоюпамять419 - BPL 16$; записьоглавления421 + MOV #RdDir,@R3; Ask the controller 422 +16$: TSTB @R3; to read into its memory 423 + BPL 16$; table of contents entry 420 420 421 421 MOV @RdBuf,(R3)+; 422 - MOV DIRREC,R2; Иперенесемеексебев423 - MOV #11.,R1; областьпамяти,указатель424 -17$: MOV @R3,(R2)+; накоторуюлежитвячейке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 425 425 SOB R1,17$; DIRREC. 426 426 427 427 ;...................................... ... ... @@ -428,96 +428,97 @@ 428 428 {{/code}} 429 429 430 430 431 -== **014:Размонтироватьдиск**==435 +== 014: Unmount disk == 432 432 433 - Кодкоманды014,чтобыразмонтироватьдиск,следуетсброситьконтроллер,переслатьвDRконтроллераномерприводаAZ,которыйследуетразмонтировать,ипослатьвCSRконтроллеракод014,послечегодождатьсяокончанияоперации(онадлительная)ипроверитьнаошибку.Ошибкавыдается,еслиприводнебылсмонтирован.434 -[[ **//пример утилитыAZUMNT//**>>url:https://forum.maxiol.com/index.php?showtopic=5605&st=0&p=59418&#entry59418]]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]] 435 435 436 436 437 -== **015:Начатьпередачусчитанногоблока**==441 +== 015: Start transferring the read block == 438 438 439 - Кодкоманды-015.Получивэтукоманду,контроллернастраиваетсянапословнуювыдачусодержимоготогосамоговстроенногобуферана256слов,которыебудутвыданыпоследовательночерезрегистрDR.Никакихожиданийнетребуется,простопересылаем256разсловоизDRвпоследовательныеячейкипамяти,ивсе.Еслинужноменьше,чем256слов(последнийукороченныйблокфайла),тоостатокможнопростобросить,несчитывая,сбросконтроллеравначалеследующейоперациисброситиэтотостаток.440 -\\ Примерпрограммы: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: 441 441 442 442 {{code language="assembler"}} 443 443 ;.................................. 444 -RdBuf=015; символическоенаименованиекоманды448 +RdBuf=015; symbolic name of the command 445 445 446 -; ВR3отпредыдущегофрагментаосталсяадресCSR450 +; In R3 from the previous fragment there is the address of the CSR 447 447 ; (177220) 448 448 449 -; Считаем,чтоунасвR2находитсяадреспервогослова450 -; памяти,кудаследуетразместитьпрочитанныйблок.451 -; Программаполученияэтогоадресанеприводится.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. 452 452 453 - MOV #400,R1; Готовимсчетчикслов457 + MOV #400,R1; Prepare the word counter 454 454 ; 0400 oct = 256 dec 455 455 456 - MOV #RdBuf,(R3)+; ипересылаемкоманду457 -; RdBuf вCSR.АдресвR3укажетнаDR (177222).460 + MOV #RdBuf,(R3)+; and send the command 461 +; RdBuf to the CSR. The address in R3 will point to DR (177222). 458 458 459 -3$: MOV @R3,(R2)+ ;перешлемочередноесловов460 - память461 - SOB R1,3$; иповторимэто256 (0400)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 463 463 ;.................................. 464 464 {{/code}} 465 465 466 -Всё, чтение закончено. 467 -\\Для записи наоборот, требуется сначала перенести весь блок данных из памяти ЦП в контроллер и потом выдать команду "Записать содержимое буфера на диск" 470 +That's it, reading is complete. 468 468 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" 469 469 470 -== **016: Принять блок данных в буфер** == 471 471 472 -Код команды 016. Команда настраивает контроллер на прием блока данных и помещении его в буфер. Следующие 256 циклов записи в DR поместят данные, переданные через МПИ, в буфер. 473 -\\Пример программы. 475 +== 016: Receive data block into buffer == 474 474 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 + 475 475 {{code language="assembler"}} 476 476 ;.................................. 477 477 478 -WrBuf=016; Символическоенаименованиекоманды483 +WrBuf=016; Symbolic name of the command 479 479 480 -; Передзаписьюнужновыполнитьтежедействия,чтоив481 -; пп. 3.1.-3.3.Обычно,этооднаитаже программа,482 -; простопослепункта3.3.выполняетсяпроверка"Что483 -; требуется:чтениеилизапись?"иразветвлениена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. 485 485 486 -; Послефрагментавп.3.3.вR3 остался адресCSR487 -; (177220). Будемсчитать,чтовR2находитсяадресв488 -; памятиЦП,гденаходитсяблок,подлежащийзаписи.489 -; Программаполученияэтогоадресанепоказана.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. 490 490 491 - MOV #400,R1; Готовимсчетчик496 + MOV #400,R1; Preparing the counter 492 492 493 - MOV #WrBuf,(R3)+; ПерешлемкомандувCSRи494 - переключимадресвR3на495 - 498 + MOV #WrBuf,(R3)+; Let's forward the command to the CSR and 499 +; switch the address in R3 to 500 +; DR 496 496 497 -4$: MOV (R2)+,@R3; Перешлемочередноеслово498 - данных499 - SOB R1,4$; иповторимэто256раз502 +4$: MOV (R2)+,@R3; Let's forward the next word 503 +; data 504 + SOB R1,4$; and repeat this 256 times 500 500 ;.................................. 501 501 {{/code}} 502 502 503 -== **017:Получитьразмерпсевдодиска,большой**==508 +== 017: Get ramdisk size, large == 504 504 505 - Естьдвекомандыполученияразмерапсевдодиска,т.е.смонтированногонавыбранныйпсевдоприводAZnфайл-образа.506 -\\ ЕслииспользуемаяОС(илипрограмма,работающаясдискамибезОС)умеетработатьсбольшими(больше32М)дисками,следуетпользоватьсякомандойскодом017.Последовательностьдействий:сброситьконтроллер(п. 3.1),выбратьнакопитель(п. 3.2)ипереслатьвCSRкод017,азатем,безкаких-либоожиданий,считатьизDRсначаламладшее,иследомзанимстаршеесловоразмеравыбранногонакопителя(файл-образа).507 -\\ ЕслииспользуемаяОСнеумеетработатьсдискамибОльшими,чем32М(RT-11),следуетпользоватьсякомандой007 -получитьразмерпсевдодискасограничениемдо32М.Действияпохожие:сбрасываемконтроллер,выбираемдиск,посылаемвCSRкод[[007>>doc:||anchor="H007:41F43E43B44344743844244C44043043743C43544043F44143543243443E43443844143A430"]]исчитываемизDRоднословоразмерапсевдодиска.Еслиразмерфайл-образа,смонтированногонавыбранныйпсевдопривод,больше65534блоков,вместоэтого"большого"размера,контроллервозвращает число65534.Напоминаем,чточисло65535кое-гдеиспользуетсявспециальныхцеляхинеможетбытьразмеромдиска.508 -\\ Такженапоминаем,чтоеслинаэтотнакопительнесмонтированфайл-образ,последовательностьдействийнепройдет(команда001выборустройства)иисполнениепрограммыдоэтогоместапростонедойдет.Поэтомуошибокуэтихкоманднепредусмотрено.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 510 510 511 511 {{code language="assembler"}} 512 512 ;...................................... 513 513 514 -GetBig=017; Получить"большой"размердиска519 +GetBig=017; Get the "big" disk size 515 515 516 -; Отфрагмента3.2 (выбордиска)унасвR3остался517 -; адресDR (177222)521 +; From fragment 3.2 (disk selection) we have in R3 522 +; DR address (177222) 518 518 519 - MOV #GetBig,-(R3); пошлемкоманду520 - TST (R3)+; вернемадресвR3назад,наDR524 + MOV #GetBig,-(R3); send the command 525 + TST (R3)+; return the address in R3 back to DR 521 521 MOV @R3,BigSiz 522 522 MOV @R3,BigSiz+2 523 523 ;...................................... ... ... @@ -524,27 +524,26 @@ 524 524 {{/code}} 525 525 526 526 527 -== **020:Получитьрасширенныйкоддиагностики**==532 +== 020: Get extended diagnostic code == 528 528 529 - Кодкоманды020,послесбросаконтроллераследуетвыдатьэтукомандувCSRизатемпрочитатьдвасловарасширеннойдиагностикиизDR.Командамгновенная,ожиданиенетребуется.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. 530 530 531 531 532 -== **027:Получитьверсиюfirmware AZ STM32**==537 +== 027: Get firmware version AZ STM32 == 533 533 534 -Код команды 027, возвращает 2 слова 535 -\\первое слово - 06404 = старший байт 13. это версия прошивки, младший байт 4. это версия железа - те AZБК в данном случае 536 -второе слово - 037 = это максимальный монтируемый диск - 31. 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. 537 537 538 538 539 539 {{code language="assembler"}} 540 540 ;------------------------------------------------------------- 541 -; получениеверсии прошивкиSTM32 -результатвR1ошибка545 +; getting STM32 firmware version - result in R1 R1=0 error 542 542 GTSTMV: MOV #AZ$CSR,R1 543 -1$: CLR (R1) ; Пошлемкоманду"Сброс"544 - TSTB (R1) ; Проверимготовностьконтроллера545 - BPL 1$ ; Еслинеготов,сбрасываемеще547 +1$: CLR (R1) ; Send "Reset" command 548 + TSTB (R1) ;Check controller readinessконтроллера 549 + BPL 1$ ; If not ready, reset again 546 546 mov #27,(R1) 547 - TST (R1)+ ; Проверяемнаошибку551 + TST (R1)+ ; Check for error 548 548 BMI 2$ 549 549 mov (R1),R1 550 550 return ... ... @@ -554,45 +554,45 @@ 554 554 {{/code}} 555 555 556 556 557 -== **030:Нетоперации**==561 +== 030: No operation == 558 558 559 - Основноеназначениеэтойкоманды-устанавливатьбитразрешенияпрерыванийотконтроллера.Командапередаетбитразрешенияпрерывания,которыйнаходитсяснейводномслове,ноневходитвеесостав(напоминаем,командарасполагаетсявбитахD0 - D5,абитразрешенияпрерываний-D6),всоответствующийтриггерконтроллераибольшеникакневлияетнапроцессывконтроллере.Управлениеэтимтриггеромработаетдажевсостоянии"Думаю,прошунемешать",иэтоглавнаяособенностькоманды"нетоперации".560 -\\ Командаимееткод0030.Посылка в CSRкода0130разрешитпрерыванияотконтроллера,посылкакода0030запретитих.Примернеприводитсявследствиетривиальностиего.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. 561 561 562 562 563 -= **Блоккомандработысэнергонезависимойпамятью**=567 += Command block for working with non-volatile memory = 564 564 565 - ИнтерфейспредоставляетлюбомуAZ-контроллерудоступк255словамэнергонезависимойпамяти,всекомандыустанавливаютбитготовностипозавершению.Этопозволяетсохранятьпользовательскиенастройкивэнергонезависимойпамяти,кпримеруэтоиспользуетсявAZБК-тамсохраняютсянастройкидляболеекомфортнойработыконтроллера.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. 566 566 567 - Всекомандыэтогоблокаиспользуютбуферэнергонезависимойпамятидлясвоейработы.571 +All commands in this block use a non-volatile memory buffer for their operation. 568 568 569 -== **021:Cчитатьблокэнергонезависимойпамятивбуфер**==573 +== 021: Read non-volatile memory block into buffer == 570 570 571 571 (% class="wikigeneratedid" %) 572 - Кодкоманды021,даннаякомандавызываетчтениеблокаэнергонезависимойпамятивбуферэнергонезависимойпамяти.576 +Command code 021, this command causes a block of non-volatile memory to be read into the non-volatile memory buffer. 573 573 574 574 575 -== **022:Отдатьнашинусчитанныйблокэнергонезависимойпамятиизбуфера**==579 +== 022: Transfer the read block of non-volatile memory from the buffer to the bus == 576 576 577 577 (% class="wikigeneratedid" %) 578 - Кодкоманды022,даннаякомандаобеспечиваетпередачубуфераэнергонезависимойпамятиврегистрDRдлясчитывания.582 +Command code 022, this command ensures that the non-volatile memory buffer is transferred to the DR register for reading. 579 579 580 580 (% class="wikigeneratedid" %) 581 - Примерпрограммы585 +Example program 582 582 583 583 {{code language="assembler"}} 584 -AZ$CSR регистркомандисостояния(CSR)585 -AZ$DR регистрданных(DR)588 +AZ$CSR = 177220; command and status register (CSR) 589 +AZ$DR = 177222; data register (DR) 586 586 587 587 588 -; trap 50 - cбросAZ592 +; trap 50 - reset AZ 589 589 ; результат в R1 =0 ok 590 590 AZreset: MOV #AZ$CSR,R1 591 -1$: CLR (R1); Пошлемкоманду"Сброс"592 - TSTB (R1); Проверимготовностьконтроллера593 - BPL 1$; Еслинеготов,сбрасываемеще594 - разипроверяемснова595 - TST (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, 596 596 BMI 0ERR$ 597 597 CLR R1 598 598 return ... ... @@ -601,30 +601,30 @@ 601 601 return 602 602 603 603 604 -; trap 54 - чтениеэнергонезависимойпамятиблока1 EEPROMвбуферсадресаADREEPROMMEM605 -; результатR3 -адрес,еслиR3=0ошибка606 -; статусчтениявR1 0 - ok607 -; 1 - размернесоответствуетсохраненному608 -; 2 - o шибкаверсии609 -; 3 - oшибкаконтрольной суммы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 610 610 ReadEEPROM: push R2 611 - call AZreset; сбросим615 + call AZreset; reset 612 612 tst R1 613 613 bne 0ERR$ 614 614 ; теперь читаем 615 615 MOV #AZ$CSR,R1 616 - mov #21,(R1); считатьблок1энергонезависимойпамятивбуфер617 -0$: TSTB (R1); проверяемрезультатвыполнения618 - BPL 0$; ждем619 - mov #22,(R1); отдатьнашинусчитанныйблокэнергонезависимойпамятиизбуфера620 -1$: TSTB (R1); проверяемрезультатвыполнения621 - BPL 1$; ждем622 - TST (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 623 623 mov #ADREEPROMMEM,R3 624 - mov #256.,R2; читаем256.слов;первоеслово-результатчтения625 -2$: mov (R1),(R3)+; читаемблоксловвпамять628 + mov #256.,R2; read 256. words; first word is reading result 629 +2$: mov (R1),(R3)+; read block of words into memory 626 626 sob R2,2$ 627 - mov #ADREEPROMMEM,R3; успешно631 + mov #ADREEPROMMEM,R3; successful 628 628 mov (R3),R1 629 629 br 0END$ 630 630 0ERR$: CLR R3 ... ... @@ -632,41 +632,39 @@ 632 632 return 633 633 {{/code}} 634 634 635 -очевидно, после считывания памяти необходимо проверить код результата в первом слове - см расшифровку кодов ошибок 636 -\\Примеры возвращаемых данных по командам 637 -\\последовательная подача команды 021 и затем 022 позволит считать 256. слов 638 -из энергонезависимой памяти 639 -**Внимание! **первое слово это будет статус успешности чтения 640 - 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 641 641 642 642 * 0 - ok 643 -* 1 - размернесоответствуетсохраненному644 -* 2 - o шибкаверсии645 -* 3 - oшибкаконтрольной суммы645 +* 1 - size does not match saved 646 +* 2 - version error 647 +* 3 - checksum error 646 646 647 -== **023:Принятьсшинывбуферданныедляпоследующейзаписивбуфер**==649 +== 023: Receive data from the bus into the buffer for subsequent writing into the buffer == 648 648 649 - Кодкоманды023,даннаякомандапозволяетнаполнитьбуферэнергонезависимойпамяти651 +Command code 023, this command allows you to fill the non-volatile memory buffer 650 650 651 -== **024:Записатьизбуферавблокэнергонезависимойпамяти**==653 +== 024: Write from buffer to non-volatile memory block == 652 652 653 - Кодкоманды024,даннаякомандавызываетзаписьблокаэнергонезависимойпамятиизбуфераэнергонезависимойпамяти.655 +Command code 024, this command causes a non-volatile memory block to be written from the non-volatile memory buffer. 654 654 655 - Примерпрограммы657 +Example program 656 656 657 657 {{code language="assembler"}} 658 -AZ$CSR регистркомандисостояния(CSR)659 -AZ$DR регистрданных(DR)660 +AZ$CSR = 177220; Command and Status Register (CSR) 661 +AZ$DR = 177222; Data Register (DR) 660 660 661 661 662 -; trap 50 - cбросAZ664 +; trap 50 - reset AZ 663 663 ; результат в R1 =0 ok 664 664 AZreset: MOV #AZ$CSR,R1 665 -1$: CLR (R1); Пошлемкоманду"Сброс"666 - TSTB (R1); Проверимготовностьконтроллера667 - BPL 1$; Еслинеготов,сбрасываемеще668 - разипроверяемснова669 - TST (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, 670 670 BMI 0ERR$ 671 671 CLR R1 672 672 return ... ... @@ -674,27 +674,27 @@ 674 674 COM R1 675 675 return 676 676 677 -; trap 55 - записьэнергонезависимойпамятиизбуферасадресаADREEPROMMEM в блок 1 EEPROM679 +; trap 55 - write non-volatile memory from the buffer at address ADREEPROMMEM в блок 1 EEPROM 678 678 WriteEEPROM: push R1 679 679 push R2 680 680 push R3 681 - call AZreset; сбросим683 + call AZreset; reset 682 682 tst R1 683 683 bne 0ERR$ 684 684 685 685 MOV #AZ$CSR,R1 686 - mov #23,(R1); командуемчтобудемписатьданныевбуфер687 -0$: TSTB (R1); проверяемрезультатвыполнения688 - BPL 0$; ждем689 - TST (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 690 690 mov #ADREEPROMMEM+2,R3 691 - mov #255.,R2; пишем255.слов;первоесловопропускаем-результатчтения692 -1$: mov (R3)+,(R1); отдаемвконтроллер693 + mov #255.,R2; write 255. words; skip the first word - the result of reading 694 +1$: mov (R3)+,(R1); send to the controller 693 693 sob R2,1$ 694 - tst -(R1); декрементируем695 - mov #24,(R1); записатьизбуферавблок1энергонезависимойпамяти696 -2$: TSTB (R1); проверяемрезультатвыполнения697 - BPL 2$; ждем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 698 698 br 0END$ 699 699 0ERR$: CLR R3 700 700 0END$: pop R3 ... ... @@ -703,23 +703,21 @@ 703 703 return 704 704 {{/code}} 705 705 706 -** Обращаювнимание**,призаписи,буферидетсразусданными,тенетпервогословасостатусом.708 +**Please note** that when recording, the buffer immediately comes with the data, i.e. there is no first word with the statu 707 707 708 708 709 709 710 -= БлоккоманддляработысRTCиNTP =712 += Block of commands for working with RTC and NTP = 711 711 712 - ВконтроллереAZ®есть2источникаполучениядаты-времени,первыйэтоRTCвстроенныйвSTM32,второйэточасывстекеTCP/IP.ЧасыRTCработаютавтономноприналичииустановленнойбатарейки2032.ЧасывстекеTCP/IPустанавливаютсянаоснованииданныхсNTP-сервера.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. 713 713 714 714 715 -== Форматбуфераtimestamp (доступен по чтению) ==717 +== Buffer format timestamp (readable) == 716 716 717 -API контроллерасразуготовитвремявнескольких форматах,дабыегобылоудобноприменитьнасторонеPDP-11719 +The controller API immediately prepares time in several formats, so that it can be conveniently used on the PDP-11 side 718 718 719 719 {{info}} 720 -формат буфера даты-времени 721 -offset в восьмеричной системе - те слова 722 -формат буфера даты-времени 722 +datetime buffer format octal offset - those words datetime buffer format 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 (призаписи) ==740 +== SimpleIN buffer format (when writing) == 741 741 742 - форматмаксимальноупрощен,дляработысостороныPDP-11742 +the format is simplified as much as possible, for work with PDP-11 743 743 744 744 {{info}} 745 -offset ввосьмеричнойсистеме-теслова745 +offset in octal - those words 746 746 747 -[0]=year год,младшиедвецифры-те22ане2022(!)748 -[2]=month; месяц749 -[4]=day; день750 -[6]=wday; деньнедели=0неустановлен, 1-понедельник2 -вторникитд751 -[10]=hour; час752 -[12]=min; минута753 -[14]=sec; секунда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 754 754 {{/info}} 755 755 756 756 757 -== **031:ПолучитьвремяизRTCвбуферtimestamp**==757 +== 031: Get time from RTC to timestamp buffer == 758 758 759 - Кодкоманды031,даннаякомандаиспользуетRTCчасыкакисточникзаполнениябуфераtimestamp759 +Command code 031, this command uses RTC clock as a source of filling the timestamp buffer 760 760 761 - Примерпрограммы:761 +Example program: 762 762 763 763 {{code language="assembler"}} 764 -; trap 61 - чтениеданныхчасовизавтономныхчасовRTC765 -; R3 - адресбуферакуданадосчитать766 -; результатвR3адрес,еслиуспешно. R3=0если ошибка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 767 767 GetDateFromRTC: push R0 768 768 push R1 769 769 push R2 770 - call AZreset; сбросим770 + call AZreset; reset 771 771 tst R1 772 772 bne G60ERR 773 773 MOV #AZ$CSR,R1 774 774 mov #31,(R1) 775 - br G60; идемтудаткдальшекододинаковый775 + br G60; let's go there because further code is the same 776 776 {{/code}} 777 777 778 -== **032:Получитьвремяизбуфераtimestamp**==778 +== 032: Get time from timestamp buffer == 779 779 780 - Кодкоманды032,даннаякомандаотдаетнашинусодержимоебуфераtimestamp780 +Command code 032, this command sends the contents of the timestamp buffer to the bus 781 781 782 782 {{code language="assembler"}} 783 -; работасчасами784 -; trap 60 - чтениеданныхчасовизTCP/IPстека785 -; R3 - адресбуферакуданадосчитать786 -; результатвR3адрес,еслиуспешно. R3=0если ошибка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 787 787 GetDateFromLAN: push R0 788 788 push R1 789 789 push R2 790 - call AZreset; сбросим790 + call AZreset; reset 791 791 tst R1 792 792 bne G60ERR 793 793 MOV #AZ$CSR,R1 794 794 mov #42,(R1) 795 -G60: TSTB (R1); проверяемрезультатвыполнения796 - BPL G60; ждем795 +G60: TSTB (R1); check execution result 796 + BPL G60; wait 797 797 mov #32,(R1) 798 -1$: TSTB (R1); проверяемрезультатвыполнения798 +1$: TSTB (R1); check execution result 799 799 BPL 1$; ждем 800 - TST (R1)+; инкрементируем801 - mov R3,R0; запомнимR3- адрес802 - mov #10.,R2; читаем10слов803 -2$: mov (R1),(R3)+; читаемблоксловвпамять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 804 804 sob R2,2$ 805 - mov R0,R3; успешно,вернемадресвR3805 + mov R0,R3; successful, return address to 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 - Стоитпроверитькорректностьполученноговремени:814 +It is worth checking the correctness of the received time: 815 815 816 816 {{code language="assembler"}} 817 -; trap 63 - проверкакорректностивремени818 -; R3 - адресбуфера,результатвR3,еслиадресбуфератоOK, =0ошибка817 +; trap 63 - check time correctness 818 +; R3 - buffer address, result in R3, if buffer address then OK, =0 error 819 819 CheckDateTime: Cmp 6(r3),#2021. 820 820 Blos 1err 821 821 Cmp 6(r3),#2100. ... ... @@ -825,119 +825,119 @@ 825 825 return 826 826 {{/code}} 827 827 828 -== **033:Записьвремени-датывбуферSimpleIN**==828 +== 033: Write time-date to SimpleIN buffer == 829 829 830 - Кодкоманды033,даннаякомандапринимаетсшиныданныевбуферSimpleIN830 +Command code 033, this command receives data from the bus into the SimpleIN buffer 831 831 832 - Работаданнойкомандыаналогичнаработе команд [[023>>doc:||anchor="H023:41F44043843D44F44244C44144843843D44B43243144344443544043443043D43D44B43543443B44F43F43E44143B43543444344E44943543943743043F438441438432431443444435440"]]и[[016>>doc:||anchor="H016:A041F44043843D44F44244C43143B43E43A43443043D43D44B445432431443444435440"]].832 +The operation of this command is similar to the operation of commands 023 and 016. 833 833 834 -== **034:УстановкаRTCнаоснованииданныхизбуфера**==834 +== 034: Set RTC based on buffer data == 835 835 836 - Кодкоманды034,даннаякомандаустанавливаетRTCнаоснованииданныхвбуфереSimpleIN836 +Command code 034, this command sets the RTC based on the data in the SimpleIN buffer 837 837 838 - Даннаякомандавыполняетсябыстро,нодляисключенияпроблемцикложиданиявыполнениярекомендуется.838 +This command executes quickly, but to avoid problems, a wait loop is recommended. 839 839 840 -== **035:СтимуляциязапросавременисNTPсервера,установканаоснованииответа**==840 +== 035: Stimulate time request from NTP server, set based on response == 841 841 842 - Кодкоманды035,даннаякомандаотправляетзапроснаNTPcервер(установленныйвAZ.INIфайлеилиполученныйотDHCP)иустанавливаетчасывстекеTCP/IP.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. 843 843 844 - Примерпрограммы:отсылказапросанаустановкувременисNTPсервера844 +Example program: sending a request to set the time from an NTP server 845 845 846 846 {{code language="assembler"}} 847 -; trap 62 - отсылказапросанаустановкувременисNTPсервера847 +; trap 62 - sending a request to set the time from the NTP server 848 848 GetDateNTPtoNET:push R1 849 - call AZreset; сбросим849 + call AZreset; reset 850 850 tst R1 851 851 bne 0ERR$ 852 852 MOV #AZ$CSR,R1 853 853 mov #35,(R1) 854 -0$: TSTB (R1); проверяемрезультатвыполнения855 - BPL 0$; ждем854 +0$: TSTB (R1); check the result of execution 855 + BPL 0$; wait 856 856 0ERR$: pop R1 857 857 return 858 858 {{/code}} 859 859 860 - Выполнениекомандызанимает1-2секундывсреднем.ДаннаякомандатребуетработыстекаTCP/IP,соответственнонужныциклыожиданияпривключенномстеке.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. 861 861 862 - Примерциклаопросасцельюполучитьвремяссети862 +An example of a polling cycle to get time from the network 863 863 864 864 {{code language="assembler"}} 865 -; дата-время865 +; date-time 866 866 mov #S_DateTime_0,R3; "Lan Date:" 867 867 trap 10 868 - mov #20,R4; количествоцикловожидания869 -$datry: trap 62; отослализапроскNTPсерверу870 - mov #110,@#AZ$CSR; включимсеть871 - trap 47; ожидание872 - trap 47; ожидание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 873 873 mov #ADRTMPSTR,R3 874 - trap 60; считаливбуфер дату-время875 - trap 63; проверилидату-время874 + trap 60; read the date-time into the buffer 875 + trap 63; checked the date-time 876 876 tst R3 877 877 bne $ok 878 878 $sob: sob R4,$datry 879 - mov #S_DateTime_2,R3; печатьошибки879 + mov #S_DateTime_2,R3; print error 880 880 trap 7 881 881 br $go 882 882 883 883 $ok: mov #ADRTMPSTR,R3 884 - trap 24; печатьдаты885 - trap 25; времени886 -$go: mov #110,@#AZ$CSR; включимсеть884 + trap 24; print date 885 + trap 25; time 886 +$go: mov #110,@#AZ$CSR; let's turn on the network 887 887 {{/code}} 888 888 889 - ТутмыявноотсылаемзапроскNTPсерверу,затемвключаемработусетииждемрезультата,периодическиопрашиваяипроверяякорректностьрезультата.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. 890 890 891 -== **036:УстановкаRTCнаоснованиичасовTCP/IPстека**==891 +== 036: Setting RTC based on TCP/IP stack clock == 892 892 893 - Кодкоманды036,даннаякомандаустанавливаетRTCнаоснованиичасоввTCP/IPстека.Предварительнонадоустановить часывTCP/IP -команда036.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. 894 894 895 - Примерпрограммы:895 +Example program: 896 896 897 897 {{code language="assembler"}} 898 -; trap 64 - установкавремениRTCнаоснованиивременистека899 -; R1 - результат900 -SetDateNETtoRTC:call AZreset; сбросим898 +; trap 64 - set RTC time based on stack time 899 +; R1 - result R1=0 - OK 900 +SetDateNETtoRTC:call AZreset; reset 901 901 tst R1 902 902 bne 0ERR$ 903 903 MOV #AZ$CSR,R1 904 904 mov #36,(R1) 905 -0$: TSTB (R1); проверяемрезультатвыполнения906 - BPL 0$; ждем905 +0$: TSTB (R1); check execution result 906 + BPL 0$; wait 907 907 clr R1 908 908 0ERR$: return 909 909 {{/code}} 910 910 911 -== **042:ПолучитьвремяизчасовTCP/IPстекавбуферtimestamp**==911 +== 042: Get time from TCP/IP stack clock into timestamp buffer == 912 912 913 - Кодкоманды042,даннаякомандаиспользуетчасыTCP/IPстекакакисточникзаполнениябуфераtimestamp.913 +Command code 042, this command uses the TCP/IP stack clock as a source for filling the timestamp buffer. 914 914 915 - Примерпрограммы:915 +Example program: 916 916 917 917 {{code language="assembler"}} 918 -; работасчасами919 -; trap 60 - чтениеданныхчасовизTCP/IPстека920 -; R3 - адресбуферакуданадосчитать921 -; результатвR3адрес,еслиуспешно. R3=0если ошибка918 +; working with clock 919 +; trap 60 - reading clock data from TCP/IP stack 920 +; R3 - buffer address where to read 921 +; result in R3 address if successful. R3=0 if error 922 922 GetDateFromLAN: push R0 923 923 push R1 924 924 push R2 925 - call AZreset; сбросим925 + call AZreset; reset 926 926 tst R1 927 927 bne G60ERR 928 928 MOV #AZ$CSR,R1 929 929 mov #42,(R1) 930 -G60: TSTB (R1); проверяемрезультатвыполнения931 - BPL G60; ждем930 +G60: TSTB (R1); check execution result 931 + BPL G60; wait 932 932 mov #32,(R1) 933 -1$: TSTB (R1); проверяемрезультатвыполнения934 - BPL 1$; ждем935 - TST (R1)+; инкрементируем936 - mov R3,R0; запомнимR3- адрес933 +1$: TSTB (R1); check execution result 934 + BPL 1$; wait 935 + TST (R1)+; increment 936 + mov R3,R0; remember R3 address 937 937 mov #10.,R2; читаем 10 слов 938 -2$: mov (R1),(R3)+; читаемблоксловвпамять938 +2$: mov (R1),(R3)+; read block of words into memory 939 939 sob R2,2$ 940 - mov R0,R3; успешно,вернемадресвR3940 + mov R0,R3; successful, return address to R3 941 941 br 0END$ 942 942 G60ERR: CLR R3 943 943 0END$: pop R2 ... ... @@ -946,28 +946,28 @@ 946 946 return 947 947 {{/code}} 948 948 949 - всекомандыустанавливаютбитготовностипозавершению.949 +All commands set the ready bit upon completion. 950 950 951 951 952 -= ** Команды специфические для[[AZБК®>>doc:Контроллеры AZБК® для компьютеров БК-0010 БК-0010\.01 БК-0011М.WebHome]]** =952 += **[[AZБК®>>doc:Контроллеры AZБК® для компьютеров БК-0010 БК-0010\.01 БК-0011М.WebHome]] **specific commands = 953 953 954 - ДанныекомандыпредназначеныдляработыконтроллераAZБК®,разработанногодлясериикомпьютеровБК-БК-0010/БК-0010.01/БК-0011М.954 +These commands are intended for operation of the AZБК® controller, developed for the BK series of computers - BK-0010/BK-0010.01/BK-0011M. 955 955 956 - ДругиеконтроллерыAZ®игнорируютэтикоманды956 +Other AZ® controllers ignore these commands. 957 957 958 -== **037:перезапускконтроллера[[AZБК®>>doc:Контроллеры AZБК® для компьютеров БК-0010 БК-0010\.01 БК-0011М.WebHome]]и всей БК** ==958 +== 037: Restart of the** [[AZБК®>>doc:Контроллеры AZБК® для компьютеров БК-0010 БК-0010\.01 БК-0011М.WebHome]] **controller and the entire computer == 959 959 960 - Кодкоманды037,даннаякомандаосуществляетперезапускмикроконтроллераAZ®,чтовызываетиперезапусксамойБК-0010/БК-0010.01/БК-0011М960 +Command code 037, this command restarts the AZ® microcontroller, which also causes a restart of the BK-0010/BK-0010.01/BK-0011M itself 961 961 962 - Примерпрограммы962 +Example program 963 963 964 964 {{code language="assembler"}} 965 -AZ$CSR регистркомандисостояния(CSR)966 -AZ$DR регистрданных(DR)965 +AZ$CSR = 177220; command and status register (CSR) 966 +AZ$DR = 177222; data register (DR) 967 967 968 968 969 -; trap 57 - перезапускБК полный970 -AZcouldReboot: call AZreset; сбросимAZдабыонбылготовприниматькоманды969 +; trap 57 - full restart 970 +AZcouldReboot: call AZreset; reset AZ so it is ready to receive 971 971 mov #037,@#AZ$CSR 972 972 return 973 973 {{/code}}