bug 1)
kkk dw 0
bound ax,
worked....?but the right syntax should be kkk dd 0?

bug 2)

segment use16
mov eax,cr0
mov cr0,eax

doesn't produce 66h prefix,hang my system several times....

mov cr4,eax and other some pmode registers in 16 bit mode gen the same bug.

idea 3)

how to initial structs?

struc POINT
.x dd ?
.y dd ?

I can't initial it while define data as follows

pt POINT 10,20

perhaps I can use

struc POINT x,y
.x dd x+0
.y dd y+0
to solve it,BUT if the structure was very big,Or just I was boring doing that dirty work...
Is there any clean solution to this,can We use fasm like in masm and other compilers?
Posted on 2002-08-29 08:32:32 by Hume
1) The right should be kkk dw 0,0.
2) AFAIK these instruction are not prefix-dependent, they always worked for me in 16-bit mode, for example DOS fasm version is using them, and it doesn't hang.
3) If the structure was very big, you'd have also to put so many values in the struc definition that it can't be handy. The advantage of fasm's macro structures is that you can choose exacly what syntax should be used for the structure parameters and fill other structure fields automatically (calculated, or default values).
Posted on 2002-08-29 09:19:02 by Tomasz Grysztar
1)I think dw 0,0 is also OK,but my college textbook had taught me that it should be dd 0
....heh,no matter

2)My Pc duron 850+dos 7.0 really hang while there is no 66h prefix
also tested on P733+dos7.0

I will post my rubbish code.if you del the 66h prefix before mov cr0,eax....,it really hang...I don't know how about it on other PCs....

3)I mean sometimes you need to fill 1~2 of them while initial the struc(perhaps it's very big),it's more convienient....
pt POINT 3,4
is a good idea while no need to
to define

struc POINT x,y,z......
.x dd x+0
.y dd y+0
.z dd z+0

It's also OK like fasm 140 do if others write the header struc file(am I too lazy?)

hmmm....the rubbish test code attached,Privalov,can it work perfect on your PC
if you del db 66h
before mov eax,cr0 and mov cr0,eax
and compile it again?If it's the truth,I would ask my hardware provider to seek help....hope not the truth...
Posted on 2002-08-29 10:05:27 by Hume
It was hanging my PC whether there was 66h or not. I have looked through your source and found many things to correct, the attached version is a quick and dirty fix to make it working on my machine.
You don't need to define the J16, J32 etc. macros, fasm allows the forms like "jmp dword 0:0" and "jmp fword 0:0". fasm was designed especially for the PM OS programming, and I wanted to avoid any db-defined instructions in my code. Look at the system.inc from the DOS version of fasm, at the unReal mode support in the kelvar example from my website and at my OS kernel sources here to see how I usually do PM programming with fasm.
I have also modified a bit your macro for descriptor definitions. To allow it to accept empty arguments in the current form, it would need a several if's.
Posted on 2002-08-29 12:27:49 by Tomasz Grysztar
It worked...
It seems that not the 66h prefix caused the problem,but on my PC,while I correct the 66h,it also does work,so I compare the code gen by masm and fasm,and come to the wrong conclusion.

sorry for my bad codes,and sorry for my bad English.hope to see fasm docs as soon as possible.
you are great!

how do you debug PM os level prog?any tools recommanded,it's really a disaster for me to restart my pC again and againand again...
Posted on 2002-08-29 22:31:19 by Hume