flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
avcaballero 24 Aug 2005, 07:40
Hello
I can do the following in masm: cmp bx, offset es:nameproc How can do the same in fasm? Thank you |
|||
![]() |
|
Kevin_Zheng 24 Aug 2005, 07:56
One answer:
Code: lea ax, [es:nameproc] cmp bx,ax |
|||
![]() |
|
gunblade 24 Aug 2005, 08:21
or just
Code: cmp bx, [es:nameproc] ![]() |
|||
![]() |
|
gunblade 24 Aug 2005, 11:12
Whoop, read a mov instead of a lea there..
sorry, your right, there goes my attempt to optimizze 2 lines into 1 ![]() |
|||
![]() |
|
vid 24 Aug 2005, 13:32
Kevin_Zheng wrote:
what?!? what should that code do? what is it in binary code. processor has no such instruction as "cmp bx,es:nameproc". ![]() |
|||
![]() |
|
avcaballero 24 Aug 2005, 14:30
Thank you Kevin_Zheng, I will test it as sortly as i can. It's a pitty that "cmp bx, offset es:nameproc" doesn't work (similar in nasm).
Quote:
I used it recentely in TSRs. Quote:
OFFSET gives the number position Cheers |
|||
![]() |
|
Matrix 24 Aug 2005, 23:12
ehhz...
, what should cmp word register, segment:offset do? bug in masm? |
|||
![]() |
|
vid 25 Aug 2005, 08:24
someone assemble it and send me it's opcode, i'm very curious. because there just ISN'T any such instruction (maybe "cmp reg,imm" with semgent prefix but if i am right this is invalid opcode)
|
|||
![]() |
|
avcaballero 25 Aug 2005, 10:02
Too fast typing I really want to say that "cmp bx, es:procname" doesn't work in fasm, the same in nasm.
Now I haven't got my code. But if I don't remember wrong, for deinstall a tsr we need to know that no one has change interrupt vector that we have change first, so because of "procname" is resident in ES segment and bx has the interrupt vector value for now, if both aren't equal, we can't remove our tsr. OFFSET belong to preprocessor and gives the offset number. What we can see in a debuger is this number. I'm sorry for my english |
|||
![]() |
|
vid 25 Aug 2005, 13:01
ah, now i understand, if you have more same names in different segment then segment name should choose one. this wouldn't be possible in FASM because "es" is segment register and during compilation it isn't clear which program segment (if any) it points to. in MASM this is ?solved? by ASSUME, but i don't like this. i think you can't have same names in different segments in FASM. But at least we stay clear.
|
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.