flat assembler
Message board for the users of flat assembler.
Index
> OS Construction > Arrays in FASM? |
Author |
|
okasvi 29 Sep 2006, 18:25
...
myarray db 0, 27, "1", "2", "3" |
|||
29 Sep 2006, 18:25 |
|
rhyno_dagreat 29 Sep 2006, 21:19
Umm... and I'd access each individual byte by doing "myarray + n", right?
|
|||
29 Sep 2006, 21:19 |
|
LocoDelAssembly 29 Sep 2006, 23:38
Since it's a byte array yes, (symbol+elementNumber) is enough but for general accessing is (symbol+elementNumber*sizeOfElement).
|
|||
29 Sep 2006, 23:38 |
|
Dex4u 30 Sep 2006, 00:41
You could do something like this pseudo code
Code: xor eax,eaxin al,0x60; do some test here for ctrl etcmov [ScanCode],al ;al = scan codemov edi,eax;Convert to ASCIImov al,[edi+normal_keymap] ; normal_keymap = address of array |
|||
30 Sep 2006, 00:41 |
|
rhyno_dagreat 30 Sep 2006, 03:08
I think I get it, thanks... but why copy al to scan code?
|
|||
30 Sep 2006, 03:08 |
|
Dex4u 30 Sep 2006, 03:37
rhyno_dagreat wrote: I think I get it, thanks... but why copy al to scan code? So you can put it in ah at the end of the function, like this Code: mov al,[keybuffer] ; this has the ASCII mov ah,[ScanCode] ;this has the scan code |
|||
30 Sep 2006, 03:37 |
|
rhyno_dagreat 30 Sep 2006, 03:49
Oh, I see now... thanks!
|
|||
30 Sep 2006, 03:49 |
|
Niels 30 Sep 2006, 13:39
Hello rhyno_dagreat,
This downloadable booklet has [one] or [two] things on arrays: http://www.drpaulcarter.com/pcasm/index.php |
|||
30 Sep 2006, 13:39 |
|
rhyno_dagreat 30 Sep 2006, 18:03
Hey, thanks Niels! I believe I've read some of that book before, and it helped me a little while ago. I knew arrays were groups of variables one after another in memory, but I didn't know you could access 'em the way they are said to be able to be accessed in these other languages (if what I said makes any sense ) but thank you again for the link! I had to reformat my HD and install Windows again, so I'm gonna download that again.
|
|||
30 Sep 2006, 18:03 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.