> "Brett Lathrope" <br...@lathrope.com> wrote in message...
> > Ok, Valentine helped me with a routine (below).
> > But it keeps whining about "asm" with an "unknown identifier" error
> > when I try to compile/build it.
> > Is there a unit I need to add to support it? I have DOS in my uses.
> > I'm using TP 5.5
> > {******************************************************}
> > { Copy Screen from one page to another. }
> > { }
> > { Arguments can be 0 to 7 }
> > { }
> > { Routine by Valentine Mehling (va...@earthlink.net) }
> > { from the comp.lang.pascal.borland news group. }
> > {******************************************************}
> > Procedure CopyScreen(from, too : word) ;
> > begin
> > from := (from * $1000) ; { * page size in bytes }
> > too := (too * $1000) ;
> > asm mov cx,$B800 { set new segment address }
> > mov es,cx { - and transfer to es }
> > mov bx,$800 { page size in words }
> > mov si,from { store source index }
> > mov di,too { store destination index }
> > @loop: mov ax,es:[si] { fetch }
> > mov es:[di],ax { store }
> > inc si { increment indexes twice }
> > inc si
> > inc di
> > inc di
> > dec bx { decrement counter }
> > cmp bx,$00 { compare counter to 0 }
> > jne @loop { loop if not 0 }
> > end ; { asm }
> > end ;
> Just out of interest would anyone here know a Pascal equivalant to
> this statement: 'mov ax,es:[si]'. I 'am using TP 5.5 & have no
> intention to change to 7. For example in TP 5.5 you could do this for
> a statement like 'mov cx,$b800' in the form of this:
> uses dos; {this is required for setting up the registers}
> var regs : registers; {just defining the regs statement}
> begin
> regs.cx:=$b800; {pascal equivalant to 'mov cx,$b800'}
> end.
> If anyone could let me know what 'mov ax,es:[si]' means in pascal I
> should be able to interpret this for TP 5.5.