NASM Forum > Programming with NASM
Example INT 0x10 AH 0x0E in Bios
ramosaurio:
Hello everyone, i just started to learn programming with nasm. I'm doing a little program to verify the Bios interrupt set.
I have experience programming with ARM, but now i'm stuck with the 0x10 interruption. I did a simple "Hello" to print it with the 0X0E mode.
--- Code: ---[BITS 16]
org 0x7c00
mov ah, 0x0e
mov al, 'H'
int 0x10
mov al, 'E'
int 0x10
mov al, 'L'
int 0x10
int 0x10
mov al, 'O'
int 0x10
jmp $
times 510 - ($-$$) db 0
dw 0xaa55
--- End code ---
I take this example from this Bootloader project https://github.com/cfenollosa/os-tutorial/tree/master/02-bootsector-print
The problem is that when i mount it in my VM it only prints the first lettler but not the others letters.
Thank's in advantage.
PD. I think that i post it in the correct section, sorry if there are any problem.
Frank Kotler:
Hi ramosaurio,
Welcome to the Forum.
I would expect your code to work on real hardware. Who knows what a VM might do? Try reloading ah with 0x0E before each interrupt.
Best,
Frank
debs3759:
With a properly written IBM compatible BIOS that should work. Can you use a debugger to single step through the code while in the VM, to see if it is changing any registers?
fredericopissarra:
Try this:
--- Code: ---bits 16
jmp 0x7c0:_start ; I prefeer to use smaller offsets!
_start:
push cs
pop ds
cld
lea si,[msg]
.loop:
mov ah,0x0e
lodsb
test al,al
jz _exit
mov bx,7 ; page 0, white foreground.
int 0x10 ; probably int 0x10 destroys AX...
jmp .loop
_exit:
hlt
jmp _exit
msg: db `Hello!!!\0`
times 510-($-$$) db 0
dw 0xaa55
--- End code ---
ramosaurio:
--- Quote from: Frank Kotler on February 05, 2019, 09:38:49 PM ---Hi ramosaurio,
Welcome to the Forum.
I would expect your code to work on real hardware. Who knows what a VM might do? Try reloading ah with 0x0E before each interrupt.
Best,
Frank
--- End quote ---
I tried reloading 0X0E before each interrupt and i have the same problem.
Anyway thank's i'm going to try it on real hardware because i didn't know that the VM could give me so many problems.
--- Quote from: debs3759 on February 05, 2019, 11:21:29 PM ---With a properly written IBM compatible BIOS that should work. Can you use a debugger to single step through the code while in the VM, to see if it is changing any registers?
--- End quote ---
Okay, i'm not using any debugger for the VM, could you recommend me some free debugger? (i heard from one called IDA, but i got it and the free version doesn't support x64 architectures.
Thank's
Navigation
[0] Message Index
[#] Next page
Go to full version