All pastes #435733 Raw Edit

Rick

public text v1 · immutable
·published 2007-04-12 03:09 UTC
rendered paste body
struct Test
{
	unsigned short a: 6;
	unsigned short b: 10;
};

int main(int argc, char *argv[])
{
	Test test;
	
	test.a = atoi(argv[1]);
	test.b = atoi(argv[2]);
	test.a = atoi(argv[3]);

	printf(".a = %d, .b = %d\n", test.a, test.b);

	return 1;
}

.text:00401000 ; int __cdecl main(int argc,const char **argv,const char *envp)
.text:00401000 _main           proc near               ; CODE XREF: start+16Ep
.text:00401000
.text:00401000 argc            = dword ptr  0Ch
.text:00401000 argv            = dword ptr  10h
.text:00401000 envp            = dword ptr  14h
.text:00401000
.text:00401000                 push    esi
.text:00401001                 push    edi
.text:00401002                 mov     edi, [esp+argv]
.text:00401006                 mov     eax, [edi+4]
.text:00401009                 push    eax             ; char *
.text:0040100A                 call    j__atol
.text:0040100F                 mov     ecx, [edi+8]
.text:00401012                 push    ecx             ; char *
.text:00401013                 call    j__atol
.text:00401018                 mov     edx, [edi+0Ch]
.text:0040101B                 push    edx             ; char *
.text:0040101C                 mov     esi, eax
.text:0040101E                 call    j__atol
.text:00401023                 and     eax, 3Fh
.text:00401026                 shl     esi, 6
.text:00401029                 or      eax, esi
.text:0040102B                 movzx   eax, ax
.text:0040102E                 mov     ecx, eax
.text:00401030                 shr     ecx, 6
.text:00401033                 push    ecx
.text:00401034                 and     eax, 3Fh
.text:00401037                 push    eax
.text:00401038                 push    offset a_aD_bD  ; ".a = %d, .b = %d\n"
.text:0040103D                 call    _printf
.text:00401042                 add     esp, 18h
.text:00401045                 pop     edi
.text:00401046                 mov     eax, 1
.text:0040104B                 pop     esi
.text:0040104C                 retn
.text:0040104C _main           endp