Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.os.msdos.programmer > #1141

Re: Compiled older Basic programs

From "Bill Buckels" <bbuckels@mts.net>
Newsgroups comp.os.msdos.programmer
Subject Re: Compiled older Basic programs
Date 2013-12-08 21:43 -0600
Organization Aioe.org NNTP Server
Message-ID <l83e8u$va2$1@speranza.aioe.org> (permalink)
References <e8222f8f-7049-4eeb-96ea-61b71d78a4ba@googlegroups.com>

Show all headers | View raw


"MIkael Ljungberg" <mljmacqb@gmail.com> wrote:
>I have compiled BasicA and GWBasic in MS-DOS and BasicA in OS/2, to *.exe 
>programs. I do now how to do now, save the *.bas file in ascii format. Then 
>use BASCOM to compile it, and link it.

Well, that's a start. I can still remember how much fun I had doing the same 
thing. There are differences between interpreted and compiled BASIC that you 
may run into. For example:

If you use the BLOAD command to load graphics you will need to explictly set 
your segments in your executables somewhat differently than in the 
interpreter. The following should explain how to do that: (note: my 
wikipedia article http://en.wikipedia.org/wiki/BSAVE_(graphics_image_format) 
should also tell you a little about BSAVED graphics files, and my clipshop 
utility should give you a way to make them  http://www.clipshop.ca  if you 
are interested.)

LOADPIC:
  ' picture loader subroutine
  SELECT CASE PICTYPE%

  CASE 1, 3, 5, 6, 7  'Raw Data
      SEGMENT = &HB800              'Use Screen Segment
      OFFSET = &H0
      DEF SEG = SEGMENT
      BLOAD PICNAME$, OFFSET        'Bload the Picture

  CASE 2, 4
      'load image fragments
      SEGMENT = VARSEG(PIC(0))
      OFFSET = VARPTR(PIC(0))

      DEF SEG = SEGMENT
      BLOAD PICNAME$, OFFSET
      XTAB = INT((640 - PIC(0)) / 4)   'center horizontally
      PUT (XTAB, 0), PIC, PSET         'put picture

  END SELECT
  DEF SEG  'Go back to original segment

  IF ERRORLEVEL > 0 THEN
      CLS
      LINE (0,0)-(319,24),0,BF
      LINE (0,0)-(319,24),1,B
      LOCATE 2,2
      PRINT PICNAME$ + " NOT loaded. Press a key..."
      A$ = INPUT$(1)
  END IF

RETURN

Good to see you having fun.

Bill 

Back to comp.os.msdos.programmer | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Compiled older Basic programs MIkael Ljungberg <mljmacqb@gmail.com> - 2013-12-07 12:25 -0800
  Re: Compiled older Basic programs "Bill Buckels" <bbuckels@mts.net> - 2013-12-08 21:43 -0600

csiph-web