21 June 2006, 14:08 | #1 |
Posts: n/a
|
Hex to Decimal
..
Last edited by -Rob-; 23 June 2008 at 00:46. |
21 June 2006, 15:24 | #2 |
Going nowhere
Join Date: Oct 2001
Location: United Kingdom
Age: 50
Posts: 9,012
|
This what you want?
lea converted_string(pc),a2
move.l d0,d2 moveq #8-1,d3 nextconversion: rol.l #4,d2 move.l d2,d4 and.l #$f,d4 add.l #"0",d4 cmp.l #"9",d4 bls.s skip_addition addq.l #7,d4 skip_addition: move.b d4,(a2)+ dbra d3,nextconversion converted_string: dcb.b 8+2,0 |
21 June 2006, 16:46 | #3 |
Posts: n/a
|
Lets say at address $300 i have the HEX value F. I want to turn this single value in to decimal..
|
21 June 2006, 18:09 | #4 |
Zone Friend
Join Date: Aug 2005
Location: Germany
Age: 52
Posts: 424
|
Maybe this is of any use(from asm manual):
|
21 June 2006, 18:31 | #5 |
Going nowhere
Join Date: Oct 2001
Location: United Kingdom
Age: 50
Posts: 9,012
|
This then...
moveq #0,d0
moveq #0,d1 move.b $300.s,d0 divu.w #$a,d0 move.b d0,d1 rol.l #4,d1 swap d0 add.b d0,d1 Converted value will be left in d1 I've never had to do it before, so forgive the non-optimisation! Also, because its a byte conversion, its only good up to a hex value of $63 (99 in decimal). But it does as you requested |
21 June 2006, 18:36 | #6 | |
Posts: n/a
|
Quote:
Just what i needed, thanks |
|
21 June 2006, 18:50 | #7 |
Going nowhere
Join Date: Oct 2001
Location: United Kingdom
Age: 50
Posts: 9,012
|
I assume its for a trainer menu
|
21 June 2006, 19:17 | #8 | |
Posts: n/a
|
Quote:
|
|
21 June 2006, 19:22 | #9 |
Posts: n/a
|
Now that we are at the trainers, perhaps you could help out on Magic Pockets. In game progress, it stores level nr. at 171e.w and stage nr. at 1720.w. The instruction at $4f2c set the start level to 1. If i change this to ex. 2, it loads level 1 anyway, but level acts & look strange, so there must be another value to be set..
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Little hex editing help please | Aria | support.Games | 4 | 16 June 2011 20:20 |
Hex Comp | mai | support.Other | 2 | 28 May 2010 20:00 |
Hex Editor | Retro1234 | request.Other | 9 | 24 October 2006 11:03 |
Hex Editor Help | misguided_fool | request.Apps | 5 | 22 March 2006 09:53 |
HEX --> DEC Converter | Joe Maroni | request.Apps | 9 | 03 May 2005 11:23 |
|
|