View Single Post
Old Oct 9th, 2005, 1:33 PM   #1
Wizard1988
Professional Programmer
 
Wizard1988's Avatar
 
Join Date: Oct 2005
Location: Chitown
Posts: 422
Rep Power: 4 Wizard1988 is on a distinguished road
Unhappy Displaying contents of an array

I am trying to print out contents of an array, I can assemble and link my code, but the output is wrong.

Here is my code

.model small
.stack 100h

.data
	array8 db 10h,20h,30h,40h
.code
	extern Writeint:proc, Crlf:proc
main proc
	mov ax, @data
	mov ds, ax
	
	mov bx, offset array8
	mov ax, [bx]
	mov bx,16
	call Writeint
	
	mov ax,4c00h
	int 21h
		
main endp
end main

When I run the executable I get 2010. I know this has something to do with byte flipping or somethign like that. Does anyone know how I can fix this?

Thanks for any input
Wizard1988 is offline   Reply With Quote