IBM 770 manual SMAPI BIOS B-61, MyPtr

Models: 770

1 148
Download 148 pages 54.66 Kb
Page 137
Image 137

BOOLEAN GetSmapiEntry(PSMB pFunc)

 

 

 

{

 

 

 

 

PFSMB_HEADER_REAL

MyPtr

= ðxFððððððð ;

WORD

cnt =

ð

;

 

BYTE

cksum

=

ð

;

//

//1) Search for signature first

while((cnt++ < ðx1ððð) && !(((MyPtr->SMBHDR_SIG)[ð] == '$') &&

((MyPtr->SMBHDR_SIG)[1] == 'S') && ((MyPtr->SMBHDR_SIG)[2] == 'M') && ((MyPtr->SMBHDR_SIG)[3] == 'B') )) {

MyPtr++ ;

}

//

//2) Find the Signature?

if (cnt >= ðx1ððð) {

//We cannot find it. return FALSE ;

} else {

//3) Calculate Checksum

for (cnt = ð ; cnt < MyPtr->SMBHDR_LEN ; cnt++) cksum += (BYTE)((MyPtr->SMBHDR_SIG)[cnt]) ;

if (cksum) {

//Bad Checksum return FALSE ;

}else {

//Build Return Address

(\pFunc) = ( (DWORD)(MyPtr->SMBHDR_R_OFFSET) +

(((DWORD)(MyPtr->SMBHDR_R_SEGMENT)) << 16) ) ; return TRUE ;

}

}

}

SMAPI BIOS B-61

Page 137
Image 137
IBM 770 manual SMAPI BIOS B-61, MyPtr