Search code examples
assemblydostasmcodepagescodepage-437

Character Block is not showing the right output in Turbo Assembler


I tried to create a fuel pump with only character blocks in strings but when I compiled it using TASM this is the output the dosbox gave to me.

I don't why this is the output since my characters are stored in strings not characters.

The data that I stored are mostly character blocks some of them are half blocks up and down the most characters I use for this is the full block.

.model small
.stack
.data

    fuelpump0 db     "    ▄█████████████████▄$"
    fuelpump1 db     "   █▀                 ▀█$"
    fuelpump2 db     "   █  ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄  █  ▄▄▄$"
    fuelpump3 db     "   █  █             █  █    ██▄$"
    fuelpump4 db     "   █  █             █  █    ▀██$"
    fuelpump5 db     "   █  █             █  ███▄   █$"
    fuelpump6 db     "   █  █             █  █  ▀▀█ █$"
    fuelpump7 db     "   █  █             █  █    █ █$"
    fuelpump8 db     "   █  ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀  █    █ █$"
    fuelpump9 db     "   █                   █    █ █$"
    fuelpumpa db     "   █                   █    █ █$"
    fuelpumpb db     "   █                   █    █ █$"
    fuelpumpc db     "   █                   █    █ █$"
    fuelpumpd db     "   █                   █    █ █$"
    fuelpumpe db     "   █                   █    █ █$"
    fuelpumpf db     "   █                   █    ▀█▀$"
    fuelpumpg db     " ▄▄█                   █▄▄$"
    fuelpumph db     " █                       █$"
    fuelpumpi db     " █████████████████████████$"

.code
    begin:
        mov ax, @data
        mov ds,ax

        mov dx, offset fuelpumpn
        mov ah,09h                 
        int 21h

        mov dx, offset fuelpump1
        mov ah,09h
        int 21h

        mov dx, offset fuelpump2
        mov ah,09h
        int 21h

        mov dx, offset fuelpump3
        mov ah,09h
        int 21h


        mov dx, offset fuelpump4
        mov ah,09h
        int 21h


        mov dx, offset fuelpump5
        mov ah,09h
        int 21h

        mov dx, offset fuelpump6
        mov ah,09h
        int 21h

        mov dx, offset fuelpump7
        mov ah,09h
        int 21h

        mov dx, offset fuelpump8
        mov ah,09h
        int 21h

        mov dx, offset fuelpump9
        mov ah,09h
        int 21h

        mov dx, offset fuelpumpa
        mov ah,09h
        int 21h

        mov dx, offset fuelpumpb
        mov ah,09h
        int 21h

        mov dx, offset fuelpumpc
        mov ah,09h
        int 21h

        mov dx, offset fuelpumpd
        mov ah,09h
        int 21h

        mov dx, offset fuelpumpe
        mov ah,09h
        int 21h

        mov dx, offset fuelpumpf
        mov ah,09h
        int 21h

        mov dx, offset fuelpumpg
        mov ah,09h
        int 21h

        mov dx, offset fuelpumph
        mov ah,09h
        int 21h

        mov dx, offset fuelpumpi
        mov ah,09h
        int 21h

        mov ah, 4ch
        int 21h

    end begin

I am starting to wonder if my character is not part of ASCII table since they are all part of extended ASCII characters. I hope I can get some hints to solve the problem.


Solution

  • I solved the problem, it may not be the best solution but here's what I did:

    • TASM is able to echo special characters in Extended ASCII Table by just simply typing the decimal values of each special characters like ▐ (222), █ (219), ▀ (223) and ▄ (220). Just make sure they have commas each of them and must not be the inside the quotation marks.

    • You can mix both strings and integers in every data string you are storing just make sure you put commas for every strings, and integers and add 13,10 as the return key and "$" to the end.