|
Why every number before has a "$" in MAME debuger?
#322794 - 03/03/14 05:53 PM
|
|
|
0032: 75 90 F1 mov p1,#$F1 0035: 75 B0 EB mov p3,#$EB 0038: 78 7F mov r0,#$7F 003A: 76 00 mov @r0,#$00 003C: D8 FC djnz r0,$003A 003E: 75 81 68 mov sp,#$68 0041: D2 65 setb $2C.5 0043: 12 10 89 lcall $1089 0046: 12 11 4D lcall $114D 0049: 12 11 8E lcall $118E
Dose "$" tell me it is HEX? Why not "#F1H" for "#$F1"?
I am from China. I am sorry about my English.
|
|
|
Sune |
Connected
|
|
|
Reged: 09/21/03
|
Posts: 5648
|
Loc: Lagoa Santa, Brasil
|
|
Send PM
|
|
|
Re: Why every number before has a "$" in MAME debuger?
[Re: lxd]
#322796 - 03/03/14 06:44 PM
|
|
|
> 0032: 75 90 F1 mov p1,#$F1 > 0035: 75 B0 EB mov p3,#$EB > 0038: 78 7F mov r0,#$7F > 003A: 76 00 mov @r0,#$00 > 003C: D8 FC djnz r0,$003A > 003E: 75 81 68 mov sp,#$68 > 0041: D2 65 setb $2C.5 > 0043: 12 10 89 lcall $1089 > 0046: 12 11 4D lcall $114D > 0049: 12 11 8E lcall $118E > > Dose "$" tell me it is HEX? Why not "#F1H" for "#$F1"?
http://en.wikipedia.org/wiki/Dollar_sign#Use_in_computer_software
S
|
|
|
|
Re: Why every number before has a "$" in MAME debuger?
[Re: lxd]
#322803 - 03/03/14 09:54 PM
|
|
|
The convention used depends on the CPU. The Motorola convention uses $ to indicate a number is hexadecimal and # to indicate it's a literal value.
$1234 = value at memory location 0x1234 #$1234 = literal value 0x1234
|
|
|
|
Re: Why every number before has a "$" in MAME debuger?
[Re: lxd]
#322823 - 03/04/14 10:57 AM
|
|
|
> 0032: 75 90 F1 mov p1,#$F1 > 0035: 75 B0 EB mov p3,#$EB > 0038: 78 7F mov r0,#$7F > 003A: 76 00 mov @r0,#$00 > 003C: D8 FC djnz r0,$003A > 003E: 75 81 68 mov sp,#$68 > 0041: D2 65 setb $2C.5 > 0043: 12 10 89 lcall $1089 > 0046: 12 11 4D lcall $114D > 0049: 12 11 8E lcall $118E > > Dose "$" tell me it is HEX? Why not "#F1H" for "#$F1"?
$ means hex # means literal, as apposed to a memory address
English is read left to write, having $ at the beginning means that you know that it's hex before you read the hex number. Having it at the end you might have to go back and re-read the number. Because hex numbers include A-F then using H will merge into the number and make it harder to read.
I imagine these perceptual queues are stronger if English is your first language.
My brain seems wired to read logic in C code as English too, for people who don't follow this (either non-English speakers or people who don't try to read their code) I find it harder because of grammatical issues like double negatives.
Edited by smf (03/04/14 10:58 AM)
|
|
|
R. Belmont |
Cuckoo for IGAvania
|
|
|
Reged: 09/21/03
|
Posts: 9716
|
Loc: ECV-197 The Orville
|
|
Send PM
|
|
|
Re: Why every number before has a "$" in MAME debuger?
[Re: Vas Crabb]
#322831 - 03/04/14 06:07 PM
|
|
|
> The convention used depends on the CPU. The Motorola convention uses $ to indicate a > number is hexadecimal and # to indicate it's a literal value.
Yup, and the 6502 inherited that.
I believe MAME does show "02h" for x86 even though Intel assembly syntax is Satanic ;-)
|
|
|