Texas Instruments MSC1210 manual Boot ROM Routines

Models: MSC1210

1 324
Download 324 pages 20.97 Kb
Page 281
Image 281

Description

C parameters are passed to the subroutine code such that the first parameter is passed in R7, whereas additional parameters use lower R registers (R7 first, then R6, R5, etc.). In the case of multibyte parameters, the low byte uses the next available R register while the high byte uses the lower R register. Thus, the put_string routine uses R7 to receive the low byte of the address of the string while R6 is used to receive the high byte of the address of the string.

The result or error code is returned in R7 and/or R6, with the low byte in R7 and the high byte, if any, in R6.

C.1.1 Note Regarding the put_string Function

The put_string routine was designed to print strings that are referenced when the boot ROM is located at 0x0000 and also at 0xF800. This means that it forces the location of the string to match the same 2K segment the program is located in. This will lead to strange behavior if the string address is located in a different 2K segment. For this reason it is suggested that you use the fol- lowing code instead:

void putstring(char code * data msg)

{

while (*msg != 0)

{

tx_byte((unsigned char) *msg); if ( *msg==\n)

tx_byte(‘\r’);

msg++

}

}

Boot ROM Routines

C-3

 

Page 281
Image 281
Texas Instruments MSC1210 manual Boot ROM Routines