Okay, so I have some real-mode code that displays characters on the screen. It should work, but doesn't.
It's really weird, becauseit works if I put a inline value into al, but not if I read from string.Code:[BITS 16] [ORG 1000h] hello: mov BYTE al,[string] call charout call charout .end jmp .end ; outputs the character in al. charout: mov ah,0x0E mov bh,0x00 mov bl,0x06 int 0x10 ret string: db "HELLO WORLD",10,13,0 ; message to display times (512*2)-($-$$) db 0 ;512 bytes to a sector
You're calling a bios function what writes a character in teletype mode, so following the logic of your program, it should put the first 2 characters from your string, the thing is, you're not moving the pointer to string so it always prints the first character. You're passing the value of the first character from your string to al, but u must instead pass the reference (remove the brackets) to a register like SI, DI, AX, BX, DX, ... and increment your pointer using INC instruction. Make a loop in a new function that iterates through the string until it finds a 0 (null).
I can help you with that if you need.
Check this reference: Interrupt Services DOS/BIOS/EMS/Mouse
There are currently 1 users browsing this thread. (0 members and 1 guests)