Skip to content

Latest commit

 

History

History
14 lines (9 loc) · 530 Bytes

File metadata and controls

14 lines (9 loc) · 530 Bytes

Register variables

  • Using the register keyword instead of new, you can create registers with same datatypes as of variables, but there is a slight difference - you cannot point at them!
register[int]myRegister=364

new[ptr]pointToReg=addressof?myRegister

pointToReg=73

console.println.log("myRegister remains {myRegister}")
  • The addressof instruction will return a value, but that value will not be a valid address that can be accessed; and you will eventually get a runtime error that something is wrong.