Title Program Template (Pointers.asm)
; Program Description:
; Author:
; Cration Date:
; Revisions:
; Date:
; Modified by:
INCLUDE Irvine32.inc
PBYTE TYPEDEF PTR BYTE ; pointer to bytes
PWORD TYPEDEF PTR WORD ; pointer to words
PDWORD TYPEDEF PTR DWORD ; pointer to double words
; TYPEDEF = 모든 내장된 자료형의 크기로 사용이 가능하다.
.data
; (insert variables here)
arrayB BYTE 10h, 20h, 30h
arrayW WORD 1, 2, 3
arrayD DWORD 4, 5, 6
;Create some pointer variables.
ptr1 PBYTE arrayB
ptr2 PWORD arrayW
ptr3 PDWORD arrayD
.code
main PROC
; (insert executable instructions here)
mov esi, ptr1 ; esi is arrayB's offset value
mov al, [esi] ; al is arrayB's first value. mov right, left value must be same!
; [esi]+1's result and [esi+1]'s result are same.
mov esi, ptr2 ; eis is arrayW's offset value
mov ax, [esi] ; ax is arrayW's first value
mov esi, ptr3 ; eis is arrayD's offset value
mov eax, [esi] ; eax is arrayD's first value
call DumpRegs
exit
main ENDP
; (insert additional procedures here)
END main