so, I want to avoid using int 21h and start working with BIOS level code. I'm trying to write something equivalent to int 21h, function 09h, using int 10h functions 09h, 03h, and 02h, except I want the reading to terminate when it reaches a 00h character, switch to green text when it reaches a 02h character, and switch back to normal when it reaches a 01h character.
Here is my code:
outp proc push cx push ax push bx push dx xor cx,cx xor bx,bx nxchr: add dx,cx mov al,[dx] cmp al,00h jz stwrt cmp al,01h jnz skp01 mov attrCUR,attrWHT skp01: cmp al,02h jnz skp02 mov attrCUR,attrGRN skp02: mov ah,09h mov bl,attrCUR push cx xor cx,cx int 10h pop cx inc cx mov ah,03h int 10h inc dl mov ah,02h int 10h jmp nxchr stwrt: pop dx pop bx pop ax pop cx ret outp endp
to use this I would set dx to the offset of the beginning of the string andthen call outp.
I'm getting the error that mov al,[dx] is an "illegal indexing mode," and that mov attrCUR,attrWHT and mov attrCUR,attrGRN are illegal memory references, although now that I look at it I can see exactly why. Anyways, how can I move the contents of the memory location in dx into the al register?
Also, I changed mov attrCUR,attrWHT to "mov attrCUR,[offset attrWHT]" and it said constant too large... how do I fix this?
help please...thanks in advance.
fixed the mov attrCUR,attrWHT problem... just put the value into bl directly instead of using a memory location intermediate.