Assembler

Reference.Assembler History

Hide minor edits - Show changes to output

Added lines 1-12:
You can embed PIC« assembler code in subroutines and functions, as well as your main program code, by using an '''asmů end''' asm block. You can also declare local variables inside your subroutine or function and use them in you assembler code. For example,
=firewing [=
Function AddTen(value As uinteger) As Byte
  Dim localVar As uinteger = 10
  Asm
  mov  localVar, WREG        ; local variable into WREG
  add  value                ; add param variable 
  mov  WREG, AddTen          ; move WREG result into function result
  End Asm
End Function
=]