flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
a115433 05 Mar 2010, 19:50
read about virtual memory.
you can access dma memory, but only if its mapped to your address space. |
|||
![]() |
|
kohlrak 06 Mar 2010, 01:44
Well, everything is reserved unless explicitly asked for, pretty much. You're given the stack, the area in your program, and malloc/brk. I take it you're just beginning, you tried to use [0] and it didn't work?
|
|||
![]() |
|
donn 06 Mar 2010, 02:58
Hi, yeah, I've read through some manuals and references, worked out a lot of 'ideas' and got some of the workings down for application ideas. Progressing, but a lot of the plans and ideas aren't translated yet to run. I haven't assembled yet, wondered about how to lay down the memory portion. I must have read about the details you guys are describing in the AMD Memory Model Architecture parts, I might have also gotten virtual memory confused with like parts of 64 bit modes being more opened up in a way. Like I think I read segmentation is not used in some of the 64bit modes. I'm forgetting a lot of what I read though. Ha. I want to get less theoretical and more with results, so the responses you guys gave helped. Yea, I'm learning, to get any of the address space to work in the application, I think theres that ORG instruction, is there a requesting instruction to use before using addresses in brackets?
k, good to hear from u both, Denat |
|||
![]() |
|
Tyler 06 Mar 2010, 05:59
org specifies the offset to be added to all labels, pointers, etc., it prepares your program for the
offset it will be loaded into it's segment at. eg. With .coms under Windows, you use org 0x100 because it will be loaded into the segment provided to it by Windows at an offset of 0x100 in that segment. Org is a "macro" that is preprocessed by Fasm, it isn't included in the code at all, it just changes the value of location specific identifiers. Code: ; org 0 would be implied start: mov byte [variable], 0 variable rb 1 As it is, Fasm sees "start:" as 0 and will substitute 0(idk if actually does, but in effect it does the same thing) for it anywhere it sees it, and will substitute all occurrences of "variable" with 3?(idk instruction sizes). But with org, you can tell Fasm that your program isn't going to be loaded at 0, but 0x7c00 Code: org 0x7c00 start: mov byte [variable], 0 variable rb 1 Now Fasm sees "start:" as 0x7c00 and (assuming "mov byte [variable], 0" is 3 bytes in size) sees "variable" as 0x7c03 |
|||
![]() |
|
donn 07 Mar 2010, 02:20
Cool, I'll use it like that.
Denat |
|||
![]() |
|
kohlrak 08 Mar 2010, 00:58
I noticed you're having trouble with getting started; you may find this useful.
|
|||||||||||||||||||||
![]() |
|
donn 29 Mar 2010, 03:47
So,
Code: ;Print @@: pop rsi invoke printf, msg, null dec rbx jnz @b Code: flat assembler version 1.68 (16384 kilobytes memory) main.asm [6]: includes "libc.so.6", printf ;MUST BE BEFORE ANY SEGMENTS linhead64.inc [16] includes [2]: segment interpreter readable error: extra characters on line. Denat |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.