Subtracting two label addresses, in argument to Round(), causes strange result.
Subtracting two pointer variables is OK.
You can remove the /4, issue remains.
PB 5.60 x86 Windows 7
Code: Select all
DataSection
Start:
Data.a $01, $02, $03, $04 ; 4 bytes (1 long)
Finish:
EndDataSection
nBytes = (?Finish - ?Start)
;Debug nBytes ; OK (4)
nLongs = nBytes / 4
Debug nLongs ; OK (1)
nLongs = (?Finish - ?Start) / 4
Debug nLongs ; OK (1)
nLongs = Round(nBytes / 4, #PB_Round_Up)
Debug nLongs ; OK (1)
nLongs = Round((?Finish - ?Start) / 4, #PB_Round_Up) ; <------------------------
Debug nLongs ; not OK!
*Start = ?Start
*Finish = ?Finish
nLongs = Round((*Finish - *Start) / 4, #PB_Round_Up)
Debug nLongs ; OK (1)