Results 1 to 2 of 2
  1. #1
    Void's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Inline.
    Posts
    3,198
    Reputation
    205
    Thanks
    1,445
    My Mood
    Mellow

    [Source]Printing strings using interrupts in 16-bit.

    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]

  2. The Following 2 Users Say Thank You to Void For This Useful Post:

    Astral Witch (12-28-2010),therofl (11-01-2010)

  3. #2
    .::SCHiM::.'s Avatar
    Join Date
    Sep 2010
    Gender
    male
    Posts
    733
    Reputation
    180
    Thanks
    880
    My Mood
    Twisted
    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




  4. The Following User Says Thank You to .::SCHiM::. For This Useful Post:

    Astral Witch (12-28-2010)

Similar Threads

  1. [Source Code] (16 Bit..DOS ONLY) C++ using Assembly BIOS interrupts, draw rectangle
    By Auxilium in forum C++/C Programming
    Replies: 9
    Last Post: 05-28-2011, 05:53 AM
  2. [Release + Source] Using GDI+ to draw a dot on the screen
    By Erinador in forum Visual Basic Programming
    Replies: 19
    Last Post: 01-11-2010, 08:32 PM
  3. Replies: 3
    Last Post: 12-23-2009, 09:37 AM
  4. Using only the Ipod touch to create and compile source files
    By radnomguywfq3 in forum C++/C Programming
    Replies: 3
    Last Post: 03-22-2009, 11:26 AM
  5. How to use print screen
    By the1fear in forum Soldier Front Hacks
    Replies: 11
    Last Post: 03-07-2008, 05:52 PM