CP/M User
Veteran Member
I'll just start my mentioning to most of you this program will seem pointless.
For those interested, I've added some more code to my site:
http://www.geocities.com/cpm22_user/programs/Amstrad_CPC/TurboPAS/
I've called it brkdown (well it's supposed to be Breakdown, but it's better than nothing). No Sorry lads, it's not a game (so no knocking down walls with ball & bat) I'm afraid. It's a demonstration of taking a large integer number (works better as a hex though) & spliting it into two smaller bytes. For example, once executed the program will ask you to enter a number (between $0 & $FFFF <- The dollar signs are important because this is the way TP handles Hexidecimal numbers or anything between -32767 & 32767 as an int, don't know why it won't take -32768, this is supposed to represent $8000, though $8000 works as entered in the program).
Anyway once the integer of some kind is entered, the program splits the numbers into byte size numbers, so $ffff is $ff & $ff, $f0ff is $f0 $ff (the results are displayed in hexidecimal <- this routine is from my dechex.pas program which I mentioned earlier).
I wrote this program because eventually my other program will need to take a integer value & use this for making a byte sized number <- which works better for what I'm doing.
Just one last thing, does anybody know of a way to print an error message if the use enters a invalid number or something? If somebody does a runtime error is the result, I'd be interested to know about that.
Cheers,
CP/M User.
For those interested, I've added some more code to my site:
http://www.geocities.com/cpm22_user/programs/Amstrad_CPC/TurboPAS/
I've called it brkdown (well it's supposed to be Breakdown, but it's better than nothing). No Sorry lads, it's not a game (so no knocking down walls with ball & bat) I'm afraid. It's a demonstration of taking a large integer number (works better as a hex though) & spliting it into two smaller bytes. For example, once executed the program will ask you to enter a number (between $0 & $FFFF <- The dollar signs are important because this is the way TP handles Hexidecimal numbers or anything between -32767 & 32767 as an int, don't know why it won't take -32768, this is supposed to represent $8000, though $8000 works as entered in the program).
Anyway once the integer of some kind is entered, the program splits the numbers into byte size numbers, so $ffff is $ff & $ff, $f0ff is $f0 $ff (the results are displayed in hexidecimal <- this routine is from my dechex.pas program which I mentioned earlier).
I wrote this program because eventually my other program will need to take a integer value & use this for making a byte sized number <- which works better for what I'm doing.
Just one last thing, does anybody know of a way to print an error message if the use enters a invalid number or something? If somebody does a runtime error is the result, I'd be interested to know about that.
Cheers,
CP/M User.