How can i write an assembly language program to display even number from zero to n times?

1 Answers

Ray Dart Profile
Ray Dart answered
This requires "topping and tailing" according to the assembler you are using. Note that the mnemonics differ from assembler to assembler and from processor to processor.
Otherwise, I think this is good.
Mov ah, 02 [to output a character via int 21
mov dl, 0 [zero dl
Cmp dl, n [when n is the number you specify
jl loop [jump to loop if less than n
add dl, 2
Int 21 [now acually do the outputting
jmp loop1
int 20 [halt

Note that blurtit will capitalise some of the mnemonics - please ignore this - items after the [are comments
thanked the writer.
Ray Dart
Ray Dart commented
The item loop: Needs to go after the line "int 21 [now acually do the outputting"

Answer Question