org 0x7c00
cli ;disable hardware interrupts
cld ;clear direction flag
xor ax,ax ;zero out ax
mov ds,ax ;initialise data segment
mov ss,ax ;initialise stack segment
mov sp, 0x7c00 ;point sp at memory available for
stack
mov si, msg ;ds:si -> message
call putstr ;print message
hang:
jmp hang ;loop forever
msg db '
Ah, Necromancy Sweet!',
0
INT 21H ;print new line
msg db 'Ah, Wizard erudite!
', 0
putstr:
lodsb ;load next character
or al,al ;end of string?
jz finish ;exit loop if so
mov bx, 7 ;page = 0, attribute = 7
mov ah, 0xe ;print character function
int 0x10 ;print character
jmp putstr ;get next character
finish:
retn ;return to caller
Get Answers For Free
Most questions answered within 1 hours.