Path: utzoo!attcan!uunet!lll-winken!lll-lcc!ames!killer!igloo!andyross From: andyross@igloo.UUCP (Andrew Rossmann) Newsgroups: comp.sys.ibm.pc Subject: Re: assorted questions Keywords: Video addressing & ports, terminal emulation Message-ID: <1347@igloo.UUCP> Date: 2 Jan 89 18:38:49 GMT References: <5082@phoenix.Princeton.EDU> Reply-To: andyross@igloo.UUCP (Andrew Rossmann) Organization: igloo, Northbrook, IL Lines: 49 In article <5082@phoenix.Princeton.EDU> jwbirdsa@phoenix.Princeton.EDU (James Webster Birdsall) writes: > > Three questions: > > 1) I need a sophisticated way to determine where the screen begins in >RAM. I have looked in the interrupt list recently posted and didn't find >anything that looked useful. For example, how does Turbo C (which makes >a point of doing direct screen writes for speed) do it? > > 2) Saw this posted a while ago but can't find it again... what port >should I watch to avoid snow on the CGA? And am I right in believing >that this problem is limited to the CGA? > > 3) Finally, could somebody send me a list of the control codes which >a VT100/102 responds to? (i.e. the codes the host sends to it). > > Thanks a lot... >======================================================================== >! James W. Birdsall Compu$erve: 71261,1731 ! >! jwbirdsa@phoenix.Princeton.EDU jwbirdsa@bogey.Princeton.EDU ! >! jwbirdsa@pucc.BITNET ...allegra!princeton!phoenix!jwbirdsa! >======================================================================== To find the address of video (at least in text mode) just use INT 10h function 0Fh. If the mode returned is 7, then video starts at segment B000h, otherwise it's at B800h. Video is arranged with the each character requiring 2 bytes. The first being the attributes, and the second the character. For graphics modes, 4,5 and 6 start at B800. On the Tandy 1000 series, 8 and 9 also start at B800. (The PCjr varies in these modes.) Other graphic modes generally start at A000. I'm unsure about Hercules graphics. The port to check for snow protection is 3DAh. Just do: MOV DX,3DAh ;port HORZ_RET: IN AL,DX ;get status TEST AL,1 ;check JNZ HORZ_RET ;wait till low CLI ;turn off interrupts HWAIT: IN AL,DX ;get status TEST AL,1 ;is it high? JZ HWAIT ;wait until high ;write character to screen in your own way Only CGA displays need this, but not all require it. It should be made on option if you can. Attempting to wait on a monochrome display (which uses port 3BAh) will freeze your program because it is never used. andyross@ddsw1.MCS.COM -or- ddsw1!andyross -or- ddsw1!igloo!andyross