1 / 32

หลักการภาษาชุดคำสั่ง

หลักการภาษาชุดคำสั่ง. ภาษาคอมพิวเตอร์. มหาวิทยาลัยเนชั่น http:// www. nation. ac.th. อ.บุรินทร์ รุจจนพันธุ์ . ปรับปรุง 9 มิถุนายน 255 6. ภาษาคอมพิวเตอร์ (Computer Language).

benjamin
Télécharger la présentation

หลักการภาษาชุดคำสั่ง

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. หลักการภาษาชุดคำสั่ง ภาษาคอมพิวเตอร์ มหาวิทยาลัยเนชั่น http://www.nation.ac.th อ.บุรินทร์ รุจจนพันธุ์ . ปรับปรุง 9 มิถุนายน 2556

  2. ภาษาคอมพิวเตอร์ (Computer Language) ภาษาคอมพิวเตอร์ (Computer Language) คือ ภาษาที่ใช้ หรือเกี่ยวข้องกับคอมพิวเตอร์ ซึ่งมักใช้ร่วมกับภาษาโปรแกรม แต่ภาษาคอมพิวเตอร์นั้นมีความหมายที่กว้างกว่า โดยไม่จำเป็นที่จะต้องเป็นภาษาโปรแกรม ซึ่งเป็นที่รู้กันว่าภาษาอย่าง HTML หรือ SQL ไม่ใช่ภาษาโปรแกรม แต่ถือว่าเป็นภาษาคอมพิวเตอร์

  3. ภาษาโปรแกรม (Program Language) ภาษาโปรแกรม (Program Language) คือ วิธีการมาตรฐานในการสื่อสารสำหรับแสดงคำสั่งไปยังคอมพิวเตอร์ ภาษาโปรแกรมกำหนดไวยากรณ์และการตีความหมายจากโปรแกรมคอมพิวเตอร์ที่เขียนขึ้น ภาษาโปรแกรมทำให้โปรแกรมเมอร์สามารถระบุอย่างชัดเจนถึงข้อมูลที่คอมพิวเตอร์จะทำงาน และวิธีการที่คอมพิวเตอร์จะประมวลผลข้อมูลเหล่านั้น

  4. ภาษาคอมพิวเตอร์มีมากมายภาษาคอมพิวเตอร์มีมากมาย ข้อมูลจาก http://dmoz.org/Computers/Programming/Languages/ 143 ภาษา ข้อมูลจาก http://people.ku.edu/~nkinners/LangList/Extras/langlist.htm 2500 ภาษา ข้อมูลจาก http://www.levenez.com/lang/ 50 ภาษา (Computer Languages Timeline) ABC, Ada, ADL, Algol 60, Algol 68, APL, AppleScript@, Assembly, Awk, BASIC, Befunge, BETA, Bigwig, Bistro@, Blue, Brainfuck, C, C++, Caml@, Cecil, CHILL, Clarion, Clean, Clipper, CLU, Cobol, CobolScript, Cocoa, Component Pascal@, C-sharp, Curl, D, DATABUS, Delphi, DOS Batch@, Dylan, E, Eiffel, ElastiC, Erlang, Euphoria, Forth, Fortran, Fortress, FP, Frontier, Goedel, Groovy@, Haskell, HTML@, HTMLScript@, HyperCard@, ICI, Icon, IDL, Intercal, Io, Jal@, Java, JavaScript, Jovial, LabVIEW, Lagoona@, LaTeX@, Leda, Limbo, Lisp, Logo@, Lua, m4, Maple@, Mathematica@, MATLAB@, Mercury, Miranda, Miva, ML, Modula-2, Modula-3, Moto, Oberon, Objective Caml@, Objective-C, Obliq, Occam, Oz, Pascal, Perl, PHP, Pike, PL, Pliant, PL-SQL, POP-11, PostScript@, PowerBuilder@, Prograph, Prolog, Proteus, Python, R@, REBOL, Refal, Rexx, Rigal, RPG, Ruby, SAS, Sather, Scheme@, Self@, SETL, SGML@, Simkin, Simula, Sisal, S-Lang, Smalltalk, Snobol, SQL, Squeak@, Tcl-Tk, Tempo, TeX@, TOM, TRAC, Transcript, Turing, T3X, UML@, VBScript@, Verilog@, VHDL@, Visual Basic, Visual DialogScript, Visual FoxPro, Water, XML@, XOTcl@, YAFL, Yorick, Z

  5. โปรแกรมเมอร์คนแรกของโลกโปรแกรมเมอร์คนแรกของโลก Augusta Lovelace Ada คือ โปรแกรมเมอร์คนแรกของโลก แต่ Edsger Wybe Dijkstra ใช้คำว่า โปรแกรมเมอร์ (Programmer) กับโลกของคอมพิวเตอร์เป็นคนแรก ข้อมูลจาก http://www.cs.utexas.edu/users/dahlin/Classes/GradOS/papers/p341-dijkstra.pdf ข้อมูลจาก http://www.thaiall.com/article/teachpro.htm

  6. ประวัติ Batch File BAT file (BATch file) A file of DOS or OS/2 commands, which are executed one after the other. It has a .BAT extension and is created with a text editor. A file of DOS commands that are "batch" processed one after the other. Windows also supports batch files, which are mostly identical to the DOS commands. To create a DOS batch file, use a text editor such as Edit. If you use a word processor, save your batch file as an ASCII text file, not as a standard document. Always include a .BAT extension with your batch file name. ข้อมูลจาก http://www.thaiall.com/assembly/batch.htm

  7. ตัวอย่าง Batch file (j.bat) DOS>j.bat x @echo off rem j x javac %1.java java %1

  8. ตัวอย่าง Batch file (x.bat) DOS>x.bat @echo off rem copyto.bat c:\x *.doc b.ppt c.xls set destdir=%1 :start shift if "%1" == "" goto end copy %1 %destdir% goto start :end echo bye ข้อมูลจาก http://www.thaiall.com/assembly/

  9. ประวัติภาษา GW-BASIC GW คำว่า GW ย่อมาจาก "Gee Whiz" เป็นภาษาในยุคแรก ๆ ที่ใช้ประกอบการสอนการเขียนโปรแกรมในคอมพิวเตอร์ และทำงานบน PC ได้ดีในระดับหนึ่ง มีการทำงานเป็น Interpreter มีการนำภาษานี้ใช้สอนในหนังสือ คอมพิวเตอร์เบื้องต้น และเทคนิคการเขียนโปรแกรม ที่เขียนโดย รศ.วัชราภรณ์ สุริยาภิวัฒน์ ที่มีการนำไปใช้สอนในสถาบันต่าง ๆ กันมาก เพราะมีการตีพิมพ์กว่า 20 ครั้ง ซึ่งสมัยผมเป็นนักศึกษา ก็เริ่มเรียนภาษานี้เป็นภาษาแรก ถูกพัฒนาขึ้นตั้งแต่ปีค.ศ. 1963 (พ.ศ.2506) ข้อมูลจาก http://www.thaiall.com/gwbasic/

  10. ตัวอย่างภาษา GW-BASIC (1/2) 10 dim a 20 a = a + 1 30 print a 40 if a < 5 then go to 20 ตัวแปลภาษา http://www.oocities.org/KindlyRat/GWBASIC.html ข้อมูลจาก http://www.thaiall.com/gwbasic/

  11. ตัวอย่างภาษา GW-BASIC (2/2) 10 FOR I = 1 TO 5 15 PRINT TAB(40 - I); 20 FOR J = 1 TO I 30 PRINT RIGHT$(STR$(J),1); 40 NEXT J 50 PRINT 60 NEXT I ตัวแปลภาษา http://www.oocities.org/KindlyRat/GWBASIC.html ข้อมูลจาก http://www.thaiall.com/gwbasic/

  12. ประวัติภาษา HTML HTML (HyperText Markup Language) คือ ภาษาคอมพิวเตอร์ที่ออกแบบมาเพื่อใช้ในการเขียนเว็บเพจ ถูกเรียกดูผ่านเว็บบราวเซอร์ เริ่มพัฒนาโดย ทิม เบอร์เนอรส์ ลี (Tim Berners Lee) ในปีค.ศ.1990 (พ.ศ.2533) HTML เป็นมาตรฐานที่จัดการโดย World Wide Web Consortium แต่ปัจจุบัน W3C ผลักดัน XHTML ที่ใช้ XML มาทดแทน HTML รุ่น 4.01 ข้อมูลจาก http://inventors.about.com/od/computersoftware/a/html.htm

  13. ตัวอย่างภาษา HTML (1/3) DOS>explorer x.htm <html> <head> <title>hello</title> </head> <body> a<br>b c<br>d </body> </html>

  14. ตัวอย่างภาษา HTML (2/3) DOS>explorer y.htm <html> <head><title>hello</title></head> <body bgcolor=yellow> My name is burin<br> <a href=http://google.com>google</a> <br><a href=x.htm>x.htm</a> <br><img src=x.jpg> </body> </html>

  15. ตัวอย่างภาษา HTML (3/3) DOS>explorer z.htm <body bgcolor=yellow> My name is burin<br> I am working at YONOK University<br> <a href=http://google.com>google</a> <br><a href=x.htm>x.htm</a> <br><img src=x.jpg>

  16. ประวัติภาษา PERL Perl is a dynamic programming language created by Larry Wall and first released in 1987. Perl borrows features from a variety of other languages including C, shell scripting (sh), AWK, sed and Lisp. Structurally, Perl is based on the brace-delimited block style of AWK and C, and was widely adopted for its strengths in string processing and lack of the arbitrary limitations of many scripting languages at the time ข้อมูลจาก http://en.wikipedia.org/wiki/Perl_programming_language

  17. ตัวอย่างภาษา PERL (x.pl) DOS>explorer http://127.0.0.1/cgi-bin/x.pl #!/usr/bin/perl #!c:/thaiabc/php/perl.exe print "Content-type: text/html\n\n"; print "<pre>Hello, World...\n"; foreach $key (keys(%ENV)) { print "$key = $ENV{$key}\n"; }

  18. ประวัติภาษา SQL เอสคิวแอล (SQL = Structured Query Language) คือ ภาษาสอบถามข้อมูล หรือภาษาจัดการข้อมูลอย่างมีโครงสร้าง มีการพัฒนาภาษาคอมพิวเตอร์ และโปรแกรมฐานข้อมูลที่รองรับมากมาย เพราะจัดการข้อมูลได้ง่าย ถูกพัฒนาครั้งแรกโดย Donald D. Chamberlin and Raymond F. Boyce ที่ IBM ช่วงต้นทศวรรษ 1970 MySQL หรือ SQL Server คือ โปรแกรมฐานข้อมูล มีหน้าที่เก็บข้อมูลอย่างเป็นระบบ รองรับคำสั่ง SQL (Structured Query Language) เป็นเครื่องมือสำหรับเก็บข้อมูล ที่ต้องใช้ร่วมกับเครื่องมืออื่นอย่างสอดคล้อง เพื่อให้ได้ระบบที่รองรับความต้องการของผู้ใช้ เช่น เครื่องบริการเว็บ (Web Server) และโปรแกรมประมวลผลฝั่งเครื่องบริการ (Server-Side Script) ข้อมูลจาก http://en.wikipedia.org/wiki/SQL

  19. ตัวอย่างภาษา SQL 1.create table a (a1 int, a2 char(20)); 2. insert into a values (1, "abc");3.insert into a (a2, a1)values("a",1); 4. select * from a;6.delete from a where a1=1; 7. update a set a2="def" where a1=1;8.select * from a order by a2; ข้อมูลจาก http://en.wikipedia.org/wiki/SQL ข้อมูลจาก http://www.thaiall.com/mysql

  20. ประวัติภาษา PHP PHP (Professional Home Page) ถูกคิดค้นขึ้นในปีค.ศ.1994 (พ.ศ.2537) โดย Mr.Rasmus Lerdorf เพื่อใช้ตรวจสอบสถิติการเข้าชมเว็บของตนเอง ปีค.ศ.1995 มีการเผยแพร่ และพัฒนาเป็น PHP/FI หรือ PHP รุ่น 2 ให้มีความสามารถมากขึ้น กลางปีค.ศ.1996 เริ่มมีทีมพัฒนา โดยมี Mr.Zeev Suraski และ Mr.Andi Gutmans ร่วมทีม และได้ PHP รุ่น 3

  21. ตัวอย่างภาษา PHP (x.php) DOS>explorer http://127.0.0.1/x.php <? for($x=1;$x<=5;$x++) { echo "hello".$x."<br>"; } ?> <b>bye</b>

  22. ประวัติภาษา ASP ASP (Active Server Page) ภาษา ASP เป็นโปรแกรมที่มากับ Internet Information Server (IIS) บริษัทไมโครซอฟท์เริ่มโครงการ ASP ช่วงธันวาคม 2540 ภาษานี้ถูกมองว่ามาล่าช้าเมื่อเทียบกับภาษาในกลุ่มเดียวกัน ในธันวาคม 2541 ได้เปิดตัว ASP 2.0 ใน WindowsNT4 และ ASP 3.0 ใน Windows 2000

  23. ตัวอย่างภาษา ASP (x.asp) DOS>explorer http://localhost/x.asp <% for x = 1 to 5 response.write("hello" & x) next %> <b>bye</b>

  24. ประวัติภาษา JAVA Java is a programming language originally developed by Sun Microsystems and released in 1995. Java applications are typically compiled to bytecode, although compilation to native machine code is also possible. At runtime, bytecode is usually either interpreted or compiled to native code for execution, although direct hardware execution of bytecode by a Java processor is also possible. The language, widely considered to be the most popular platform for web development, derives much of its syntax from C and C++ but has a simpler object model and fewer low-level facilities. JavaScript, a scripting language, shares a similar name and has similar syntax, but is not directly related to Java. ข้อมูลจาก http://en.wikipedia.org/wiki/Java_(programming_language)

  25. ตัวอย่างภาษา JAVA (x.java) DOS> javac x.java DOS> java x class x { public static void main(String[] a){ System.out.println(“test”); } }

  26. ประวัติภาษา JSP JSP (Java Server Page) ภาษา JSP เป็นเทคโนโลยีของจาวาสำหรับสร้าง HTML, XML หรือตามที่ผู้ใช้ร้องขอ มีตัวแปลภาษาคือ Tomcat Apache และ Java Compiler พัฒนาโดย James Duncan Davidson ค.ศ.2000 ตัวแปลภาษาจะสร้าง Servlet และเปลี่ยนเป็น Byte Code สำหรับถูกเรียกใช้ครั้งต่อไป จาก JSP Source Code ข้อมูลจาก http://java.sun.com/products/jsp/faq.html ข้อมูลจาก http://www.apl.jhu.edu/~hall/java/Servlet-Tutorial/

  27. ตัวอย่างภาษา JSP (x.jsp) DOS>explorer http://localhost:8080/x.jsp <% for (int i=1;i<=10;i++){ out.println(i); } %> <b>bye</b>

  28. ประวัติภาษา PASCAL ภาษาปาสคาลพัฒนาโดย Niklaus Wirth ในปีค.ศ. 1970 ได้รับความนิยมในสมัยนั้น เนื่องมาจากตัวภาษามีลักษณะเด่นหลายด้าน เช่น รูปแบบคำสั่งที่มีลักษณะเป็นภาษาอังกฤษ ง่ายต่อการเขียน และการจดจำ นอกจากนี้โปรแกรมยังมีลักษณะที่เป็นโครงสร้าง (Structure Programing) ง่ายต่อการศึกษา มีตัวแปลภาษา(Compiler) ในหลายระบบปฎิบัติการ เหมาะกับงานด้านวิทยาศาสตร์ที่มีการคำนวณซับซ้อน และเหมาะกับการเริ่มต้นเขียนโปรแกรมเป็นครั้งแรก ปาสคาล(Pascal)เป็นชื่อที่ได้จากมาจากชื่อของ Blaise Pascal นักวิทยาศาสตร์และนักคณิตศาสตร์ชาวฝรั่งเศส ผู้ซึ่งมีชื่อเสียงในการประดิษฐ์เครื่องจักรที่ใช้ในการคำนวณ เป็นต้นแบบของเครื่องคอมพิวเตอร์ในปัจจุบัน ข้อมูลจาก http://en.wikipedia.org/wiki/Pascal_programming_language

  29. ตัวอย่างภาษา PASCAL (x.pas) { Short Sample } uses crt; begin clrscr; for i:=0 to 7 do begin writeln("hello"); end; readln; end. ข้อมูลจาก http://www.thaiall.com/pascal/indexo.html

  30. ประวัติภาษา COBOL ภาษาโคบอล (COBOL : Common Business Oriented Language) เป็นภาษาสำหรับใช้ในงานธุรกิจภาษาแรกของโลก พัฒนาในปีค.ศ. 1962 โดยคณะกรรมการโคดาซิล (The Conference on Data Systems Languages - CODASYL) มีจุดเด่นคือ สามารถใช้งานแฟ้มข้อมูลได้หลายแบบ กำหนดโครงสร้างข้อมูลได้สะดวก มีลักษณะการเขียนโปรแกรม แบบเอกสารอธิบายโปรแกรม ช่วยให้นักพัฒนารุ่นถัดไปเข้าใจได้ง่าย ข้อมูลจาก http://www.thaiall.com/cobol/indexo.html

  31. ตัวอย่างภาษา COBOL (x.cbl) DOS> cobol test,test,test,nul DOS> link test,test,nul,,nul DOS> test working-storage section. 77 x pic 99. procedure division. move 0 to x. perform cal-para until x >= 10. stop run. cal-para. add 1 to x. display x.

  32. ภาษาที่น่าศึกษา จึงมีเว็บเพจเผยแพร่ • http://www.thaiall.com/assembly • http://www.thaiall.com/assembly/batch.htm • http://www.thaiall.com/assembly/debugcmd.htm • http://www.thaiall.com/gwbasic • http://www.thaiall.com/pascal • http://www.thaiall.com/tc • http://www.thaiall.com/clipper • http://www.thaiall.com/cobol • http://www.thaiall.com/perl • http://www.thaiall.com/php • http://www.thaiall.com/asp • http://www.thaiall.com/jsp • http://www.thaiall.com/class • http://www.thaiall.com/java • http://www.thaiall.com/teachaccess • http://www.thaiall.com/vb

More Related