Well, lemme see...
push 28 ;DispStr(x,y,color,str_addr,length)
push Message
push 2ch ; I assume "space"...
push 00h
push 00h
call DispStr
sub sp, 7 ; Wot????
DispStr:
push bp
mov bp, sp ;enter 0,0
mov ch, 00h ; why not use cx? strlen might be over 256
mov cl, [bp+12] ; length
mov bh, 00h ; page
mov bl, [bp+8] ; color
mov dl, [bp+6] ; column (I may have row/column reversed
mov dh, [bp+4] ;row
mov ax, [bp+10]
push bp
mov bp, ax
mov ax, 1301h
int 10h
pop bp
mov sp, bp
pop bp ;leave
ret
Message:
db "Something with this program!"
Message_len equ $ - Message ; could use this for length
(all untested)
I would expect the high byte of all your parameters except "Message" to be zero (no such thing as "empty"), so (almost - except 11) any odd number added to bp should fetch zero...
The "odd" thing about int 10h/13h is the es:bp address for the address of the string. Nice job saving/restoring bp! Since it works, you must have es right. Printing to row zero can scroll off the top of the screen before you get a chance to see it, sometimes. Apparently that isn't a problem.
What are you thinking with the "sub sp, 7"??? I'd expect "add sp, 10" - I'd write it as "add sp, 2 * 5" (5 parameters, two bytes each) - to "clean up" the stack. You want to keep your stack aligned on an "even" boundary, at least. You should see the convolutions gcc goes through to align the stack (to 16 bytes)!
If it's working, you're doing good!
Best,
Frank