DOS version: 6.22
BC version: 3.1
Hardware architecture: x86
Current problem encountered: Found that some registers cannot be operated normally: For example, the Transmit Configuration Register. When writing in 8-bit, 16-bit, 32-bit, and then reading in 8-bit, it is found that the value cannot be written in at all each time. My 8-bit operation is the outport() function, the 16-bit operation is the outportb() function, and for 32-bit, I use the static void outportd(unsigned short portid, unsigned long value) //output dword to I/O port
{
asm MOV DX, portid
asm DB 0x66 //
asm MOV AX, WORD PTR value // MOV EAX,value
asm DB 0x66, 0xEF // OUT DX,EAX
}
There is one point I don't particularly understand. Generally, if a register supports 32-bit writing, it should be able to write in 8-bit and 16-bit as well. But currently, I don't know which part of my operation is wrong. Who has done work in this aspect, give some suggestions or opinions, thanks......
BC version: 3.1
Hardware architecture: x86
Current problem encountered: Found that some registers cannot be operated normally: For example, the Transmit Configuration Register. When writing in 8-bit, 16-bit, 32-bit, and then reading in 8-bit, it is found that the value cannot be written in at all each time. My 8-bit operation is the outport() function, the 16-bit operation is the outportb() function, and for 32-bit, I use the static void outportd(unsigned short portid, unsigned long value) //output dword to I/O port
{
asm MOV DX, portid
asm DB 0x66 //
asm MOV AX, WORD PTR value // MOV EAX,value
asm DB 0x66, 0xEF // OUT DX,EAX
}
There is one point I don't particularly understand. Generally, if a register supports 32-bit writing, it should be able to write in 8-bit and 16-bit as well. But currently, I don't know which part of my operation is wrong. Who has done work in this aspect, give some suggestions or opinions, thanks......
