ALl,
I am trying to port an old MS bascom code to Freebasic in language QB.
IS there a list of guidelines and/or rules for making the conversion?
I am especially looking for replacements for these "unique" types of code:
TESTFB.BAS(33) error 10: Expected '=', found 'SEG'
445 DEF SEG = 0: IA=PEEK(&H46C)+256*PEEK(&H46D): DEF SEG: RETURN ' 9 TICKS=0.5 S, 546=30 SEC
^
TESTFB.BAS(33) error 24: Invalid data types, found '+'
445 DEF SEG = 0: IA=PEEK(&H46C)+256*PEEK(&H46D): DEF SEG: RETURN ' 9 TICKS=0.5 S, 546=30 SEC
^
TESTFB.BAS(33) error 10: Expected '=', found 'SEG'
445 DEF SEG = 0: IA=PEEK(&H46C)+256*PEEK(&H46D): DEF SEG: RETURN ' 9 TICKS=0.5 S, 546=30 SEC
/thanks
/paul
Proting from old MS bascom
-
- Posts: 1
- Joined: Jan 25, 2021 13:32
Re: Proting from old MS bascom
These constructs are msdos specific, and won't work outside msdos.
Under Windows however the functions gettickcount/gettickcount64 fulfil roughly the same role, giving you a monotonous increasing time since startup in milliseconds. (the -64 variant is Vista+ though)
Under *nix it is usually something like clock_gettime(clock_monotonic,&tv) to get a clock value in seconds and nanoseconds that you then have to combine to a int64 milliseconds number.
Under Windows however the functions gettickcount/gettickcount64 fulfil roughly the same role, giving you a monotonous increasing time since startup in milliseconds. (the -64 variant is Vista+ though)
Under *nix it is usually something like clock_gettime(clock_monotonic,&tv) to get a clock value in seconds and nanoseconds that you then have to combine to a int64 milliseconds number.
Re: Proting from old MS bascom
MCS Electronic's BASCOM (for Windows) is a commercial compiler for AVR-MicroControllers ...
FreeBASIC is NOT compatible with that.
Search the Internet for: Great Cow BASIC (which should do).
FreeBASIC is NOT compatible with that.
Search the Internet for: Great Cow BASIC (which should do).
Re: Proting from old MS bascom
Clock ticks at 0:046C are not a Atmel feature to my best knowledge.MrSwiss wrote:MCS Electronic's BASCOM (for Windows) is a commercial compiler for AVR-MicroControllers ...
FreeBASIC is NOT compatible with that.
Search the Internet for: Great Cow BASIC (which should do).
Re: Proting from old MS bascom
MS BasCom is the Microsoft Business BASIC Compiler for MS-DOS or CP/M, released sometime in 1983. DEF SEG was something only seen on 16-bit real mode x86 processors, usually under MS-DOS. No other processor that I know of had a segmented architecture. Certainly AVR has never been segmented.MrSwiss wrote:MCS Electronic's BASCOM (for Windows) is a commercial compiler for AVR-MicroControllers ...
Re: Proting from old MS bascom
BasCom was the original compiler developed by Microsoft for MsDos and CP/M.MrSwiss wrote:MCS Electronic's BASCOM (for Windows) is a commercial compiler for AVR-MicroControllers ...
FreeBASIC is NOT compatible with that.
http://www.emsps.com/oldtools/msbasv.htm
It was used to compile GWBasic programs, but supported also a bit of structured programming, and didn't need line numbers, so after some time Microsoft added an IDE and called it Quick Basic 1.0
The BASCOM for AVR is totally unrelated with it. And since it doesn't seem to support the DEF SEG instruction, it's pretty clear that pmurphy555 was talking about the Microsoft one (since he also called it "old bascom"