Post Reply 
Confused about variables
02-25-2016, 06:22 AM
Post: #4
RE: Confused about variables
Hello,


Nope, you have it wrong...

#.....:-nb
where ... is a number, n is a number of bits and b is b, o, d or h is the syntax for entering integers... But it does not Convert anything to integers.
R->B is the operation that converts a real to a binary.
you can also look at SetBits and SetBase that allow to modify the binary number.

As Tim was saying there is no variable typing in HPPL (with the obvious exception of the build in A-Z, Z?, L? and M? variables).

How are you proposing to store your data?
Program instructions
Cpu registers
I would advise that you use lists (easiest), or you could use a string for the program and named variables for the CPU registers.

One thing with int containing variables, you can access bits directly by doing var(bit) or a sub part of the integer by doing var(start_bit, nb_bits)... This works in read and write and can be very useful.
for example, if you have a AX variable (register A), you can access AL by doing AX(0,8) and AH by doing AX(8,8)

Cyrille

Although I work for the HP calculator group, the views and opinions I post here are my own. I do not speak for HP.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Confused about variables - smp - 02-24-2016, 12:31 PM
RE: Confused about variables - Tim Wessman - 02-24-2016, 03:05 PM
RE: Confused about variables - smp - 02-25-2016, 12:55 AM
RE: Confused about variables - cyrille de brébisson - 02-25-2016 06:22 AM
RE: Confused about variables - smp - 02-26-2016, 09:58 PM
RE: Confused about variables - smp - 02-29-2016, 05:25 PM



User(s) browsing this thread: 1 Guest(s)