Download Micron User Guide - Blue Chip Technology

Transcript
MICRON SINGLE BOARD COMPUTER
USING THE BOARD
ACCESSING SOFTWARE 'INT 50H' FUNCTIONS
Most high level languages allow access to software interrupts through a particular function call. The user
loads a particular function code into the AH register followed by a specific set of parameters in the other
registers before executing the interrupt.
For example, in C :#include <stdio.h>
#include <dos.h>
#define MICRON 0x50
void main(void)
{
union REGS regs;
regs.x.ax = 0x0400;
/* read eeprom data */
regs.x.bx = 0x31;
/* from address 0x31 */
int86(MICRON, &regs, &regs);
printf("EEPROM Address 0x31 contains % x\n",regs.x.dx);
}
and similarly in Quick Basic
'Read EEPROM Data via interrupt 50 call
$include:'QB.BI'
DIM INARY%(7), OUTARY%(7)
CONST AX=0,BX=1,CX=2,DX=3,BP=4,SI=5,DI=6,FL=7
INARY%(AX) = &H0400
' Read e2 data
INARY%(BX) = &H31
' address &H31
CALL INT86OLD(&H50,INARY%(),OUTARY%()) ' Call the Int50h servi ce
PRINT "EEPROM ADDRESS &H31 CONTAINS: " ;OUTARY%(DX)
Note that only the functions listed in the sections above are valid. On return, the contents of register AH
may contain a value indicating the status:
AH = 00h
AH = 01h
AH = 02h
AH = 03h
Blue Chip Technology Limited
-
Function successful, Carry flag cleared
Function invalid, Carry flag set
Function valid but disabled, Carry flag set
Function failed, Carry flag set
Page 21