Hi guys, im currently programming in 16bit dos for my class.. Is there a better technique (as to saving space/memory) to writing what i have down here, or that is the best it will get?

mov dx, ' '
    int 21h
    mov dx, '|'
    int 21h
    mov dx, ' '
    int 21h
    mov dx, 0Ah
    int 21h

Recommended Answers

All 3 Replies

Use DL rather than DX. The group of functions you have to be calling (you didn't say which of several possibilities you're specifying in AH) don't use DH. A MOV to DX is 3 bytes, a MOV to DL is two.

Could use '$' terminated string output API too (Int 21h fn 09h)

if i use dl as oppose to dx, then i won't be able to use the push function, unless i do some a ptr convert right? and that would result in me typing more lines of codes.. which is bad?

I see no push instructions in the code you posted.

Just push DX anyway. If DH is trash, who cares?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.