Quantcast
Channel: MEL PICBASIC Forum
Viewing all articles
Browse latest Browse all 4745

display greater than 8 bit numbers

$
0
0
I'm sure I'm going to say duh to this but here goes.

Question first, how do I display a number greater than 255 in a virtual terminal. I'm using a 12F683, PBP3 in a Proteus simulator. I want to do something like this:

x var word
y var word
z var word
x=20
y=20
z = y * x
serout2 dec z ' I know some stuff is missing. Just giving you an idea of what I'm doing.

Using this scenario z equals 400. When I send it out to the terminal I get 144 displayed because the largest z can be is 255. The binary of 400 is 1 1001 0000 but I only get the last 8 bits sent out, 1001 0000, to the display which is 144.

Please don't smack me down too hard. Thanks for your time.

Viewing all articles
Browse latest Browse all 4745

Trending Articles