flat assembler
Message board for the users of flat assembler.
Index
> Windows > Convert C Struct bit fields to FASM |
Author |
|
revolution 03 Jul 2020, 14:03
The whole structure is one dword. And within that are the bits.
Code: D3D11_VIDEO_PROCESSOR_COLOR_SPACE dd ? ;for multipliers D3D11_VIDEO_PROCESSOR_COLOR_SPACE.Usage = 1 shl 0 D3D11_VIDEO_PROCESSOR_COLOR_SPACE.RGB_Range = 1 shl 1 D3D11_VIDEO_PROCESSOR_COLOR_SPACE.YCbCr_Matrix = 1 shl 2 D3D11_VIDEO_PROCESSOR_COLOR_SPACE.YCbCr_xvYCC = 1 shl 3 D3D11_VIDEO_PROCESSOR_COLOR_SPACE.Nominal_Range = 1 shl 4 ;for masks D3D11_VIDEO_PROCESSOR_COLOR_SPACE.Usage = 1 shl 0 D3D11_VIDEO_PROCESSOR_COLOR_SPACE.RGB_Range = 1 shl 1 D3D11_VIDEO_PROCESSOR_COLOR_SPACE.YCbCr_Matrix = 1 shl 2 D3D11_VIDEO_PROCESSOR_COLOR_SPACE.YCbCr_xvYCC = 1 shl 3 D3D11_VIDEO_PROCESSOR_COLOR_SPACE.Nominal_Range = 3 shl 4 ;for shifts D3D11_VIDEO_PROCESSOR_COLOR_SPACE.Usage = 0 D3D11_VIDEO_PROCESSOR_COLOR_SPACE.RGB_Range = 1 D3D11_VIDEO_PROCESSOR_COLOR_SPACE.YCbCr_Matrix = 2 D3D11_VIDEO_PROCESSOR_COLOR_SPACE.YCbCr_xvYCC = 3 D3D11_VIDEO_PROCESSOR_COLOR_SPACE.Nominal_Range = 4 |
|||
03 Jul 2020, 14:03 |
|
mns 03 Jul 2020, 17:28
Thank you revolution, for the kind quick response.
So the "=" will define the size of the struct: members?(If the question is silly and not grasping the basic knowladge of FASM, kindly bear with me) |
|||
03 Jul 2020, 17:28 |
|
revolution 03 Jul 2020, 23:22
"=" is just defining a value, there is no special meaning, it is just a number.
You can use the number to examine the bits you need. For example if you are using masks: Code: mov eax, [D3D11_VIDEO_PROCESSOR_COLOR_SPACE] test eax, D3D11_VIDEO_PROCESSOR_COLOR_SPACE.RGB_Range |
|||
03 Jul 2020, 23:22 |
|
mns 04 Jul 2020, 08:08
Thank you very much revolution
|
|||
04 Jul 2020, 08:08 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.