On an i386, I am unable to get acid to properly report the values in the
floating point registers.
Could someone please explain what I am doing wrong ?
You are doing nothing wrong (or at least almost nothing).
As for the rest of the system:
- libmach has the wrong size for the 386 floating point register file.
- libmach has the addresses of the floating point registers backward
(i.e., F0 and F7 swapped, F1 and F6 swapped, etc.)
- /sys/lib/acid/386's fpr() is trying to format the registers as fmt 'g',
whatever that means, when in fact it should be using '3',
which means the 80-bit little endian IEEE floating point.
in fact, fpr shouldn't say a format at all, since the floating
point registers already have the right format by default.
- acid implements the '3' format but does not recognize it in
acid programs (e.g., as fmt(x, '3') or x\3.
All these problems are now fixed on sources.
So your typescript should have said *(F0\3) or just *F0,
but was otherwise correct:
% acid 8.out
8.out:386 plan 9 executable
/sys/lib/acid/port
/sys/lib/acid/386
/usr/rsc/lib/acid
acid: new()
1252595: system call _main SUBL $0x48,SP
1252595: breakpoint main+0x3 MOVL $.string(SB),AX
acid: bpset(main+0x10)
acid: cont()
1252595: breakpoint main+0x10 FMOVDP F0,x+0x14(SP)
acid: *F0
3.5
acid: fpr()
F0 3.5
F1 0
F2 0
F3 0
F4 0
F5 0
F6 -183.464
F7 0
control 0x0272
status 0x3900
tag 0x3fff
ip offset 0x0000174f
cs selector 0x0023
opcode 0xe907
data operand offset 0xeee8
operand selector 0x001b
acid:
Russ