⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 struct2.asm

📁 想学习汇编语言的
💻 ASM
字号:
TITLE Nested Structures              (Struct2.asm)

; This program shows how to declare nested
; structures, and how to access the members.
; Last update: 8/14/01.

INCLUDE Irvine32.inc

Rectangle STRUCT
	UpperLeft COORD <>
	LowerRight COORD <>
Rectangle ENDS

.data
rect1 Rectangle <>
rect2 Rectangle { }
rect3 Rectangle { {10,20}, {5,15} }
rect4 Rectangle < <10,20>, <5,15> >

.code
main PROC

; Direct reference to a nested member.
	mov rect1.UpperLeft.X,30

; Using an indirect operand, access a
; nested member.
	mov esi,OFFSET rect1
	mov (Rectangle PTR [esi]).UpperLeft.Y, 40

; Get the offsets of individual members.
	mov edi,OFFSET rect2.LowerRight
	mov edi,OFFSET rect2.LowerRight.X

	exit
main ENDP
END main

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -