void dumplong(unsigned long x)
_dumplong:
push bp
mov bp,sp
char buf[9];
sub sp,OFFSET L04604
char *z = "0123456789abcdef";
mov ax,OFFSET L03767
mov dx,ds
mov WORD PTR -16[bp],ax
mov WORD PTR -14[bp],dx
y = 0;
mov WORD PTR ?y@?1??dumplong@@9@9,OFFSET 0
buf[0] = 'P';
buf[1] = 'P';
buf[2] = 'P';
buf[3] = 'P';
mov BYTE PTR -12[bp],OFFSET 80
mov BYTE PTR -11[bp],OFFSET 80
mov BYTE PTR -10[bp],OFFSET 80
mov BYTE PTR -9[bp],OFFSET 80
buf[3-y] = 'R';
mov ax,OFFSET 3
sub ax,WORD PTR ?y@?1??dumplong@@9@9
lea bx,WORD PTR -12[bp]
add bx,ax
mov BYTE PTR ss:[bx],OFFSET 82
buf[4] = 'P';
mov BYTE PTR -8[bp],OFFSET 80
buf[4+y] = 'S';
mov ax,WORD PTR ?y@?1??dumplong@@9@9
add ax,OFFSET 4
lea bx,WORD PTR -12[bp]
add bx,ax
mov BYTE PTR ss:[bx],OFFSET 83
buf[5] = 'P';
buf[6] = 'P';
buf[7] = 'P';
mov BYTE PTR -7[bp],OFFSET 80
mov BYTE PTR -6[bp],OFFSET 80
mov BYTE PTR -5[bp],OFFSET 80
I've been looking at this for hours.
Unless I've somehow stuffed up the test, this data is
all being set to 'P'.
Regardless of whether I do a subtraction or an addition
(of 0), the data is not changed.
buf[3-y] = 'R';
mov ax,OFFSET 3 ; ax = 3
sub ax,WORD PTR ?y@?1??dumplong@@9@9 ; ax -= y
lea bx,WORD PTR -12[bp] ; bx = &buf[0]
add bx,ax ; bx += ax
mov BYTE PTR ss:[bx],OFFSET 82 ; *bx = 'R'
I've been looking at this for hours.
Unless I've somehow stuffed up the test, this data is
all being set to 'P'.
I don't follow, you set buf[3] to 'R' (shows as OFFSET 82 in the
disassembly) and buf[4] to 'S'.
Ah, as soon as I hit send I realized what you were saying - you don't
think there's a miscompilation. You're saying the write to ss:[bx] isn't working, and you suspect the lea is to blame?
It seems correct to me, the base should be irrelevant and the actual
write has the correct override. I don't know what could be causing
that!
I tried zapping the add into a subtract, on the assumption
that it was a compiler bug, since I think I am using 1.52
but I think there is a 1.52C available via patch.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 300 |
Nodes: | 16 (2 / 14) |
Uptime: | 32:57:55 |
Calls: | 6,707 |
Files: | 12,239 |
Messages: | 5,353,204 |