Jump to content
Sign in to follow this  
ra68gi

Problem With Math Operator " \ ".

Recommended Posts

Hi Dave,

I am getting error when i use integer divide operator "\".

 

#pragma DATA     _CONFIG,  _WDT_OFF & _XT_OSC & _CP_OFF & _PWRTE_OFF

'portb pins gives BCD out to be viewed in simulator
dim tens as byte, units as byte
sub main()
trisb=0
dim z as byte,y as byte
do while true
for y=0 to 99
tens = y \ 10
units=y Mod 10
tens=tens*16
portb=units+tens
call delay_ms(500)
next y
loop
end sub

 

Building...

BoostBasic Optimizing Basic Compiler Version 6.55 Beta (for PIC16 architecture)

http://www.sourceboost.com

Copyright© 2004-2006 Pavel Baranov

Copyright© 2004-2006 David Hobday

 

Beta version. No limitations. Expire date: 2007.01.01

 

 

_.bas

SB_BCD_0_TO_99.bas(10): error: general error

 

failure

Exit code was 1.

Removing target: _.obj

SB_BCD_0_TO_99.bas(10): error: failure

Failed to locate output file '_.obj'

Done

 

Failed

 

But it compiles well with floating point divide operator "/".

 

in the above code if i changed it to

 

tens = y / 10  '"/" works but not "\"

 

it works.

 

what might be the problem.

 

Raghunathan

Share this post


Link to post
Share on other sites

Your content will need to be approved by a moderator

Guest
You are commenting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×