Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Inline Assembly was already on Turbo Pascal 4.


Wikipedia claims that TP 6 added inline assembly, I looked at the TP 4 manual and found you can write

  procedure FillWord(var Dest,Count,Data: word);
  begin
  inline(
     $C4/$BE/Dest/       { LES DI,Dest[BP] }
     $8B/$8E/Count/      { MOV CX,Count[BP] }
     $8B/$86/Data/       { MOV AX,Data[BP] }
     $FC/                { CLD }
     $F3/$AB);           { REP STOSW }
  end;
Note that {} is a comment so this is raw machine code expressed in bytes where you can substitute in addresses or other values. Not as cool as what came later.


It is about having the feature available in some form.


Well, prior to 7 I had the yellow one. 6? and no books or manuals, just some snippets from a Peter Norton book I got from the library enough times that the librarian asked me to not check it out for two weeks once. I got 7 for christmas and it came with the manual and maybe I mis-remember the difference between "added" and "I learned about it then"




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: