Instruction-set Design: what is the ML instruction format(s)?
1) Which instructions to include: (RISC vs. CISC)
complex e.g., VAX
"MATCHC substrLength, substr, strLength, str"
2) Which built-in data types: character, integer, floating point, etc.
3) Instruction format:
4) # registers
5) Addressing modes supported
Addressing Modes: How can labels for subprogram names, local variables, and global variables be represented in the executable machine language?
Immediate - part of the ML instruction contains the value
Register - operand is contained in a register
Absolute/Direct addressing - the memory address of where the label resides is put into the machine language instruction (EA, effective address = direct)
e.g., assume subPgm2 is at 40016, and global x is at 800016
How relocatable is the code in memory if direct addressing is used?
How many bits are needed to represent a direct address?
Register Indirect - operand is pointed at by an address in a register
Indirect - operand is pointed at by an address in a memory
Index - operand is pointed at by an address in a register plus offset
(Base-register addressing)
Often the reference register is the stack pointer register to manipulate the run-time stack.
Relative/PC-relative - base-register addressing where the PC is the implicitly referenced register
Base with Index - ML instruction contains two registers: a register containing a memory address (base reg.) and a register containing an index
Base with Index and offset - two registers and an offset are added together to form the effective address
Useful for array accesses.
Autoincrement: Assembly Language (R3)+
Effective address = [R3], after using R3 to access the operand R3 in incremented.
Autodecrement: Assembly Language -(R3)
Before using R3 to access the operand, R3 is decremented.
Effective address = [R3],