home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 8
/
CDASC08.ISO
/
NEWS
/
554
/
JUIN
/
ASMARRAY.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1993-10-07
|
983b
|
39 lines
{─ Fido Pascal Conference ────────────────────────────────────────────── PASCAL ─
Msg : 517 of 614
From : Fred Johnson 1:280/5.0 17 Jun 93 21:51
To : Colin Chow
Subj : array access in tp/asm
────────────────────────────────────────────────────────────────────────────────
TO: Colin Chow
Subject: array access in tp/asm
CC> Can anyone please post me a simple example on how to access
CC> the contents of an array in tp'asm? Preferably an array[1..4] of
CC> byte = (for ie.) 1,20,3,7.
}
var
xArray : array[1..4] of byte;
begin
xArray[1] := ord('a');
xArray[2] := ord('b');
xArray[3] := ord('c');
xArray[4] := ord('$');
asm
mov ah, 0ah
mov al, byte ptr OFFSET xArray+3; {print 4th element}
xor bx, bx
mov cx, 1h;
int 10h
end;
writeln;
asm
mov dx, OFFSET xArray; {Do the whole string}
mov ah, 09h
int 21h
end;
end.