Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .model small
- .stack 100h
- COLBOX macro C,POS,EPOS
- MOV AX, 600H
- MOV BH, C
- MOV CX, POS
- MOV DX, EPOS
- INT 10H
- endm
- CURPOS macro X,Y
- MOV AH, 2H
- MOV BH, 0
- MOV DH, Y
- MOV DL, X
- INT 10H
- endm
- .data
- UISTR DB 'GUI TEST!$'
- GX DB 1
- GY DB 8
- .CODE
- MOV AX, @DATA
- MOV DS, AX
- ; DEFINE STORE VARS FOR DRAW PROTOCOL
- MOV DI, OFFSET UISTR
- ; PUT COLOR BOX ARROUND TEXT
- COLBOX 17H, 0505H, 060DH
- CURPOS 5,5
- CALL DRAWGUI
- LEA DI, UISTR
- CURPOS 5,6
- CALL DRAWGUI
- ; EXIT DOS
- MOV AH, 4CH
- INT 21H
- ;-------------------------------------
- DRAWGUI PROC
- ; LOOP THROUGH STRING AND DRAW CHAR ARE X AND Y'S
- ; BLACKLISTED REGISTERS - DH, DL
- ; RELY REGISTERS - DI
- ; RETURNS LENGTH WITH BL
- ; SET CHAR COUNT TO 0
- MOV BL, 0
- ; GET STARTING CURSOR POSITION
- MOV AH, 3H
- INT 10H
- ; POSITIONS OUTPUTED TO DL, DH (X,Y)
- ; LOOP DI AND DRAW EACH CHAR AT DL, DH
- NXTCHAR:
- ; RECIEVE CHAR WITH ADDRESS OUTPUT TO BITS
- MOV BH, [DI]
- ; PRINT CHAR THEN MOVE TO NEXT
- MOV CL, DL
- MOV AH, 2H
- ;BACKUP X POSITION
- MOV DL, BH
- INT 21H
- ; POP X POSITION BACK THEN MOVE TO NEXT X
- MOV DL, CL
- INC DL
- MOV CH, BH
- ; SET CURSOR POS AT NEXT X
- MOV AH, 2H
- ; SET DEFAULT PAGE XY
- MOV BH, 0
- INT 10H
- ; CHECK IF LAST CHAR
- INC DI
- MOV BH, [DI]
- CMP BH, '$'
- JE RETURN
- ; ABSOLUTE LENGTH, WITHOUT CARRAGE RETURN
- INC BL
- JMP NXTCHAR
- RETURN:
- RET
- DRAWGUI ENDP
- END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement