0

Hello, I have a few questions about Assembly. I am extremely new to it!

Question 1:
How do you write functions in assembly? Is it even possible?

Question 2:
How do you get an input to a dd variable type (do I have to do the math on four db inputs?)

Question 3:
Is it possible to make arrays in Assembly? If so how?

Thank you for any help! I am using masm32 with 16-bit link and CodeView v4.

3
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by chrjs
0

1.

ProcName proc
  ; code here

  ret
ProcName endp

2. Don't know 16bit asm, but this should work, dwMyVar is a DWORD in the uninitialized data section

mov   dwMyVar, eax ; or mov   dwMyVar, 1 etc

3. unsure in 16 bit

0

Arrays work the same in 16-bit and 32-bit, you just have to allocate enough memory on the stack that you need.

; allocate space for an array of 10 bytes

sub sp, 10
mov bx, sp

; bx is the pointer to the start of the array
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.