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.

Recommended Answers

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

Jump to Post

All 2 Replies

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

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
Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.