Hi everybody,
I am a beginner of assembly language. I have a hard time to program this things. My professor ask me to write a program which can display all the ASCII code(from 0 to 255). I try to write by myself, however, I have no clue how it works. Here is my program(not finish yet).
;Beginning of the program
code segment
assume cs:code,ds:code
org 100h
mov ah,0
mov al,3
int 10h
start: mov ax,0B800h
mov es,ax
mov bx,0d
mov ax,0
l:
mov es:[bx],ax
mov byte ptr es:[bx+1],17h
inc bx
inc ax
cmp ax,256
jne l
mov ah,4ch
int 21h
code ends
end start
; end of the program
There are few problems in the program:
1. I want to print out all the ASCII code, however, I only can print half of them. For example, I can see 'B', but not 'C', or I can see
'D', but not 'E'. I guess it's something wrong with the "byte" problem of operand or register???
2. I don't know how to go to another line. It's like "\n" in C++ and Java.
3. The program suppose have white in foreground and blue in background, however, I can see various of strange color with respect to each ASCII code, why is that??
Moreover, I don't know if there is some web site has good resource of how to write beginner's language. I need both tutorial notes and plus good example(program) to support the argument. Please let me know if you have. Thanks for everybody. This is my assignment of my class, it's due on monday, so I hope you guys can help me out as soon as possible. Thanks again.
From Allen
I am a beginner of assembly language. I have a hard time to program this things. My professor ask me to write a program which can display all the ASCII code(from 0 to 255). I try to write by myself, however, I have no clue how it works. Here is my program(not finish yet).
;Beginning of the program
code segment
assume cs:code,ds:code
org 100h
mov ah,0
mov al,3
int 10h
start: mov ax,0B800h
mov es,ax
mov bx,0d
mov ax,0
l:
mov es:[bx],ax
mov byte ptr es:[bx+1],17h
inc bx
inc ax
cmp ax,256
jne l
mov ah,4ch
int 21h
code ends
end start
; end of the program
There are few problems in the program:
1. I want to print out all the ASCII code, however, I only can print half of them. For example, I can see 'B', but not 'C', or I can see
'D', but not 'E'. I guess it's something wrong with the "byte" problem of operand or register???
2. I don't know how to go to another line. It's like "\n" in C++ and Java.
3. The program suppose have white in foreground and blue in background, however, I can see various of strange color with respect to each ASCII code, why is that??
Moreover, I don't know if there is some web site has good resource of how to write beginner's language. I need both tutorial notes and plus good example(program) to support the argument. Please let me know if you have. Thanks for everybody. This is my assignment of my class, it's due on monday, so I hope you guys can help me out as soon as possible. Thanks again.
From Allen