1 / 9

For i=1 to 5

A compiler. Source Code (typed in using text processor). Object Code. 0100101001010101 1101101001001010. For i=1 to 5. 1110101001010101 1000001001001010. pctDisplay.Print “Hello elephant”. 0010101001010101 1111001001001010. pctDisplay.Print “Goodbye”. Next i.

fordon
Download Presentation

For i=1 to 5

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. A compiler Source Code (typed in using text processor) Object Code 0100101001010101 1101101001001010 For i=1 to 5 1110101001010101 1000001001001010 pctDisplay.Print “Hello elephant” 0010101001010101 1111001001001010 pctDisplay.Print “Goodbye” Next i 10111011010010111010101001010101 111100111001001101010100100010001001011001001010 This is then saved as a .exe file, that is, a program file. .exe stand for ‘executable’

  2. A compiler Source Code (typed in using text processor) Object Code 0100101001010101 1101101001001010 For i=1 to 5 1110101001010101 1000001001001010 pctDisplay.Print “Hello elephant” 0010101001010101 1111001001001010 pctDisplay.Print “Goodbye” Next i 10111011010010111010101001010101 111100111001001101010100100010001001011001001010 Doesn’t take much memory, Doesn’t need to be translated again Executes fast

  3. An interpreter Source Code (typed in using text processor) Translate Execute 0100101001010101 1101101001001010 For i=1 to 5 1110101001010101 1000001001001010 Hello Elephant pctDisplay.Print “Hello elephant” 0010101001010101 1111001001001010 pctDisplay.Print “Goodbye” Goodbye Next i 10111011010010111010101001010101 111100111001001101010100100010001001011001001010 1

  4. An interpreter Source Code (typed in using text processor) Translate Execute 0100101001010101 1101101001001010 For i=1 to 5 1110101001010101 1000001001001010 Hello Elephant pctDisplay.Print “Hello elephant” 0010101001010101 1111001001001010 pctDisplay.Print “Goodbye” Goodbye Next i 10111011010010111010101001010101 111100111001001101010100100010001001011001001010 2

  5. An interpreter Source Code (typed in using text processor) Translate Execute 0100101001010101 1101101001001010 For i=1 to 5 1110101001010101 1000001001001010 Hello Elephant pctDisplay.Print “Hello elephant” 0010101001010101 1111001001001010 pctDisplay.Print “Goodbye” Goodbye Next i 10111011010010111010101001010101 111100111001001101010100100010001001011001001010 3

  6. An interpreter Source Code (typed in using text processor) Translate Execute 0100101001010101 1101101001001010 For i=1 to 5 1110101001010101 1000001001001010 Hello Elephant pctDisplay.Print “Hello elephant” 0010101001010101 1111001001001010 pctDisplay.Print “Goodbye” Goodbye Next i 10111011010010111010101001010101 111100111001001101010100100010001001011001001010 4

  7. An interpreter Source Code (typed in using text processor) Translate Execute 0100101001010101 1101101001001010 For i=1 to 5 1110101001010101 1000001001001010 Hello Elephant pctDisplay.Print “Hello elephant” 0010101001010101 1111001001001010 pctDisplay.Print “Goodbye” Goodbye Next i 10111011010010111010101001010101 111100111001001101010100100010001001011001001010 5

  8. An interpreter Source Code (typed in using text processor) Translate Execute 0100101001010101 1101101001001010 For i=1 to 5 1110101001010101 1000001001001010 Hello Elephant pctDisplay.Print “Hello elephant” 0010101001010101 1111001001001010 pctDisplay.Print “Goodbye” Goodbye Next i 10111011010010111010101001010101 111100111001001101010100100010001001011001001010 We still have the original Source Code (typed in using text processor) It continually translated and executed The translated code is lost

  9. Compiler Interpreter Creates an object code version –efficient in memory & speed Indicates errors well Pro No Object code produced Does not indicate errors Con If used to run a prog, slow because the lines have to repeatedly be translated (inefficient)

More Related