Table of Contents

QTIPS - New Assembler Routines V2.0+

Published ByDateVersionKnowledge LevelKeywords
Sprezzatura Ltd01 AUG 19902.0+EXPERTMKDIR, CHATTR, SEQ, REVLOMSG

There are two new useful assembler routines included in version 2.0, MKDIR and CHATTR.

MKDIR

As the name implies this is a routine that can be called in place of performing a DOS MKDIR. It is both quicker and cleaner. To implement, call passing two parameters, firstly a file name (CHAR(0) terminated) then a flag (set to 0 for fail, 1 for successful creation). EG

  DIR  = "C:\INSTALL"
  DIR := CHAR(0)
  CALL MKDIR(DIR,FLAG)
  IF FLAG THEN
     GOSUB OK
  END ELSE
     GOSUB FAIL
  END

CHATTR

This routine will be of most use to those developers writing utilities which directly update the screen (EG a REVLOMSG editor - see next utility diskette). It permits the alteration of a video attribute at a nominated location/locations on screen. Calling syntax is

  CALL CHATTR(A,B,C,D)

where

Ais the X position of the start of the attributes to change
Bis the Y position of the start of the attributes to change
Cis SEQ(attribute) required
Dis the number of attributes to replace

Thus to start at Position 4,4 on screen and change the next 100 character positions to Yellow on Blue leaving the actual ascii characters on screen unchanged one would

    DECLARE FUNCTION ESC.TO.ATTR
    YOB = CHAR(27) : "C1N"
    ATTR = ESC.TO.ATTR(YOB)
    SEQ_AT = SEQ(ATTR)
    CALL CHATTR(4,4,SEQ_AT,1 00)

(Volume 2, Issue 4, Page 3)