Sponsored Content
Full Discussion: Byte Padding
Top Forums Programming Byte Padding Post 302107647 by girishsjce on Tuesday 20th of February 2007 12:02:19 AM
Old 02-20-2007
CPU & Memory Padding Issues.

Its actually low level issue. Padding stores all the data element started from even addresses. In this mechanism char also take 2 bytes ( one Byte stored in current even address, next data element can store in next even address, in b/w odd address is wasted). But it improves data reading efficiency.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Padding

Hi Can anyone tell me how to pad zeroes on the left side to a numeric string in unix shell scripting Your answer is very much appreciated Thanks Vijay (2 Replies)
Discussion started by: vijaygopalsk
2 Replies

2. Programming

Padding variables

Is there a function in c that will allow me to pad variables? I have an int that can't be longer than 10. I need to pad a numeric value with leading zeros 314 0000000314 (1 Reply)
Discussion started by: flounder
1 Replies

3. Shell Programming and Scripting

Padding in Unix

I have a file with different character counts on each line how do i make it with unique character counts. example: 1st line : ABCD 011 XYZ 0000 YYYY BBB TEADINGDA 2nd line: ABCD 011 xys 0010 YYYY BBB TEAD 3rd line : ABCD 022 YXU 000 UUU BBB TE 1st line is 43... (3 Replies)
Discussion started by: rudoraj
3 Replies

4. Shell Programming and Scripting

Check if 2 files are identical byte-to-byte?

In my server migration requirement, I need to compare if one file on old server is exactly the same as the corresponding file on the new server. For diff and comm, the inputs need to be sorted. But I do not want to disturb the content of the file and need to find byte-to-byte match. Please... (4 Replies)
Discussion started by: krishmaths
4 Replies

5. Shell Programming and Scripting

Remove a byte(Last byte from the last line)

Hi All Can anyone please suggest me how to remove the last byte from a falt file .This is from the last line's last BYTE. Please suggest me something. Thank's and regards Vinay (1 Reply)
Discussion started by: vinayrao
1 Replies

6. UNIX for Dummies Questions & Answers

Zero padding dates

I have a file with records containing dates like: SMPBR|DUP-DO NOT USE|NEW YORK||16105|BA5270715|2007-6-6|MWERNER|109||||JOHN||SMITH|MD|72211118||||||74559|21 WILMINGTON RD||D|2003-11-6|SL# MD CONTACT-LIZ RICHARDS|||0|Y|N||1411458| How can I get the date fields in each of my records to be... (1 Reply)
Discussion started by: ChicagoBlues
1 Replies

7. Shell Programming and Scripting

Padding with zeros.

Hi Friends, I would like to left pad with "0's" on first column say (width six) I have a large file with the format: FILE: 1: ALFRED 84378 NY 8385: JAMES 88385 FL 323: SMITH 00850 TX My output needs to be like: 000001: ALFRED 84378 NY 008385: JAMES 88385 FL 000323: SMITH... (10 Replies)
Discussion started by: sbasetty
10 Replies

8. Shell Programming and Scripting

Padding leading zero

hi All i am new to linux... source txt .. 281-BUM-5M BUM-5M 0 0 282-BUM-5M BUM-5M 0 0 83-BUM-5M BUM-5M 0 0 is it possible to use bash script to convert to (remove the "-" and fill up to 4 digit" ? 0281 BUM-5M BUM-5M 0 0 0282 BUM-5M BUM-5M 0 0 0083 BUM-5M BUM-5M 0 0 thanks a ... (5 Replies)
Discussion started by: samoptimus
5 Replies

9. Shell Programming and Scripting

bash padding

Hi all Is there a way to pad the output of a bash script see that code below for i in `sed -n '/Start Printer/,/End Printer/p' /u/ab/scripts/hosts.conf | awk '!/^#/ {print $2}' | egrep -v 'broke|primera' `; do pages=`snmpget -Ov -v1 -c public $i sysLocation.0 | awk '{print $2}'` ... (3 Replies)
Discussion started by: ab52
3 Replies

10. Shell Programming and Scripting

Padding a csv value with 0's

I have this csv file that I would like to sort on the 20th and 21st field. They are high lighted below. My challenge is that when I sort on those fields they are not in order as I would have liked. It seems like I have to pad those fields to the longest value in that fields data. ... (6 Replies)
Discussion started by: GroveTuckey
6 Replies
srec_signetics(5)						File Formats Manual						 srec_signetics(5)

NAME
srec_signetics - Signetics file format DESCRIPTION
The Signetics file format is not often used. The major disadvantage in modern applications is that the addressing range is limited to only 64kb. Records All data lines are called records, and each record contains the following 5 fields: +--+------+----+----+----+----+ |: | aaaa | cc | as | dd | ss | The field are defined as follows: +--+------+----+----+----+----+ : Every record starts with this identifier. aaaa The address field. A four digit (2 byte) number representing the first address to be used by this record. cc The byte-count. A two digit value (1 byte), counting the actual data bytes in the record. as Address checksum. Covers 2 address bytes and the byte count. dd The actual data of this record. There can be 1 to 255 data bytes per record (see cc) ss Data Checksum. Covers only all the data bytes of this record. Record Begin Every record begins with a colon ":[rq] character. Records contain only ASCII characters. No spaces or tabs are allowed in a record. In fact, apart from the 1st colon, no other characters than 0..9 and A..F are allowed in a record. Interpretation of a record should be case less, it does not matter if you use a..f or A..F. Unfortunately the colon was chosen for the Signetics file format, similar to the Intel format (see srec_intel(5) for more information). However, SRecord is able to automatically detect the dofference between the two format, when you use the -Guess format specifier. Address Field This is the address where the first data byte of the record should be stored. After storing that data byte, the address is incremented by 1 to point to the address for the next data byte of the record. And so on, until all data bytes are stored. The address is represented by a 4 digit hex number (2 bytes), with the MSD first. The order of addresses in the records of a file is not important. The file may also contain address gaps, to skip a portion of unused memory. Byte Count The byte count cc counts the actual data bytes in the current record. Usually records have 32 data bytes, but any number between 1 and 255 is possible. A value of 0x00 for cc indicates the end of the file. In this case not even the address checksum will follow! The record (and file) are terminated immediately. It is not recommended to send too many data bytes in a record for that may increase the transmission time in case of errors. Also avoid sending only a few data bytes per record, because the address overhead will be too heavy in comparison to the payload. Address Checksum This is not really a checksum anymore, it looks more like a CRC. The checksum can not only detect errors in the values of the bytes, but also bytes out of order can be detected. The checksum is calculated by this algorithm: checksum = 0 for i = 1 to 3 checksum = checkum XOR byte ROL checksum next i For the Address Checksum we only need 2 Address bytes and 1 Byte Count byte to be added. That's why we count to 3 in the loop. Every byte is XORed with the previous result. Then the intermediate result is rolled left (carry rolls back into b0). This results in a very reliable checksum, and that for only 3 bytes! The last record of the file does not contain any checksums! So the file ends right after the Byte Count of 0. Data Field The payload of the record is formed by the Data field. The number of data bytes expected is given by the Byte Count field. The last record of the file may not contain a Data field. Data Checksum This checksum uses the same algorithm as used for the Address Checksum. This time we calculate the checksum with only the data bytes of this record. checksum = 0 for i = 1 to cc checksum = checksum XOR byte ROL checksum next i Note that we count to the Byte Count cc this time. Size Multiplier In general, binary data will expand in sized by approximately 2.4 times when represented with this format. EXAMPLE
Here is an example Signetics file :B00010A5576F77212044696420796F75207265617B :B01010E56C6C7920676F207468726F756768206136 :B02010256C6C20746861742074726F75626C652068 :B0300D5F746F207265616420746869733FD1 :B03D00 In the example above you can see a piece of code in Signetics format. The first 3 lines have 16 bytes of data each, which can be seen by the byte count. The 4th line has only 13 bytes, because the program is at it's end there. Notice that the last record of the file contains no data bytes, and not even an Address Checksum. SEE ALSO
http://sbprojects.fol.nl/knowledge/fileformats/signetics.htm AUTHOR
This man page was taken from the above Web page. It was written by San Bergmans <sanmail@bigfoot.com> Reference Manual SRecord srec_signetics(5)
All times are GMT -4. The time now is 07:07 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy