|
||||||
| Assembly A machine oriented language in which mnemonics are used to represent each machine language instruction. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
||||
|
Can anyone tell why this doesn't work?
Okay, so I have some real-mode code that displays characters on the screen. It should work, but doesn't.
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
__________________
Watches: Nanoha, Haruhi, AzuDai. Listens to: E-Type, Dj Melodie, Nightcore. "When people are wrong they need to be corrected. And then when they can't accept it, an argument ensues." - MeTh0Dz Last edited by Aereshaa; 06-22-2009 at 03:42 PM.. |
|
||||
|
Re: Can anyone tell why this doesn't work?
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 |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Clipboard Game | Jordan | Games | 3471 | Today 12:14 AM |
| What do I need to change in order to get this to work using ajax? | doheja07 | AJAX | 1 | 08-08-2009 08:59 PM |
| Multi-lingual Website - How To Work with Resources Files | lartzi | C# Programming | 1 | 06-20-2008 12:39 PM |
| All url ports blocked at work.. | phpforfun | The Lounge | 1 | 03-13-2008 08:42 PM |
All times are GMT -5. The time now is 08:20 AM.
Amrosama.cc
Arekbulski.cc
Debtboy.cc
Guest.cc
Jaan.cc
James.cc
Mathx.cc
Tsz.cc
Vswe.cc