80 likes | 588 Views
An Abstract Semantic Processor. BY- -Rajeshri Shinkar -Priyanka Khapare -Bhavana shingi -Sneha Shirsath. Semantics – It defines the meaning of syntactically correct program in that language. We will use an operational approach to semantics.
E N D
An Abstract Semantic Processor BY- -Rajeshri Shinkar -Priyanka Khapare -Bhavana shingi -Sneha Shirsath
Semantics – It defines the meaning of syntactically correct program in that language. • We will use an operational approach to semantics. • So we introduced a simple abstract processor called SIMPLESEM. • SIMPLESEM consist – • 1 Instruction pointer • 2 memory • 3 processor
For simplicity, we will assume that instruction to be executed and data to be manipulated are stored in two seperate memory sections. • 1 code memory (C) • 2 data memory (D) • C’s and D’s addresses start at 0(zero). • Notation used D[X] and C[X]
D C ip (fig - SIMPLESEM machine)
Modification of the value stored in a cell is performed by instruction – • set target,source • Example – • set 10,D[20] • read and write are special registers for i/o. • set 15,read • set write,D[50]
Set 99,D[15]+D[33]*D[41] is also acceptable expression. • The machine operates by executing the following steps- • 1 Get the current instruction to be executed(i.e,C[ip]); • 2 Increment ip; • 3 Execute the current instruction.
In particular, we introduced 2 instructions – • 1 jump • 2 jumpt • Ex- • jump 47 • jumpt 47,D[3]>D[8] • SIMPLESEM allows indirect addressing • Ex- set D[10],D[20]
THANK-YOU Ref- programming language concepts by carlo ghezzi