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

From version 2.77
edited by Max
on 2025/02/25 17:22
Change comment: (Autosaved)
To version 2.76
edited by Max
on 2025/02/25 17:17
Change comment: (Autosaved)

Summary

Details

Page properties
Content
... ... @@ -1238,35 +1238,34 @@
1238 1238  Example program:
1239 1239  
1240 1240  {{code language="assembler"}}
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 -
1241 +; trap 52 - чтение блока IP адресов в блок памяти IPADDDBLOCK (8. ячеек)
1242 +; результат в R3 =0 error, иначе адрес куда считано (IPADDDBLOCK)
1243 +GetIPaddrs: push R1
1244 + push R2
1245 + call AZreset; сбросим
1246 + tst R1
1247 + bne 0ERR$
1248 + MOV #AZ$CSR,R1
1249 + mov #40,(R1)
1250 +0$: TSTB (R1); прочитать адреса в свою память
1251 + BPL 0$; ждем
1252 + mov #41,(R1)
1253 +1$: TSTB (R1); подготовить буфер
1254 + BPL 1$; ждем
1255 + TST (R1)+; инкрементируем
1256 + mov #IPADDDBLOCK,R3
1257 + mov #12.,R2
1258 +2$: mov (R1),(R3)+; читаем блок слов в память
1259 + sob R2,2$
1260 + mov #IPADDDBLOCK,R3; успешно
1261 + br 0END$
1262 +0ERR$: CLR R3
1263 +0END$: pop R2
1264 + pop R1
1265 + return
1267 1267  {{/code}}
1268 1268  
1269 -Example return data:
1268 +Пример данных
1270 1270  
1271 1271  {{info}}
1272 1272  Data examples - words returned in octal format
... ... @@ -1278,65 +1278,64 @@
1278 1278  124300 055000 - DNS2 address of backup DNS 192.168.0.80
1279 1279  {{/info}}
1280 1280  
1281 -== 043: Read MAC address into ip buffer ==
1280 +== **043: чтение MAC-адреса в ip буфер** ==
1282 1282  
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
1282 +Код команды 043, данная команда читает текущий фактический MAC адрес в буфер IP адресов
1283 +те сначала 043, а затем 041 команды
1284 1284  
1285 -Example program:
1285 +Пример программы:
1286 1286  
1287 1287  {{code language="assembler"}}
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 -
1288 +; trap 72 - чтение MAC адреса в блок памяти IPADDDBLOCK (12. ячеек)
1289 +; результат в R3 =0 error, иначе адрес куда считано (IPADDDBLOCK)
1290 +GetMACaddrs: push R1
1291 + push R2
1292 + call AZreset ; сбросим
1293 + tst R1
1294 + bne 0ERR$
1295 + MOV #AZ$CSR,R1
1296 + mov #43,(R1)
1297 +0$: TSTB (R1) ; прочитать адреса в свою память
1298 + BPL 0$ ; ждем
1299 + mov #41,(R1)
1300 +1$: TSTB (R1) ; подготовить буфер
1301 + BPL 1$ ; ждем
1302 + TST (R1)+ ; инкрементируем
1303 + mov #IPADDDBLOCK,R3
1304 + mov #12.,R2
1305 +2$: mov (R1),(R3)+ ; читаем блок слов в память
1306 + sob R2,2$
1307 + mov #IPADDDBLOCK,R3; успешно
1308 + br 0END$
1309 +0ERR$: CLR R3
1310 +0END$: pop R2
1311 + pop R1
1312 + retur
1314 1314  {{/code}}
1315 1315  
1316 1316  
1317 1317  
1318 -= Commands for working with a MicroSD card at the file level =
1317 += **Команды для работы с MicroSD картой на файловом уровне** =
1319 1319  
1320 1320  
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.
1320 +Данные команды предназначены для работы с MicroSD картой на уровне файловой системы и позволяет читать/писать файлы без монтирования файлов как образов дисков.
1322 1322  
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)
1322 +Эти команды используют буфер 256. слов который задействован в интерфейсе работы с энергонезависимой памятью (см выше команды 022 023)
1323 +\\Ограничения - длина полного пути к файлу  256 байт
1324 1324  
1325 -Limitations - the length of the full path to the file is 256 bytes
1325 +== **050: Установить имя файла который будем читать** ==
1326 1326  
1327 -== 050: Set the name of the file we will read ==
1327 +Код команды 050 данная команда устанавливает имя файла который будем читать, при этом производится открытие файла на чтение, а также получение его свойств.
1328 1328  
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.
1329 +== **051: Получить размер файла на чтение (или его статус) на МПИ** ==
1330 1330  
1331 -== 051: Get file size for reading (or its status) on BUS ==
1331 +Код команды 051 данная команда передает на МПИ размер файла или ошибку его чтения. Размер файла 31бит, старший бит является признаком ошибки. Соответственно максимальный размер файлов с которыми можно работать через этот интерфейс ограничен 2^31 байт (2GB).
1332 1332  
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).
1333 +формирование ошибки выглядит так:
1334 +sizeanyfile=1<<31 + FFres; ~/~/ если установлен старший бит 32х битного слова - то в младшей части код ошибки
1335 +\\FFres = ошибка FatFS
1336 +
1334 1334  
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,22 +1364,23 @@
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: Read a block of a set file into a buffer ==
1365 +== **052: Читать блок установленного файла в буфер** ==
1368 1368  
1369 -Command code 052, this command reads a file into a non-volatile memory buffer.
1367 +Код команды 052,  данная команда осуществляет чтение файла в буфер энергонезависимой памяти.
1370 1370  
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.
1369 +В итоге схема чтения файла выглядит вот так
1370 +**023** - заливаем имя файла в буфер
1371 +**050** - устанавливаем файл на чтение
1372 +**051 **- читаем длину файла или ошибку открытия файла
1373 +если ошибка - повторяем сначала 023 050 051
1374 +если все ok - приступаем к чтению файла
1375 +**052** - читает блок файла в буфер
1376 +**022 **- забираем данные из буфера
1377 +пары 052 022 повторяем нужное количество раз дабы считать весь файл
1378 +как файл будет прочтен - последняя 052 команда закроет его автоматически.
1379 +
1381 1381  
1382 -Example program:
1381 +Пример программы
1383 1383  
1384 1384  {{code language="assembler"}}
1385 1385  
... ... @@ -1500,7 +1500,7 @@
1500 1500  как файл будет записан - последняя 055 команда закроет его автоматически
1501 1501  
1502 1502  
1503 -Example program:
1502 +Пример программы:
1504 1504  
1505 1505  {{code language="assembler"}}
1506 1506  ; заливаем в буфер имя файла