User Tools

A PCRE internal error occured. This might be caused by a faulty plugin

====== Function DEPOSIT-FIELD ====== ====Syntax==== * **deposit-field** //newbyte bytespec integer// → //result-integer// ====Arguments and Values==== * //newbyte// - an //[[CL:Glossary:integer]]//. * //bytespec// - a //[[CL:Glossary:byte specifier]]//. * //integer// - an //[[CL:Glossary:integer]]//. * //result-integer// - an //[[CL:Glossary:integer]]//. ====Description==== Replaces a field of bits within //integer//; specifically, returns an //[[CL:Glossary:integer]]// that contains the bits of //newbyte// within the //[[CL:Glossary:byte]]// specified by //bytespec//, and elsewhere contains the bits of //integer//. ====Examples==== <blockquote> (deposit-field 7 ([[CL:Functions:byte]] 2 1) 0) <r>6 </r> (deposit-field -1 ([[CL:Functions:byte]] 4 0) 0) <r>15 </r> (deposit-field 0 ([[CL:Functions:byte]] 2 1) -3) <r>-7 </r> </blockquote> ====Side Effects==== None. ====Affected By==== None. ====Exceptional Situations==== None. ====See Also==== * **[[CL:Functions:byte|Function BYTE]]** * **[[CL:Functions:dpb|Function DPB]]** ====Notes==== <blockquote> ([[CL:Functions:logbitp]] //j// (deposit-field //m// ([[CL:Functions:byte]] //s// //p//) //n//)) ≡ ([[CL:Special Operators:if]] ([[CL:Macros:and]] ([[CL:Functions:math-not-less|>=]] //j// //p//) ([[CL:Functions:math-less|<]] //j// (+ //p// //s//))) ([[CL:Functions:logbitp]] //j// //m//) ([[CL:Functions:logbitp]] //j// //n//)) </blockquote> **[[CL:Functions:deposit-field]]** is to **[[CL:Functions:mask-field]]** as **[[CL:Functions:dpb]]** is to **[[CL:Functions:ldb]]**.