#include <intrins.h>
void _bfld_ (
unsigned int sfr, /* the SFR name */
int mask, /* the data bits mask */
int data); /* the data value */
Description
The _bfld_ function generates a BFLDL instruction, a BFLDH
instruction, or both on sfr depending on the value
of the mask and data
parameters. This routine is implemented as an intrinsic function. The
code required is generated inline rather than being a function
call.
Return Value
None.
Example
1 #include <intrins.h>
2 #include <reg166.h>
3
4 void main (void) {
5 _bfld_ (P0, 0xFFFF, 0x0101);
6 _bfld_ (P1, 0x00F0, 0x0010);
7 _bfld_ (P0, 0xF000, 0x2000);
8 }
ASSEMBLY LISTING OF GENERATED OBJECT CODE
; FUNCTION main (BEGIN RMASK = @0x4000)
; SOURCE LINE # 4
; SOURCE LINE # 5
0000 1A8001FF BFLDH P0,#0FFH,#01H
0004 0A80FF01 BFLDL P0,#0FFH,#01H
; SOURCE LINE # 6
0008 0A82F010 BFLDL P1,#0F0H,#010H
; SOURCE LINE # 7
000C 1A8020F0 BFLDH P0,#0F0H,#020H
; SOURCE LINE # 8
0010 CB00 RET
; FUNCTION main (END RMASK = @0x4000)
This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.
ARM websites use two types of cookie: (1) those that enable the site to function and perform as required; and (2) analytical cookies which anonymously track visitors only while using the site. If you are not happy with this use of these cookies please review our Privacy Policy to learn how they can be disabled. By disabling cookies some features of the site will not work.