home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.pascal
- Path: sparky!uunet!usc!cs.utexas.edu!torn!news.ccs.queensu.ca!mast.queensu.ca!dmurdoch
- From: dmurdoch@mast.queensu.ca (Duncan Murdoch)
- Subject: Re: Strange behavior?
- Message-ID: <dmurdoch.424.727716812@mast.queensu.ca>
- Lines: 27
- Sender: news@knot.ccs.queensu.ca (Netnews control)
- Organization: Queen's University
- References: <727662763.AA01194@contrast.wlink.nl>
- Date: Fri, 22 Jan 1993 15:33:32 GMT
-
- In article <727662763.AA01194@contrast.wlink.nl> berend@contrast.wlink.nl (Berend de Boer) writes:
- >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;
-
- >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.
-
- The problem is the strange way BASM handles symbols. To BASM, "s" means
- the BP relative offset of the local variable "s". Neither "OFFSET s" nor
- "SEG s" are meaningful. The bug is that neither your first line nor your
- last line are signalled as syntax errors, as they should be.
-
- A more forgiving implementation would translate line 1 into line 2, and line
- 3 into "mov ax,ss", but BASM is not forgiving.
-
-
- Duncan Murdoch
- dmurdoch@mast.queensu.ca
-