Simple array access

Source: Internet
Author: User

. 386
. Model flat, stdcall

Include msvcrt. inc
Includelib msvcrt. Lib
. Code
Start:
JMP @ F
Szfmt dB '% d', 0dh, 0ah, 0
 
Val DD 11
Dd 22
Dd 33,44, 55

Valsum equ ($-Val)/(sizeof DWORD)
Vallen equ lengthof Val

Valt DD 2 DUP (23, 34, 45)
 

@@:
Invoke crt_printf, ADDR szfmt, Val
Invoke crt_printf, ADDR szfmt, Val [0]
Invoke crt_printf, ADDR szfmt, Val [4*1]
Invoke crt_printf, ADDR szfmt, Val [4*2]
Invoke crt_printf, ADDR szfmt, Val [4*3]
Invoke crt_printf, ADDR szfmt, Val [4*4]

 

Invoke crt_printf, ADDR szfmt, valsum
Invoke crt_printf, ADDR szfmt, vallen

 

Invoke crt_printf, ADDR szfmt, Valt
Invoke crt_printf, ADDR szfmt, Valt [4*1]
Invoke crt_printf, ADDR szfmt, Valt + 8
Invoke crt_printf, ADDR szfmt, Valt [4*3]
Invoke crt_printf, ADDR szfmt, Valt [4*4]
Invoke crt_printf, ADDR szfmt, Valt + 20

RET
End start

 

; /////////// Compile the file into a KB

; /// Ml/C/coff Add. ASM
; /// Link/subsystem: console/merge:. RDATA =. Text Add. OBJ> NUL

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.