> On Feb 9, 2008 8:17 AM, Brantley Coile <[EMAIL PROTECTED]> wrote:
>> I would like to hear what Rob or others have to say about the
>> assembler syntax, but I actually like the syntax for the following
>> reason.
>
> if you love assembly code, the assembler on Plan 9 is not great.
>
> If you love assembly code, you are in need of a CAT scan in my view.
>
> The v6 manual entry for as called assembly code "the ultimate dead
> language". If only that had been true.
>
> gcc and friends have made the world safe for assembly, and there is more
> assembly in use than ever.
>
> Writing assembly code should be as painful as possible. Plan 9
> succeeds in that regard. It's a good thing in my view.
>
> ron
I'm afraid Plan 9 fails in this reguard. Here's some Oberon code
to make the pread call. (This is NOT Wirth's compiler, but Paul Reed's.
He agrees with you about make assembly programming as hard as possible.)
PROCEDURE syspread(poshi, poslo: LONGINT;
VAR buf: ARRAY OF CHAR; fd: LONGINT): LONGINT;
BEGIN
(*
18: return value
14: poshi
10: poslo
0c: buflen
08; buf ptr
04: fd
00: RA
*)
SYSTEM.CODE(
0C9H, (* leave *)
06AH, 50, (* pushb $close *)
058H, (* pop eax *)
0CDH, 040H, (* int $40h *)
089H,084H,024H,018H,000H,000H,000H, (* movl eax,
18h(esp) *)
0C2H, 14H, 0 (* ret $14h *)
)
END syspread;