manual:chapter6:libdata:cmd_binputb

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Next revision Both sides next revision
manual:chapter6:libdata:cmd_binputb [2019/10/29 16:24]
jojo1973 created
manual:chapter6:libdata:cmd_binputb [2019/11/06 15:43]
jojo1973
Line 9: Line 9:
 ---- ----
 ^  __Input Stack__  ^^^^  ^  __Output Stack__  ^ ^  __Input Stack__  ^^^^  ^  __Output Stack__  ^
-|  **D<sub>dest</sub>**  |  **Num<sub>offset</sub>**  |  **Num<sub>src</sub>**  |  **Num<sub>bytes</sub>**  |  **→**  |  **D<sub>new</sub>** +|  **D<sub>dest</sub>**  |  **Num<sub>offset</sub>**  |  **Num<sub>src</sub>**  |  **Num<sub>bytes</sub>**  |  **→**  |  **D<sub>dest_updated</sub>** 
-|  **D<sub>dest</sub>**  |  **Num<sub>offset</sub>**  |  **S<sub>src</sub>**  |  **Num<sub>bytes</sub>**  |  **→**  |  **D<sub>new</sub>** +|  **D<sub>dest</sub>**  |  **Num<sub>offset</sub>**  |  **S<sub>src</sub>**  |  **Num<sub>bytes</sub>**  |  **→**  |  **D<sub>dest_updated</sub>** 
-|  **D<sub>dest</sub>**  |  **Num<sub>offset</sub>**  |  **L<sub>src</sub>**  |  **Num<sub>bytes</sub>**  |  **→**  |  **D<sub>new</sub>**  |+|  **D<sub>dest</sub>**  |  **Num<sub>offset</sub>**  |  **L<sub>src</sub>**  |  **Num<sub>bytes</sub>**  |  **→**  |  **D<sub>dest_updated</sub>**  |
 |  //Level 4//  |  //Level 3//  |  //Level 2//  |  //Level 1//  |  //→//  |  //Level 1//  |  |  //Level 4//  |  //Level 3//  |  //Level 2//  |  //Level 1//  |  //→//  |  //Level 1//  | 
  
Line 23: Line 23:
 <callout color="orangered" icon="fa fa-comment" title="Description"> <callout color="orangered" icon="fa fa-comment" title="Description">
 ---- ----
-The ''BINPUTB'' stores a specified number of bytes into a binary data container, starting from an offset position; it's not possible to write data exceeding the container's size.+The ''BINPUTB'' command stores a specified number of bytes into a binary data container, starting from an offset position; it's not possible to write data exceeding the container's size.
  
 The source of data can be: The source of data can be:
  
-  * a **scalar**: the number is converted to a positive integer and its lower 8 bits are replicated for a specified number of times into the data container; +  * a **scalar**: the number is converted to an unsigned binary integer and divided into bytes which are stored in the container, in __little endian byte order__
-  * a **string**: the string is converted to a stream of UTF8 codepoints whose lower 8 bits are written into the container; +  * a **string**: the string is converted to a stream of UTF8 codepoints whose lower 8 bits are stored into the container; 
-  * a **list of scalars**: each number is converted to a positive integer and its lower 8 bits are written into the container.+  * a **list of scalars**: each number is converted to an unsigned binary integer and its lower 8 bits are written in the container.
  
-If the size of the source data is less than the specified number of bytes the writing operation terminates silently without error.+If the size of the source data is less than the specified number of bytes remaining bytes will be set to ''#00h''.
 </callout> </callout>
  
Line 42: Line 42:
 ---- ----
 <code> <code>
-4:              BINDATA 1 A4gACz+4:        BINDATA 2 AAAAAAAAAAAA
 3:                             0 3:                             0
-2:                             0 +2:            #1122334455667788h 
-1:                             4+1:                             8
 …………………………………………………………………………………… ……………………………………………………………………………………
 BINPUTB BINPUTB
 </code> </code>
-where level 4 stores a binary data container of size 4, will result in+will result in
 <code> <code>
-1:              BINDATA 1 AAAAAA+1:        BINDATA 2 VWZ3iYESIzR4
 …………………………………………………………………………………… ……………………………………………………………………………………
  
 </code> </code>
-a data container totally empty.+a data container storing bytes ''{ #88h #77h #66h #55h #44h #33h #22h #11h }'' in positions from 0 to 7. 
 +---- 
 +<code> 
 +4:        BINDATA 2 AAAAAAAAAAAA 
 +3:                             0 
 +2:                           "∞̅" 
 +1:                             2 
 +…………………………………………………………………………………… 
 +BINPUTB 
 +</code> 
 +(where character on level 2 is $\overline{\infty}$, obtained with **LS<sup>hold</sup>-0**) will result in 
 +<code> 
 +1:        BINDATA 2 AAAFHiAAAAAA 
 +…………………………………………………………………………………… 
 + 
 +</code> 
 +a data container storing bytes ''{ #1Eh #05h }'' in positions from 0 to 1. 
 +---- 
 +<code> 
 +4:        BINDATA 2 AAAAAAAAAAAA 
 +3:                             0 
 +2: { #1122334455h #5544332211h } 
 +1:                             2 
 +…………………………………………………………………………………… 
 +BINPUTB 
 +</code> 
 +will result in 
 +<code> 
 +1:        BINDATA 2 AAARVZAAAAAA 
 +…………………………………………………………………………………… 
 + 
 +</code> 
 +a data container storing bytes ''{ #55h #11h #00h #00h #00h #00h #00h #00h }'' in positions from 0 to 1.
 </callout> </callout>
  
  • manual/chapter6/libdata/cmd_binputb.txt
  • Last modified: 2021/09/23 00:44
  • by jojo1973