yl equ 96 yh equ 32 xl equ 64 xh equ 32 maxrow equ 24 maxcol equ 80 rscale equ 768/maxrow cscale equ 1024/maxcol initgraf: lcall ilprt db esc,FF,0 ret ansi: mov a,#31 jmp sndchr dot: mov a,#28 lcall sndchr RAW: mov r0,#low y1+1 mov p2,#high y1 jmp point plot: mov a,#29 ; vector graphics submode lcall sndchr line: mov r0,#low y2+1 mov p2,#high y2 call point jmp point ; savit: mov r0,#low x1 mov r1,#low x2 mov r2,#4 newxy: movx a,@r0 ; x2 = x1 movx @r1,a ; y2 = y1 inc r0 inc r1 djnz r2,newxy ret ; POINT: lcall getword ; get y2/y1 mov r3,#32 lcall dvide8 mov a,r6 ; get highy orl a,#yh lcall sndchr ; send highy mov a,r7 ; get lowy orl a,#yl lcall sndchr ; send lowy lcall getword ; get x2/x1 mov r3,#32 lcall dvide8 mov a,r6 ; get highx orl a,#xh lcall sndchr ; send highx mov a,r7 ; get lowx orl a,#xl ljmp sndchr ; send lowx ; getword: movx a,@r0 mov r6,a dec r0 movx a,@r0 mov r7,a dec r0 ret ; ; r2 HAS ROW, r3 HAS COL set_cursor: push dpl push dph clr c mov a,#maxrow ; make rows start at top subb a,r2 mov b,#rscale mul ab mov dph,b mov dpl,a shld y1 mov a,r3 mov b,#cscale mul ab mov dph,b mov dpl,a shld x1 call dot pop dph pop dpl ret