660 DOSSEG .MODEL SMALL .386 ;-------------------------------------------------------------------------- ; DIRWR skriver ett tecken direkt till bildminnet ; ; void dirwr(int char, int col, int row, int attr) ;-------------------------------------------------------------------------- .DATA screen DWORD 0b8000000h numcols DWORD 00000044ah .CODE PUBLIC _dirwr _dirwr PROC push bp mov bp, sp push di les di, numcols mov bx, es:[di] shl bx, 1 les di, screen sub ax, ax mov ax, [bp+8] ;row sub ax, 1 mul bx ;row * ((columns*2)/row) mov dx, [bp+6] ;column sub dx, 1 shl dx, 1 ;Take attribute byte in account add ax, dx add di, ax ;offset adress of screen now in di mov ax, [bp+4] ;ASCII character... stosb mov ax, [bp+10] ;And attribute stosb pop di pop bp ret ;Goodbye! _dirwr ENDP _dirstr PROC push bp mov bp, sp push si push di les di, numcols mov bx, es:[di] shl bx, 1 les di, screen sub ax, ax mov ax, [bp+6] ;row sub ax, 1 mul bx ;times bytes/row mov dx, [bp+4] ;column sub dx, 1 shl dx, 1 ;Take attribute byte in account add ax, dx add di, ax ;offset adress of screen now in di cld push ds lds si, [bp+8] str_lp: cmp byte ptr ds:[si], 0 jz rdy lodsb stosb inc di jmp str_lp rdy: pop ds pop di pop si pop bp ret _dirstr ENDP END . 0