Page 1 of 1

IAP calls in BASIC

Posted: Tue Jul 16, 2019 8:39 pm
by basicchip
IAP calls or In Application Programming, gives access to a number of ROM routines to write flash, enable low power modes, get device IDs and other operations. With the inline Assembly capability of BASIC, it is easy to make these calls.

For the LPC1768 we needed access to getting the device ID, in order to use that unique number to generate a MAC address number for an Ethernet connection. Here is an example to excercise that operation.

Code: Select all

#include "ASMinlineBASIC.bas"

dim COMMAND(4)
dim RESULT(4)


COMMAND(0)= 58

x = addressof COMMAND

x = addressof RESULT

for x=0 to 4
    print hex(RESULT(x))