PL/0语言编译程序整理实现:(6)、代码类型
来源:互联网 发布:软件开发模型 编辑:程序博客网 时间:2024/05/22 13:12
unit uCodeType;
interface
const
CNT_LevelMax = 3; //--最大允许的块嵌套层数)
CNT_AddressMax = 2047; //--最大寻址空间
CNT_Code_MaxLen = 200; //--PCODE目标代码表的最大长度(可容纳代码行数)
type
//--PCODE指令类型
TInstructionType = (lit,opr,lod,sto,cal,int,jmp,jpc);
//--PCODE指令:指令、层差、操作数
TInstruction = packed record
IType: TInstructionType;
Level: 0..CNT_LevelMax;
Address: 0..CNT_AddressMax;
end;
PInstruction = ^TInstruction;
TInstructions = array[0..CNT_Code_MaxLen] of TInstruction;
PInstructions = ^TInstructions;
const
CNT_CodeNames: array[TInstructionType] of string = (
' lit ',
' opr ',
' lod ',
' sto ',
' cal ',
' int ',
' jmp ',
' jpc '
);
implementation
(*
lit 0, a //--load constant a
opr 0, a //--execute opr a
lod l, a //--load variable l, a
sto l, a //--store variable l, a
cal l, a //--call procedure a at level l
int 0, a //--increment t-register by a
jmp 0, a //--jump to a
jpc 0, a //--jump conditional to a
*)
end.
- PL/0语言编译程序整理实现:(6)、代码类型
- PL/0语言编译程序整理实现:(2)、单词类型
- PL/0语言编译程序整理实现:(4)、对象类型
- PL/0语言编译程序整理实现:(7)、目标代码
- PL/0语言编译程序整理实现:(8)、代码执行
- PL/0语言编译程序整理实现:(12)、测试代码
- PL/0语言编译程序整理实现:(3)、词法分析
- PL/0语言编译程序整理实现:(5)、语法分析
- PL/0语言编译程序整理实现:(9)、错误信息
- PL/0语言编译程序整理实现:(10)、错误处理
- PL/0语言编译程序整理实现:(11)、测试界面
- PL/0语言编译程序整理实现:(1)、语法描述EBNF
- PL/0语言编译程序分析
- PL/0语言编译程序分析
- PL/0语言编译程序分析
- PL/0语言编译程序分析
- PL/0语言编译程序分析
- PL/0语言编译程序分析
- LOCAL_PRELINK_MODULE和prelink-linux-arm.map
- 对称和不对称加密
- [全程建模]业务用例与用例的对应关系解析
- 苹果工程师用乐高积木重建最古老计算机
- 下雪啦
- PL/0语言编译程序整理实现:(6)、代码类型
- 图文并茂详解VisualStudio使用技巧
- 顺序表(数据结构)
- RedHat AS 5.3 yum源配置
- PL/0语言编译程序整理实现:(7)、目标代码
- 每天是一个新的开始.加油.
- win2008建立无线共享有线网络
- PL/0语言编译程序整理实现:(8)、代码执行
- PL/0语言编译程序整理实现:(9)、错误信息