Binarus
2013-02-25 13:30:57 UTC
Dear experts,
please forgive that I am posting my question to this group - the openwatcom.users.assembler group seems to be dead.
I am trying to port a big project from Borland C++ 5.02 to OpenWatcom. The main reason for this is that the OpenWatcom toolchain is more advanced and that it is well integrated into Code::Blocks (I don't want to use Borland's outdated IDE any more).
The project contains some assembler source code files (pure assembler, not inline assembler). I have some difficulties with porting these to WASM:
1) Declaring PROCs with parameters:
According to the docs, WASM is almost compatible to MASM, so I am using the documentation for MASM 6.1 as reference. In MASM, if I have a function _StartPerfCounter with two parameters which are both pointers to a DWORD, I can do the following:
.MODEL HUGE,C
_StartPerfCounter PROC FAR, PDW_DestLow: FAR DWORD PTR, PDW_DestHigh: FAR DWORD PTR
...
That code produces errors with WASM. It doesn't seem to be possible to declare FAR pointer parameters or pointers to a certain type at all. The following works:
.MODEL HUGE,C
_StartPerfCounter PROC FAR, PDW_DestLow: PTR, PDW_DestHigh: PTR
...
But I am not sure if this does what I mean. How should I declare a procedure with FAR pointer parameters in WASM?
2) Predefined symbols:
The existing project uses @fardata and friends in many places. According to the docs, MASM understands that predefined symbol. But WASM complains about undefined symbols, and I haven't found something similar what I could use.
So what's the correct method to get the current fardata segment in WASM?
The existing project (mainly) uses the predefined symbols for something like that:
MOV AX, @fardata
MOV DS, AX
...
Thank you very much for any help,
Binarus
please forgive that I am posting my question to this group - the openwatcom.users.assembler group seems to be dead.
I am trying to port a big project from Borland C++ 5.02 to OpenWatcom. The main reason for this is that the OpenWatcom toolchain is more advanced and that it is well integrated into Code::Blocks (I don't want to use Borland's outdated IDE any more).
The project contains some assembler source code files (pure assembler, not inline assembler). I have some difficulties with porting these to WASM:
1) Declaring PROCs with parameters:
According to the docs, WASM is almost compatible to MASM, so I am using the documentation for MASM 6.1 as reference. In MASM, if I have a function _StartPerfCounter with two parameters which are both pointers to a DWORD, I can do the following:
.MODEL HUGE,C
_StartPerfCounter PROC FAR, PDW_DestLow: FAR DWORD PTR, PDW_DestHigh: FAR DWORD PTR
...
That code produces errors with WASM. It doesn't seem to be possible to declare FAR pointer parameters or pointers to a certain type at all. The following works:
.MODEL HUGE,C
_StartPerfCounter PROC FAR, PDW_DestLow: PTR, PDW_DestHigh: PTR
...
But I am not sure if this does what I mean. How should I declare a procedure with FAR pointer parameters in WASM?
2) Predefined symbols:
The existing project uses @fardata and friends in many places. According to the docs, MASM understands that predefined symbol. But WASM complains about undefined symbols, and I haven't found something similar what I could use.
So what's the correct method to get the current fardata segment in WASM?
The existing project (mainly) uses the predefined symbols for something like that:
MOV AX, @fardata
MOV DS, AX
...
Thank you very much for any help,
Binarus