I think that you are off by one line in your source code counting, and I believe that this is the line in question:
label1: mov ebp, [color + position] ; 29 - write (color, position->ebp)
As a rule, don't use two potentially relocatable addresses (e.g. any label/address that can be move around by optimization) as a combined memory reference.
Within the context of your code, you are probably trying to achieve the following:
color dd 0xff0000 ; 27 - pixel color
position dd 0xa0000000 ; 28 - pixel position
label1: mov ebp, DWORD[color] ; 29 - write (color->ebp)
add ebp, DWORD[position] ; 30 - add (position->ebp)
%macro clearreg 1-* ; 32 - clear register
%rep %0 ; 33
push %1 ; 34
%rotate 1 ; 35
%endrep ; 36
%endmacro ; 37
offset dd 0x13 ; 39 - video memory offset
label2: add ebp,DWORD[offset] ; 40 add (offset->ebp)
mov DWORD[0xa000],ebp ; 41 - write (ebp->video memory)
%macro clearvid 1-* ; 42 - clear video memory
%rep %0 ; 43
push %1 ; 44
%rotate 1 ; 45
%endrep ; 46
%endmacro ; 47
Note that there are quite a few more mistakes in your code besides the ones I implicitly corrected via the above example.
I would suggest (re)reading the NASM Documentation in regard to memory references and the like.