Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: Notesfiles $Revision: 1.7.0.8 $; site trsvax
Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxn!ihnp4!inuxc!pur-ee!uiucdcs!convex!trsvax!earl
From: earl@trsvax
Newsgroups: net.micro.trs-80
Subject: Re: Tandy 2000 PASCAL
Message-ID: <70700039@trsvax>
Date: Tue, 17-Sep-85 10:41:00 EDT
Article-I.D.: trsvax.70700039
Posted: Tue Sep 17 10:41:00 1985
Date-Received: Fri, 20-Sep-85 06:22:37 EDT
References: <1887@reed.UUCP>
Lines: 88
Nf-ID: #R:reed.UUCP:-188700:trsvax:70700039:000:2551
Nf-From: trsvax!earl    Sep 17 09:41:00 1985


Graphics on a Tandy 2000 using MS-PASCAL.

Actually, it is fairly easy to do graphics on the machine. Especially when using
MS-PASCAL. All you need is Microsoft's Assembler and you're in business.

For example:

;****************************
;*   
;*   PASCAL PROCEDURE PIXEL
;*
;* Called like so:
;* PIXEL(row,col,color: integer); external;
;*
;****************************
;
data    segment   public 'data'
data    ends
dgroup  group     data
	assume    cs:adds,ds:dgroup,ss:dgroup
adds    segment   'code'
public  pixel
pixel   proc       far
	push       bp     ;save regs
	push       cx
	push       dx
	mov        bp,sp  ;setup pntr to stack
	mov        dx,14[bp] ;get row val
	mov        cx,12[bp] ;get col val
	mov        al,10[bp] ;get pixel color
	mov        ah,12     ;set up fot MSDOS funct call
	int        10h       ;go write the pixel
	pop        dx        ;restore regs
	pop        cx
	pop        bp
	ret        6         ;return and clear stack
pixel   endp
adds    ends
	end

You also have to be able to set the screen mode, if you want to get into
graphics.
Thus you could use:

;**********************************
;*
;*  PASCAL PROCEDURE SCREEN
;*
;*  Called like so:
;*
;* SCREEN(mode: integer); external;

;*
;***********************************
;
data     segment     public  'data'
data     ends
dgroup   group       data
	 assume      cs:adds,ds:dgroup,ss:dgroup
adds     segment     'code'
public   screen
screen   proc        far
	 push        bp     ;save regs
	 mov         bp,sp  ;setup pntr to stack
	 mov         al,6[bp] ;get screen mode
	 mov         ah,00h   ;set up for DOS funct call
	 int         10h      ; go set screen mode
	 pop         bp       ;restore reg
	 ret         2        ;return and clear stack
screen   endp
adds     ends
	 end


Anyway, you use the assembler to create a Relocatable Object File, then use the
LIB command to merge these into a library file, Then within a Pascal program
declare these procedure to be external. When you get to the LINKing stage, just
add the library to the list. Tandy sells a Programmer's Reference Manual for
about $20.00 that has more detailed information on using MSDOS and BIOS function
calls. By using these functions and the assembler and LIB commands, a user/prog-
grammer can build up a fairly sizable set of graphics functions on their own.

I think that since it is fairly simple to create one's own custom graphics
library package, that nobody bothered to do it.

This information is provided by an individual and is not supported by TANDY
Corporation.