//---------------------------------------------------------------- // mysub.s // // This GNU assembly language file defines a procedure which // can be called by a 16-bit program executing in real mode. // It advances the cursor to the beginning of the next line. // // assemble using: $ as mysub.s -o mysub.o // // programmer: ALLAN CRUSE // written on: 02 MAY 2004 //---------------------------------------------------------------- .code16 .text newline: pushaw push %ds push %es mov $0x0F, %ah # get display-page in BH int $0x10 mov $0x03, %ah # get cursor locn in DH,DL int $0x10 mov %cs, %ax # address this segment mov %ax, %ds # with DS register mov %ax, %es # also ES register lea crlf, %bp # offset of string mov $2, %cx # length of string mov $0x07, %bl # normal attribute mov $0x1301, %ax # write string int $0x10 pop %es pop %ds popaw ret crlf: .ascii "\n\r" .globl newline