Hello, I know I had already posted something like this, but I can't understand why this isn't working.
;HERE I USE CELDA VARIABLE TO SAVE THE CURRENT MEMORY POSITION, BUT IT DOESN'T WORK
putchar:
push 0b800h
pop es
mov di, [.celda]
mov [es:di], al
inc di
mov byte [es:di], 7
inc di
add word [.celda], 2
ret
.celda:
dw 0
;THIS IS THE SAME BUT FOR STRINGS
putstring:
mov al, [si]
inc si
cmp al, 0
je .end
call putchar
jmp putstring
.end:
ret
;THIS DOESN'T WORK ALSO
getchar:
in al, 96
cmp al, 0
je getchar
ret
Well, I hope you answer soon.
Mati Argentina...
without bios
The concept is really simple! The video memory of 80*25 text mode is located in the physical address of 0x000B8000. This is 0x0000:0xB800 in real mode. Since we have 80 horizontal and 25 characters, with each character equipped with one attribute byte, we will have 2000*2 = 4000 bytes of video memory. Byte#0 is the first character while Byte#1 is the first character's attribute. Byte#2 is the second character while Byte#3 is the second character's attribute and so on.
On the field with sword and shield amidst the din of dying of men's wails. War is waged and the battle will rage until only the righteous prevails.
Sorry to correct you but it is 0xB800:0000 in real mode. At least I am pretty sure.XCHG wrote:The concept is really simple! The video memory of 80*25 text mode is located in the physical address of 0x000B8000. This is 0x0000:0xB800 in real mode. Since we have 80 horizontal and 25 characters, with each character equipped with one attribute byte, we will have 2000*2 = 4000 bytes of video memory. Byte#0 is the first character while Byte#1 is the first character's attribute. Byte#2 is the second character while Byte#3 is the second character's attribute and so on.
![Wink :wink:](./images/smilies/icon_wink.gif)