PDA

View Full Version : Include ASM file help



harryweb
- 3rd May 2007, 19:25
HI,

A friend of mine has done a small routine with PROTON but I use PBP.
He send me ASM & BAS files.

This is a very short prog: (myvar.bas)

Dim freqlol As Byte
Dim freqloh As Byte
Dim freqhil As Byte
Dim freqhih As Byte
Dim freq As Dword
Dim frg As float
Dim frg2 As Dword
dim w1 As frg2.word1
dim w0 as frg2.word0


freq = 24000000

frg = freq / 931.322
frg2 = frg * 10000
freqlol = w0.byte0
freqloh = w0.byte1
freqhil = w1.byte0
freqhih = w1.byte1

This subroutine could help me to calc a value (32 bits and floating point) for "freq" (freq is not always 24000000 but to test my PBP prog this the test value)

My PBP test prog is:

Asm
include "myvar.INC"
Endasm

serout2 portb.0,84,["go",10,13]
serout2 portb.0,84,[dec FREQHIH" ",DEC freqhil," ",DEC freqloh," ",DEC freqlol]

end

Just to try if I can get the values I need for my DDS
"myvar.INC" is the asm prog done from my friend (myvar.asm renamed)
But when I try to compile, I have errors

someone can help ?

Harryweb

skimask
- 3rd May 2007, 20:22
error---------------Dim freqlol As Byte
error---------------Dim freqloh As Byte
error---------------Dim freqhil As Byte
error---------------Dim freqhih As Byte
double-error--------Dim freq As Dword
double-error--------Dim frg As float
double-error--------Dim frg2 As Dword
error---------------dim w1 As frg2.word1
error---------------dim w0 as frg2.word0

error---------------freq = 24000000

error---------------frg = freq / 931.322
possible error depending on value of frq--------frg2 = frg * 10000

freqlol = w0.byte0
freqloh = w0.byte1
freqhil = w1.byte0
freqhih = w1.byte1

needed? Nope...---------------------Asm
loads of errors because of above------include "myvar.INC"
needed? Nope...---------------------Endasm

serout2 portb.0,84,["go",10,13]
I count at least one error here also...--serout2 portb.0,84,[dec FREQHIH" ",DEC freqhil," ",DEC freqloh," ",DEC freqlol]

someone can help ?
[/QUOTE]

Yes, someone can help...
After you taken a look at the manual and can tell why the above lines won't compile (no, it's not hidden magic or anything, they're right there in the PBP manual).