Astral Witch (12-28-2010),therofl (11-01-2010)
Yeah, I was working on this last night, first in MASM, then in NASM because MASM was sort of being a douchebag. ):
[highlight=asm]
[bits 16]
[org 0x100]
main:
jmp start
message db 'Test..',0
PrintChar:
push bp
mov bp,sp
mov ax,word [bp+4]
mov al,byte [bp+4]
mov ah,0Eh
int 10h
mov sp,bp
pop bp
ret
PrintString:
push bp
mov bp,sp
mov bx,0
printLoop:
push bp
mov bp,[bp+4]
add bp,bx
mov cl,byte [bp]
pop bp
cmp cl,0
je print_done
push cx
call PrintChar
inc bx
jmp printLoop
print_done:
mov sp,bp
pop bp
ret
start:
xor ax,ax
mov ds,ax
mov es,ax
mov bp,100h
mov sp,100h
push message
call PrintString
l:
jmp l ;infinite loop to keep the window open
[/highlight]
Last edited by NextGen1; 02-07-2011 at 06:03 PM.
Astral Witch (12-28-2010),therofl (11-01-2010)
MASM isn't a douchebag
It rocks
I'm SCHiM
Morals derive from the instinct to survive. Moral behavior is survival behavior above the individual level.
Polymorphic engine
Interprocess callback class
SIN
Infinite-precision arithmetic
Hooking dynamic linkage
(sloppy)Kernel mode Disassembler!!!
Semi debugger
Astral Witch (12-28-2010)