| | Erhan
Registered: Feb 2005 Posts: 17 |
decimal to hex convert and REL format
Hi,
i have two questions for coding here..
1) in memory, two bytes exists in this format: e.g. 04 and 50 repeatedly, but equals to 450 in decimal format and i need to convert them to 2 byte hexadecimal,
result will be $01C2 what is the shortest way? (i think @codebase, no similar examples)
2) in a diskfile, an existing data file's length is $20 bytes for example, i need to write $08 bytes to specific location in that file. (file format should be REL?)
and i need save routine for this,
Thanks |
|
... 10 posts hidden. Click here to view all posts.... |
| | Fungus
Registered: Sep 2002 Posts: 686 |
The drive is going to have to do a block read and block write anyways, so you may as well just use a prg or seq or even a usr file to do it. it won't be any faster or be less code to handle it with a rel file.
If you want to, you can just use the disk buffer and b-p command if you only need to read/write specific bytes at a specific offset in the block, ie, there is only ONE high score per level.
Of course it depends on how many levels you have, and how many records you need.
If it is how I think it is, you just need to use a few dos commands in order to handle it. listen, second, unlsn for writing the bytes to the buffer, and talk, tksa, and untalk for reading them. as well as acptr/getin, ciout/chrout for the actual data transferring... but you probly know how to do all that so I'm just being long winded now... |
Previous - 1 | 2 - Next | |