; mp4.h - long-int class definition ; by Douglas Jones - Oct 27, 2009 LONGSIZE= 8 ; long integers are 2 words each, ; accessed by the following methods ; all methods conform to the normal Hawk calling conventions ; link through R1, ; use R2 as a stack pointer ; use R3-up as parameters ; guarantee R2 and R7-15 are restored on return ; registers R3-R7, if unspecified as return values, may be wiped out EXT INT2LONG ; integer to long conversion ; given R3 - pointer to long ; given R4 - 2's complement integer value ; returns R3 - pointer to long, with given value ; sets the long to the indicated integer value EXT LONG2INT ; long to integer conversion ; given R3 - pointer to long ; returns R3 - integer value if the long value fits ; returns R4 - error flag, 0 if it fits, 1 if not EXT LONGCOPY ; copy one long to another ; given R3 - pointer to long destination ; given R4 - pointer to long source ; returns R3 - the pointer is not changed, but referent updated EXT LONGCMP ; compare two longs ; given R3 - pointer to long a ; given R4 - pointer to long b ; returns R3 - -1 if a < b, 0 if a=b, +1 if a > b EXT LONGADD ; add two longs ; given R3 - pointer to long augend ; given R4 - pointer to long addend ; returns R3 - the pointer is not changed, but referent now holds sum EXT LONGSUB ; subtract two longs ; given R3 - pointer to long minuend ; given R4 - pointer to long subtrahend ; returns R3 - the pointer is not changed, referent now is difference EXT LONGMUL ; multiply two longs ; given R3 - pointer to multiplicand ; given R4 - pointer to multiplier ; returns R3 - the pointer is not changed, but referent holds product EXT LONGDIV ; divide two longs ; given R3 - pointer to dividend ; given R4 - pointer to divisor ; returns R3 - the pointer is not changed, but referent holds quotient EXT LONGMOD ; get remainder from most recent division ; given R3 - pointer to destination ; returns R3 - the pointer is not changed, but referent is remainder