; /// MACRO AND PROCEDURE DEFINITIONS USED IN THE DISPLAY.RTF FILE ////
;;///////////////////////////////////////////////////////////////////////////////////////////////////////
; SETS TEXT VIDEO SCREEN 50 LINES 80 COLUMNS
TEXTVID MACRO
; clears text video screen
CLS PROC
; converts an offset value to row column
OFFSET2RC PROC
OFFSET2RC ENDP
; ax and bx can be used as input regs
; convert row column position to screen offset position
; call wrc2offset ax,bx
WRC2OFFSET PROC
;convert row column position to screen offset position
RC2OFFSET PROC
; text should be identified as db in data segment as follows:
; text db "hello world",0dh,0ah,"$"
; input ds:si offset of text to show
; ax = row
; bx = column
; bp = color
SHOWSTR PROC
; eax = row
; ebx = column
; ch = color
; cl = char
SHOWCHAR PROC
; di = pos
; ds:si = offset text
; bp = color
; modifies di
;before using write and writeln don't forget to initialize di
; shows a string at the current cursor position and
WRITELN PROC
; di = pos
; ds:si = offset text
; bp = color
; modifies di
; shows a string at the current cursor position and
WRITE PROC
; puts a linefeed on the current screen position
; edi will point to the next screen offset address
; pos is the current position
; esi = the position that holds the start column
CRLF PROC
; ax = row
; bx = column
; cx = repeatcount
; dh = color
; dl = char
REPEATCHAR PROC
;shows an integer value in a register with color
;to put a space when using more than two of this macro use
;before using showintx functions don't forget to initialize di
; shows an integer at the current cursor position and
; moves cursor to the end of number
; eax = integer value
; ecx = base
; bp = color
SHOWINT PROC
; ah = color
PAGECOLOR PROC
; dx ax mod bx
; getmod1 266,264= dx=2 ax=1
; ax = number
GETMOD1 PROC
; ax = number
; bx = modnum
GETMOD2 PROC
; getmod1 266,264= dx=2 ax=1
; 32-bit
; eax = number
GETMOD3 PROC
; calculates powers of an integer number
POWER PROC
; centers a string horizontally
; ax = xpos1
; bx = xpos2
; cx = stringlen1
HCENTER PROC
; centers astring vertically
; ax = ypos1
; bx = ypos2
; cx = stringlen1
VCENTER PROC
; eax = x
; ebx = y
; ecx = width
TEXTRECT PROC
; DS:ESI = OFFSET FORM
FORMTEXTRECT PROC
; DS:ESI = OFFSET COMBO
COMBOTEXTRECT PROC
; DS:ESI = OFFSET COMBOLIST
COMBOLISTTEXTRECT PROC
; DS:ESI = OFFSET FORM
TEXTBOLDLINE PROC
MULTIPLY PROC
.
;* loadptr - macro to load far address
; into segment:register pair, or
;* near address into register.
;*
;* params: sgmnt - segment to be loaded
; with segment address
;* reg - register to be loaded with offset address
;* pointer - pointer to address
;*
;* shows: instructions - lds les
;* directives - macro if ifidni else
;* else ifendif .err endm
LOADPTR MACRO SGMNT, REG, POINTER
;* loadptr - macro to load far address
; into segment:register pair, or
;* near address into register.
;*
;* params: sgmnt - segment to be loaded
; with segment address
;* reg - register to be loaded with offset address
;* pointer - pointer to address
;*
;* shows: instructions - lds les
;* directives - macro if ifidni else
;* else ifendif .err endm
LOADPTR MACRO SGMNT, REG, POINTER
; shows a string o the row,col position in screen
; text should be identified as db in data segment as follows:
; text db "hello world",0dh,0ah,"$"
MSHOWSTR MACRO ROW,COL,TEXT,COLOR
; shows a string o the row,col position in screen
; text should be identified as db in data segment as follows:
; text db "hello world",0dh,0ah,"$"
XSHOWSTR MACRO ROW,COL,TEXT,COLOR
;before using write2 and writeln2 don't forget to initialize di
; shows a string at the current cursor position and
WRITELN2 MACRO TEXT,COLOR
; shows a string at the current cursor position and
WRITE2 MACRO TEXT,COLOR
;shows an integer value in a register with color
;to put a space when using more than two of this macro use
;to put a line feed use add di,160
;before using showintx functions don't forget to initialize di
; shows an integer at the current cursor position and
SHOWINT8 MACRO REG, BASE, COLOR
SHOWINT16 MACRO REG, BASE, COLOR
SHOWINT32 MACRO REG, BASE, COLOR
SHOWX MACRO COLOR