HPlogo System Debug Reference Manual > Chapter 10 System Debug Standard Functions

func btow

MPE documents

Complete PDF
Table of Contents
Index

E0201 Edition 4 ♥
E0300 Edition 3
E0692 Edition 3

Byte to word. Converts a CM DB-relative byte address to a CM DB-relative word address.

Syntax



   btow (byteaddress [splitstack])

Formal Declaration



   btow:I16 (byteaddress:I16 [splitstack:bool=FALSE])

Parameters


byteaddress

The CM DB-relative byte address which is to be converted into a CM DB-relative word address.

splitstack

If splitstack is FALSE, then byteaddress is assumed to be within the current process's CM stack. The byte address is logically shifted right by one bit. If the result is greater than the current S location, then %100000 is added. This effectively turns on the sign bit. By default, splitstack is FALSE.

If splitstack is TRUE, then byteaddress is assumed to be a data segment (DST) relative offset. The byte address is logically shifted right by one bit. No special test for the current location of S is performed.

Examples



 %cmdebug > dr
 DBDST=%204   DB=%1000    X=%0    STATUS=%100030=(Mitroc CCG 030) PIN=%40
 SDST=%204    DL=%177650  Q=%726  S=%41767   CMPC=SYS %27.253
 CIR=%041601  MAPFLAG=%1  MAPDST=%0

 %cmdebug > wl btow (100002)
 %40001

 %cmdebug > wl btow (177776)
 %177777

These examples assume the current CM registers which are displayed above. Note the large stack usage above DB.

 %cmdebug > dr
 DBDST=%204   DB=%70000   X=%0    STATUS=%100030=(Mitroc CCG 030) PIN=%40
 SDST=%204    DL=%110650  Q=%726  S=%1204    CMPC=SYS %27.253
 CIR=%041601  MAPFLAG=%1  MAPDST=%0

 %cmdebug > wl btow (177776)
 %177777

 %cmdebug > wl btow (100002)
 %140001

 %cmdebug > wl btow (40002)
 %120001

These examples assume the current CM registers displayed above. Note the huge DL area.

Limitations, Restrictions


none




func bound


func cisetvar