Typed Assembly Language
Neal Glew   Intel Research

TAL (http://www.cs.cornell.edu/talc/)
  - assembly / machine instruction plus 
  - typing annotations
  - typing rules
  - proven safety

  Morrisett et al. TOPLAS 1999

  TALx86 (Morrisett et al. WCSSS, 1999)

  e.g.
     computing 6!
     - give each register a type, {r1:int}
     - add types to labels so it can be checked

     computing <r1>!, return addr = <r31>
     - return addr has type {r31:{r1:int}}

TAL0
  TAL0 - Syntax
    - registers r
    - labels L
    - integers n
    - Blocks B ::= jmp o | halt o | i;B
    - instructions
       -i ::= aop r = o1, o2 | bop o1, o2, o | mov r=o
    - operands o ::= r | L | n

  TAL0 - Machine State
    \Sigma = (H, R, B)
    -- H : heap maps labels to blocks
    -- R : register file maps registers to values
    -- B : program counter

  TAL0 - Execution (rules)

  TAL0 - Errors
    - halting state (H, R, halt o)
    - all other irreducible states are stuck states

  TAL0 - Types
    
  TAL0 - Typing Contexts
    - track types of reigsters
    - track types of labels

  TAL0 - SubTyping
    - register file containing more values than required is safe
    - code types are contravarieant as usual
      |- code(\gamma1) <= code(\gamma2) if |- \gamma2 <= \gamma1
    - |- int <= int

  TAL0 - typing operands
    - integers, labels, registers, blocks

  TAL0 - Instruction Typing Rules
  TAL0 - Block Typing Rules
  TAL0 - Machine State Typing 

  TAL0 - Type Safety
    - type safe
    - proof: ...
    - All jumps to valid labels : control flow safety
    - All arithmetic operations are done with integers only

Extensions to TAL0
  - more primitive types, e.g. floats
  - jal o
       mov r31, L;
       jmp o; L:
  - polymorphic identity

  TAL1
    - addtion in types, heap, operands 
    - change rules for jumps
    - callee saved registers (e.g.)
