Searching \ for '[PIC]: Confusion on hex format?' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/devices.htm?key=pic
Search entire site for: 'Confusion on hex format?'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: Confusion on hex format?'
2002\01\18@205334 by Ted Mawson

flavicon
face
I'm following the assembly code in worktime.asm to get me (back) up to
speed on assembly language.



There's a bit where it goes.



;  Macro

EStrobe MACRO                   ;  Strobe the "E" Bit
 bsf    E
 bcf    E
ENDM

           CBLOCK     0CH
               sec             ; seconds digit
               sec10           ; 10's of second digit
               mins            ; minutes digit
               min10           ; 10's of minutes digit
               hr              ; hours digit
               hr10            ; 10's of hours digit
               highlim         ; high limit + 1 of digit
               w_temp          ; holds W during interrupt
               status_temp     ; holds STATUS during interrupt
               fsr_temp        ; holds FSR during interrupt
               Dlay            ; 8 Bit Delay Variable
               working         ; working flag 0 not working, 1 working
               ptr             ; used in displaying message
               Temp            ; a temporary variable
               bin             ; a temporary variable
               oset            ; offset of time register
               oldtime         ; holds last value of sec
              ENDC



Here's my question - CBLOCK defines a block of constants starting at a
given address.  Problem is, 0CH isn't a valid address - or is it?  If it
is, why does it have a '0' in the lead position? 0xCH isn't valid as H
is one too many for hex?  I expect I'm being dumb but, can someone
please point me to my mistake?



Ted Mawson

http://www.portfoliopm.com

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2002\01\18@212859 by Drew Vassallo

picon face
>             CBLOCK     0CH
>                 sec             ; seconds digit
>                 oldtime         ; holds last value of sec
>                ENDC
>
>Here's my question - CBLOCK defines a block of constants starting at a
>given address.  Problem is, 0CH isn't a valid address - or is it?  If it

You can use 0Ch just fine.  The problem is that it's not the easiest to
read.

This could be written as 0x0C, 0x00C, 0x0Ch, etc.  The compiler should pick
up either variation.

--Andrew

_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2002\01\18@231632 by myke predko

flavicon
face
Hey Ted,

The zero ("0") is put before the hex character (in your example "C") because
it indicates to the assembler that it is a constant value.

Without the zero, the assembler would encounter the string "Ch", which it
would assume is a label.

When I'm doing PC assembly language, this one always bites me on the bum -
It's easy to write "10h" (which will be correctly interpreted as 16 decimal)
and then follow with "AAh" which is going to be initially interpreted as a
label.

This is why I prefer a definite type prefix like "0x0" or "$".

myke

{Original Message removed}

2002\01\18@235958 by Jinx

face picon face
> >             CBLOCK     0CH
> >                 sec             ; seconds digit
> >                 sec10           ; 10's of second digit
> >                 mins            ; minutes digit
> >                 min10           ; 10's of minutes digit
>
> > Problem is, 0CH isn't a valid address - or is it?

0x0c is the start of user RAM in the F84 or F628, hence
where you'd expect variables to be assigned to

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2002\01\19@134128 by tecnicolor

flavicon
face
cblock asign a label to a addrr. given but
writing 0ch means 0x0c the h on the first number is
for hexa number as equal the 0xNUMBER
but you not say what pic are using?
--- Ted Mawson <spam_OUTTed.MawsonTakeThisOuTspamPORTFOLIOPM.COM> wrote:
{Quote hidden}

_____________________________________________________________
Sign up for FREE email @ http://www.phat.co.nz and get your own @phat.co.nz address!
muzic n' more @ http://www.muzic.net.nz

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


More... (looser matching)
- Last day of these posts
- In 2002 , 2003 only
- Today
- New search...