Path: utzoo!mnetor!uunet!mcvax!jurjen From: jurjen@cwi.nl (Jurjen N.E. Bos) Newsgroups: comp.sys.hp Subject: HP28C (version 1BB) SYSEVALs Message-ID: <7509@boring.cwi.nl> Date: 22 Feb 88 21:52:28 GMT Organization: CWI, Amsterdam Lines: 135 Keywords: HP28C, SYSEVAL Introduction Warning: people not having version 1BB can get disastous results. The HP28 objects consists of a routine pointer, followed by the data field. The HP28C is adressed in nibbles. Pointers are, as you will know, 5 nibbles. The routine pointer points directly to a machinecode subroutine that executes the code for that kind of object. The data field of an object can be anything. Types, as far as I know: Pointer Type Followed by (size in parentheses) 02911 pointer value(5) 02933 real sign(1),mantissa(12),exponent+500(3) 02955 high r. sign(1),mantissa(15),exponent+50000(5) 02977 complex real,imag part (2*16) 0299D high c. real,imag part (2*21) 029BF byte value(2) 029E1 ? 02A0A array size(5),type(5),#dim(5),dimensions(5)...,data 02A2C ? 02A4E string size(5),data(2)... 02A70 binary size(5),data(1)... 02A96 list data(5)...,02F90 02AB8 ? 02ADA algebr. data(5)...,02F90 02C67 program 27F0A,data(5)...,27F1F,02F90 02C96 code size(5),... 02D12 name #letters(2),data(2)... 02D37 local n. #letters(2),data(2)... 02D5C function number(2*3) 067A1 true 067E0 false Interesting addresses: (routines use pointer arguments, and don't check anything!) 0201E DEPTH 0205A DUP 0207E DUP2 020AB DUPN 020F5 SWAP 02116 DROP 0212A DROP2 02140 DROPN 02067 ROT 02094 OVER 020B4 PICK 020F7 ROLL 02241 ROLLD 03495 CDR (really!) 034DC + for strings 03422 convert string to byte 03599 + for lists O369D + string+byte 0372B make structure given type and size 03845 ->PROG 03859 ->LIST 0386D ->ALG ebraic 0389B STRUCT-> 067FA XOR 06812 NOT 0684E == for reals 06866 AND 06895 OR 068B7 == for any object 06982 get type 069C4 000000h = 069E5 000000h != 06A02 < 06A37 == for pointers 06A6C != for pointers 06AA1 > 06ADA + 06AFE - 06B0D 1+ 06B2C 1- 06B4B 2+ 06B6C 2- 06B8D 2* 06BAC 2/ 06BCF * 06C04 DIVMOD 06C98-06F04 are pointer constants of all kinds of values. 177F1-1BF4C are the routine for the user commands; they check stack depth, do LAST and call an internal routine. 1C490 number->pointer 1C565 pointer->number 1C952 bool to number 1EA55 number to bool Interesting programs: Instead of SYSEVAL one can put the pointer to n directly in the program code, as will be shown later. I write h if I mean either SYSEVAL or the repolacement. SYS without EVAL (very nice for peeking in the ROM): SYS << 06D6Ah 32F25h >> READ << 10 - HEX 4 1 FOR R "" 1 4 START OVER 06D6Ah 32F25h 04358h 1C565h R->B #100000 + ->STR DUP SIZE DUP 4 - SWAP SUB " " + SWAP + SWAP 5 + SWAP NEXT 1 23 SUB R DISP -1 STEP 10 + >> SS << DEPTH ->LIST 'T' STO 4FFABh READ DROP T LIST-> DROP 'T' PURGE >> ->PRG Convert contents of stack to program. You don't get << and >>, but they're unnecessary anyway. << 0201Eh 03845h >> I hope this is clear; please mail me any special requests; I'll post the answers, if it isn't too much. Enjoy the internals of your machine! Jurjen No I'm NOT a saint!