Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

query

Status
Not open for further replies.
savnik said:
limithi equ .13
limitlo equ .12
Debug equ 1

What mean this:

oneMhz equ .1000000/.200
1000000/200=5000
so the variable 'oneMhz' has a numeric value of 500


What mean this:

movlw high oneMhz ; move the high byte of the WORD variable 'oneMhz' into W
movwf limithi ;move the W value into REG limithi
movlw low oneMhz ; move low byte of the WORD variable into W
movwf limitlo; move the W value into the REG limitlo

And what mean this:

!Debug

I dont know which assembler you are using, cant help you with 'debug' in this context.
 
savnik said:
This code is from AN592 and use MPASM v5.06

which is the difference:
oneMhz equ .1000000/.200
hndredK equ .100000/.20

hi,
Looking at the MPASM data, it appears that 'debug' instructs the assembler to make a 'debug file' .

In my assembler a number with a '.' in front is read as a decimal number.
oneMhz equ .1000000/.200
hndredK equ .100000/.20
They are the same, ie: 5000, I also think your assembler recognises the requirement for a WORD variable. ie: 16 bits.
The 5000 is just BYTE sized!.

What are you trying to do?
 
ericgibbs said:
I dont know which assembler you are using, cant help you with 'debug' in this context.

Makes no difference what it is, the assembler will just do a text replacement, changing every occurance of 'Debug' to '1'

The ! is the logic operator NOT, so in this case means 'NOT 1'.
 
ericgibbs said:
hi,
Looking at the MPASM data, it appears that 'debug' instructs the assembler to make a 'debug file' .

In my assembler a number with a '.' in front is read as a decimal number.
oneMhz equ .1000000/.200
hndredK equ .100000/.20
They are the same, ie: 5000, I also think your assembler recognises the requirement for a WORD variable. ie: 16 bits.
The 5000 is just BYTE sized!.

What are you trying to do?
i want to understand the code
 
A tip.

Using a title like query is a bad thing to do because it could be a question about anything.

A good title would have been assembler query or even better AN592 MPASM query,

Such titles attract people who know the answer and allow the people who do not to skip reading it to find out what your query is about.
 
savnik said:
limithi equ .13
limitlo equ .12
Debug equ 1

What mean this:

oneMhz equ .1000000/.200


What mean this:

movlw high oneMhz
movwf limithi
movlw low oneMhz
movwf limitlo

And what mean this:

!Debug
the oneMhz is fixed number and equ to .1000000/.200
which is the high oneMhz , and which is the low oneMhz
 
3v0 said:
A tip.

Using a title like query is a bad thing to do because it could be a question about anything.

A good title would have been assembler query or even better AN592 MPASM query,

Such titles attract people who know the answer and allow the people who do not to skip reading it to find out what your query is about.
you are right , so Nigel change the title to AN592 MPASM query.
 
Nigel Goodwin said:
Makes no difference what it is, the assembler will just do a text replacement, changing every occurance of 'Debug' to '1'

The ! is the logic operator NOT, so in this case means 'NOT 1'.
hi,
I dont normally use the 'shorthand' symbols, didnt recognise it.:rolleyes:

How do you feel about the use of these symbols in your coding?.
I have always been advised not to use them as their meanings can vary from one asm to another?.:confused:
 
ericgibbs said:
hi,
I dont normally use the 'shorthand' symbols, didnt recognise it.:rolleyes:

I checked the MPASM helpfile :D

How do you feel about the use of these symbols in your coding?.
I have always been advised not to use them as their meanings can vary from one asm to another?.:confused:

Well it's not 'coding' anyway, they are all assembler directives.
 
Nigel Goodwin said:
I checked the MPASM helpfile :D
Well it's not 'coding' anyway, they are all assembler directives.

Whatever!

I appreciate that you don't have to give a straight answer to a question or in fact any answer at all.
But it would be refreshing, just once in a while, to see you give a meaningful response to a reasonable question from a forum member.
 
ericgibbs said:
Whatever!

I appreciate that you don't have to give a straight answer to a question or in fact any answer at all.
But it would be refreshing, just once in a while, to see you give a meaningful response to a reasonable question from a forum member.

In what way was my original response (or the majority of my posts) not a 'straight answer'?.

For that matter I don't see how correcting an error, which will only cause confusion, is in any way 'not straight' either. While you knew what you meant, and I knew what you meant, a beginner wouldn't know what you meant - so it's important to be accurate!.
 
hi,
My original post to you reads:
I dont normally use the 'shorthand' symbols, didnt recognise it.
How do you feel about the use of these symbols in your coding?.
I have always been advised not to use them as their meanings can vary from one asm to another?.


It was necessary to use the expression
"I dont normally use the 'shorthand' symbols"
If I had said,
"I dont normally use the 'assembler directives"........... that would be incorrect.

"How do you feel about the use of these symbols in your coding?."
No where do I say its 'code'.
Many engineers refer to the 'Source Code' as 'coding' or 'code listing'.

Extract from MPLAB:
Directives are assembler commands that appear in the source code but are not usually translated directly into opcodes. They are used to control the assembler: its input, output, and data allocation


"I have always been advised not to use them as their meanings can vary from one asm to another?."
Extract from MPLAB:
Many of the assembler directives have alternate names and formats. These may exist to provide backward compatibility with previous assemblers from Microchip and to be compatible with individual programming practices. If portable code is desired, it is recommended that programs be written using the specifications contained here.

Your Reply:
For that matter I don't see how correcting an error, which will only cause confusion, is in any way 'not straight' either. While you knew what you meant, and I knew what you meant, a beginner wouldn't know what you meant - so it's important to be accurate!.

Extract from your Tutorials:
For the full code, with the equates, variable declarations and look-up table, consult the code for the examples below.

As I have said before I dont mind constructive criticism, but what does irritate is 'nit picking' to score brownie points.
 
Last edited:
Status
Not open for further replies.

Latest threads

Back
Top