flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
3D_FASM 03 Jun 2023, 10:02
Example of code?
|
|||
![]() |
|
macomics 03 Jun 2023, 10:07
Code: fsave [state] state: db 512 dup (0) |
|||
![]() |
|
3D_FASM 03 Jun 2023, 10:26
Why size is 512. Maybe 94 or 108 bytes?
Last edited by 3D_FASM on 03 Jun 2023, 11:20; edited 1 time in total |
|||
![]() |
|
3D_FASM 03 Jun 2023, 11:22
Ok. FNSAVE instruction writes 94 bytes of data when the CPU executes 16-bit code and 108 bytes of data when the CPU executes 32-bit code.
Code: state: db 108 dup (0) ... fsave [state] |
|||
![]() |
|
revolution 03 Jun 2023, 11:29
We need a fiftyfourword size operand!
Code: state d54w ? fsave [state] fsave fiftyfourword[0x1234] |
|||
![]() |
|
macomics 03 Jun 2023, 11:32
revolution wrote: We need a fiftyfourword size operand! Code: use64 fsave [state] state d54w ? Code: ~ $ fasm test1.asm -m 102400 flat assembler version 1.73.30 (102400 kilobytes memory) test1.asm [3]: state d54w ? processed: state d54w ? error: illegal instruction. Code: use32 fsave fiftyfourword [state] state db 512 dup ? Code: ~ $ fasm test1.asm -m 102400 flat assembler version 1.73.30 (102400 kilobytes memory) test1.asm [2]: fsave fiftyfourword [state] processed: fsave fiftyfourword[state] error: invalid operand. Last edited by macomics on 03 Jun 2023, 11:39; edited 2 times in total |
|||
![]() |
|
3D_FASM 03 Jun 2023, 11:35
Hm... why d54w ? why not d108b ?)
fiftyfourword - sounds too long. Last edited by 3D_FASM on 03 Jun 2023, 11:35; edited 1 time in total |
|||
![]() |
|
revolution 03 Jun 2023, 11:35
macomics wrote: Cool. When did it appear? Why is there nothing about this in the documentation? |
|||
![]() |
|
revolution 03 Jun 2023, 11:36
3D_FASM wrote: Hm... why d54w ? why not d108b ?) |
|||
![]() |
|
macomics 03 Jun 2023, 11:42
revolution, see above
|
|||
![]() |
|
3D_FASM 03 Jun 2023, 11:43
revolution wrote: It follows the normal dw, dd, dq, d54w / word, dword, qword Fine but db is skipped at start of this sequence: db - 1 byte, dw - 2 bytes, dd - 4 bytes, dq - 8 bytes etc ... |
|||
![]() |
|
macomics 03 Jun 2023, 11:47
3D_FASM wrote: Fine but db is skipped at start of this sequence: db - define byte (1 byte) dw - define word (2 bytes) dd - define double word (4 bytes), dq - define qquad word(8 bytes) etc ... d54w - define 54 * word (54*2 bytes = 108) |
|||
![]() |
|
Tomasz Grysztar 03 Jun 2023, 11:52
With fasmg's implementation you can use a sized label (but it works with unsized one as well, just like in fasm):
Code: include 'cpu/p5.inc' use32 fsave [state] label state:108 rb 108 |
|||
![]() |
|
3D_FASM 03 Jun 2023, 11:53
It seems to me that a byte is quite a normal and understandable unit of measurement instead word. This is by the way.
|
|||
![]() |
|
revolution 03 Jun 2023, 12:35
3D_FASM wrote: It seems to me that a byte is quite a normal and understandable unit of measurement instead word. This is by the way. ![]() |
|||
![]() |
|
Furs 03 Jun 2023, 18:04
Byte should've been called half word.
|
|||
![]() |
|
revolution 03 Jun 2023, 23:07
Arm defines hwords as 16-bit. So byte should be quarter word.
But then there is confusion between quad word (4 x 32-bit) and quarter word (1/4 x 32-bit) ![]() Code: my_data dq ? ; is this 8-bits or 128-bits? |
|||
![]() |
|
macomics 04 Jun 2023, 02:24
revolution wrote: But then there is confusion between quad word (4 x 32-bit) and quarter word (1/4 x 32-bit) Sad Will have to make two definitions with different registers Code: my_data8 dq ? my_data128 dQ ? |
|||
![]() |
|
bitRAKE 04 Jun 2023, 08:35
Furs wrote: Byte should've been called half word. Byte came later, 5-bit bytes and it grew - "just a part of a word" - because it was shorter than typing character. The power of two scheme came later. Once bytes became 8-bits, nibbles were needed, and before that there was a phase where everything was defined in octal - three bit thinking. 😀 |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.