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
-
... ... @@ -1034,15 +1034,14 @@ 1034 1034 {{code language="assembler"}} 1035 1035 ;-------------------------------------------------- 1036 1036 ; 76th page map - we prepare data for the screenshot command there 1037 -SCR_PAGE = 130000 ; we temporarily attach the 76th page to the 77th - that is, into the 130000 window 1038 -SCR_TAG = SCR_PAGE+0 ; here is the input - 240 - 1 word 1039 -SCR_ADDR_CONF 1040 -SCR_PAGE_CONF 1037 +SCR_PAGE = 130000 ; we temporarily attach the 76th page to the 77th - that is, into the 130000 window 1038 +SCR_TAG = SCR_PAGE+0 ; here is the input - 240 - 1 word 1039 +SCR_ADDR_CONF = SCR_TAG+2 ; here is the command with addresses - address+length 24 bits - 4 words 1040 +SCR_PAGE_CONF = SCR_ADDR_CONF+8. ; here is the command with pages - the starting page and the number of pages - 2 words 1041 1041 SCR_MEM_CONF = SCR_PAGE_CONF+4. ; here is the memory configuration from the registers - 22 words 1042 1042 SCR_VGA_CONF = SCR_MEM_CONF+44. ; here video controller configuration - 10 words 1043 -SCR_PAL = SCR_VGA_CONF+20. ; here 338. values ??(words) of palette 338 words1043 +SCR_PAL = SCR_VGA_CONF+20. ; here 338. values (words) of palette 338 words 1044 1044 ;-------------------------------------------------- 1045 - 1046 1046 ; trap 41 - preparation of default information for screenshot functionality 1047 1047 PrepSRC: jsr R5, PUSHA ; batch saving of registers 1048 1048 mov @#177326,-(SP) ; save page 130k which was before the call ... ... @@ -1138,205 +1138,206 @@ 1138 1138 Example program 1139 1139 1140 1140 {{code language="assembler"}} 1141 -; обновиминформациювхидерескриншота1140 +; update the information in the screenshot header 1142 1142 ;-------------------------------------------------- 1143 -; карта76йстраницы-тудамыготовимданныедлякомандыскринщотов1144 - 70000уюстраницуцепляемнаместо77йвременно-тевокно1300001145 - тутвход- 240 - 1слово1146 - сюдакомандусадресами-адрес+длина24бита- 4слова1147 - сюдакомандусостраницами-начальнаястраницаиколичествостраниц- 2слова1148 - cюдаконфигурациюпамятиизрегистров- 22слова1149 - сюдаконфигурациювидеоконтроллера- 10cлов1150 - сюда338.значений(слов)палитры338слов1142 +; 76th page map - we prepare data for the screenshot command there 1143 +SCR_PAGE = 130000 ; we temporarily attach the 76th page to the 77th - that is, into the 130000 window 1144 +SCR_TAG = SCR_PAGE+0 ; here is the input - 240 - 1 word 1145 +SCR_ADDR_CONF = SCR_TAG+2 ; here is the command with addresses - address+length 24 bits - 4 words 1146 +SCR_PAGE_CONF = SCR_ADDR_CONF+8. ; here is the command with pages - the starting page and the number of pages - 2 words 1147 +SCR_MEM_CONF = SCR_PAGE_CONF+4. ; here is the memory configuration from the registers - 22 words 1148 +SCR_VGA_CONF = SCR_MEM_CONF+44. ; here video controller configuration - 10 words 1149 +SCR_PAL = SCR_VGA_CONF+20. ; here 338. values (words) of palette 338 words 1151 1151 ;-------------------------------------------------- 1151 + mov @#177326,R5 ; save page 130k which was before the call 1152 + mov #76,@#177336 ; hook the 76th page into the window 1152 1152 1153 - mov @#177326,R5 ; сохраним страницу 130k которая была до вызова 1154 - mov #76,@#177336 ; цепляем 76ую страницу в окно 1155 - 1156 - ;конфигурация видеоконтроллера 1154 + ;video controller configuration 1157 1157 ; 177230-177256 1158 1158 mov #SVGAC,R4 1159 1159 1160 - mov @#177230,(R4)+;177230 - региструправления1161 - mov @#177232,(R4)+;177232 - регистрверхняястраница(слой0)1162 - mov @#177240,(R4)+;177240 - регистрсредняястраница(слой1)1163 - mov @#177242,(R4)+;177242 - регистр-нижняястраница(слой2)1164 - mov @#177244,(R4)+;177244 - регистрвертикальногоскролингаслой21165 - mov @#177246,(R4)+;177246 - регистрвертикальногоскролингаслой11166 - mov @#177250,(R4)+;177250 - регистрвертикальногоскролингаслой01167 - mov @#177252,(R4)+;177252 - регистргозизонтальногоскролингаслой01168 - mov @#177254,(R4)+;177254 - регистргозизонтальногоскролингаслой11169 - mov @#177256,(R4)+;177256 - регистргозизонтальногоскролингаслой21158 + mov @#177230,(R4)+;177230 - control register 1159 + mov @#177232,(R4)+;177232 - register - top page (layer 0) 1160 + mov @#177240,(R4)+;177240 - register - top page (layer 1) 1161 + mov @#177242,(R4)+;177242 - register - top page (layer 2) 1162 + mov @#177244,(R4)+;177244 - vertical scroll register layer 2 1163 + mov @#177246,(R4)+;177246 - vertical scroll register layer 1 1164 + mov @#177250,(R4)+;177250 - vertical scroll register layer 0 1165 + mov @#177252,(R4)+;177252 - horizontal scroll register layer 0 1166 + mov @#177254,(R4)+;177254 - horizontal scroll register layer 1 1167 + mov @#177256,(R4)+;177256 - horizontal scroll register layer 2 1170 1170 1171 - mov R5,@#177336; вернемстраницускоторойбылвызов1169 + mov R5,@#177336; return the page from which the call was made 1172 1172 1173 1173 1174 1174 ;------------------------- 1175 - MOV #AZ$CSR,R3 ; ГотовимCSRконтроллера1176 - MOV #AZ$DR,R4 ; ГотовимDRконтроллера1177 -20$: CLR (R3) ; Сбросимконтроллер1173 + MOV #AZ$CSR,R3 ; Preparing controller CSR 1174 + MOV #AZ$DR,R4 ; Preparing controller DR 1175 +20$: CLR (R3) ; Reset the controller 1178 1178 TSTB (R3) 1179 1179 BPL 20$ 1180 1180 1181 - ; очистимблокпамятидляимени-дабысистемасделаладефолтноеимяфайла1182 - mov #23,(R3) ; командуемчтобудемписатьданныевбуфер1183 -128$: TSTB (R3) ; проверяемрезультатвыполнения1184 - BPL 128$ ; ждем1179 + ; clear the memory block for the name - so that the system makes a default file name 1180 + mov #23,(R3) ; command that we will write data to the buffer 1181 +128$: TSTB (R3) ; check the result of execution 1182 + BPL 128$ ; wait 1185 1185 clr R1 1186 1186 1187 1187 mov #256.,R2 ; 1188 -129$: mov R1,(R4) ; отдаемвконтроллер1186 +129$: mov R1,(R4) ; give to the controller 1189 1189 sob R2,129$ 1190 1190 1191 1191 1192 - MOV #044,(R3) ; командаскриншот1190 + MOV #044,(R3) ; screenshot command 1193 1193 22$: TSTB (R3) ; 1194 1194 BPL 22$ ; 1195 1195 1196 - ; получимимяскриншота1197 - mov #22,(R3) ; отдатьнашинусчитанныйблокпамятиизбуфера1198 -121$: tstb (R3) ; проверяемрезультатвыполнения1199 - bpl 121$ ; ждем1194 + ; get the screenshot name 1195 + mov #22,(R3) ; give the read memory block from the buffer to the bus 1196 +121$: tstb (R3) ; check the result of execution 1197 + bpl 121$ ; wait 1200 1200 1201 1201 mov #BUF,R1 1202 - mov #256.,R2 ; читаем256.слов;первоеслово-результатчтения1203 -122$: mov (R4),(R1)+ ; читаемблоксловвпамять1200 + mov #256.,R2 ; read 256. words; the first word is the result of reading 1201 +122$: mov (R4),(R1)+ ; read a block of words into memory 1204 1204 sob R2,122$ 1205 1205 1206 1206 .PRINT #RESOK 1207 1207 .Print #BUF 1208 1208 1209 - mov #110,@#AZ$CSR; включаемсетьпо-умолчаниюсетьдолжнабытьпостоянновключена1207 + mov #110,@#AZ$CSR; enable the network by default, the network should be constantly enabled 1210 1210 .Exit 1211 1211 {{/code}} 1212 1212 1213 - Дляраспаковкискриншотаможноиспользоватьвотэтуутилиту1211 +To unpack a screenshot, you can use this utility - [[https:~~/~~/master.pdp-11.ru/screen_unpack/>>https://master.pdp-11.ru/screen_unpack/]] 1214 1214 1215 1215 1216 1216 1217 -= **КомандыдляработысостекомTCP/IP**=1215 += Commands for working with the TCP/IP stack = 1218 1218 1219 - следующиекомандыработаютсбуфероминформацииTCP/IP cтека.1217 +The following commands operate on the TCP/IP stack information buffer. 1220 1220 1221 -== **040:Получитьipадресипрочиенастройки стекаTCP/IPвбуфер**==1219 +== 040: Get IP address and other TCP/IP stack settings to buffer == 1222 1222 1223 - Кодкоманды040,даннаякомандазаполняетбуферинформациейсTCP/IP cтекатекущей(фактической)информацией.1221 +Command code 040, this command fills the buffer with information from the TCP/IP stack with current (actual) information. 1224 1224 1225 -== **041:Чтениебуфераipадреса**==1223 +== 041: Reading ip address buffer == 1226 1226 1227 - Кодкоманды041,даннаякомандапередаетбуфернашину1225 +Command code 041, this command transfers the buffer to the bus 1228 1228 1229 - этапаракомандпозволяетполучитьтекущуюинформациюсостека1227 +This pair of commands allows you to get current information from the stack 1230 1230 1231 -* IP адрес1232 -* MASK маску1233 -* GW гейтвей1234 -* NTP адресNTP-сервера1235 -* DNS1 адресосновногоDNS1236 -* DNS2 адресрезервногоDNS1229 +* IP address 1230 +* MASK mask 1231 +* GW gateway 1232 +* NTP address of the NTP server 1233 +* DNS1 primary DNS address 1234 +* DNS2 backup DNS address 1237 1237 1238 - соответственноэто12слов1236 +accordingly it is 12 words 1239 1239 1240 - Примерпрограммы:1238 +Example program: 1241 1241 1242 1242 {{code language="assembler"}} 1243 -; trap 52 - чтение блока IP адресов в блок памяти IPADDDBLOCK (8. ячеек) 1244 -; результат в R3 =0 error, иначе адрес куда считано (IPADDDBLOCK) 1245 -GetIPaddrs: push R1 1246 - push R2 1247 - call AZreset; сбросим 1248 - tst R1 1249 - bne 0ERR$ 1250 - MOV #AZ$CSR,R1 1251 - mov #40,(R1) 1252 -0$: TSTB (R1); прочитать адреса в свою память 1253 - BPL 0$; ждем 1254 - mov #41,(R1) 1255 -1$: TSTB (R1); подготовить буфер 1256 - BPL 1$; ждем 1257 - TST (R1)+; инкрементируем 1258 - mov #IPADDDBLOCK,R3 1259 - mov #12.,R2 1260 -2$: mov (R1),(R3)+; читаем блок слов в память 1261 - sob R2,2$ 1262 - mov #IPADDDBLOCK,R3; успешно 1263 - br 0END$ 1264 -0ERR$: CLR R3 1265 -0END$: pop R2 1266 - pop R1 1267 - return 1241 +; trap 52 - reading a block of IP addresses into the IPADDDBLOCK memory block (8 cells) 1242 +; result in R3 = 0 if error, otherwise the address where it was read (IPADDDBLOCK) 1243 +GetIPaddrs: push R1 1244 + push R2 1245 + call AZreset; reset 1246 + tst R1 1247 + bne 0ERR$ 1248 + MOV #AZ$CSR,R1 1249 + mov #40,(R1) 1250 +0$: TSTB (R1); read addresses into its memory 1251 + BPL 0$; wait 1252 + mov #41,(R1) 1253 +1$: TSTB (R1); prepare buffer 1254 + BPL 1$; wait 1255 + TST (R1)+; increment 1256 + mov #IPADDDBLOCK,R3 1257 + mov #12.,R2 1258 +2$: mov (R1),(R3)+; read block of words into memory 1259 + sob R2,2$ 1260 + mov #IPADDDBLOCK,R3; success 1261 + br 0END$ 1262 +0ERR$: CLR R3 1263 +0END$: pop R2 1264 + pop R1 1265 + return 1266 + 1268 1268 {{/code}} 1269 1269 1270 - Примерданных1269 +Example return data: 1271 1271 1272 1272 {{info}} 1273 - Примерыданных-возвращаемыесловаввосьмеричномформате1274 -124300 116400 - IP адрес192.168.0.1571275 -177777 000377 - MASK маску255.255.255.01276 -124300 000400 - GW гейтвей192.168.0.11277 -124300 000400 - NTP адресNTP-сервера192.168.0.11278 -124300 050000 - DNS1 адресосновногоDNS 192.168.0.901279 -124300 055000 - DNS2 адресрезервногоDNS 192.168.0.801272 +Data examples - words returned in octal format 1273 +124300 116400 - IP address 192.168.0.157 1274 +177777 000377 - MASK mask 255.255.255.0 1275 +124300 000400 - GW gateway 192.168.0.1 1276 +124300 000400 - NTP address of NTP server 192.168.0.1 1277 +124300 050000 - DNS1 address of primary DNS 192.168.0.90 1278 +124300 055000 - DNS2 address of backup DNS 192.168.0.80 1280 1280 {{/info}} 1281 1281 1282 -== **043:чтениеMAC-адресавipбуфер**==1281 +== 043: Read MAC address into ip buffer == 1283 1283 1284 -Код команды 043, данная команда читает текущий фактический MAC адрес в буфер IP адресов 1285 -те сначала 043, а затем 041 команды 1283 +Command code 043, this command reads the current actual MAC address into the IP address buffer i.e. first 043 and then 041 commands 1286 1286 1287 - Примерпрограммы:1285 +Example program: 1288 1288 1289 1289 {{code language="assembler"}} 1290 -; trap 72 - чтение MAC адреса в блок памяти IPADDDBLOCK (12. ячеек) 1291 -; результат в R3 =0 error, иначе адрес куда считано (IPADDDBLOCK) 1292 -GetMACaddrs: push R1 1293 - push R2 1294 - call AZreset ; сбросим 1295 - tst R1 1296 - bne 0ERR$ 1297 - MOV #AZ$CSR,R1 1298 - mov #43,(R1) 1299 -0$: TSTB (R1) ; прочитать адреса в свою память 1300 - BPL 0$ ; ждем 1301 - mov #41,(R1) 1302 -1$: TSTB (R1) ; подготовить буфер 1303 - BPL 1$ ; ждем 1304 - TST (R1)+ ; инкрементируем 1305 - mov #IPADDDBLOCK,R3 1306 - mov #12.,R2 1307 -2$: mov (R1),(R3)+ ; читаем блок слов в память 1308 - sob R2,2$ 1309 - mov #IPADDDBLOCK,R3; успешно 1310 - br 0END$ 1311 -0ERR$: CLR R3 1312 -0END$: pop R2 1313 - pop R1 1314 - retur 1288 +; trap 72 - reading the MAC address into the IPADDDBLOCK memory block (12 cells) 1289 +; result in R3 = 0 if error, otherwise the address where it was read (IPADDDBLOCK) 1290 +GetMACaddrs: push R1 1291 + push R2 1292 + call AZreset ; reset 1293 + tst R1 1294 + bne 0ERR$ 1295 + MOV #AZ$CSR,R1 1296 + mov #43,(R1) 1297 +0$: TSTB (R1) ; read addresses into its memory 1298 + BPL 0$ ; wait 1299 + mov #41,(R1) 1300 +1$: TSTB (R1) ; prepare buffer 1301 + BPL 1$ ; wait 1302 + TST (R1)+ ; increment 1303 + mov #IPADDDBLOCK,R3 1304 + mov #12.,R2 1305 +2$: mov (R1),(R3)+ ; read block of words into memory 1306 + sob R2,2$ 1307 + mov #IPADDDBLOCK,R3; success 1308 + br 0END$ 1309 +0ERR$: CLR R3 1310 +0END$: pop R2 1311 + pop R1 1312 + retur 1313 + 1315 1315 {{/code}} 1316 1316 1317 1317 1318 1318 1319 -= **КомандыдляработысMicroSDкартойнафайловомуровне**=1318 += Commands for working with a MicroSD card at the file level = 1320 1320 1321 1321 1322 - ДанныекомандыпредназначеныдляработысMicroSDкартойнауровнефайловойсистемыипозволяетчитать/писатьфайлыбезмонтированияфайловкакобразовдисков.1321 +These commands are designed to work with a MicroSD card at the file system level and allow you to read/write files without mounting files as disk images. 1323 1323 1324 -Эти команды используют буфер 256. слов который задействован в интерфейсе работы с энергонезависимой памятью (см выше команды 022 023) 1325 -\\Ограничения - длина полного пути к файлу 256 байт 1323 +These commands use a 256-word buffer that is used in the interface for working with non-volatile memory (see commands 022 023 above) 1326 1326 1327 - ==**050:Установитьимяфайлакоторыйбудемчитать**==1325 +Limitations - the length of the full path to the file is 256 bytes 1328 1328 1329 - Кодкоманды050,даннаякомандаустанавливаетимяфайлакоторыйбудемчитать,приэтом производится открытие файла на чтение, а также получение его свойств.1327 +== 050: Set the name of the file we will read == 1330 1330 1331 - ==**051:Получитьразмерфайланачтение(илиегостатус)наМПИ**==1329 +Command code 050, this command sets the name of the file that we will read, while opening the file for reading, and also obtaining its properties. 1332 1332 1333 - Кодкоманды051,даннаякомандапередаетнаМПИразмерфайлаилиошибкуего чтения. Размер файла 31бит, старший бит является признаком ошибки. Соответственно максимальный размер файлов с которыми можно работать через этот интерфейс ограничен 2^31 байт (2GB).1331 +== 051: Get file size for reading (or its status) on BUS == 1334 1334 1335 -формирование ошибки выглядит так: 1336 -sizeanyfile=1<<31 + FFres; ~/~/ если установлен старший бит 32х битного слова - то в младшей части код ошибки 1337 -\\FFres = ошибка FatFS 1338 - 1333 +Command code 051, this command transmits the file size or reading error to the MPI. The file size is 31 bits, the most significant bit is an error indicator. Accordingly, the maximum file size that can be worked with via this interface is limited to 2 ^ 31 bytes (2GB). 1339 1339 1335 +The error generation looks like this: 1336 +sizeanyfile=1<<31 + FFres; ~/~/ if the most significant bit of a 32-bit word is set, then the error code is in the lower part 1337 + 1338 +FFres = FatFS error 1339 + 1340 1340 {{code language="c"}} 1341 1341 typedef enum { 1342 1342 FR_OK = 0, /* (0) Succeeded */ ... ... @@ -1364,23 +1364,22 @@ 1364 1364 1365 1365 [[http:~~/~~/elm-chan.org/fsw/ff/doc/open.html>>url:http://elm-chan.org/fsw/ff/doc/open.html]] 1366 1366 1367 -== **052:Читатьблокустановленногофайлавбуфер**==1367 +== 052: Read a block of a set file into a buffer == 1368 1368 1369 - Кодкоманды052,даннаякомандаосуществляетчтениефайлавбуферэнергонезависимойпамяти.1369 +Command code 052, this command reads a file into a non-volatile memory buffer. 1370 1370 1371 -В итоге схема чтения файла выглядит вот так 1372 -**023** - заливаем имя файла в буфер 1373 -**050** - устанавливаем файл на чтение 1374 -**051 **- читаем длину файла или ошибку открытия файла 1375 -если ошибка - повторяем сначала 023 050 051 1376 -если все ok - приступаем к чтению файла 1377 -**052** - читает блок файла в буфер 1378 -**022 **- забираем данные из буфера 1379 -пары 052 022 повторяем нужное количество раз дабы считать весь файл 1380 -как файл будет прочтен - последняя 052 команда закроет его автоматически. 1381 - 1371 +As a result, the file reading scheme looks like this 1372 +**023** - fill the file name into the buffer 1373 +**050 **- set the file for reading 1374 +**051** - read the file length or file open error 1375 +if there is an error - repeat 023 050 051 from the beginning 1376 +if everything is ok - start reading the file 1377 +**052** - read the file block into the buffer 1378 +**022** - take data from the buffer 1379 +repeat the **052 022** pairs the required number of times in order to read the entire file 1380 +once the file is read - the last 052 command will close it automatically. 1382 1382 1383 - Примерпрограммы1382 +Example program: 1384 1384 1385 1385 {{code language="assembler"}} 1386 1386 ... ... @@ -1501,7 +1501,7 @@ 1501 1501 как файл будет записан - последняя 055 команда закроет его автоматически 1502 1502 1503 1503 1504 - Примерпрограммы:1503 +Example program: 1505 1505 1506 1506 {{code language="assembler"}} 1507 1507 ; заливаем в буфер имя файла ... ... @@ -1617,7 +1617,7 @@ 1617 1617 первое слово - общий объем карты доступный для FAT в МБ 1618 1618 второе слово - свободный объем на карте в МБ 1619 1619 1620 - Примерпрограммы:1619 +Example program: 1621 1621 1622 1622 {{code language="assembler"}} 1623 1623 ; trap 51 - получение объема SD карты всего/свободно в мегабайтах ... ... @@ -1653,7 +1653,7 @@ 1653 1653 1654 1654 Код команды 025, данная команда устанавливает соединение с сервером Hall of Fame, инициализирует шифрованный тоннель и подготавливает API к работе. 1655 1655 1656 - Примерпрограммы1655 +Example program: 1657 1657 1658 1658 {{code language="assembler"}} 1659 1659 AZ$CSR = 177220 ; регистр команд и состояния (CSR) ... ... @@ -1732,7 +1732,7 @@ 1732 1732 1733 1733 Код команды 026, данная команда осуществляет непосредственный обмен с Hall of Fame 1734 1734 1735 - Примерпрограммы1734 +Example program: 1736 1736 1737 1737 {{code language="assembler"}} 1738 1738 ;4. авторизация пользователя