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
-
... ... @@ -395,43 +395,37 @@ 395 395 |(% style="width:136px" %)4|(% style="width:305px" %)fDate|(% style="width:242px" %)Date in MS-DOS format 396 396 |(% style="width:136px" %)6|(% style="width:305px" %)fTime|(% style="width:242px" %)Time in MS-DOS format 397 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 398 398 399 399 400 -Смещение Имя Значение 401 -0 fSize Размер файла в байтах, младшее слово 402 -2 старшее слово 403 -4 fDate Дата в формате MS-DOS 404 -6 fTime Время в формате MS-DOS 405 -10 fAttr Атрибуты 1 байт 406 -11 fName ИМЯ.ТИП файла, 8+1+3+1 = 13 байт 407 -\\Смещения указаны восьмеричные. Формула в строке fName означает, что там сначала должно быть имя, максимально из восьми символов, далее должна быть точка, далее тип, до трёх символов, и завершающий нулевой байт 0х00. Если тип не указан, точка тоже не нужна. 408 -\\Атрибуты файлов в байте fAttr (восьмеричные): 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): 409 409 \\001 - Read Only 410 410 002 - Hidden 411 411 004 - System 412 412 020 - Directory 413 413 040 - Archive 414 -\\ Примерпрограммы.408 +\\Example program 415 415 416 416 {{code language="assembler"}} 417 417 ;...................................... 418 -RdDir = 013; кодкоманды"Читатьзаписьоглавления"412 +RdDir = 013; command code "Read table of contents entry" 419 419 RdBuf = 015 420 420 421 421 MOV #AZ$CSR,R3 422 422 423 423 15$: CLR @R3; 424 - TSTB @R3; Сбросимконтроллер418 + TSTB @R3; Reset the controller 425 425 BPL 15$; 426 426 427 - MOV #RdDir,@R3; Попросимконтроллер428 -16$: TSTB @R3; прочитатьвсвоюпамять429 - 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 430 430 431 431 MOV @RdBuf,(R3)+; 432 - MOV DIRREC,R2; Иперенесемеексебев433 - MOV #11.,R1; областьпамяти,указатель434 -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 435 435 SOB R1,17$; DIRREC. 436 436 437 437 ;...................................... ... ... @@ -438,96 +438,97 @@ 438 438 {{/code}} 439 439 440 440 441 -== **014:Размонтироватьдиск**==435 +== 014: Unmount disk == 442 442 443 - Кодкоманды014,чтобыразмонтироватьдиск,следуетсброситьконтроллер,переслатьвDRконтроллераномерприводаAZ,которыйследуетразмонтировать,ипослатьвCSRконтроллеракод014,послечегодождатьсяокончанияоперации(онадлительная)ипроверитьнаошибку.Ошибкавыдается,еслиприводнебылсмонтирован.444 -[[ **//пример утилиты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]] 445 445 446 446 447 -== **015:Начатьпередачусчитанногоблока**==441 +== 015: Start transferring the read block == 448 448 449 - Кодкоманды-015.Получивэтукоманду,контроллернастраиваетсянапословнуювыдачусодержимоготогосамоговстроенногобуферана256слов,которыебудутвыданыпоследовательночерезрегистрDR.Никакихожиданийнетребуется,простопересылаем256разсловоизDRвпоследовательныеячейкипамяти,ивсе.Еслинужноменьше,чем256слов(последнийукороченныйблокфайла),тоостатокможнопростобросить,несчитывая,сбросконтроллеравначалеследующейоперациисброситиэтотостаток.450 -\\ Примерпрограммы: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: 451 451 452 452 {{code language="assembler"}} 453 453 ;.................................. 454 -RdBuf=015; символическоенаименованиекоманды448 +RdBuf=015; symbolic name of the command 455 455 456 -; ВR3отпредыдущегофрагментаосталсяадресCSR450 +; In R3 from the previous fragment there is the address of the CSR 457 457 ; (177220) 458 458 459 -; Считаем,чтоунасвR2находитсяадреспервогослова460 -; памяти,кудаследуетразместитьпрочитанныйблок.461 -; Программаполученияэтогоадресанеприводится.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. 462 462 463 - MOV #400,R1; Готовимсчетчикслов457 + MOV #400,R1; Prepare the word counter 464 464 ; 0400 oct = 256 dec 465 465 466 - MOV #RdBuf,(R3)+; ипересылаемкоманду467 -; 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). 468 468 469 -3$: MOV @R3,(R2)+ ;перешлемочередноесловов470 - память471 - SOB R1,3$; иповторимэто256 (0400)472 - ; раз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 473 473 ;.................................. 474 474 {{/code}} 475 475 476 -Всё, чтение закончено. 477 -\\Для записи наоборот, требуется сначала перенести весь блок данных из памяти ЦП в контроллер и потом выдать команду "Записать содержимое буфера на диск" 470 +That's it, reading is complete. 478 478 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" 479 479 480 -== **016: Принять блок данных в буфер** == 481 481 482 -Код команды 016. Команда настраивает контроллер на прием блока данных и помещении его в буфер. Следующие 256 циклов записи в DR поместят данные, переданные через МПИ, в буфер. 483 -\\Пример программы. 475 +== 016: Receive data block into buffer == 484 484 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 + 485 485 {{code language="assembler"}} 486 486 ;.................................. 487 487 488 -WrBuf=016; Символическоенаименованиекоманды483 +WrBuf=016; Symbolic name of the command 489 489 490 -; Передзаписьюнужновыполнитьтежедействия,чтоив491 -; пп. 3.1.-3.3.Обычно,этооднаитаже программа,492 -; простопослепункта3.3.выполняетсяпроверка"Что493 -; требуется:чтениеилизапись?"иразветвлениена494 -; программучтенияилизаписи.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. 495 495 496 -; Послефрагментавп.3.3.вR3 остался адресCSR497 -; (177220). Будемсчитать,чтовR2находитсяадресв498 -; памятиЦП,гденаходитсяблок,подлежащийзаписи.499 -; Программаполученияэтогоадресанепоказана.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. 500 500 501 - MOV #400,R1; Готовимсчетчик496 + MOV #400,R1; Preparing the counter 502 502 503 - MOV #WrBuf,(R3)+; ПерешлемкомандувCSRи504 - переключимадресвR3на505 - 498 + MOV #WrBuf,(R3)+; Let's forward the command to the CSR and 499 +; switch the address in R3 to 500 +; DR 506 506 507 -4$: MOV (R2)+,@R3; Перешлемочередноеслово508 - данных509 - 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 510 510 ;.................................. 511 511 {{/code}} 512 512 513 -== **017:Получитьразмерпсевдодиска,большой**==508 +== 017: Get ramdisk size, large == 514 514 515 - Естьдвекомандыполученияразмерапсевдодиска,т.е.смонтированногонавыбранныйпсевдоприводAZnфайл-образа.516 -\\ ЕслииспользуемаяОС(илипрограмма,работающаясдискамибезОС)умеетработатьсбольшими(больше32М)дисками,следуетпользоватьсякомандойскодом017.Последовательностьдействий:сброситьконтроллер(п. 3.1),выбратьнакопитель(п. 3.2)ипереслатьвCSRкод017,азатем,безкаких-либоожиданий,считатьизDRсначаламладшее,иследомзанимстаршеесловоразмеравыбранногонакопителя(файл-образа).517 -\\ ЕслииспользуемаяОСнеумеетработатьсдискамибОльшими,чем32М(RT-11),следуетпользоватьсякомандой007 -получитьразмерпсевдодискасограничениемдо32М.Действияпохожие:сбрасываемконтроллер,выбираемдиск,посылаемвCSRкод[[007>>doc:||anchor="H007:41F43E43B44344743844244C44043043743C43544043F44143543243443E43443844143A430"]]исчитываемизDRоднословоразмерапсевдодиска.Еслиразмерфайл-образа,смонтированногонавыбранныйпсевдопривод,больше65534блоков,вместоэтого"большого"размера,контроллервозвращает число65534.Напоминаем,чточисло65535кое-гдеиспользуетсявспециальныхцеляхинеможетбытьразмеромдиска.518 -\\ Такженапоминаем,чтоеслинаэтотнакопительнесмонтированфайл-образ,последовательностьдействийнепройдет(команда001выборустройства)иисполнениепрограммыдоэтогоместапростонедойдет.Поэтомуошибокуэтихкоманднепредусмотрено.519 -\\ Примерпрограммысбольшимидисками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 520 520 521 521 {{code language="assembler"}} 522 522 ;...................................... 523 523 524 -GetBig=017; Получить"большой"размердиска519 +GetBig=017; Get the "big" disk size 525 525 526 -; Отфрагмента3.2 (выбордиска)унасвR3остался527 -; адресDR (177222)521 +; From fragment 3.2 (disk selection) we have in R3 522 +; DR address (177222) 528 528 529 - MOV #GetBig,-(R3); пошлемкоманду530 - TST (R3)+; вернемадресвR3назад,наDR524 + MOV #GetBig,-(R3); send the command 525 + TST (R3)+; return the address in R3 back to DR 531 531 MOV @R3,BigSiz 532 532 MOV @R3,BigSiz+2 533 533 ;...................................... ... ... @@ -534,27 +534,26 @@ 534 534 {{/code}} 535 535 536 536 537 -== **020:Получитьрасширенныйкоддиагностики**==532 +== 020: Get extended diagnostic code == 538 538 539 - Кодкоманды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. 540 540 541 541 542 -== **027:Получитьверсиюfirmware AZ STM32**==537 +== 027: Get firmware version AZ STM32 == 543 543 544 -Код команды 027, возвращает 2 слова 545 -\\первое слово - 06404 = старший байт 13. это версия прошивки, младший байт 4. это версия железа - те AZБК в данном случае 546 -второе слово - 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. 547 547 548 548 549 549 {{code language="assembler"}} 550 550 ;------------------------------------------------------------- 551 -; получениеверсии прошивкиSTM32 -результатвR1ошибка545 +; getting STM32 firmware version - result in R1 R1=0 error 552 552 GTSTMV: MOV #AZ$CSR,R1 553 -1$: CLR (R1) ; Пошлемкоманду"Сброс"554 - TSTB (R1) ; Проверимготовностьконтроллера555 - BPL 1$ ; Еслинеготов,сбрасываемеще547 +1$: CLR (R1) ; Send "Reset" command 548 + TSTB (R1) ;Check controller readinessконтроллера 549 + BPL 1$ ; If not ready, reset again 556 556 mov #27,(R1) 557 - TST (R1)+ ; Проверяемнаошибку551 + TST (R1)+ ; Check for error 558 558 BMI 2$ 559 559 mov (R1),R1 560 560 return ... ... @@ -564,10 +564,10 @@ 564 564 {{/code}} 565 565 566 566 567 -== **030:Нетоперации**==561 +== 030: No operation == 568 568 569 - Основноеназначениеэтойкоманды-устанавливатьбитразрешенияпрерыванийотконтроллера.Командапередаетбитразрешенияпрерывания,которыйнаходитсяснейводномслове,ноневходитвеесостав(напоминаем,командарасполагаетсявбитахD0 - D5,абитразрешенияпрерываний-D6),всоответствующийтриггерконтроллераибольшеникакневлияетнапроцессывконтроллере.Управлениеэтимтриггеромработаетдажевсостоянии"Думаю,прошунемешать",иэтоглавнаяособенностькоманды"нетоперации".570 -\\ Командаимееткод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. 571 571 572 572 573 573 = **Блок команд работы с энергонезависимой памятью** =