flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > struc

Author
Thread Post new topic Reply to topic
ly



Joined: 11 Oct 2005
Posts: 13
ly
Hi why this does not compile ? value out of range error
;-----------------------------------------------------------
org 100h
use16

mov [my.arg1],01
mov [my.arg3],1120
mov [my.arg4],'ABCDEFGH' ;;;value out of range error , why ?
mov [my.arg5],50000
mov [my.arg2],01

xor ah,ah
int 16h
int 20h

struc myStruc {
.arg1 db ?
.arg2 db ?
.arg3 dw ?
.arg4 dd 2 dup (?) ;;;;
.arg5 dd ?
}
my myStruc
Code:
;--------------------------------------    
Post 17 Oct 2005, 20:05
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
1. label "my.arg4" is declared as dword. would you await
Code:
data dw 4121 dup('0')    

declares label "data" with size 8242 size assigned? dup is for
declaring arrays, for example "a rd 4" declares array of 4 dword elemts, addressed [a],[a+4],[a+8],[a+12] and this wouldnt' be possible if a would have size 16 bytes

2. there is no "mov [memory64],constant64" instruction
Post 17 Oct 2005, 21:47
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
ly



Joined: 11 Oct 2005
Posts: 13
ly
thanks vid
so the solution is:

mov [my.arg4],'ABCD'
mov [my.arg4+4],'EFGH'
Post 17 Oct 2005, 22:09
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
yes, if you want to get: db 'ABCDEFGH'
Post 17 Oct 2005, 22:50
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar.

Powered by rwasa.