OutOfABoxIntoAnother
OutOfABoxIntoAnother

Reputation: 11

DOSBox assembly print function - 8086 TASM

I'm using 16-bit TASM compiler with DOSBox and would like to know how to include the dosbox printing function in my assembly code. What I'm trying to do is similar to the following (however that is with NASM and I need TASM. i.e. something that would work with an 8086):

global _main
extern _printf     ;What would be its equivalent in TASM?
section .data
msg db "Hello World!", 0Dh, 0Ah, 0
section .bss
section .text

_main:
push ebp
mov ebp, esp

push msg         ;How do we do
call _printf     ;this with TASM?

add esp, 4
mov esp, ebp
pop ebp
ret

Upvotes: 1

Views: 1296

Answers (1)

cat_1000101
cat_1000101

Reputation: 1

you can use the int 21h interrupt to print a msg. you can do this by first in the msg in the end you need the character '$' to signal the end of the msg, second moving the offset of the msg to the register dx then mov ah,9 and calling the interrupt.

it should look like this: msg db 'hello wrold!$'

mov dx,offset msg mov ah,9 int 21h

Upvotes: 0

Related Questions