Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

How to program in assembler8086 the unix command "banner"

monkammonkam Member Posts: 6
Dear Mr. or Mrs..

I am studying in Germany. Since one week now, Im
trying without any result to write the program bellow in assembler.
I will be very greatfull if you could help me.
This is the program:
Write a program that constructs the UNIX-command
"banner".
Banner is a command which enlarge each letter to a 8*8
letter matrix.

Example: c:...> banner hallo
hallo(appears in big characters on your DOS screen)

have a nice day.

Comments

  • blitzblitz Member Posts: 620
    : Dear Mr. or Mrs..
    :
    : I am studying in Germany. Since one week now, Im
    : trying without any result to write the program bellow in assembler.
    : I will be very greatfull if you could help me.
    : This is the program:
    : Write a program that constructs the UNIX-command
    : "banner".
    : Banner is a command which enlarge each letter to a 8*8
    : letter matrix.
    :
    : Example: c:...> banner hallo
    : hallo(appears in big characters on your DOS screen)
    :
    : have a nice day.
    :
    :

    Here's a program written by me some years ago that displays (actually scrolls) some big characters using the 80x50 text mode and the 8x16 ROM font - there are a little bit too many hard-coded values (and no comments :-)) in it but maybe it'll prove of some use to you...

    [code]
    void vga25() {
    asm {
    mov ax,3
    int 0x10
    }}

    void cursor_off() {
    asm {
    mov ah,1
    mov ch,127
    int 0x10
    }}

    void vga50() {
    asm {
    mov ax,0x1202
    mov bl,0x30
    int 0x10
    mov ax,3
    int 0x10
    mov ax,0x1112
    xor bl,bl
    int 0x10
    }}

    long getfontaddr() {
    asm {
    mov ax,0x1130
    mov bh,6
    push bp
    push es
    int 0x10
    mov dx,es
    mov ax,bp
    pop es
    pop bp
    }}

    void scroll2left() {
    asm {
    push ds
    push es
    cld
    mov ax,0xb800
    mov ds,ax
    mov es,ax
    mov si,2+1440
    mov dx,2
    mov di,1440
    mov bx,32
    }
    repeat:
    asm {
    mov cx,79
    rep movsw
    add si,dx
    add di,dx
    dec bx
    jnz repeat
    pop es
    pop ds
    }}

    long addr = getfontaddr();

    void drawcol(int car, int col) {
    asm {
    push ds
    push es
    lds si,addr
    mov ax,car
    shl ax,4
    add si,ax
    mov ax,0xb800
    mov es,ax
    mov di,79*2+1440
    mov ax,32+256*7
    mov bx,1+256*(10+16*4)
    mov dh,128
    mov cx,col
    shr dh,cl
    mov cx,16
    }
    repeat:
    asm {
    mov dl,[si]
    and dl,dh
    jz no_way
    mov es:[di],bx
    mov es:[di+160],bx
    jmp end_loop
    }
    no_way:
    asm {
    mov es:[di],ax
    mov es:[di+160],ax
    }
    end_loop:
    asm {
    inc si
    add di,160*2
    loop repeat
    pop es
    pop ds
    }}

    void waitretrace() {
    asm mov dx,0x3DA
    d1:
    asm {
    in al,dx
    and al,8
    jnz d1
    }
    d2:
    asm {
    in al,dx
    and al,8
    jz d2
    }}

    int keypressed() {
    asm {
    mov ah,0x11
    int 0x16
    mov ax,0
    jz exit
    inc ax
    }
    exit:
    }

    char msg[] = "POSHSOFT WARNING: Learning Assembler Now Greatly
    Reduces Serious Problems Of Your Programs. ";

    void main()
    {
    int i = 0, j = 0, k, l;

    vga50(); cursor_off();
    while (1) {
    l = (i<18) ? 2:1;
    for (k = 0; k < l; k++) {
    waitretrace(); scroll2left();
    drawcol(msg[i], j);
    }
    j++;
    if (j > 7) {
    j = 0; i++;
    if (!msg[i]) i = 0;
    }
    if (keypressed()) break;
    }
    vga25();
    }
    [/code]
  • Chris BrownChris Brown USAMember Posts: 4,624 ✭✭

    ____ // http://forcoder.org // free video tutorials and ebooks about { Ruby, MATLAB, Python, Assembly, R, C++, Go, Visual Basic .NET, C#, PHP, JavaScript, Scratch, Delphi, Objective-C, C, Swift, Java, PL/SQL, Visual Basic, Perl Rust, Awk, Scala, Apex, Scheme, Crystal, Bash, Alice, Fortran, Lua, F#, Transact-SQL, ABAP, FoxPro, Hack, Kotlin, Prolog, LabVIEW, D, Clojure, VBScript, Dart, ML, Logo, Ada, Erlang, Lisp, SAS, COBOL, Julia } _________

Sign In or Register to comment.