My code:
WINDOW STRUCT
_WINDOW_Flag DD ?
_WINDOW_CLASS DD ?
_WINDOW_X DD ?
_WINDOW_Y DD ?
_WINDOW_WIDTH DD ?
_WINDOW_HEIGHT DD ?
_WINDOW_PROC DD ?
_WINDOW_VALUE DD ?
_WINDOW_PARRENT DD ?
WINDOW ENDS
.
.
.
error this line:
assume esi: PTR WINDOW
error code: type is wrong size for register
writing this "assume si: PTR WINDOW" no error
I don't see any problem with the ASSUME statement :
.386
.model flat,stdcall
option casemap:none
WINDOW STRUCT
_WINDOW_Flag DD ?
_WINDOW_CLASS DD ?
_WINDOW_X DD ?
_WINDOW_Y DD ?
_WINDOW_WIDTH DD ?
_WINDOW_HEIGHT DD ?
_WINDOW_PROC DD ?
_WINDOW_VALUE DD ?
_WINDOW_PARRENT DD ?
WINDOW ENDS
.data?
buffer db 100 dup(?)
.code
start:
mov esi,OFFSET buffer
ASSUME esi:PTR WINDOW
mov [esi]._WINDOW_X,100
ASSUME esi:NOTHING
ret
END start
it's probably because his
".model flat,stdcall" isn't present or intact.
(note that the assembler assumes a pointer to be 16-bit, not 32-bit)
thanx.
Problem 16 bit segment.
xcode segment para public 'CODE' use16
In a 16-bit segment you need to use a 16-bit register for the pointer, and it must be a base or index register. If you combine two registers in one instruction, one must be a base register and the other an index register. For example:
mov ax,[bx+si]
is OK, but these are not:
mov ax,[bp+bx]
mov ax,[si+di]