home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!mcsun!sun4nl!wtrlnd!contrast!postmaster
- From: berend@contrast.wlink.nl (Berend de Boer)
- Newsgroups: comp.lang.pascal
- Subject: Strange behavior?
- Message-ID: <727662763.AA01194@contrast.wlink.nl>
- Date: Thu, 21 Jan 1993 21:51:26
- Sender: postmaster@contrast.wlink.nl
- Lines: 56
-
- Hello All!
-
- Can anyone explain the following behavior to me?
-
- Sorry, I wrote the above sentence and the test programs below before
- looking in Duncan's buglist. The SEG bug is document (number 16), but
- the OFFSET bug is not, at least I could not find it.
-
- Well than, for your information:
-
- ====test program====
- program Test;
-
- procedure T;
- var
- s : string;
- begin
- asm
- mov ax,OFFSET s {* line 1 *}
- lea ax,s {* line 2 *}
- mov ax,SEG s {* line 3 *}
- end;
- end;
-
- begin
- T;
- end.
- =========
-
- If you look at the compiled code you will see that line 1 and line 3 are
- compiled strange (in my honest opinion). Register ax is loaded with
- $FFCE ($FF00 in real mode) and $FFFF respectively, while line 2 is OK.
-
- This bug does not show up when you do it like the following program:
-
- ====test program====
- program Test;
-
- var
- s : string;
- begin
- asm
- mov ax,OFFSET s {* line 1 *}
- lea ax,s {* line 2 *}
- mov ax,SEG s {* line 3 *}
- end;
- end.
- =========
-
-
- Groetjes,
-
- Berend. (-:
- fido: 2:281/527.23
- email: berend@contrast.wlink.nl
-
-