I just started messing around with assembly language and I tried to print the number 9 on console. Here is what I wrote:
global _main
section .data
digit equ 9
section .bss
section .text
_main:
mov edx, 1
mov ecx, digit
add ecx, 48
mov ebx, 1
mov eax, 4
int 21h
ret
I know I can do it using extern _printf
but I want try it with interrupts. I thought 21h
is a windows interrupt. So, what interrupt code should I use?
Here's an example from a course that I teach. This is a raw bootsector that you can compile directly as an object file and use as a bootable floppy or USB image in something like Qemu, VirtualBox, VMWare, Bochs or a real machine.
This makes use of the real mode BIOS interrupt 16 (0x10) for character output. I think this is what you're trying to get at with your question. :)