Welcome to our latest new user
Gabezcommodore
! (Registered 2025-07-24)
You are not logged in -
nap
CSDb User Forums
Forums
>
C64 Coding
>
decimal to hex convert and REL format
2010-12-04
19:02
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....
2010-12-06
18:31
Fungus
Registered: Sep 2002
Posts: 756
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
Refresh
Subscribe to this thread:
You need to be logged in to post in the forum.
Search the forum:
Search
All forums
C64 Coding
C64 Composing
C64 Pixeling
C64 Productions
CSDb Bug Reports
CSDb Development
CSDb Discussions
CSDb Entries
CSDb Feedback
CSDb Info
CSDb moderators
CSDb Questions
Messages to moderators
Requests
for
in
Writer & text
Text
Writer
All times are CET.
Search CSDb
All
Releases
Groups
Sceners
Events
BBS
SIDs
-------
Forum
Comments
Advanced
Users Online
MCM/ONSLAUGHT
Mr. Sex/Byterapers
Kronos/Arsenic/FC
Mojzesh/TGR🇬🇧
Nicron
Acidchild/Padua
Viti/Hokuto Force
Colt45RPM
Guests online: 63
Top Demos
1
Next Level
(9.7)
2
13:37
(9.7)
3
Harminc
(9.7)
4
Codeboys & Endians
(9.7)
5
Mojo
(9.7)
6
Coma Light 13
(9.6)
7
Edge of Disgrace
(9.6)
8
Comaland 100%
(9.6)
9
Wonderland XIV
(9.6)
10
Signal Carnival
(9.6)
Top onefile Demos
1
Morphing Starball
(9.9)
2
Nine
(9.8)
3
Layers
(9.6)
4
Cubic Dream
(9.6)
5
Party Elk 2
(9.6)
6
Copper Booze
(9.5)
7
Scan and Spin
(9.5)
8
Onscreen 5k
(9.5)
9
Grey
(9.5)
10
Dawnfall V1.1
(9.5)
Top Groups
1
Performers
(9.3)
2
Booze Design
(9.3)
3
Censor Design
(9.3)
4
Oxyron
(9.3)
5
Artline Designs
(9.3)
Top Organizers
1
Burglar
(9.9)
2
Sixx
(9.8)
3
Tim
(9.7)
4
Irata
(9.7)
5
hedning
(9.7)
Home
-
Disclaimer
Copyright © No Name 2001-2025
Page generated in: 0.089 sec.