I'm trying to compile some code from the late nineties in Visual Studio 2013. For the most part it's pretty straight forward but there are a small number of ASM blocks I'm not too sure about (I've never done any x86 ASM, only the odd bit of microcontroller specific stuff at uni years ago).
The function below generated compile errors relating to size mismatches, so I changed the ints to short int thinking it was written for 16 bit. That got rid of the size errors but now I have this error relating to the "short int 60h" line:
Error 1 error C2400: inline assembler syntax error in 'opcode'; found 'data type'
static unsigned int Read_TSR( unsigned short int b_offset )
{
unsigned short int buffer;
_asm {
mov ax,899bh
mov bx,2
mov dx,b_offset
short int 60h
mov buffer,bx
}
return ( buffer );
}
So all the short ints above were just ints in the original code.
If I remove short and leave it as just "int 60h" the error disappears, but I worry I'd again be mismatching sizes only now perhaps the compiler isn't complaining for some reason.
Googling the "found data type" error I haven't come across this syntax, which looks very odd to me, just having an int declared as if to do nothing in the middle of the ASM.
Can anyone suggest how this can be safely ported? An explanation of why that int is even there would be read with interest too ...
Thanks