IAP calls in BASIC

Questions about the BASICtools and MakeItC
Post Reply
Posts: 991
Joined: Fri Oct 19, 2012 2:39 am
Location: Lake Tahoe, CA

IAP calls in BASIC

Post by basicchip » Tue Jul 16, 2019 8:39 pm

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))

Post Reply