Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

two arrays, different data types, incrementing?

4 views
Skip to first unread message

Tom Harbert

unread,
May 1, 2003, 9:48:54 PM5/1/03
to
first i will start out by saying im relatively new to assembly.. i am having
trouble with incrementing two arrays... the first is fine.. i just increment
it by 1 each time because its a byte however how can i access the elements
in the space_array to position what i am writing out to the screen.. its 4
bytes is that right? so i should increment by 4.. but how can i do this.. i
tried to
push si
push cx
mov cx, si
mt: add si, 4
loop mt
_________________
sort of thing.. im having trouble.. any help would be appreciated im just
trying to make a small display on the screen
any help would be appreciated..
________


..model small
..stack 100h
..data

calc_array db 00101010b, 00101010b, 00101010b, 00101010b
db 00101010b, 00101010b, 00101010b, 00101010b

space_array dw 1, 7, 1, 1, 1, 1, 1, 1
dw 1, 1, 1, 1, 1, 1, 1, 1
..code

main proc

mov ax, @data ; move address of data segment to the ax register
mov ds, ax ; move ax into the data segment register

mov ax, 03h
int 10h

mov ax, 0B800h
mov es, ax
xor di, di

mov ah, 00001111b

mov cx, 8

mov si, 0

go: mov al, calc_array[si]
mov es:[di], al
add di, space_array[bx]
mov es:[di], ah
add di, space_array[bx]
add si, 1
loop go

call get_char

mov ax, 4C00h
int 21h

main endp

get_char proc
mov ah, 00h
int 16h
ret
get_char endp

end main


0 new messages